瀏覽代碼

采购入库查询条件

changhaoning 2 年之前
父節點
當前提交
624f5e4d3a
共有 1 個文件被更改,包括 29 次插入2 次删除
  1. 29 2
      src/main/java/com/dk/mdm/mapper/ivt/InboundMapper.xml

+ 29 - 2
src/main/java/com/dk/mdm/mapper/ivt/InboundMapper.xml

@@ -176,7 +176,7 @@
     <sql id="Condition">
         <where>
             <if test="intoNo != null and intoNo != ''">
-                AND tpi.into_no = LIKE concat('%',my_ex.likequery(#{intoNo}),'%')
+                AND tpi.into_no LIKE concat('%',my_ex.likequery(#{intoNo}),'%')
             </if>
             <if test="intoType != null and intoType != ''">
                 AND tpi.into_type LIKE concat('%',my_ex.likequery(#{intoType}),'%')
@@ -198,7 +198,7 @@
                 AND tpi.from_id = #{fromId}::uuid
             </if>
             <if test="fromNo != null and fromNo != ''">
-                AND tpi.from_no = #{fromNo}
+                AND tpi.from_no LIKE concat('%',my_ex.likequery(#{fromNo}),'%')
             </if>
             <if test="orgId != null and orgId != ''">
                 AND tpi.org_id = #{orgId}::uuid
@@ -253,6 +253,33 @@
             <if test="intoStatus != null and intoStatus != ''">
                  AND tpi.into_status LIKE concat('%',my_ex.likequery(#{intoStatus}),'%')
             </if>
+            <if test="skuModel != null and skuModel!='' ">
+                and exists (select 1 from dkic_b.t_psi_inbound_item tpii
+                left join dkic_b.t_mst_goods_sku tmgs on tmgs.sku_id = tpii.sku_id
+                where
+                tpi.into_id = tpii.into_id
+                and tpii.flg_valid
+                AND position(#{skuModel} in tmgs.sku_model) > 0
+                )
+            </if>
+            <if test="skuCode != null and skuCode!='' ">
+                and exists (select 1 from dkic_b.t_psi_inbound_item tpii
+                left join dkic_b.t_mst_goods_sku tmgs on tmgs.sku_id = tpii.sku_id
+                where
+                tpi.into_id = tpii.into_id
+                and tpii.flg_valid
+                AND position(#{skuCode} in tmgs.sku_code) > 0
+                )
+            </if>
+            <if test="skuName != null and skuName!='' ">
+                and exists (select 1 from dkic_b.t_psi_inbound_item tpii
+                left join dkic_b.t_mst_goods_sku tmgs on tmgs.sku_id = tpii.sku_id
+                where
+                tpi.into_id = tpii.into_id
+                and tpii.flg_valid
+                AND position(#{skuName} in tmgs.sku_name) > 0
+                )
+            </if>
         </where>
     </sql>