|
@@ -64,6 +64,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
and t1.is_changed = 0 and t1.process_inspection_id = 0
|
|
and t1.is_changed = 0 and t1.process_inspection_id = 0
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
+
|
|
|
|
+ <!-- 根据批次号和发出单号查询biz_outsourced_order_detail表中production_dept_id为0并且根据biz_outsourced_order_detail的id查询biz_return_receipt_detail表中不存或status=0的记录,返回结果集
|
|
|
|
+-->
|
|
|
|
+<!-- <select id="getOutsourceDetailList" parameterType="BizTaksStockLot" resultMap="BizTaksStockLotResult">-->
|
|
|
|
+
|
|
|
|
+<!-- SELECT t1.* FROM biz_taks_stock_lot t1-->
|
|
|
|
+<!-- <trim prefix=" WHERE" suffix="" suffixOverrides="AND">-->
|
|
|
|
+
|
|
|
|
+<!-- </trim>-->
|
|
|
|
+
|
|
|
|
+<!-- </select>-->
|
|
|
|
+
|
|
|
|
+ <select id="getOutsourceDetailList" parameterType="BizTaksStockLot" resultMap="BizTaksStockLotResult">
|
|
|
|
+ SELECT t1.*, t2.form_code as outsourceFormNo
|
|
|
|
+ FROM biz_taks_stock_lot t1
|
|
|
|
+ INNER JOIN biz_outsourced_order_detail t2 ON t1.lot_id = t2.lot_id
|
|
|
|
+ LEFT JOIN biz_return_receipt_detail t3 ON t2.id = t3.outsource_detail_id
|
|
|
|
+ LEFT JOIN biz_outsourced_order t4 ON t2.master_id = t4.id
|
|
|
|
+ <trim prefix="WHERE" suffixOverrides="AND">
|
|
|
|
+ t1.deleted = 0
|
|
|
|
+ AND t1.status < 2
|
|
|
|
+ AND t1.is_taks_stock = 0
|
|
|
|
+ AND t1.is_waste = 0
|
|
|
|
+ AND t4.is_inner_outsource = 0
|
|
|
|
+ <if test="takeStockPeriodId != null and takeStockPeriodId != ''"> AND t1.take_stock_period_id = #{takeStockPeriodId}</if>
|
|
|
|
+ <if test="outsourceFormNo != null and outsourceFormNo != ''"> AND t2.form_code = #{outsourceFormNo}</if>
|
|
|
|
+ <if test="lotCode != null and lotCode != ''"> AND t1.lot_code = #{lotCode}</if>
|
|
|
|
+ AND t2.production_dept_id = 0
|
|
|
|
+ AND t2.deleted = 0
|
|
|
|
+ AND (
|
|
|
|
+ t3.id IS NULL
|
|
|
|
+ OR (t3.id IS NOT NULL AND t3.status = 0)
|
|
|
|
+ )
|
|
|
|
+ </trim>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
<delete id="physicalDelete">
|
|
<delete id="physicalDelete">
|
|
DELETE FROM biz_taks_stock_lot
|
|
DELETE FROM biz_taks_stock_lot
|
|
<trim prefix=" WHERE" suffix="" suffixOverrides="AND">
|
|
<trim prefix=" WHERE" suffix="" suffixOverrides="AND">
|