Commit 33ad570d authored by tianbo's avatar tianbo

气瓶企业许可超期错误修改

parent 282cf5b7
......@@ -5,15 +5,12 @@
<select id="queryNumAndOutOfDateNum" resultType="java.util.Map">
SELECT
count( t.sequence_nbr ) AS cylinderNum,
l.expiry_date AS fillingPermitDate,
(select expiry_date from tz_base_unit_licence where unit_code = u.credit_code ORDER BY expiry_date desc limit 1) AS fillingPermitDate,
count( CASE WHEN i.next_inspection_date <![CDATA[ < ]]> now() THEN 1 END ) AS outOfDateNum
FROM
tz_cylinder_unit U
LEFT JOIN tz_cylinder_info AS t ON t.app_id = u.app_id
LEFT JOIN tz_cylinder_inspection AS i ON i.sequence_code = t.sequence_code
LEFT JOIN (SELECT * FROM tz_base_unit_licence
GROUP BY unit_code
ORDER BY expiry_date DESC) AS l ON l.unit_code = u.credit_code
WHERE
u.sequence_nbr = #{sequenceNbr}
GROUP BY u.sequence_nbr
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment