165 lines
7.2 KiB
XML
165 lines
7.2 KiB
XML
<?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.roomroot.jwgl.mapper.XYDBMapper">
|
||
|
||
<resultMap id="BaseResultMap" type="com.roomroot.jwgl.entity.XYDB">
|
||
<id column="学员队编号" property="xydbh"/>
|
||
<result column="学员队名称" property="xydmc"/>
|
||
<result column="学员队人数" property="xydrs"/>
|
||
<result column="年级" property="nj"/>
|
||
<result column="专业代号" property="zydh"/>
|
||
<result column="专业教室编号" property="zyjsbh"/>
|
||
<result column="备注" property="bz"/>
|
||
<result column="在校状态" property="zxzt"/>
|
||
<result column="序号" property="xh"/>
|
||
<result column="任务类别" property="rwlb"/>
|
||
<result column="虚实类型" property="xslx"/>
|
||
<result column="入学日期" property="rxrq"/>
|
||
<result column="毕业日期" property="byrq"/>
|
||
<result column="学员队类型" property="xydlx"/>
|
||
<result column="培训任务标识号" property="pxrwbsh"/>
|
||
<result column="节次类别" property="jclb"/>
|
||
<result column="系统模式" property="xtms"/>
|
||
<result column="JSONZD" property="jsonzd"/>
|
||
<result column="简称" property="jc"/>
|
||
<result column="所属单位" property="ssdw"/>
|
||
<result column="主体培训任务" property="ztpxrw"/>
|
||
</resultMap>
|
||
|
||
<!-- 三表联查结果映射(学员队表 + 学员队期表 + 专业表) -->
|
||
<resultMap id="ElectiveClassResultMap" type="com.roomroot.jwgl.vo.elective.ElectiveClassVO">
|
||
<id column="学员队编号" property="xydbh"/>
|
||
<result column="学员队名称" property="xydmc"/>
|
||
<result column="学员队人数" property="xydrs"/>
|
||
<result column="年级" property="nj"/>
|
||
<result column="专业代号" property="zydh"/>
|
||
<result column="任务类别" property="rwlb"/>
|
||
<result column="入学日期" property="rxrq"/>
|
||
<result column="毕业日期" property="byrq"/>
|
||
<result column="学员队类型" property="xydlx"/>
|
||
<result column="在校状态" property="zxzt"/>
|
||
<result column="虚实类型" property="xslx"/>
|
||
<result column="培训任务标识号" property="pxrwbsh"/>
|
||
<result column="节次类别" property="jclb"/>
|
||
<result column="所属单位" property="ssdw"/>
|
||
<result column="主体培训任务" property="ztpxrw"/>
|
||
<result column="简称" property="jc"/>
|
||
<result column="学号前缀" property="xhqz"/>
|
||
<result column="学号位数" property="xhws"/>
|
||
<result column="允许注册" property="yxzc"/>
|
||
<result column="培训类型" property="pxlx"/>
|
||
<result column="培训层次" property="pxcc"/>
|
||
<result column="培训类型2" property="pxlx2"/>
|
||
</resultMap>
|
||
|
||
<sql id="Base_Column_List">
|
||
"学员队编号", "学员队名称", "学员队人数", "年级", "专业代号",
|
||
"专业教室编号", "备注", "在校状态", "序号", "任务类别",
|
||
"虚实类型", "入学日期", "毕业日期", "学员队类型", "培训任务标识号",
|
||
"节次类别", "系统模式", "JSONZD", "简称", "所属单位", "主体培训任务"
|
||
</sql>
|
||
|
||
<select id="selectPageList" resultMap="BaseResultMap">
|
||
SELECT <include refid="Base_Column_List" />
|
||
FROM "学员队表"
|
||
WHERE 1=1
|
||
<if test="cond.xydmc != null and cond.xydmc != ''">
|
||
AND "学员队名称" LIKE CONCAT('%', #{cond.xydmc}, '%')
|
||
</if>
|
||
<if test="cond.nj != null and cond.nj != ''">
|
||
AND "年级" = #{cond.nj}
|
||
</if>
|
||
<if test="cond.zydh != null and cond.zydh != ''">
|
||
AND "专业代号" = #{cond.zydh}
|
||
</if>
|
||
<if test="cond.rwlb != null and cond.rwlb != ''">
|
||
AND "任务类别" = #{cond.rwlb}
|
||
</if>
|
||
<if test="cond.xydlx != null and cond.xydlx != ''">
|
||
AND "学员队类型" = #{cond.xydlx}
|
||
</if>
|
||
ORDER BY "序号"
|
||
</select>
|
||
|
||
<!-- 三表联查分页:学员队表 LEFT JOIN 学员队期表 LEFT JOIN 专业表 -->
|
||
<select id="selectPageListWithPeriod" resultMap="ElectiveClassResultMap">
|
||
SELECT
|
||
t."学员队编号",
|
||
t."学员队名称",
|
||
t."学员队人数",
|
||
t."年级",
|
||
t."专业代号",
|
||
t."任务类别",
|
||
t."入学日期",
|
||
t."毕业日期",
|
||
t."学员队类型", t."在校状态", t."虚实类型", t."培训任务标识号",
|
||
t."节次类别", t."所属单位", t."主体培训任务", t."简称",
|
||
p."学号前缀",
|
||
p."学号位数",
|
||
p."允许注册",
|
||
z."培训类型",
|
||
z."培训层次",
|
||
z."培训类型2"
|
||
FROM "学员队表" t
|
||
LEFT JOIN "学员队期表" p ON p."学员队编号" = t."学员队编号"
|
||
LEFT JOIN "专业表" z ON z."专业代号" = t."专业代号"
|
||
WHERE 1=1
|
||
<if test="cond.xydmc != null and cond.xydmc != ''">
|
||
AND t."学员队名称" LIKE CONCAT('%', #{cond.xydmc}, '%')
|
||
</if>
|
||
<if test="cond.nj != null and cond.nj != ''">
|
||
AND t."年级" = #{cond.nj}
|
||
</if>
|
||
<if test="cond.zydh != null and cond.zydh != ''">
|
||
AND t."专业代号" = #{cond.zydh}
|
||
</if>
|
||
<if test="cond.rwlb != null and cond.rwlb != ''">
|
||
AND t."任务类别" = #{cond.rwlb}
|
||
</if>
|
||
<if test="cond.xydlx != null and cond.xydlx != ''">
|
||
AND t."学员队类型" = #{cond.xydlx}
|
||
</if>
|
||
<if test="cond.zxzt != null and cond.zxzt != ''">
|
||
AND t."在校状态" = #{cond.zxzt}
|
||
</if>
|
||
<if test="cond.xslx != null">
|
||
AND t."虚实类型" = #{cond.xslx}
|
||
</if>
|
||
<if test="cond.pxrwbsh != null and cond.pxrwbsh != ''">
|
||
AND t."培训任务标识号" = #{cond.pxrwbsh}
|
||
</if>
|
||
<if test="cond.rxrqStart != null">
|
||
AND t."入学日期" >= #{cond.rxrqStart}
|
||
</if>
|
||
<if test="cond.rxrqEnd != null">
|
||
AND t."入学日期" <= #{cond.rxrqEnd}
|
||
</if>
|
||
<if test="cond.byrqStart != null">
|
||
AND t."毕业日期" >= #{cond.byrqStart}
|
||
</if>
|
||
<if test="cond.byrqEnd != null">
|
||
AND t."毕业日期" <= #{cond.byrqEnd}
|
||
</if>
|
||
<if test="cond.pxlx != null and cond.pxlx != ''">
|
||
AND z."培训类型" = #{cond.pxlx}
|
||
</if>
|
||
<if test="cond.pxcc != null and cond.pxcc != ''">
|
||
AND z."培训层次" = #{cond.pxcc}
|
||
</if>
|
||
<if test="cond.pxlx2 != null and cond.pxlx2 != ''">
|
||
AND z."培训类型2" = #{cond.pxlx2}
|
||
</if>
|
||
ORDER BY t."序号"
|
||
</select>
|
||
|
||
<!-- 根据日期范围查询学员队(入学日期 <= startTime 且 毕业日期 >= endTime) -->
|
||
<select id="selectByDateRange" resultMap="BaseResultMap">
|
||
SELECT <include refid="Base_Column_List" />
|
||
FROM "学员队表"
|
||
WHERE "入学日期" <= #{startTime}
|
||
AND "毕业日期" >= #{endTime}
|
||
ORDER BY "序号"
|
||
</select>
|
||
|
||
</mapper>
|