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

zhangtao
dongdingding 1 year ago
parent 848b4e3f39
commit 464f3b0146

@ -322,14 +322,18 @@
WHEN YEAR(e.MAX_EXAMINE_END_TIME) < a.planned_year OR (YEAR(e.MAX_EXAMINE_END_TIME) = a.planned_year AND MONTH(e.MAX_EXAMINE_END_TIME) < a.planned_month) THEN 2 WHEN YEAR(e.MAX_EXAMINE_END_TIME) < a.planned_year OR (YEAR(e.MAX_EXAMINE_END_TIME) = a.planned_year AND MONTH(e.MAX_EXAMINE_END_TIME) < 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