|
@@ -54,6 +54,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
order by d.exam_state, d.start_date
|
|
|
</select>
|
|
|
|
|
|
+ <select id="sortSelectTTrainingbccDeviceList" parameterType="TTrainingbccDevice" resultMap="TTrainingbccDeviceResult">
|
|
|
+ select d.id,s.name , d.staff_id, d.regular_id, d.start_date, d.remarks, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.supplementary, d.learn_state, d.exam_state, d.exam_id,d.exam_num, d.learn_time from t_trainingbcc_device d
|
|
|
+ left join t_staffmgr s on s.staffid = d.staff_id
|
|
|
+ left join t_trainingbcc t on t.id = d.regular_id and t.DEL_FLAG = 0
|
|
|
+ Left join SYS_DICT_DATA s0 on s.UNIT = s0.DICT_VALUE and s0.DICT_TYPE ='STAFF_UNIT'
|
|
|
+ LEFT JOIN SYS_DICT_DATA s2 on s.ACTUALPOST = s2.DICT_VALUE and s2.DICT_TYPE = 'ACTUALPOST'
|
|
|
+ LEFT JOIN SYS_DICT_DATA s1 on s.team = s1.DICT_VALUE and s1.DICT_TYPE = 'TEAM_DIVIDE'
|
|
|
+ <where>
|
|
|
+ <if test="staffId != null and staffId != ''"> and d.staff_id = #{staffId} and d.exam_state != 1 and ((ADD_MONTHS(TRUNC(SYSDATE, 'MM'), 1) > t.course_startdate and t.course_enddate >= SYSDATE) or (d.supplementary = 1 and d.exam_state = 0)) </if>
|
|
|
+ <if test="regularId != null "> and d.regular_id = #{regularId}</if>
|
|
|
+ <if test="startDate != null "> and d.start_date = #{startDate}</if>
|
|
|
+ <if test="remarks != null and remarks != ''"> and d.remarks = #{remarks}</if>
|
|
|
+ <if test="createrCode != null and createrCode != ''"> and d.creater_code = #{createrCode}</if>
|
|
|
+ <if test="createdate != null "> and d.createdate = #{createdate}</if>
|
|
|
+ <if test="updaterCode != null and updaterCode != ''"> and d.updater_code = #{updaterCode}</if>
|
|
|
+ <if test="updatedate != null "> and d.updatedate = #{updatedate}</if>
|
|
|
+ <if test="supplementary != null and supplementary != ''"> and d.supplementary = #{supplementary}</if>
|
|
|
+ <if test="learnState != null "> and d.learn_state = #{learnState}</if>
|
|
|
+ <if test="examState != null "> and d.exam_state = #{examState}</if>
|
|
|
+ <if test="examId != null "> and d.exam_id = #{examId}</if>
|
|
|
+ <if test="learnTime != null "> and d.learn_time = #{learnTime}</if>
|
|
|
+ <if test="trainingType != null and trainingType != ''">and t.training_type = #{trainingType}</if>
|
|
|
+ and d.del_flag = 0
|
|
|
+ </where>
|
|
|
+ ORDER BY d.del_flag, s0.DICT_SORT, s1.DICT_SORT ,s2.DICT_SORT
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="selectTTrainingbccDeviceById" parameterType="Long" resultMap="TTrainingbccDeviceResult">
|
|
|
<include refid="selectTTrainingbccDeviceVo"/>
|
|
|
where d.id = #{id}
|