demand: 扫描漏组批次问题件取问题件表

committer: heyu
This commit is contained in:
aike 2025-07-10 16:49:21 +08:00
parent 88a25f233b
commit 846cc6b438

View File

@ -3816,17 +3816,23 @@
select a.id, a.bill_code,a.trans_line_type,
a.product_type,a.start_site_code,a.send_site_code,a.problem_type,a.virtual_remark
from emis_waybill a
left join emis_waybill_batch_status b on a.bill_code = b.bill_code
and (b.site_batch_status is null or b.site_batch_status != '1')
where a.del_flag = '0'
<if test="lineCode != null and lineCode != ''">
and a.trans_line_type = #{lineCode}
</if>
and DATE_FORMAT(a.send_date, '%Y-%m-%d') <![CDATA[ >= ]]> '2025-01-01'
and DATE_FORMAT(a.send_date, '%Y-%m-%d') <![CDATA[ <= ]]> DATE_FORMAT(DATE_SUB(CURDATE(), INTERVAL 7 DAY), '%Y-%m-%d')
and (a.problem_type is null or a.problem_type not in (151,170))
and ((a.virtual_remark is null or a.virtual_remark = '' or a.virtual_remark = ' ')or a.receive_country != '0095')
and DATE_FORMAT(a.send_date, '%Y-%m-%d') <![CDATA[ <= ]]> DATE_FORMAT(DATE_SUB(CURDATE(), INTERVAL 7 DAY),
'%Y-%m-%d')
and ((a.virtual_remark is null or a.virtual_remark = '' or a.virtual_remark = ' ')or a.receive_country !=
'0095')
and a.order_status not in ('0','2')
and not exists (
select 1 from emis_waybill_batch_status b where a.bill_code = b.bill_code and b.site_batch_status = '1' and b.del_flag = '0'
)
and not exists (
select 1 from emis_waybill_problem_info c where a.bill_code = c.bill_code and c.problem_type in (151,170)
and c.del_flag = '0'
)
order by a.create_time desc
limit #{offset}, #{pageSize}
</select>