|
|
@@ -7,11 +7,16 @@
|
|
|
SELECT t1.id, t1.user_name, t1.name,t1.code,t3.name AS gender_cn,t1.mobile,
|
|
|
(SELECT SUM(a2.score) FROM teacher_award a1
|
|
|
INNER JOIN teacher_award_item a2 ON a1.teacher_award_item_id = a2.id
|
|
|
- WHERE a1.status = 1 AND a1.delete_mark = 0 AND a2.delete_mark = 0
|
|
|
+ INNER JOIN xjr_workflow_form_relation a3 ON a1.id = CAST(a3.form_key_value AS SIGNED)
|
|
|
+ WHERE a1.delete_mark = 0 AND a2.delete_mark = 0
|
|
|
AND a1.applicant_user_id = t1.id
|
|
|
<if test="dto.awardDateStart != null and dto.awardDateEnd != null">
|
|
|
and a1.award_date between #{dto.awardDateStart} and #{dto.awardDateEnd}
|
|
|
</if>
|
|
|
+ <if test="dto.createDateStart != null and dto.createDateEnd != null">
|
|
|
+ and a1.create_date between #{dto.createDateStart} and #{dto.createDateEnd}
|
|
|
+ </if>
|
|
|
+ AND a3.current_state = 'COMPLETED'
|
|
|
) AS score FROM xjr_user t1
|
|
|
INNER JOIN base_teacher t2 ON t1.id = t2.user_id
|
|
|
left join xjr_user_dept_relation t4 on t4.user_id = t1.id
|
|
|
@@ -19,11 +24,16 @@
|
|
|
WHERE t1.delete_mark = 0 AND t2.delete_mark = 0
|
|
|
AND (SELECT SUM(a2.score) FROM teacher_award a1
|
|
|
INNER JOIN teacher_award_item a2 ON a1.teacher_award_item_id = a2.id
|
|
|
- WHERE a1.status = 1 AND a1.delete_mark = 0 AND a2.delete_mark = 0
|
|
|
+ INNER JOIN xjr_workflow_form_relation a3 ON a1.id = CAST(a3.form_key_value AS SIGNED)
|
|
|
+ WHERE a1.delete_mark = 0 AND a2.delete_mark = 0
|
|
|
AND a1.applicant_user_id = t1.id
|
|
|
<if test="dto.awardDateStart != null and dto.awardDateEnd != null">
|
|
|
and a1.award_date between #{dto.awardDateStart} and #{dto.awardDateEnd}
|
|
|
</if>
|
|
|
+ <if test="dto.createDateStart != null and dto.createDateEnd != null">
|
|
|
+ and a1.create_date between #{dto.createDateStart} and #{dto.createDateEnd}
|
|
|
+ </if>
|
|
|
+ AND a3.current_state = 'COMPLETED'
|
|
|
) IS NOT NULL
|
|
|
<if test="dto.userName != null and dto.userName != '' ">
|
|
|
and t1.user_name like concat('%', #{dto.userName}, '%')
|
|
|
@@ -41,8 +51,9 @@
|
|
|
SELECT t1.id, t1.user_name, t1.name,t1.code,t3.name AS gender_cn,t1.mobile,
|
|
|
(SELECT SUM(a2.score) FROM teacher_award a1
|
|
|
INNER JOIN teacher_award_item a2 ON a1.teacher_award_item_id = a2.id
|
|
|
- WHERE a1.status = 1 AND a1.delete_mark = 0 AND a2.delete_mark = 0
|
|
|
- AND a1.applicant_user_id = t1.id
|
|
|
+ INNER JOIN xjr_workflow_form_relation a3 ON a1.id = CAST(a3.form_key_value AS SIGNED)
|
|
|
+ WHERE a1.delete_mark = 0 AND a2.delete_mark = 0
|
|
|
+ AND a1.applicant_user_id = t1.id AND a3.current_state = 'COMPLETED'
|
|
|
<if test="dto.awardDateStart != null and dto.awardDateEnd != null">
|
|
|
and a1.award_date between #{dto.awardDateStart} and #{dto.awardDateEnd}
|
|
|
</if>
|