未符合项基础模块-->历史数据查询失效bug修复

This commit is contained in:
yuezhihang
2021-12-24 09:49:21 +08:00
parent d1cf56c660
commit b33c643622
2 changed files with 41 additions and 33 deletions
@@ -40,7 +40,7 @@
WHERE
close_state = 1
<if test="sar.standId != null and sar.standId != '' ">
and STAND_ID = #{standId}
and STAND_ID = #{sar.standId}
</if>
<if test="sar.productName != null and sar.productName != '' ">
and PRODUCT_NAME like concat(concat('%',#{sar.productName}),'%')
@@ -61,15 +61,15 @@
c.*
FROM
(
SELECT (@i:=@i+1) as rows,sar_stand_unqualified.* ,sar_standards_info.STAND_TYPE as standType , ts_user.UNAME as dutyEngineerName , ts_institution.name as responsibleUnit FROM
SELECT (@i:=@i+1) as rows,sar_stand_unqualified.* ,sar_standards_info.STAND_TYPE as standType , concat(ts_user.UNAME,concat('(',concat(ts_user.USID,')'))) as dutyEngineerName , ts_institution.name as responsibleUnit FROM
(sar_stand_unqualified,(SELECT @i:=0)j)
left join sar_standards_info on sar_stand_unqualified.STAND_ID = sar_standards_info.id
left join ts_user on ts_user.USID = sar_stand_unqualified.DUTY_ENGINEER
left join ts_institution on ts_institution.id=ts_user.INSTITUTION_ID
WHERE
sar_stand_unqualified.close_state = 1
sar_stand_unqualified.close_state = #{sar.closeState}
<if test="sar.standId != null and sar.standId != '' ">
and sar_stand_unqualified.STAND_ID = #{standId}
and sar_stand_unqualified.STAND_ID = #{sar.standId}
</if>
<if test="sar.productName != null and sar.productName != '' ">
and sar_stand_unqualified.PRODUCT_NAME like concat(concat('%',#{sar.productName}),'%')
@@ -81,7 +81,7 @@
and (REPLACE(sar_stand_unqualified.STAND_SERIAL_NUMBER,' ','') like concat(concat('%',REPLACE(#{sar.standSerialNumber},' ','')),'%')
or sar_stand_unqualified.STAND_NAME like concat(concat('%',#{sar.standSerialNumber}),'%'))
</if>
order by sar_stand_unqualified.STAND_ID ,sar_stand_unqualified.ITEMS_NUM asc
order by sar_stand_unqualified.ID,sar_stand_unqualified.STAND_ID ,sar_stand_unqualified.ITEMS_NUM asc
limit #{start},#{end}
)c
ORDER BY c.STAND_ID, CONVERT(SUBSTRING(c.ITEMS_NUM,1,(SELECT LOCATE('.',CONCAT(c.ITEMS_NUM,'.')))),SIGNED) ,c.rows
@@ -119,9 +119,9 @@
SELECT (@i:=@i+1) as rows,sar_stand_unqualified.* FROM
sar_stand_unqualified,(SELECT @i:=0)j
WHERE
close_state = 1
close_state = #{sar.closeState}
<if test="sar.standId != null and sar.standId != '' ">
and STAND_ID = #{standId}
and STAND_ID = #{sar.standId}
</if>
<if test="sar.productName != null and sar.productName != '' ">
and PRODUCT_NAME like concat(concat('%',#{sar.productName}),'%')