|
|
@@ -109,7 +109,7 @@
|
|
|
AND t.start_time >= #{start_date} AND t.end_time < #{end_date}
|
|
|
</if>
|
|
|
<if test="position_ids != null and position_ids.size() > 0">
|
|
|
- AND u.positionid in
|
|
|
+ AND u.positionid in
|
|
|
<foreach collection="position_ids" item="position_id" index="index"
|
|
|
open="(" close=")" separator=",">
|
|
|
#{position_id}
|
|
|
@@ -204,9 +204,67 @@
|
|
|
) check_num_t ON checked_score_t.checked_person = check_num_t.checked_person
|
|
|
AND check_num_t.mth = checked_score_t.mth
|
|
|
</sql>
|
|
|
+
|
|
|
+
|
|
|
+ <!--包含未扣分的-->
|
|
|
+ <sql id="selectAllCheckedInfoAllCheck">
|
|
|
+ SELECT
|
|
|
+ check_num_t.checked_num , check_num_t.mth, IFNULL(checked_score_t.checkd_all_score ,0) as checkd_all_score, check_num_t.checked_person,check_num_t.checked_dept
|
|
|
+ FROM
|
|
|
+
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ COUNT(t.checked_person) AS checked_num,
|
|
|
+ t.checked_person,
|
|
|
+ monthfunc (t.start_time) AS mth,
|
|
|
+ t.id,t.checked_dept
|
|
|
+ FROM
|
|
|
+ check_task t
|
|
|
+ WHERE
|
|
|
+ t.checked_person IS NOT NULL
|
|
|
+ AND t.check_status != 22 and t.id not in <include refid="taskexclouddeleteUser"/>
|
|
|
+ <if test="start_date !=null">
|
|
|
+ AND t.start_time >= #{start_date}
|
|
|
+ </if>
|
|
|
+ <if test="end_date !=null">
|
|
|
+ AND t.end_time < #{end_date}
|
|
|
+ </if>
|
|
|
+ <if test="mth!=null and mth!=''">
|
|
|
+ AND monthfunc (t.start_time) =#{mth}
|
|
|
+ </if>
|
|
|
+ GROUP BY
|
|
|
+ t.checked_person,
|
|
|
+ mth
|
|
|
+ ) check_num_t
|
|
|
+
|
|
|
+ LEFT JOIN (
|
|
|
+ SELECT
|
|
|
+ monthfunc (t.start_time) AS mth,
|
|
|
+ sum(m.check_item_score) AS checkd_all_score, m.*
|
|
|
+ FROM
|
|
|
+ check_score m INNER JOIN
|
|
|
+ ( select * From check_task t
|
|
|
+ where t.check_status != 22 and t.id not in <include refid="taskexclouddeleteUser"/>
|
|
|
+ <if test="start_date !=null">
|
|
|
+ AND t.start_time >= #{start_date}
|
|
|
+ </if>
|
|
|
+ <if test="end_date !=null">
|
|
|
+ AND t.end_time < #{end_date}
|
|
|
+ </if>
|
|
|
+ <if test="mth!=null and mth!=''">
|
|
|
+ AND monthfunc (t.start_time) =#{mth}
|
|
|
+ </if>
|
|
|
+ ) t
|
|
|
+ ON m.task_id = t.id
|
|
|
+ WHERE 1=1
|
|
|
+ GROUP BY mth , m.checked_person
|
|
|
+
|
|
|
+ ) checked_score_t ON checked_score_t.checked_person = check_num_t.checked_person
|
|
|
+ AND check_num_t.mth = checked_score_t.mth
|
|
|
+ </sql>
|
|
|
|
|
|
<select id="selectYearScoreInfo" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">
|
|
|
- SELECT sum(tab.checkd_all_score) AS all_check_score , sum(tab.checked_num) AS checked_num , tab.mth FROM ( <include refid="selectAllCheckedInfo" /> ) tab
|
|
|
+ SELECT sum(tab.checkd_all_score) AS all_check_score , sum(tab.checked_num) AS checked_num , tab.mth FROM ( <include refid="selectAllCheckedInfoAllCheck" /> ) tab
|
|
|
WHERE 1=1
|
|
|
<if test="dept_list!=null and queryType == 1 and dept_list.size()>0 ">
|
|
|
AND tab.checked_dept IN
|