|
@@ -33,78 +33,96 @@
|
|
|
|
|
|
|
|
|
|
<select id="selectEvaluateList" resultType="com.zfjg.manage.api.dto.enforce.job.EnforceEvaluateDTO">
|
|
<select id="selectEvaluateList" resultType="com.zfjg.manage.api.dto.enforce.job.EnforceEvaluateDTO">
|
|
- select enforce_org_id,enforce_org_name,(
|
|
|
|
- SELECT
|
|
|
|
- COUNT( 1 )
|
|
|
|
- FROM
|
|
|
|
- enforce_job ej
|
|
|
|
- LEFT JOIN enforce_video ev ON ej.id = ev.enfore_job_id
|
|
|
|
- AND ev.is_deleted = 0
|
|
|
|
- WHERE
|
|
|
|
- ej.enforce_org_id = eo.enforce_org_id
|
|
|
|
- and ej.job_status = 'ARCHIVED'
|
|
|
|
- AND ej.is_deleted = '0'
|
|
|
|
- AND ev.enfore_job_id IS NULL;
|
|
|
|
- <if test="pm.startDate != null and pm.startDate !=''">
|
|
|
|
- AND ej.finish_time <![CDATA[ >= ]]> #{pm.startDate}
|
|
|
|
- </if>
|
|
|
|
- <if test="pm.endDate != null and pm.endDate !=''">
|
|
|
|
- AND ej.finish_time <![CDATA[ <= ]]> #{pm.endDate}
|
|
|
|
- </if>
|
|
|
|
- ) noProcessCount,
|
|
|
|
- (
|
|
|
|
- SELECT
|
|
|
|
- count( 1 )
|
|
|
|
- FROM
|
|
|
|
- enforce_job a
|
|
|
|
- WHERE
|
|
|
|
- a.enforce_org_id = eo.enforce_org_id
|
|
|
|
- AND time_out = 1
|
|
|
|
- AND job_type in ('REVIEW','NORMAL','REPORT')
|
|
|
|
- AND a.is_deleted = 0
|
|
|
|
- <if test="pm.startDate != null and pm.startDate !=''">
|
|
|
|
- AND a.last_enforce_date <![CDATA[ >= ]]> #{pm.startDate}
|
|
|
|
- </if>
|
|
|
|
- <if test="pm.endDate != null and pm.endDate !=''">
|
|
|
|
- AND a.last_enforce_date <![CDATA[ <= ]]> #{pm.endDate}
|
|
|
|
- </if>
|
|
|
|
- ) timeoutCount,
|
|
|
|
- (
|
|
|
|
SELECT
|
|
SELECT
|
|
- sum( a.times )
|
|
|
|
|
|
+ eo.enforce_org_id,
|
|
|
|
+ eo.enforce_org_name,
|
|
|
|
+ <if test="pm.process != null and pm.process == true ">
|
|
|
|
+ COALESCE ( ejv.noProcessCount, 0 ) AS noProcessCount,
|
|
|
|
+ </if>
|
|
|
|
+ COALESCE ( ej.timeoutCount, 0 ) AS timeoutCount,
|
|
|
|
+ COALESCE ( eds.deductCount, 0 ) AS deductCount,
|
|
|
|
+ COALESCE ( eds.deductScore, 0 ) AS deductScore
|
|
FROM
|
|
FROM
|
|
- enforce_deduct_record_situation a
|
|
|
|
- LEFT JOIN enforce_deduct_record b ON a.deduct_record_id = b.id
|
|
|
|
|
|
+ enforce_organize eo
|
|
|
|
+ <if test="pm.process != null and pm.process == true ">
|
|
|
|
+ left join (
|
|
|
|
+ SELECT
|
|
|
|
+ ej.enforce_org_id,
|
|
|
|
+ COUNT( 1 ) noProcessCount
|
|
|
|
+ FROM
|
|
|
|
+ enforce_job ej
|
|
|
|
+ LEFT JOIN enforce_video ev ON ej.id = ev.enfore_job_id
|
|
|
|
+ AND ev.is_deleted = 0
|
|
|
|
+ WHERE ej.job_status = 'ARCHIVED'
|
|
|
|
+ AND ej.is_deleted = '0'
|
|
|
|
+ AND ev.enfore_job_id IS NULL
|
|
|
|
+ and (
|
|
|
|
+ <trim prefixOverrides="or">
|
|
|
|
+ <if test="pm.startDate1 != null and pm.startDate1 != ''">
|
|
|
|
+ or ( ej.finish_time BETWEEN #{pm.startDate1} AND #{pm.endDate1} and ev.create_time <![CDATA[ <= ]]> '2024-12-23 23:59:59' )
|
|
|
|
+ </if>
|
|
|
|
+ <if test="pm.startDate2 != null and pm.startDate2 != ''">
|
|
|
|
+ or ( ej.finish_time BETWEEN #{pm.startDate2} AND #{pm.endDate2} and ev.create_time<![CDATA[ <= ]]> '2024-12-27 00:00:00' )
|
|
|
|
+ </if>
|
|
|
|
+ <if test="pm.endDate3 != null and pm.endDate3 != ''">
|
|
|
|
+ or ( ej.finish_time BETWEEN '2024-12-18 00:00:00' AND #{pm.endDate3} and ev.create_time <![CDATA[ <= ]]> DATE_ADD(ej.finish_time, INTERVAL 10 DAY) )
|
|
|
|
+ or ( ej.finish_time BETWEEN '2024-12-17 00:00:00' AND #{pm.endDate3} and ej.enforce_result = 'OVERPASS' )
|
|
|
|
+ </if>
|
|
|
|
+ </trim>
|
|
|
|
+ )
|
|
|
|
+ GROUP BY
|
|
|
|
+ ej.enforce_org_id
|
|
|
|
+ )ejv on ejv.enforce_org_id = eo.enforce_org_id
|
|
|
|
+ </if>
|
|
|
|
+ LEFT JOIN (
|
|
|
|
+ SELECT
|
|
|
|
+ enforce_org_id,
|
|
|
|
+ COUNT( 1 ) AS timeoutCount
|
|
|
|
+ FROM
|
|
|
|
+ enforce_job
|
|
WHERE
|
|
WHERE
|
|
- b.enforce_org_id = eo.enforce_org_id
|
|
|
|
|
|
+ time_out = 1
|
|
|
|
+ AND job_type IN ( 'NORMAL', 'REPORT' )
|
|
|
|
+ AND is_deleted = 0
|
|
<if test="pm.startDate != null and pm.startDate !=''">
|
|
<if test="pm.startDate != null and pm.startDate !=''">
|
|
- AND b.deduct_time <![CDATA[ >= ]]> #{pm.startDate}
|
|
|
|
|
|
+ AND finish_time <![CDATA[ >= ]]> #{pm.startDate}
|
|
</if>
|
|
</if>
|
|
<if test="pm.endDate != null and pm.endDate !=''">
|
|
<if test="pm.endDate != null and pm.endDate !=''">
|
|
- AND b.deduct_time <![CDATA[ <= ]]> #{pm.endDate}
|
|
|
|
|
|
+ AND finish_time <![CDATA[ <= ]]> #{pm.endDate}
|
|
</if>
|
|
</if>
|
|
- ) deductCount,
|
|
|
|
- (
|
|
|
|
|
|
+ GROUP BY
|
|
|
|
+ enforce_org_id
|
|
|
|
+ ) ej ON eo.enforce_org_id = ej.enforce_org_id
|
|
|
|
+ LEFT JOIN (
|
|
SELECT
|
|
SELECT
|
|
- sum( a.total_deduct )
|
|
|
|
|
|
+ b.enforce_org_id,
|
|
|
|
+ SUM( a.times ) AS deductCount,
|
|
|
|
+ SUM( a.total_deduct ) AS deductScore
|
|
FROM
|
|
FROM
|
|
enforce_deduct_record_situation a
|
|
enforce_deduct_record_situation a
|
|
LEFT JOIN enforce_deduct_record b ON a.deduct_record_id = b.id
|
|
LEFT JOIN enforce_deduct_record b ON a.deduct_record_id = b.id
|
|
- WHERE
|
|
|
|
- b.enforce_org_id = eo.enforce_org_id
|
|
|
|
<if test="pm.startDate != null and pm.startDate !=''">
|
|
<if test="pm.startDate != null and pm.startDate !=''">
|
|
AND b.deduct_time <![CDATA[ >= ]]> #{pm.startDate}
|
|
AND b.deduct_time <![CDATA[ >= ]]> #{pm.startDate}
|
|
</if>
|
|
</if>
|
|
<if test="pm.endDate != null and pm.endDate !=''">
|
|
<if test="pm.endDate != null and pm.endDate !=''">
|
|
AND b.deduct_time <![CDATA[ <= ]]> #{pm.endDate}
|
|
AND b.deduct_time <![CDATA[ <= ]]> #{pm.endDate}
|
|
</if>
|
|
</if>
|
|
- ) deductScore
|
|
|
|
- from enforce_organize eo
|
|
|
|
- where eo.enforce_org_id not in ('55c99876ec0f425aac6925a92cceeb17','256069491270746112')
|
|
|
|
|
|
+ GROUP BY
|
|
|
|
+ b.enforce_org_id
|
|
|
|
+ ) eds ON eo.enforce_org_id = eds.enforce_org_id
|
|
|
|
+ WHERE
|
|
|
|
+ eo.enforce_org_id NOT IN ( '55c99876ec0f425aac6925a92cceeb17', '256069491270746112' )
|
|
<if test="pm.enforceOrgId != null and pm.enforceOrgId != ''">
|
|
<if test="pm.enforceOrgId != null and pm.enforceOrgId != ''">
|
|
and eo.enforce_org_id = #{pm.enforceOrgId}
|
|
and eo.enforce_org_id = #{pm.enforceOrgId}
|
|
</if>
|
|
</if>
|
|
- order by eo.enforce_org_id
|
|
|
|
|
|
+ <if test="pm.enforceOrgIds !=null and pm.enforceOrgIds.size>0">
|
|
|
|
+ and eo.enforce_org_id in
|
|
|
|
+ <foreach item="item" index="i" collection="pm.enforceOrgIds" open="(" close=")" separator=",">
|
|
|
|
+ #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ ORDER BY
|
|
|
|
+ eo.enforce_org_id;
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|