修改搜索功能

This commit is contained in:
wuweihua
2026-09-17 17:58:00 +08:00
parent 5dcea947a7
commit 63988b798e
14 changed files with 353 additions and 12 deletions
@@ -87,24 +87,55 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where bill_id = #{billId}
</select>
<select id="selectOrderNoOptions" resultType="String">
select order_no
from prc_order_bill
<where>
<if test="keyword != null and keyword != ''">
order_no like concat('%', #{keyword}, '%')
</if>
</where>
group by order_no
order by max(create_time) desc
limit #{limit}
</select>
<select id="selectPrcOrderBillList" parameterType="PrcOrderBill" resultMap="PrcOrderBillResult">
<include refid="selectPrcOrderBillVo"/>
<where>
<if test="orderNo != null and orderNo != ''">
AND order_no like concat('%', #{orderNo}, '%')
</if>
<if test="orderNos != null and orderNos.size() > 0">
AND order_no IN
<foreach collection="orderNos" item="ono" open="(" separator="," close=")">
#{ono}
</foreach>
</if>
<if test="trackingNo != null and trackingNo != ''">
AND tracking_no like concat('%', #{trackingNo}, '%')
</if>
<if test="customerCode != null and customerCode != ''">
AND customer_code like concat('%', #{customerCode}, '%')
</if>
<if test="customerCodes != null and customerCodes.size() > 0">
AND customer_code IN
<foreach collection="customerCodes" item="ccode" open="(" separator="," close=")">
#{ccode}
</foreach>
</if>
<if test="customerName != null and customerName != ''">
AND customer_name like concat('%', #{customerName}, '%')
</if>
<if test="productCode != null and productCode != ''">
AND product_code like concat('%', #{productCode}, '%')
</if>
<if test="productCodes != null and productCodes.size() > 0">
AND product_code IN
<foreach collection="productCodes" item="pcode" open="(" separator="," close=")">
#{pcode}
</foreach>
</if>
<if test="countryCode != null and countryCode != ''">
AND country_code = #{countryCode}
</if>