1;自配送订单

This commit is contained in:
wangshuai 2024-07-26 11:55:11 +08:00
parent 1efa961ce9
commit 291cab7bdf
1 changed files with 11 additions and 5 deletions

View File

@ -58,11 +58,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectBusZpsOrderInfoListToAi" resultMap="BusOrderInfoResult">
select a.* from bus_order_info a
LEFT JOIN bus_return_visit_info b on b.phone_number=a.privcy_phone
where b.return_visit_time is null
<if test="storeCode != null and storeCode != ''"> and a.store_code = #{storeCode}</if>
<if test="t2 != null and t2 != ''"> and a.order_time &lt;= #{t2}</if>
SELECT t1.*
FROM bus_order_info AS t1
JOIN (
select a.order_no,min(a.id) AS min_id
from bus_order_info a
LEFT JOIN bus_return_visit_info b on b.phone_number=a.privcy_phone
where b.return_visit_time is null
<if test="storeCode != null and storeCode != ''"> and a.store_code = #{storeCode}</if>
<if test="t2 != null and t2 != ''"> and a.order_time &lt;= #{t2}</if>
GROUP BY a.order_no
) AS t2 ON t1.order_no = t2.order_no AND t1.id = t2.min_id;
</select>
<select id="selectBusOrderInfoListA" resultMap="BusOrderInfoResult">
select store_code, store_name, custom_id, order_no, min(id)