|
|
|
@ -266,14 +266,20 @@
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getShouyeList"
|
|
|
|
|
resultType="com.ruoyi.programManagement.entity.response.BPlanEnterPriseTreeResponse">
|
|
|
|
|
|
|
|
|
|
SELECT
|
|
|
|
|
IFNULL(law_areas, '合计') AS lawAreas,
|
|
|
|
|
MAX(law_sort) AS sort,
|
|
|
|
|
COUNT(law_areas) AS count,
|
|
|
|
|
SUM(CASE WHEN check_status = 1 THEN 1 ELSE 0 END) AS completed,
|
|
|
|
|
ROUND(100 * SUM(CASE WHEN check_status = 1 THEN 1 ELSE 0 END) / COUNT(law_areas)) AS completion_rate
|
|
|
|
|
FROM b_plan_enterprise
|
|
|
|
|
SELECT
|
|
|
|
|
IFNULL( law_areas, '合计' ) AS lawAreas,
|
|
|
|
|
MAX( law_sort ) AS sort,
|
|
|
|
|
COUNT( law_areas ) AS count,
|
|
|
|
|
SUM( CASE WHEN check_status = 1 THEN 1 ELSE 0 END ) AS completed,
|
|
|
|
|
ROUND(
|
|
|
|
|
100 * SUM( CASE WHEN check_status = 1 THEN 1 ELSE 0 END ) / COUNT( law_areas )) AS completion_rate,
|
|
|
|
|
SUM(
|
|
|
|
|
RISK_LEVEL IN ( 'C', 'D' )) AS cdExecutionPlan,
|
|
|
|
|
SUM(( RISK_LEVEL IN ( 'C', 'D' )) AND check_status = 1 ) AS cdFinish,
|
|
|
|
|
ROUND( 100 * SUM(( RISK_LEVEL IN ( 'C', 'D' )) AND check_status = 1 ) / SUM( RISK_LEVEL IN ( 'C', 'D' )) ) AS cdCompletionRate
|
|
|
|
|
FROM
|
|
|
|
|
b_plan_enterprise a
|
|
|
|
|
LEFT JOIN b_enterprise_new b ON a.enterprise_id = b.enterprise_id
|
|
|
|
|
<where>
|
|
|
|
|
<if test="req.plannedYear !=null and req.plannedYear!='' ">
|
|
|
|
|
and planned_year =#{req.plannedYear}
|
|
|
|
@ -286,22 +292,30 @@
|
|
|
|
|
</if>
|
|
|
|
|
and status=1
|
|
|
|
|
</where>
|
|
|
|
|
|
|
|
|
|
GROUP BY law_areas WITH ROLLUP
|
|
|
|
|
ORDER BY
|
|
|
|
|
CASE WHEN GROUPING(law_areas) = 1 THEN 1 ELSE 0 END,
|
|
|
|
|
sort
|
|
|
|
|
CASE WHEN GROUPING(law_areas) = 1 THEN 1 ELSE 0 END,
|
|
|
|
|
sort
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getShouYeMxList"
|
|
|
|
|
resultType="com.ruoyi.programManagement.entity.response.BPlanEnterPriseTreeResponse">
|
|
|
|
|
SELECT
|
|
|
|
|
IFNULL(law_hierarchy, '合计') AS lawAreas,
|
|
|
|
|
MAX(law_sort) AS sort,
|
|
|
|
|
COUNT(law_areas) AS count,
|
|
|
|
|
SUM(CASE WHEN check_status = 1 THEN 1 ELSE 0 END) AS completed,
|
|
|
|
|
ROUND(100 * SUM(CASE WHEN check_status = 1 THEN 1 ELSE 0 END) / COUNT(law_areas)) AS completion_rate
|
|
|
|
|
FROM b_plan_enterprise
|
|
|
|
|
SELECT
|
|
|
|
|
IFNULL( law_areas, '合计' ) AS lawAreas,
|
|
|
|
|
MAX( law_sort ) AS sort,
|
|
|
|
|
COUNT( law_areas ) AS count,
|
|
|
|
|
SUM( CASE WHEN check_status = 1 THEN 1 ELSE 0 END ) AS completed,
|
|
|
|
|
ROUND(
|
|
|
|
|
100 * SUM( CASE WHEN check_status = 1 THEN 1 ELSE 0 END ) / COUNT( law_areas )) AS completion_rate,
|
|
|
|
|
SUM(
|
|
|
|
|
RISK_LEVEL IN ( 'C', 'D' )) AS cdExecutionPlan,
|
|
|
|
|
SUM(( RISK_LEVEL IN ( 'C', 'D' )) AND check_status = 1 ) AS cdFinish,
|
|
|
|
|
ROUND( 100 * SUM(( RISK_LEVEL IN ( 'C', 'D' )) AND check_status = 1 ) / SUM( RISK_LEVEL IN ( 'C', 'D' )) ) AS cdCompletionRate
|
|
|
|
|
FROM
|
|
|
|
|
b_plan_enterprise a
|
|
|
|
|
LEFT JOIN b_enterprise_new b ON a.enterprise_id = b.enterprise_id
|
|
|
|
|
<where>
|
|
|
|
|
<if test="req.plannedYear !=null and req.plannedYear!='' ">
|
|
|
|
|
and planned_year =#{req.plannedYear}
|
|
|
|
|