Files
zhxg_java/srs-comprehensive/src/main/resources/mapper/comprehensive/SyncDataMapper.xml
2026-01-06 17:41:42 +08:00

58 lines
3.4 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.srs.comprehensive.mapper.SyncDataMapper">
<select id="getEmployEEInfoList" resultType="java.util.Map" parameterType="String">
SELECT TBA.GH as zgh,TBA.XM as xm,CASE
WHEN XBDM = 1 THEN '男'
WHEN XBDM = 2 THEN '女'
ELSE '未知' -- 可选添加默认值避免NULL
END as xb,TBA.MZDM,TBA.SZBMBH,TBA.ZGLBDM,TBA.ZGLBMC,TBA.ZGDQZTDM,TBA.ZGDQZTDMMC,TBA.ZGPXH,TBA.UPTIME,TBD.BMMC as ksmc,TBD.BMMC as yxmc,TBD.BMBH as ksh,TBA.ZGDQZTDM as zgzt from from_gxsdxyxxzx_teacher TBA LEFT JOIN from_gxsdxyxxzx_xzbm TBD ON TBA.SZBMBH=TBD.BMBH
<where>
TBA.ZGLBDM LIKE '1%'
<if test="zgh != null and zgh!= '' ">and TBA.GH=#{zgh}</if>
</where>
</select>
<select id="getSpecialtyInfoList" resultType="java.util.Map" parameterType="String">
select b.JXZYBH as zydm,b.JXZYJC as zyjc,b.JXZYMC as zymc,a.BMBH,a.BMMC yxmc from from_gxsdxyxxzx_xzbm a left join from_gxsdxyxxzx_zyxx b on a.BMBH=b.JXZYSSYXBBH
<where>
b.JXZYBH is not null
<if test="zydm != null and zydm!= '' ">and b.JXZYBH=#{zydm}</if>
</where>
</select>
<select id="getSpecialtyALLInfo" resultType="java.util.Map">
select b.JXZYBH as zydm,b.JXZYJC as zyjc,b.JXZYMC as zymc,a.BMMC yxmc from from_gxsdxyxxzx_xzbm a left join from_gxsdxyxxzx_zyxx b on a.BMBH=b.JXZYSSYXBBH
where b.JXZYBH is not null
</select>
<select id="getClassInfoList" resultType="java.util.Map" parameterType="SelectClass">
select BJBH as bjdm,BJSSJXZYBH as zyid,BJMC as bjmc,BJSSNJ as njid,BJJC from from_gxsdxyxxzx_class
<where>
<if test="bjdm != null and bjdm!= '' ">and BJBH=#{bjdm}</if>
<if test="gradeCode != null and gradeCode!= '' ">and BJSSNJ=#{gradeCode}</if>
</where>
</select>
<select id="selectNumber" resultType="java.lang.Integer" parameterType="String">
select count(1) as number from from_gxsdxyxxzx_student a left join from_gxsdxyxxzx_class b ON a.SZBJBH=b.BJBH
<where>
<if test="gradeCode != null and gradeCode != ''">and b.BJSSNJ=#{gradeCode}</if>
</where>
</select>
<select id="getStudentInfoList" resultType="java.util.Map">
SELECT ROW_NUMBER() OVER(ORDER BY TBA.XH) as xsid,TBA.XH as xh,TBA.XM as xm,CASE
WHEN TBA.XBDM = 1 THEN '男'
WHEN TBA.XBDM = 2 THEN '女'
ELSE '未知' -- 可选添加默认值避免NULL
END as xb,TBA.XSDQZTDM as sfzx,TBA.XSDQZTDMMC as status,TBA.MZDM as mz,TBB.BJMC as bjmc,
TBB.BJSSNJ,TBD.BMMC,TBC.JXZYMC
FROM `from_gxsdxyxxzx_student` TBA
LEFT JOIN from_gxsdxyxxzx_class TBB ON TBA.SZBJBH=TBB.BJBH
LEFT JOIN from_gxsdxyxxzx_zyxx TBC ON TBB.BJSSJXZYBH=TBC.JXZYBH
LEFT JOIN from_gxsdxyxxzx_xzbm TBD ON TBC.JXZYSSYXBBH=TBD.BMBH
where TBB.BJSSNJ&gt;=2019 and TBA.XH is not null
<if test="stuNo != null and stuNo != ''">and TBA.XH=#{stuNo}</if>
<if test="gradeCode != null and gradeCode != ''">and TBB.BJSSNJ=#{gradeCode}</if>
LIMIT #{offset}, #{pageSize}
</select>
</mapper>