@ -32,7 +32,7 @@
check_ageing,
check_ageing,
uuto,
uuto,
check_time
check_time
from b_plan_enterprise
from SZYJ. b_plan_enterprise
</sql>
</sql>
<select id= "selectBPlanEnterpriseList" parameterType= "BPlanEnterprise" resultType= "BPlanEnterpriseResponse" >
<select id= "selectBPlanEnterpriseList" parameterType= "BPlanEnterprise" resultType= "BPlanEnterpriseResponse" >
@ -66,9 +66,9 @@
a.check_ageing,
a.check_ageing,
c.risk_level ,
c.risk_level ,
CONCAT(d.district,'-', d.county) AS districtcounty
CONCAT(d.district,'-', d.county) AS districtcounty
FROM b_plan_enterprise a
FROM SZYJ. b_plan_enterprise a
left join b_administrative_division d on a.district=d.county_code
left join SZYJ. b_administrative_division d on a.district=d.county_code
LEFT JOIN b_enterprise_new c ON a.enterprise_id = c.enterprise_id
LEFT JOIN SZYJ. b_enterprise_new c ON a.enterprise_id = c.enterprise_id
<where >
<where >
<if test= "enterpriseId != null and enterpriseId != ''" > and a.enterprise_id = #{enterpriseId}</if>
<if test= "enterpriseId != null and enterpriseId != ''" > and a.enterprise_id = #{enterpriseId}</if>
<if test= "createId != null " > and a.create_id = #{createId}</if>
<if test= "createId != null " > and a.create_id = #{createId}</if>
@ -106,7 +106,7 @@
</select>
</select>
<delete id= "deleteByPlanId" >
<delete id= "deleteByPlanId" >
delete
delete
from b_plan_enterprise
from SZYJ. b_plan_enterprise
where plan_id =
where plan_id =
#{planId}
#{planId}
</delete>
</delete>
@ -145,10 +145,10 @@
c.EXAMINE_END_TIME as examineEndTime,
c.EXAMINE_END_TIME as examineEndTime,
CASE WHEN b.ent_code IS NOT NULL THEN 1 ELSE 2 END AS isPoint,
CASE WHEN b.ent_code IS NOT NULL THEN 1 ELSE 2 END AS isPoint,
CONCAT(d.district,'-', d.county) AS districtcounty
CONCAT(d.district,'-', d.county) AS districtcounty
FROM b_plan_enterprise a
FROM SZYJ. b_plan_enterprise a
LEFT JOIN b_key_enterprise b ON a.enterprise_id = b.ent_code
LEFT JOIN SZYJ. b_key_enterprise b ON a.enterprise_id = b.ent_code
LEFT JOIN b_enterprise_new c ON a.enterprise_id = c.enterprise_id
LEFT JOIN SZYJ. b_enterprise_new c ON a.enterprise_id = c.enterprise_id
left join b_administrative_division d on a.district=d.county_code
left join SZYJ. b_administrative_division d on a.district=d.county_code
<where >
<where >
<if test= "req.plannedYear !=null and req.plannedYear !=''" >
<if test= "req.plannedYear !=null and req.plannedYear !=''" >
and a.planned_year =#{req.plannedYear}
and a.planned_year =#{req.plannedYear}
@ -181,7 +181,7 @@
order by law_sort,planned_month+0
order by law_sort,planned_month+0
</select>
</select>
<select id= "page" resultType= "com.ruoyi.programManagement.entity.BPlanEnterprise" >
<select id= "page" resultType= "com.ruoyi.programManagement.entity.BPlanEnterprise" >
select * from b_plan_enterprise
select * from SZYJ. b_plan_enterprise
<where >
<where >
<if test= "req.plannedYear !=null and req.plannedYear !=''" >
<if test= "req.plannedYear !=null and req.plannedYear !=''" >
and plannedYear =#{req.plannedYear}
and plannedYear =#{req.plannedYear}
@ -203,12 +203,12 @@
COUNT(CASE WHEN bpe.is_point = 2 AND exm.USC_CODE IS NULL THEN 1 END) * 100 /
COUNT(CASE WHEN bpe.is_point = 2 AND exm.USC_CODE IS NULL THEN 1 END) * 100 /
COUNT(CASE WHEN bpe.is_point = 2 THEN 1 END) as percentageNonCompleted,
COUNT(CASE WHEN bpe.is_point = 2 THEN 1 END) as percentageNonCompleted,
COUNT(*) as totalPlanCount
COUNT(*) as totalPlanCount
FROM b_plan_manage bpm
FROM SZYJ. b_plan_manage bpm
JOIN
JOIN
b_plan_enterprise bpe ON bpm.id = bpe.plan_id
SZYJ. b_plan_enterprise bpe ON bpm.id = bpe.plan_id
LEFT JOIN
LEFT JOIN
sz_enfor_examine exm ON bpe.enterprise_id = exm.USC_CODE
SZYJ. sz_enfor_examine exm ON bpe.enterprise_id = exm.USC_CODE
LEFT JOIN sys_dept c on bpm.dept_id = c.dept_id
LEFT JOIN SZYJ. sys_dept c on bpm.dept_id = c.dept_id
<where >
<where >
<if test= "req.plannedYear !=null and req.plannedYear !=''" >
<if test= "req.plannedYear !=null and req.plannedYear !=''" >
and bpm.planned_year =#{req.plannedYear}
and bpm.planned_year =#{req.plannedYear}
@ -221,8 +221,8 @@
</select>
</select>
<select id= "getplan" resultType= "com.ruoyi.programManagement.entity.response.zhifaPlanResponse" >
<select id= "getplan" resultType= "com.ruoyi.programManagement.entity.response.zhifaPlanResponse" >
SELECT COUNT(*) AS count, b.dept_name AS deptName
SELECT COUNT(*) AS count, b.dept_name AS deptName
FROM b_plan_manage a
FROM SZYJ. b_plan_manage a
LEFT JOIN sys_dept b
LEFT JOIN SZYJ. sys_dept b
ON a.dept_id = b.dept_id
ON a.dept_id = b.dept_id
WHERE b.ancestors REGEXP '^([^,]*,){0,1}[^,]*$'
WHERE b.ancestors REGEXP '^([^,]*,){0,1}[^,]*$'
GROUP BY a.dept_id
GROUP BY a.dept_id
@ -233,8 +233,8 @@
b.DISTRICT_NAME AS institutionName,
b.DISTRICT_NAME AS institutionName,
a.ENTERPRISE_NAME as enterpriseName
a.ENTERPRISE_NAME as enterpriseName
FROM
FROM
b_plan_enterprise a
SZYJ. b_plan_enterprise a
LEFT JOIN szs_administrative_division b ON a.district = b.DISTRICT_CODE
LEFT JOIN SZYJ. szs_administrative_division b ON a.district = b.DISTRICT_CODE
<where >
<where >
<if test= "req.district !=null and req.district!='' " >
<if test= "req.district !=null and req.district!='' " >
AND a.district like concat('%', #{req.district}, '%')
AND a.district like concat('%', #{req.district}, '%')
@ -267,7 +267,7 @@
a.planned_year,
a.planned_year,
a.is_point,
a.is_point,
a.enterprise_name as entprName
a.enterprise_name as entprName
from b_plan_enterprise a
from SZYJ. b_plan_enterprise a
where a.id = #{id}
where a.id = #{id}
</select>
</select>
<select id= "getShouyeList"
<select id= "getShouyeList"
@ -275,14 +275,14 @@
SELECT
SELECT
IFNULL( law_areas, '合计' ) AS lawAreas,
IFNULL( law_areas, '合计' ) AS lawAreas,
CASE
CASE
WHEN GROUPING(law_areas) = 1 THEN (SELECT MAX(law_sort) + 1 FROM b_plan_enterprise)
WHEN GROUPING(law_areas) = 1 THEN (SELECT MAX(law_sort) + 1 FROM SZYJ. b_plan_enterprise)
ELSE MAX(law_sort)
ELSE MAX(law_sort)
END AS sort,
END AS sort,
SUM( CASE WHEN check_status = 1 THEN 1 ELSE 0 END ) AS completed,
SUM( CASE WHEN check_status = 1 THEN 1 ELSE 0 END ) AS completed,
SUM(( RISK_LEVEL IN ( 'C', 'D' )) AND check_status = 1 ) AS cdFinish
SUM(( RISK_LEVEL IN ( 'C', 'D' )) AND check_status = 1 ) AS cdFinish
FROM
FROM
b_plan_enterprise a
SZYJ. b_plan_enterprise a
LEFT JOIN b_enterprise_new b ON a.enterprise_id = b.enterprise_id
LEFT JOIN SZYJ. b_enterprise_new b ON a.enterprise_id = b.enterprise_id
<where >
<where >
<if test= "req.plannedYear !=null and req.plannedYear!='' " >
<if test= "req.plannedYear !=null and req.plannedYear!='' " >
and planned_year =#{req.plannedYear}
and planned_year =#{req.plannedYear}
@ -307,14 +307,14 @@
SELECT
SELECT
IFNULL( law_hierarchy, '合计' ) AS lawAreas,
IFNULL( law_hierarchy, '合计' ) AS lawAreas,
CASE
CASE
WHEN GROUPING(law_hierarchy) = 1 THEN (SELECT MAX(law_sort) + 1 FROM b_plan_enterprise)
WHEN GROUPING(law_hierarchy) = 1 THEN (SELECT MAX(law_sort) + 1 FROM SZYJ. b_plan_enterprise)
ELSE MAX(law_sort)
ELSE MAX(law_sort)
END AS sort,
END AS sort,
SUM( CASE WHEN check_status = 1 THEN 1 ELSE 0 END ) AS completed,
SUM( CASE WHEN check_status = 1 THEN 1 ELSE 0 END ) AS completed,
SUM(( RISK_LEVEL IN ( 'C', 'D' )) AND check_status = 1 ) AS cdFinish
SUM(( RISK_LEVEL IN ( 'C', 'D' )) AND check_status = 1 ) AS cdFinish
FROM
FROM
b_plan_enterprise a
SZYJ. b_plan_enterprise a
LEFT JOIN b_enterprise_new b ON a.enterprise_id = b.enterprise_id
LEFT JOIN SZYJ. b_enterprise_new b ON a.enterprise_id = b.enterprise_id
<where >
<where >
<if test= "req.plannedYear !=null and req.plannedYear!='' " >
<if test= "req.plannedYear !=null and req.plannedYear!='' " >
and planned_year =#{req.plannedYear}
and planned_year =#{req.plannedYear}
@ -363,10 +363,10 @@
ELSE 0
ELSE 0
END
END
AS check_status
AS check_status
FROM b_plan_enterprise a
FROM SZYJ. b_plan_enterprise a
LEFT JOIN (
LEFT JOIN (
SELECT USC_CODE, MAX(EXAMINE_END_TIME) AS MAX_EXAMINE_END_TIME, ID
SELECT USC_CODE, MAX(EXAMINE_END_TIME) AS MAX_EXAMINE_END_TIME, ID
FROM sz_enfor_examine
FROM SZYJ. sz_enfor_examine
WHERE YEAR(EXAMINE_END_TIME) = YEAR(CURDATE())
WHERE YEAR(EXAMINE_END_TIME) = YEAR(CURDATE())
GROUP BY USC_CODE, ID
GROUP BY USC_CODE, ID
) e ON a.enterprise_id = e.USC_CODE
) e ON a.enterprise_id = e.USC_CODE
@ -376,15 +376,15 @@
SELECT
SELECT
IFNULL(law_hierarchy, '合计') AS lawAreas,
IFNULL(law_hierarchy, '合计') AS lawAreas,
CASE
CASE
WHEN GROUPING(law_hierarchy) = 1 THEN (SELECT MAX(law_sort) + 1 FROM b_plan_enterprise)
WHEN GROUPING(law_hierarchy) = 1 THEN (SELECT MAX(law_sort) + 1 FROM SZYJ. b_plan_enterprise)
ELSE MAX(law_sort)
ELSE MAX(law_sort)
END AS sort,
END AS sort,
COUNT(law_areas) AS count,
COUNT(law_areas) AS count,
SUM(CASE WHEN check_status = 1 THEN 1 ELSE 0 END) AS completed,
SUM(CASE WHEN check_status = 1 THEN 1 ELSE 0 END) AS completed,
SUM(RISK_LEVEL IN ('C', 'D')) AS cdExecutionPlan
SUM(RISK_LEVEL IN ('C', 'D')) AS cdExecutionPlan
FROM
FROM
b_plan_enterprise a
SZYJ. b_plan_enterprise a
LEFT JOIN b_enterprise_new b ON a.enterprise_id = b.enterprise_id
LEFT JOIN SZYJ. b_enterprise_new b ON a.enterprise_id = b.enterprise_id
<where >
<where >
<if test= "req.plannedYear !=null and req.plannedYear!='' " >
<if test= "req.plannedYear !=null and req.plannedYear!='' " >
and planned_year =#{req.plannedYear}
and planned_year =#{req.plannedYear}
@ -410,14 +410,14 @@
SELECT
SELECT
IFNULL(law_areas, '合计') AS lawAreas,
IFNULL(law_areas, '合计') AS lawAreas,
CASE
CASE
WHEN GROUPING(law_areas) = 1 THEN (SELECT MAX(law_sort) + 1 FROM b_plan_enterprise)
WHEN GROUPING(law_areas) = 1 THEN (SELECT MAX(law_sort) + 1 FROM SZYJ. b_plan_enterprise)
ELSE MAX(law_sort)
ELSE MAX(law_sort)
END AS sort,
END AS sort,
COUNT(law_areas) AS count,
COUNT(law_areas) AS count,
SUM(RISK_LEVEL IN ('C', 'D')) AS cdExecutionPlan
SUM(RISK_LEVEL IN ('C', 'D')) AS cdExecutionPlan
FROM
FROM
b_plan_enterprise a
SZYJ. b_plan_enterprise a
LEFT JOIN b_enterprise_new b ON a.enterprise_id = b.enterprise_id
LEFT JOIN SZYJ. b_enterprise_new b ON a.enterprise_id = b.enterprise_id
<where >
<where >
<if test= "req.plannedYear !=null and req.plannedYear!='' " >
<if test= "req.plannedYear !=null and req.plannedYear!='' " >
and planned_year =#{req.plannedYear}
and planned_year =#{req.plannedYear}
@ -435,7 +435,7 @@
</select>
</select>
<update id= "updateIdList" parameterType= "java.util.List" >
<update id= "updateIdList" parameterType= "java.util.List" >
UPDATE b_plan_enterprise
UPDATE SZYJ. b_plan_enterprise
SET status = 1
SET status = 1
WHERE id in
WHERE id in
<foreach item= "item" collection= "list" open= "(" separator= "," close= ")" >
<foreach item= "item" collection= "list" open= "(" separator= "," close= ")" >
@ -444,7 +444,7 @@
</update>
</update>
<update id= "updatePlan" parameterType= "BPlanEnterpriseRequest" >
<update id= "updatePlan" parameterType= "BPlanEnterpriseRequest" >
update b_plan_enterprise
update SZYJ. b_plan_enterprise
<trim prefix= "SET" suffixOverrides= "," >
<trim prefix= "SET" suffixOverrides= "," >
<if test= "enterpriseId != null" > enterprise_id=#{enterpriseId},</if>
<if test= "enterpriseId != null" > enterprise_id=#{enterpriseId},</if>
<if test= "district != null" > district=#{district},</if>
<if test= "district != null" > district=#{district},</if>
@ -471,13 +471,13 @@
where id = #{id}
where id = #{id}
</update>
</update>
<update id= "updateEndTime" >
<update id= "updateEndTime" >
UPDATE b_enterprise_new a
UPDATE SZYJ. b_enterprise_new a
INNER JOIN (
INNER JOIN (
SELECT
SELECT
USC_CODE,
USC_CODE,
MAX_EXAMINE_END_TIME
MAX_EXAMINE_END_TIME
FROM
FROM
( SELECT ROW_NUMBER ( ) over ( PARTITION BY USC_CODE ORDER BY EXAMINE_END_TIME DESC ) rowId, USC_CODE, EXAMINE_END_TIME AS MAX_EXAMINE_END_TIME FROM sz_enfor_examine ) S
( SELECT ROW_NUMBER ( ) over ( PARTITION BY USC_CODE ORDER BY EXAMINE_END_TIME DESC ) rowId, USC_CODE, EXAMINE_END_TIME AS MAX_EXAMINE_END_TIME FROM SZYJ. sz_enfor_examine ) S
WHERE
WHERE
rowId = 1
rowId = 1
) c
) c
@ -487,7 +487,7 @@
<insert id= "insertPlan" parameterType= "BPlanEnterpriseRequest" useGeneratedKeys= "true" keyProperty= "id" >
<insert id= "insertPlan" parameterType= "BPlanEnterpriseRequest" useGeneratedKeys= "true" keyProperty= "id" >
insert into b_plan_enterprise
insert into SZYJ. b_plan_enterprise
<trim prefix= "(" suffix= ")" suffixOverrides= "," >
<trim prefix= "(" suffix= ")" suffixOverrides= "," >
<if test= "enterpriseId != null" > enterprise_id,</if>
<if test= "enterpriseId != null" > enterprise_id,</if>
<if test= "district != null" > district,</if>
<if test= "district != null" > district,</if>