laozt 11 months ago
commit 49ea5be06c

@ -315,21 +315,25 @@
</select>
<select id="selectUpdateAll" resultType="com.ruoyi.programManagement.entity.BPlanEnterprise">
SELECT a.id,a.enterprise_id, a.district, a.planned_year, a.is_point, a.enterprise_name, a.law_sort, a.law_areas, a.law_level, a.law_hierarchy, a.planned_month, a.status,
SELECT a.id, a.enterprise_id, a.district, a.planned_year, a.is_point, a.enterprise_name, a.law_sort, a.law_areas, a.law_level, a.law_hierarchy, a.planned_month, a.status,
CASE
WHEN e.MAX_EXAMINE_END_TIME IS NULL THEN 0
WHEN YEAR(e.MAX_EXAMINE_END_TIME) = a.planned_year AND MONTH(e.MAX_EXAMINE_END_TIME) = a.planned_month THEN 1
WHEN YEAR(e.MAX_EXAMINE_END_TIME) &lt; a.planned_year OR (YEAR(e.MAX_EXAMINE_END_TIME) = a.planned_year AND MONTH(e.MAX_EXAMINE_END_TIME) &lt; a.planned_month) THEN 2
ELSE 3
END AS check_ageing,
e.ID AS check_id
e.ID AS check_id,
CASE
WHEN e.ID IS NOT NULL THEN 1
ELSE 0
END AS check_status
FROM b_plan_enterprise a
LEFT JOIN (
SELECT USC_CODE, MAX(EXAMINE_END_TIME) AS MAX_EXAMINE_END_TIME, ID
FROM sz_enfor_examine
WHERE YEAR(EXAMINE_END_TIME) = YEAR(CURDATE())
GROUP BY USC_CODE, ID
) e ON a.enterprise_id = e.USC_CODE;
) e ON a.enterprise_id = e.USC_CODE
</select>

Loading…
Cancel
Save