|
@@ -87,20 +87,23 @@
|
|
|
</if>
|
|
</if>
|
|
|
) y LEFT JOIN
|
|
) y LEFT JOIN
|
|
|
|
|
|
|
|
- (SELECT u.checked_person AS user_id , u.checked_dept AS dept_id,count(1) AS checked_num,sum(u.score) AS score FROM (
|
|
|
|
|
- SELECT t.checked_person , t.checked_dept,ci.parent_id, t.check_item_score AS score FROM check_score t
|
|
|
|
|
- LEFT JOIN check_item ci ON t.check_item_id = ci.id
|
|
|
|
|
- LEFT JOIN check_task ct ON ct.id = t.task_id
|
|
|
|
|
- WHERE 1=1 and ct.check_status!=22 and ct.id not in <include refid="taskexclouddeleteUser"/>
|
|
|
|
|
- <if test="start_date!=null and end_date != null">
|
|
|
|
|
- AND ct.start_time >= #{start_date} AND ct.end_time < #{end_date}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="dept_id!=null">
|
|
|
|
|
- AND t.checked_dept =#{dept_id}
|
|
|
|
|
- </if>
|
|
|
|
|
|
|
+ (
|
|
|
|
|
+
|
|
|
|
|
+ SELECT u.checked_person AS user_id , u.checked_dept AS dept_id,count(1) AS checked_num,sum(u.score) AS score FROM (
|
|
|
|
|
+ SELECT IFNULL(t.checked_person,ct.checked_person) AS checked_person , IFNULL(t.checked_dept,ct.checked_dept) AS checked_dept ,
|
|
|
|
|
+ IFNULL(t.check_item_score,0) AS score FROM check_task ct
|
|
|
|
|
+ LEFT JOIN check_score t ON ct.id = t.task_id
|
|
|
|
|
+ WHERE 1=1 and ct.check_status!=22 and ct.id not in <include refid="taskexclouddeleteUser"/>
|
|
|
|
|
+ <if test="start_date!=null and end_date != null">
|
|
|
|
|
+ AND ct.start_time >= #{start_date} AND ct.end_time < #{end_date}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="dept_id!=null">
|
|
|
|
|
+ AND ct.checked_dept =#{dept_id}
|
|
|
|
|
+ </if>
|
|
|
)
|
|
)
|
|
|
- u LEFT JOIN check_item s ON u.parent_id = s.id GROUP BY checked_person) x
|
|
|
|
|
|
|
+ u GROUP BY checked_person) x
|
|
|
ON y.user_id = x.user_id AND y.dept_id = x.dept_id
|
|
ON y.user_id = x.user_id AND y.dept_id = x.dept_id
|
|
|
|
|
+
|
|
|
LEFT JOIN (SELECT user_id,dept_id,COUNT(1) check_a_num,SUM(check_score) check_a_score FROM other_check WHERE check_type = 1
|
|
LEFT JOIN (SELECT user_id,dept_id,COUNT(1) check_a_num,SUM(check_score) check_a_score FROM other_check WHERE check_type = 1
|
|
|
<if test="start_date!=null and end_date != null">
|
|
<if test="start_date!=null and end_date != null">
|
|
|
AND check_time >= #{start_date} AND check_time < #{end_date}
|
|
AND check_time >= #{start_date} AND check_time < #{end_date}
|