Bladeren bron

收费生产人员业务提升考核情况反馈表 修改

温红权 8 jaren geleden
bovenliggende
commit
850c6a3b78

+ 5 - 8
VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/master/StatisticsMapper.xml

@@ -106,9 +106,6 @@
         <if test="start_date!=null and end_date != null">
             AND t.start_time &gt;= #{start_date} AND t.end_time &lt; #{end_date}
         </if>
-        <if test="dept_id!=null">
-            AND t.checked_dept =#{dept_id}
-        </if>
         GROUP BY t.checked_person
         ) t LEFT JOIN (
         SELECT u.checked_person AS user_id , u.checked_dept AS dept_id , sum(u.score) AS score FROM (
@@ -128,32 +125,32 @@
         u GROUP BY checked_person
         ) m ON t.user_id = m.user_id
         ) x
-        ON y.user_id = x.user_id AND y.dept_id = x.dept_id
+        ON y.user_id = x.user_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
         <if test="start_date!=null and end_date != null">
             AND check_time &gt;= #{start_date} AND check_time &lt; #{end_date}
         </if>
-        GROUP BY user_id,dept_id) o1 ON o1.user_id = y.user_id AND y.dept_id = o1.dept_id
+        GROUP BY user_id,dept_id) o1 ON o1.user_id = y.user_id
         LEFT JOIN (SELECT user_id,dept_id,COUNT(1) check_t_num,SUM(check_score) check_t_score FROM other_check WHERE
         check_type = 2
         <if test="start_date!=null and end_date != null">
             AND check_time &gt;= #{start_date} AND check_time &lt; #{end_date}
         </if>
-        GROUP BY user_id,dept_id) o2 ON o2.user_id = y.user_id AND y.dept_id = o2.dept_id
+        GROUP BY user_id,dept_id) o2 ON o2.user_id = y.user_id
         LEFT JOIN (SELECT user_id,dept_id,COUNT(1) check_x_num,SUM(check_score) check_x_score FROM other_check WHERE
         check_type = 3
         <if test="start_date!=null and end_date != null">
             AND check_time &gt;= #{start_date} AND check_time &lt; #{end_date}
         </if>
-        GROUP BY user_id,dept_id) o3 ON o3.user_id = y.user_id AND y.dept_id = o3.dept_id
+        GROUP BY user_id,dept_id) o3 ON o3.user_id = y.user_id
         LEFT JOIN (SELECT user_id,dept_id,COUNT(1) check_s_num,SUM(check_score) check_s_score FROM other_check WHERE
         check_type = 4
         <if test="start_date!=null and end_date != null">
             AND check_time &gt;= #{start_date} AND check_time &lt; #{end_date}
         </if>
-        GROUP BY user_id,dept_id) o4 ON o4.user_id = y.user_id AND y.dept_id = o4.dept_id
+        GROUP BY user_id,dept_id) o4 ON o4.user_id = y.user_id
 
 
     </select>