guoyujia 1 week ago
parent
commit
11662c9b8e

+ 4 - 1
src/main/resources/mybatis/business/BizTaksStockCertificateLotMapper.xml

@@ -37,8 +37,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         biz_taks_stock_certificate_lot
         biz_taks_stock_certificate_lot
         <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
         <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
         deleted = 0
         deleted = 0
-        <if test="barcode != null  and barcode != ''"> AND barcode like concat('%', #{barcode}, '%')</if>
+        <if test="barcode != null  and barcode != ''"> AND
+            lot_code IN (SELECT lot_code FROM biz_taks_stock_certificate_lot WHERE barcode like concat ('%', #{barcode}, '%') and deleted = 0)
+            </if>
             <if test="takeStockPeriodId != null and takeStockPeriodId != ''"> AND take_stock_period_id = #{takeStockPeriodId}</if>
             <if test="takeStockPeriodId != null and takeStockPeriodId != ''"> AND take_stock_period_id = #{takeStockPeriodId}</if>
+
         <if test="lotCode != null  and lotCode != ''"> AND lot_code like concat('%', #{lotCode}, '%')</if>
         <if test="lotCode != null  and lotCode != ''"> AND lot_code like concat('%', #{lotCode}, '%')</if>
        </trim>
        </trim>
         GROUP BY
         GROUP BY

+ 1 - 1
src/main/resources/mybatis/business/BizTaksStockInboundOrderDetailMapper.xml

@@ -41,7 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
         <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
             deleted = 0
             deleted = 0
             <if test="inboundNumber != null  and inboundNumber != ''"> AND inbound_number like concat('%', #{inboundNumber}, '%')</if>
             <if test="inboundNumber != null  and inboundNumber != ''"> AND inbound_number like concat('%', #{inboundNumber}, '%')</if>
-            <if test="barcode != null  and barcode != ''"> AND barcode like concat('%', #{barcode}, '%')</if>
+            <if test="barcode != null  and barcode != ''"> AND (lot_code,inbound_number) IN (SELECT lot_code,inbound_number FROM biz_taks_stock_inbound_order_detail WHERE barcode like concat('%', #{barcode}, '%') AND deleted = 0)</if>
             <if test="takeStockPeriodId != null and takeStockPeriodId != ''"> AND take_stock_period_id = #{takeStockPeriodId}</if>
             <if test="takeStockPeriodId != null and takeStockPeriodId != ''"> AND take_stock_period_id = #{takeStockPeriodId}</if>
             <if test="lotCode != null  and lotCode != ''"> AND lot_code like concat('%', #{lotCode}, '%')</if>
             <if test="lotCode != null  and lotCode != ''"> AND lot_code like concat('%', #{lotCode}, '%')</if>
         </trim>
         </trim>