|
|
|
@ -17,6 +17,83 @@ |
|
|
|
</if> |
|
|
|
</sql> |
|
|
|
|
|
|
|
<!-- |
|
|
|
rqrq - 三个 PO 页面共用的顶部筛选。 |
|
|
|
文本为模糊包含;多选命中任意一个;日期为闭区间,只填一端则按单边过滤。 |
|
|
|
空值不参与条件。字段名与旧查询分开,避免命中 ${} 拼接条件。 |
|
|
|
--> |
|
|
|
<sql id="poOrderTopSearchFilter"> |
|
|
|
<if test="query.plannerAccount != null and query.plannerAccount != ''"> |
|
|
|
AND poh.c_planner LIKE CONCAT('%', #{query.plannerAccount}, '%') |
|
|
|
</if> |
|
|
|
<if test="query.buyerKeyword != null and query.buyerKeyword != ''"> |
|
|
|
AND poh.buyer LIKE CONCAT('%', #{query.buyerKeyword}, '%') |
|
|
|
</if> |
|
|
|
<if test="query.supplierNameKeyword != null and query.supplierNameKeyword != ''"> |
|
|
|
AND ss.supplier_name LIKE CONCAT('%', #{query.supplierNameKeyword}, '%') |
|
|
|
</if> |
|
|
|
<if test="query.poNoKeyword != null and query.poNoKeyword != ''"> |
|
|
|
AND poh.po_no LIKE CONCAT('%', #{query.poNoKeyword}, '%') |
|
|
|
</if> |
|
|
|
<if test="query.itemKeyword != null and query.itemKeyword != ''"> |
|
|
|
AND COALESCE(p.item, pod.item) LIKE CONCAT('%', #{query.itemKeyword}, '%') |
|
|
|
</if> |
|
|
|
<if test="query.flexidKeyword != null and query.flexidKeyword != ''"> |
|
|
|
AND pod.c_flexid LIKE CONCAT('%', #{query.flexidKeyword}, '%') |
|
|
|
</if> |
|
|
|
<if test="query.telexReleaseValue != null and query.telexReleaseValue != ''"> |
|
|
|
AND pod.c_telex_release = #{query.telexReleaseValue} |
|
|
|
</if> |
|
|
|
<if test="query.shipViaList != null and query.shipViaList.size() > 0"> |
|
|
|
AND poh.ship_via IN |
|
|
|
<foreach collection="query.shipViaList" item="shipViaItem" open="(" separator="," close=")"> |
|
|
|
#{shipViaItem} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
<if test="query.statusDisplayList != null and query.statusDisplayList.size() > 0"> |
|
|
|
AND (<include refid="statusDisplayExpression"/>) IN |
|
|
|
<foreach collection="query.statusDisplayList" item="statusDisplayItem" open="(" separator="," close=")"> |
|
|
|
#{statusDisplayItem} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
<if test="query.destinationList != null and query.destinationList.size() > 0"> |
|
|
|
AND poh.c_destination IN |
|
|
|
<foreach collection="query.destinationList" item="destinationItem" open="(" separator="," close=")"> |
|
|
|
#{destinationItem} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
<if test="query.enquiryDateStart != null and query.enquiryDateStart != ''"> |
|
|
|
AND CAST(poh.c_enquiry AS DATE) >= CAST(#{query.enquiryDateStart} AS DATE) |
|
|
|
</if> |
|
|
|
<if test="query.enquiryDateEnd != null and query.enquiryDateEnd != ''"> |
|
|
|
AND CAST(poh.c_enquiry AS DATE) <= CAST(#{query.enquiryDateEnd} AS DATE) |
|
|
|
</if> |
|
|
|
<if test="query.issueDateStart != null and query.issueDateStart != ''"> |
|
|
|
AND CAST(poh.order_date AS DATE) >= CAST(#{query.issueDateStart} AS DATE) |
|
|
|
</if> |
|
|
|
<if test="query.issueDateEnd != null and query.issueDateEnd != ''"> |
|
|
|
AND CAST(poh.order_date AS DATE) <= CAST(#{query.issueDateEnd} AS DATE) |
|
|
|
</if> |
|
|
|
<if test="query.etaDateStart != null and query.etaDateStart != ''"> |
|
|
|
AND CAST(pod.c_eta AS DATE) >= CAST(#{query.etaDateStart} AS DATE) |
|
|
|
</if> |
|
|
|
<if test="query.etaDateEnd != null and query.etaDateEnd != ''"> |
|
|
|
AND CAST(pod.c_eta AS DATE) <= CAST(#{query.etaDateEnd} AS DATE) |
|
|
|
</if> |
|
|
|
<if test="query.obdDateStart != null and query.obdDateStart != ''"> |
|
|
|
AND CAST(pod.c_obd AS DATE) >= CAST(#{query.obdDateStart} AS DATE) |
|
|
|
</if> |
|
|
|
<if test="query.obdDateEnd != null and query.obdDateEnd != ''"> |
|
|
|
AND CAST(pod.c_obd AS DATE) <= CAST(#{query.obdDateEnd} AS DATE) |
|
|
|
</if> |
|
|
|
<if test="query.crdDateStart != null and query.crdDateStart != ''"> |
|
|
|
AND CAST(pod.c_crd AS DATE) >= CAST(#{query.crdDateStart} AS DATE) |
|
|
|
</if> |
|
|
|
<if test="query.crdDateEnd != null and query.crdDateEnd != ''"> |
|
|
|
AND CAST(pod.c_crd AS DATE) <= CAST(#{query.crdDateEnd} AS DATE) |
|
|
|
</if> |
|
|
|
</sql> |
|
|
|
|
|
|
|
<!-- 通用查询映射结果 --> |
|
|
|
<resultMap id="BaseResultMap" type="com.xujie.modules.order.entity.PODetail"> |
|
|
|
<id column="order_no" property="orderNo" /> |
|
|
|
@ -300,6 +377,7 @@ |
|
|
|
<include refid="statusDisplayJoin"/> |
|
|
|
where pod.site = '${query.site}' |
|
|
|
<include refid="statusDisplayFilter"/> |
|
|
|
<include refid="poOrderTopSearchFilter"/> |
|
|
|
<if test="query.poHeaderId != null and query.poHeaderId != '' "> and pod.po_header_id like '%${query.poHeaderId}%'</if> |
|
|
|
<if test="query.orderNo != null and query.orderNo != '' "> and pod.order_no like '%${query.orderNo}%'</if> |
|
|
|
<if test="query.poNo != null and query.poNo != '' "> and poh.po_no like '%${query.poNo}%'</if> |
|
|
|
@ -479,6 +557,7 @@ |
|
|
|
<include refid="statusDisplayJoin"/> |
|
|
|
where pod.site = #{query.site} |
|
|
|
<include refid="statusDisplayFilter"/> |
|
|
|
<include refid="poOrderTopSearchFilter"/> |
|
|
|
<if test="query.customer != null and query.customer != ''"> and poh.c_customer = #{query.customer}</if> |
|
|
|
<if test="query.buyer != null and query.buyer != ''"> and poh.buyer like CONCAT('%', #{query.buyer}, '%')</if> |
|
|
|
<if test="query.poNo != null and query.poNo != ''"> and poh.po_no like CONCAT('%', #{query.poNo}, '%')</if> |
|
|
|
|