计划企业中的修改和新增时间

zhangtao
dongdingding 1 year ago
parent 848b4e3f39
commit 464f3b0146

@ -315,21 +315,25 @@
</select> </select>
<select id="selectUpdateAll" resultType="com.ruoyi.programManagement.entity.BPlanEnterprise"> <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 CASE
WHEN e.MAX_EXAMINE_END_TIME IS NULL THEN 0 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) = 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 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 ELSE 3
END AS check_ageing, 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 FROM 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 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
</select> </select>

Loading…
Cancel
Save