|
|
|
@ -80,43 +80,77 @@
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getZhifa" resultType="com.ruoyi.programManagement.entity.response.BPlanEnterpriseZhifaResponse">
|
|
|
|
|
-- SELECT
|
|
|
|
|
-- s.*
|
|
|
|
|
-- FROM
|
|
|
|
|
-- (
|
|
|
|
|
-- SELECT
|
|
|
|
|
-- a.*,
|
|
|
|
|
-- a.planned_year AS plannedYear,
|
|
|
|
|
-- b.id AS longId,
|
|
|
|
|
-- b.EXAMINE_START_TIME,
|
|
|
|
|
-- b.EXAMINE_END_TIME,
|
|
|
|
|
-- b.ENTPR_NAME as entprName,
|
|
|
|
|
-- CASE
|
|
|
|
|
-- WHEN b.USC_CODE IS NOT NULL
|
|
|
|
|
-- AND SUBSTRING( a.planned_year, 1, 7 ) = SUBSTRING( b.EXAMINE_START_TIME, 1, 7 )
|
|
|
|
|
-- THEN 1
|
|
|
|
|
-- ELSE 2
|
|
|
|
|
-- END AS checkStatus
|
|
|
|
|
-- FROM
|
|
|
|
|
-- b_plan_enterprise a
|
|
|
|
|
-- LEFT JOIN sz_enfor_examine b ON a.enterprise_id = b.USC_CODE
|
|
|
|
|
-- WHERE
|
|
|
|
|
-- b.USC_CODE IS NOT NULL
|
|
|
|
|
-- ) s
|
|
|
|
|
SELECT p.*
|
|
|
|
|
FROM (
|
|
|
|
|
SELECT
|
|
|
|
|
s.*
|
|
|
|
|
a.*,
|
|
|
|
|
a.planned_year AS plannedYear,
|
|
|
|
|
NULL AS longId,
|
|
|
|
|
NULL AS EXAMINE_START_TIME,
|
|
|
|
|
NULL AS EXAMINE_END_TIME,
|
|
|
|
|
|
|
|
|
|
2 AS checkStatus
|
|
|
|
|
FROM
|
|
|
|
|
(
|
|
|
|
|
b_plan_enterprise a
|
|
|
|
|
WHERE
|
|
|
|
|
a.enterprise_id NOT IN (SELECT USC_CODE FROM sz_enfor_examine WHERE USC_CODE IS NOT NULL)
|
|
|
|
|
|
|
|
|
|
UNION
|
|
|
|
|
|
|
|
|
|
SELECT
|
|
|
|
|
a.*,
|
|
|
|
|
a.planned_year AS plannedYear,
|
|
|
|
|
b.id AS longId,
|
|
|
|
|
b.EXAMINE_START_TIME,
|
|
|
|
|
b.EXAMINE_END_TIME,
|
|
|
|
|
b.ENTPR_NAME as entprName,
|
|
|
|
|
|
|
|
|
|
CASE
|
|
|
|
|
WHEN b.USC_CODE IS NOT NULL
|
|
|
|
|
AND SUBSTRING( a.planned_year, 1, 7 ) = SUBSTRING( b.EXAMINE_START_TIME, 1, 7 )
|
|
|
|
|
THEN 1
|
|
|
|
|
WHEN b.USC_CODE IS NOT NULL AND SUBSTRING(a.planned_year, 1, 7) = SUBSTRING(b.EXAMINE_START_TIME, 1, 7) THEN 1
|
|
|
|
|
ELSE 2
|
|
|
|
|
END AS checkStatus
|
|
|
|
|
FROM
|
|
|
|
|
b_plan_enterprise a
|
|
|
|
|
LEFT JOIN sz_enfor_examine b ON a.enterprise_id = b.USC_CODE
|
|
|
|
|
WHERE
|
|
|
|
|
b.USC_CODE IS NOT NULL
|
|
|
|
|
) s
|
|
|
|
|
FROM (
|
|
|
|
|
SELECT *,
|
|
|
|
|
ROW_NUMBER() OVER (PARTITION BY USC_CODE ORDER BY EXAMINE_START_TIME DESC) AS rn
|
|
|
|
|
FROM sz_enfor_examine
|
|
|
|
|
WHERE USC_CODE IS NOT NULL
|
|
|
|
|
) b
|
|
|
|
|
INNER JOIN b_plan_enterprise a ON a.enterprise_id = b.USC_CODE AND b.rn = 1
|
|
|
|
|
) p
|
|
|
|
|
|
|
|
|
|
<where>
|
|
|
|
|
<if test="req.plannedYear !=null and req.plannedYear !=''">
|
|
|
|
|
and s.plannedYear =#{req.plannedYear}
|
|
|
|
|
and p.plannedYear =#{req.plannedYear}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="req.district !=null and req.district !=''">
|
|
|
|
|
and s.district like concat('%', #{req.district}, '%')
|
|
|
|
|
and p.district like concat('%', #{req.district}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="req.checkStatus !=null and req.checkStatus !=''">
|
|
|
|
|
and s.checkStatus =#{req.checkStatus}
|
|
|
|
|
and p.checkStatus =#{req.checkStatus}
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
<select id="page" resultType="com.ruoyi.programManagement.entity.BPlanEnterprise">
|
|
|
|
|
select * from b_plan_enterprise
|
|
|
|
|