|
|
@@ -83,6 +83,38 @@
|
|
|
</select>
|
|
|
<select id="selectStandbyPower"
|
|
|
resultType="com.xunmei.core.reportForms.resumption.vo.IntrusionTestReportVO">
|
|
|
-
|
|
|
+ SELECT
|
|
|
+ IFNULL( a.exception_count, 0 ) AS abnormalNumber,
|
|
|
+ COUNT( a.id ) AS planNumber,
|
|
|
+ IFNULL( SUM( IF ( a.`status` = 3, 1, 0 )), 0 ) AS realityNumber,
|
|
|
+ IF
|
|
|
+ (
|
|
|
+ IFNULL( SUM( IF ( a.`status` = 3, 1, 0 )), 0 )= 0
|
|
|
+ OR COUNT( a.id )= 0,
|
|
|
+ '0%',
|
|
|
+ CONCAT(
|
|
|
+ IFNULL( SUM( IF ( a.`status` = 3, 1, 0 )), 0 )/ COUNT( a.id )* 100,
|
|
|
+ '%'
|
|
|
+ )) AS realityRate,
|
|
|
+ COUNT( c.id ) AS realityRectificationNumber,
|
|
|
+ IF
|
|
|
+ (
|
|
|
+ COUNT( c.id )= 0
|
|
|
+ OR IFNULL( a.exception_count, 0 )= 0,
|
|
|
+ '0%',
|
|
|
+ CONCAT( COUNT( c.id )/ IFNULL( a.exception_count, 0 )* 100, '%' )) AS realityRectificationRate
|
|
|
+ FROM
|
|
|
+ core_resumption a
|
|
|
+ LEFT JOIN core_resumption_plan b ON a.plan_id = b.id
|
|
|
+ LEFT JOIN core_question c ON c.src_task_id = a.id
|
|
|
+ AND reform_status = 11
|
|
|
+ WHERE
|
|
|
+ b.plan_type =5
|
|
|
+ <if test="date !=null">
|
|
|
+ AND a.ymd_date like concat(#{date},'%')
|
|
|
+ </if>
|
|
|
+ <if test="orgPath !=null">
|
|
|
+ and a.org_path like concat(#{orgPath},'%')
|
|
|
+ </if>
|
|
|
</select>
|
|
|
</mapper>
|