Commit fdfc19cf authored by zhangyingbin's avatar zhangyingbin

修改8827 8826 燃气气瓶bug

parent a94ad53b
...@@ -17,28 +17,28 @@ ...@@ -17,28 +17,28 @@
<select id="queryListByQueryDto" resultType="java.util.Map"> <select id="queryListByQueryDto" resultType="java.util.Map">
SELECT SELECT
r.sequence_nbr AS sequenceNbr, r.sequence_nbr AS sequenceNbr,
r.filling_unit_name AS fillingUnitName, -- r.filling_unit_name AS fillingUnitName,
r.factory_num AS factoryNum, -- r.factory_num AS factoryNum,
CASE -- CASE
i.cylinder_variety -- i.cylinder_variety
WHEN 1 THEN -- WHEN 1 THEN
'无缝气瓶' -- '无缝气瓶'
WHEN 2 THEN -- WHEN 2 THEN
'焊接气瓶' -- '焊接气瓶'
WHEN 3 THEN -- WHEN 3 THEN
'缠绕气瓶' -- '缠绕气瓶'
WHEN 4 THEN -- WHEN 4 THEN
'绝热气瓶' -- '绝热气瓶'
WHEN 5 THEN -- WHEN 5 THEN
'内装填料气瓶' -- '内装填料气瓶'
ELSE -- ELSE
'' -- ''
END AS cylinderVariety, -- END AS cylinderVariety,
i.qrCode AS qrCode, -- i.qrCode AS qrCode,
i.electronic_label_code AS electronicLabelCode, -- i.electronic_label_code AS electronicLabelCode,
r.sequence_code AS sequenceCode, -- r.sequence_code AS sequenceCode,
i.unit_inner_code AS unitInnerCode, -- i.unit_inner_code AS unitInnerCode,
u.unit_name AS propertyUnit, -- u.unit_name AS propertyUnit,
r.filling_startTime AS fillingStarttime, r.filling_startTime AS fillingStarttime,
r.filling_endTime AS fillingEndtime, r.filling_endTime AS fillingEndtime,
r.filling_user AS fillingUser, r.filling_user AS fillingUser,
...@@ -80,30 +80,30 @@ ...@@ -80,30 +80,30 @@
'不合格' '不合格'
end as checkResult end as checkResult
FROM FROM
tz_cylinder_filling_record_copy r tz_cylinder_filling_record r
left join tz_cylinder_unit u on u.app_id = r.app_id left join tz_cylinder_unit u on u.app_id = r.app_id
left join tz_cylinder_info_copy i on r.sequence_code = i.sequence_code left join tz_cylinder_filling b on b.filling_before_id = r.filling_before_id AND
left join tz_cylinder_filling_copy b on b.sequence_code = r.sequence_code AND
date_format(`b`.`inspection_date`,'%Y-%m-%d') = date_format(`r`.`filling_startTime`,'%Y-%m-%d') date_format(`b`.`inspection_date`,'%Y-%m-%d') = date_format(`r`.`filling_startTime`,'%Y-%m-%d')
left join tz_cylinder_filling_check_copy af on af.sequence_code = r.sequence_code AND left join tz_cylinder_filling_check af on af.filling_check_id = r.filling_check_id AND
date_format(`af`.`inspection_date`,'%Y-%m-%d') = date_format(`r`.`filling_startTime`,'%Y-%m-%d') date_format(`af`.`inspection_date`,'%Y-%m-%d') = date_format(`r`.`filling_startTime`,'%Y-%m-%d')
left join tz_cylinder_info i on b.sequence_code = i.sequence_code
WHERE WHERE
1= 1 1= 1
<if test="appId != null and appId != ''"> <if test="appId != null and appId != ''">
AND r.app_id = #{appId} AND r.app_id = #{appId}
</if> </if>
<if test="fillingUnitName != null and fillingUnitName != ''"> <!-- <if test="fillingUnitName != null and fillingUnitName != ''">-->
AND r.filling_unit_name like <!-- AND r.filling_unit_name like-->
CONCAT(CONCAT('%',#{fillingUnitName}),'%') <!-- CONCAT(CONCAT('%',#{fillingUnitName}),'%')-->
</if> <!-- </if>-->
<if test="propertyUnit != null and propertyUnit != ''"> <!-- <if test="propertyUnit != null and propertyUnit != ''">-->
AND u.unit_name like <!-- AND u.unit_name like-->
CONCAT(CONCAT('%',#{propertyUnit}),'%') <!-- CONCAT(CONCAT('%',#{propertyUnit}),'%')-->
</if> <!-- </if>-->
<if test="factoryNum != null and factoryNum != ''"> <!-- <if test="factoryNum != null and factoryNum != ''">-->
AND r.factory_num like <!-- AND r.factory_num like-->
CONCAT(CONCAT('%',#{factoryNum}),'%') <!-- CONCAT(CONCAT('%',#{factoryNum}),'%')-->
</if> <!-- </if>-->
<if test="fillingStartTime != null "> <if test="fillingStartTime != null ">
and #{fillingStartTime} <![CDATA[ <= ]]> and #{fillingStartTime} <![CDATA[ <= ]]>
r.filling_startTime r.filling_startTime
...@@ -112,24 +112,24 @@ ...@@ -112,24 +112,24 @@
and r.filling_endTime <![CDATA[ <= ]]> and r.filling_endTime <![CDATA[ <= ]]>
#{fillingEndTime} #{fillingEndTime}
</if> </if>
<if test="cylinderVariety != null and cylinderVariety != ''"> <!-- <if test="cylinderVariety != null and cylinderVariety != ''">-->
AND i.cylinder_variety = #{cylinderVariety} <!-- AND i.cylinder_variety = #{cylinderVariety}-->
</if> <!-- </if>-->
<if test="qrCode != null and qrCode != ''"> <!-- <if test="qrCode != null and qrCode != ''">-->
AND i.qrCode like CONCAT(CONCAT('%',#{qrCode}),'%') <!-- AND i.qrCode like CONCAT(CONCAT('%',#{qrCode}),'%')-->
</if> <!-- </if>-->
<if test="electronicLabelCode != null and electronicLabelCode != ''"> <!-- <if test="electronicLabelCode != null and electronicLabelCode != ''">-->
AND i.electronic_label_code like <!-- AND i.electronic_label_code like-->
CONCAT(CONCAT('%',#{electronicLabelCode}),'%') <!-- CONCAT(CONCAT('%',#{electronicLabelCode}),'%')-->
</if> <!-- </if>-->
<if test="sequenceCode != null and sequenceCode != ''"> <!-- <if test="sequenceCode != null and sequenceCode != ''">-->
AND r.sequence_code like <!-- AND r.sequence_code like-->
CONCAT(CONCAT('%',#{sequenceCode}),'%') <!-- CONCAT(CONCAT('%',#{sequenceCode}),'%')-->
</if> <!-- </if>-->
<if test="unitInnerCode != null and unitInnerCode != ''"> <!-- <if test="unitInnerCode != null and unitInnerCode != ''">-->
AND i.unit_inner_code like <!-- AND i.unit_inner_code like-->
CONCAT(CONCAT('%',#{unitInnerCode}),'%') <!-- CONCAT(CONCAT('%',#{unitInnerCode}),'%')-->
</if> <!-- </if>-->
<if test="sortParam != null and sortParam != '' and sortRule != null and sortRule != '' "> <if test="sortParam != null and sortParam != '' and sortRule != null and sortRule != '' ">
ORDER BY ${sortParam} ${sortRule} ORDER BY ${sortParam} ${sortRule}
</if> </if>
......
...@@ -4,10 +4,11 @@ ...@@ -4,10 +4,11 @@
<select id="queryNumAndOutOfDateNum" resultType="java.util.Map"> <select id="queryNumAndOutOfDateNum" resultType="java.util.Map">
SELECT SELECT
count( sequence_nbr ) AS cylinderNum, count( t.sequence_nbr ) AS cylinderNum,
count( CASE WHEN t.next_inspection_date <![CDATA[ < ]]> now() THEN 1 ELSE 0 END ) AS outOfDateNum count( CASE WHEN i.next_inspection_date <![CDATA[ < ]]> now() THEN 1 ELSE 0 END ) AS outOfDateNum
FROM FROM
tz_cylinder_info t tz_cylinder_info t
LEFT JOIN tz_cylinder_inspection AS i ON i.sequence_code=t.sequence_code
WHERE WHERE
t.sequence_nbr IN ( SELECT max( tt.sequence_nbr ) FROM tz_cylinder_info tt GROUP BY tt.sequence_code ) t.sequence_nbr IN ( SELECT max( tt.sequence_nbr ) FROM tz_cylinder_info tt GROUP BY tt.sequence_code )
AND t.app_id = ( AND t.app_id = (
......
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