|
|
@@ -5,10 +5,11 @@
|
|
|
<select id="selectStatistics" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">
|
|
|
SELECT u.checked_person AS user_id , u.checked_dept AS dept_id ,u.parent_id AS item_id ,sum(u.score) AS score ,s.name FROM (
|
|
|
SELECT t.checked_person , t.checked_dept,ci.parent_id, ci.score FROM check_score t
|
|
|
- LEFT JOIN check_item ci ON t.check_item_id = ci.id
|
|
|
+ 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
|
|
|
<if test="start_date!=null and end_date != null">
|
|
|
- AND t.update_time >= #{start_date} AND t.update_time <= #{end_date}
|
|
|
+ AND ct.start_time >= #{start_date} AND ct.end_time <= #{end_date}
|
|
|
</if>
|
|
|
<if test="dept_id!=null">
|
|
|
AND t.checked_dept =#{dept_id}
|
|
|
@@ -40,10 +41,12 @@
|
|
|
|
|
|
<select id="selectFeeStationCheckedScore" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">
|
|
|
SELECT sum(c.score) AS score ,t.checked_dept AS dept_id
|
|
|
- FROM check_score t LEFT JOIN check_item c ON t.check_item_id = c.id
|
|
|
+ FROM check_score t
|
|
|
+ LEFT JOIN check_item c ON t.check_item_id = c.id
|
|
|
+ LEFT JOIN check_task ct ON ct.id = t.task_id
|
|
|
WHERE 1=1
|
|
|
<if test="start_date!=null and end_date != null">
|
|
|
- AND t.update_time >= #{start_date} AND t.update_time <= #{end_date}
|
|
|
+ AND ct.start_time >= #{start_date} AND t.end_time <= #{end_date}
|
|
|
</if>
|
|
|
GROUP BY t.checked_dept,t.checked_person
|
|
|
</select>
|
|
|
@@ -52,9 +55,10 @@
|
|
|
SELECT u.checked_dept AS dept_id ,u.parent_id AS item_id ,sum(u.score) AS score ,s.name FROM (
|
|
|
SELECT t.checked_dept,ci.parent_id, ci.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
|
|
|
<if test="start_date!=null and end_date != null">
|
|
|
- AND t.update_time >= #{start_date} AND t.update_time <= #{end_date}
|
|
|
+ AND ct.start_time >= #{start_date} AND ct.end_time <= #{end_date}
|
|
|
</if> )
|
|
|
u LEFT JOIN check_item s ON u.parent_id = s.id GROUP BY dept_id,item_id
|
|
|
</select>
|