Browse Source

2022年11月17日18:29:03

纪新园 2 years ago
parent
commit
8150c59222

+ 11 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/shipping/controller/TWarehousebillsCntrController.java

@@ -100,4 +100,15 @@ public class TWarehousebillsCntrController extends BaseController
     {
         return toAjax(tWarehousebillsCntrService.deleteTWarehousebillsCntrByIds(fIds));
     }
+    /**
+     * 删除凯和订单从
+     */
+    @PreAuthorize("@ss.hasPermi('shipping:cntr:remove')")
+    @Log(title = "凯和订单从", businessType = BusinessType.DELETE)
+    @PostMapping("/{fId}")
+    public AjaxResult removeById(@PathVariable Long fId)
+    {
+        tWarehousebillsCntrService.deleteTWarehousebillsCntrById(fId);
+        return AjaxResult.success("操作成功");
+    }
 }

+ 11 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/warehouseBusiness/TWarehousebillsfeesController.java

@@ -117,6 +117,17 @@ public class TWarehousebillsfeesController extends BaseController {
     }
 
     /**
+     * 删除仓库费用明细
+     */
+    @PreAuthorize("@ss.hasPermi('warehouseBusiness:warehousebillsfees:remove')")
+    @Log(title = "仓库费用明细", businessType = BusinessType.DELETE)
+    @PostMapping("/{fId}")
+    public AjaxResult removeById(@PathVariable Long fId) {
+        tWarehousebillsfeesService.deleteTWarehousebillsfeesById(fId);
+        return AjaxResult.success("操作成功");
+    }
+
+    /**
      * 获取查询菜单数据
      */
     @GetMapping("/queryMenuList")

+ 11 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/warehouseBusiness/TWarehousebillsitemsController.java

@@ -92,6 +92,17 @@ public class TWarehousebillsitemsController extends BaseController {
     }
 
     /**
+     * 删除仓库明细从表
+     */
+    @PreAuthorize("@ss.hasPermi('warehouseBusiness:warehousebillsitems:remove')")
+    @Log(title = "仓库明细从表", businessType = BusinessType.DELETE)
+    @PostMapping("/{fId}")
+    public AjaxResult removeById(@PathVariable Long  fId) {
+        tWarehousebillsitemsService.deleteTWarehousebillsitemsById(fId);
+        return AjaxResult.success("操作成功");
+    }
+
+    /**
      * 获取箱号
      * @return
      */

+ 3 - 3
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseBillsServiceImpl.java

@@ -1774,7 +1774,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                 }else{
                     cntr.setUpdateBy(loginUser.getUser().getUserName());
                     cntr.setUpdateTime(new Date());
-                    tWarehousebillsCntrMapper.insertTWarehousebillsCntr(cntr);
+                    tWarehousebillsCntrMapper.updateTWarehousebillsCntr(cntr);
                 }
 
             }
@@ -5891,9 +5891,9 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
             //修改(同步业务时间为截止时间)   2022年11月9日16:09:52
             if ("KCZZ".equals(item.getfBilltype()) && ObjectUtils.isNotNull(item.getfBillingDeadline())){
                 item.setfBsdate(item.getfBillingDeadline());
-            }else{
+            }/*else{
                 return AjaxResult.error("仓储费截止日期不能为空");
-            }
+            }*/
 
             tWarehousebillsfeesMapper.insertTWarehousebillsfees(item);
         }

+ 1 - 1
ruoyi-warehouse/src/main/resources/mapper/basicData/TCorpsMapper.xml

@@ -167,7 +167,7 @@
 
     <select id="selectTCorpsById" parameterType="Long" resultMap="TCorpsResult">
         <include refid="selectTCorpsVo"/>
-        where f_id = #{fId}
+        where f_id = #{fId} and del_flag = '0'
     </select>
 
     <select id="selectCorpList" parameterType="long" resultMap="TCorpsResult">

+ 1 - 1
ruoyi-warehouse/src/main/resources/mapper/basicData/TGoodsMapper.xml

@@ -55,7 +55,7 @@
 
     <select id="selectTGoodsById" parameterType="Long" resultMap="TGoodsResult">
         <include refid="selectTGoodsVo"/>
-        where f_id = #{fId}
+        where f_id = #{fId}  and del_flag = '0'
     </select>
 
     <insert id="insertTGoods" parameterType="TGoods" useGeneratedKeys="true" keyProperty="fId">

+ 6 - 4
ruoyi-warehouse/src/main/resources/mapper/reportManagement/TWhgenlegMapper.xml

@@ -94,8 +94,8 @@
         <result property="fTrademodeid" column="f_trademodeid"/>
         <result property="fBilltype" column="f_billtype"/>
         <result property="qty" column="f_qty"/>
-        <result property="grossweight" column="f_netweight"/>
-        <result property="netweight" column="f_grossweight"/>
+        <result property="grossweight" column="f_grossweight"/>
+        <result property="netweight" column="f_netweight"/>
     </resultMap>
 
     <sql id="selectTWhgenlegVo">
@@ -149,6 +149,7 @@
     <select id="selectTWhgenleg" parameterType="TWhgenleg" resultMap="TWhgenlegResult">
         <include refid="selectTWhgenlegVo"/>
         <where>
+             del_flag = '0'
             <if test="fCorpid != null ">and f_corpid = #{fCorpid}</if>
             <if test="fShipper != null ">and f_shipper = #{fShipper}</if>
             <if test="fMblno != null ">and f_mblno = #{fMblno}</if>
@@ -182,7 +183,7 @@
 
     <select id="selectTWhgenlegById" parameterType="Long" resultMap="TWhgenlegResult">
         <include refid="selectTWhgenlegVo"/>
-        where f_id = #{fId}
+        where f_id = #{fId} and del_flag = '0'
     </select>
 
     <insert id="insertTWhgenleg" parameterType="TWhgenleg">
@@ -1189,7 +1190,7 @@
         FROM
             t_whgenleg
         WHERE
-            f_chargedate != #{time}
+            f_chargedate != #{time} and del_flag = '0'
         <foreach collection="ids" item="id" open="and f_id in(" separator="," close=")">
             #{id}
         </foreach>
@@ -1451,6 +1452,7 @@
             and t1.f_grossweightblc &gt; 0
             <if test="billNo != null and billNo != ''">and t1.f_originalbillno = #{billNo}</if>
             <if test="corpId != null ">and t1.f_corpid = #{corpId}</if>
+            and t1.del_flag = '0' and t6.del_flag = '0'
         </where>
     </select>
     <select id="selectBlNumber" resultType="java.util.Map">

+ 4 - 3
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TEnclosureMapper.xml

@@ -29,6 +29,7 @@
     <select id="selectTEnclosureList" parameterType="TEnclosure" resultMap="TEnclosureResult">
         <include refid="selectTEnclosureVo"/>
         <where>
+            del_flag = '0'
             <if test="fPid != null ">and f_pid = #{fPid}</if>
             <if test="srcId != null ">and src_id = #{srcId}</if>
             <if test="fLineno != null ">and f_lineno = #{fLineno}</if>
@@ -42,7 +43,7 @@
 
     <select id="selectTEnclosureById" parameterType="Long" resultMap="TEnclosureResult">
         <include refid="selectTEnclosureVo"/>
-        where f_id = #{fId}
+        where f_id = #{fId} and del_flag = '0'
     </select>
 
     <select id="selectWarehouseAccessoriesList" parameterType="TEnclosure" resultMap="TEnclosureResult">
@@ -54,7 +55,7 @@
 
     <select id="selectTEnclosureByPId" parameterType="long" resultMap="TEnclosureResult">
         <include refid="selectTEnclosureVo"/>
-        where f_pid = #{fPid}
+        where f_pid = #{fPid} and del_flag = '0'
     </select>
 
     <insert id="insertTEnclosure" parameterType="TEnclosure" useGeneratedKeys="true" keyProperty="fId">
@@ -115,7 +116,7 @@
     </update>
 
     <delete id="deleteTEnclosureById" parameterType="Long">
-        delete from t_enclosure where f_id = #{fId}
+       update t_enclosure set del_flag = '0' where f_id = #{fId}
     </delete>
 
     <delete id="deleteByFPid" parameterType="Long">

+ 50 - 9
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsMapper.xml

@@ -176,6 +176,7 @@
             left join sys_dept d on ware.f_bsdeptid = d.dept_id
         <where>
             ware.f_typeid IS NULL
+            and ware.del_flag = '0'
             <if test="fBillno != null  and fBillno != ''">and f_billno = #{fBillno}</if>
             <if test="fCustomsdeclartion != null  and fCustomsdeclartion != ''">and f_customsdeclartion =
                 #{fCustomsdeclartion}
@@ -392,7 +393,7 @@
             GROUP_CONCAT(f_invoicing_date SEPARATOR ',') AS f_invoicing_date
         FROM
             t_warehousebillsfees
-            WHERE f_dc = 'D'
+            WHERE f_dc = 'D' and del_flag = '0'
             GROUP BY f_pid
             ) twfD ON twfD.f_pid = bill.f_id
             LEFT JOIN (
@@ -403,10 +404,12 @@
             SUM(f_accamount) AS f_accamount
             FROM
             t_warehousebillsfees
-            WHERE f_dc = 'C'
+            WHERE f_dc = 'C' and del_flag = '0'
             GROUP BY f_pid
             ) twfC ON twfC.f_pid = bill.f_id
         <where>
+            bill.del_flag = '0'
+            and item.del_flag = '0'
             <if test="fTypeid == null or fTypeid == ''">and bill.f_typeid IS NULL</if>
             <if test="fTypeid != null and fTypeid != ''">and bill.f_typeid = #{fTypeid}</if>
             <if test="fFeeStatus != null and fFeeStatus != ''">and bill.f_fee_status = #{fFeeStatus}</if>
@@ -615,6 +618,8 @@
             LEFT JOIN t_fee tf on tf.t_mblno = bill.f_mblno
         <where>
             dict.status = '0'
+            and bill.del_flag = '0'
+            and item.del_flag = '0'
             AND dict.dict_type = 'data_trademodes'
             AND bill.f_typeid IS NULL
             <if test="fFeeStatus != null and fFeeStatus != ''">and bill.f_fee_status = #{fFeeStatus}</if>
@@ -700,7 +705,7 @@
 
     <select id="selectTWarehousebillsById" parameterType="Long" resultMap="TWarehousebillsResult">
         <include refid="selectTWarehousebillsVo"/>
-        where f_id = #{fId}
+        where f_id = #{fId} and del_flag = '0'
         ORDER BY f_bsdate desc
     </select>
 
@@ -1137,6 +1142,7 @@
             t_warehousebills
         where
             f_mblno = #{fMblno}
+            and del_flag = '0'
             AND f_bsdate = #{fBsdate}
             AND f_billtype = #{fBilltype}
     </select>
@@ -1694,13 +1700,12 @@
     </update>
 
     <delete id="deleteTWarehousebillsById" parameterType="Long">
-        delete
-        from t_warehousebills
+        UPDATE t_warehousebills SET del_flag = '1'
         where f_id = #{fId}
     </delete>
 
-    <delete id="deleteTWarehousebillsByIds" parameterType="String">
-        delete
+
+    <!-- delete
         item.*,
         elabel.*,
         bill.*,
@@ -1716,11 +1721,28 @@
         bill.f_id in
         <foreach item="fId" collection="array" open="(" separator="," close=")">
             #{fId}
+        </foreach>-->
+
+    <delete id="deleteTWarehousebillsByIds" parameterType="String">
+        UPDATE
+        t_warehousebills bill
+        LEFT JOIN t_warehousebillsfees fess ON fess.f_pid = bill.f_id
+        LEFT JOIN t_enclosure enclosure ON enclosure.f_pid = bill.f_id
+        LEFT JOIN t_warehousebillsitems item ON item.f_pid = bill.f_id
+        LEFT JOIN t_warehousebillsitems_elabel elabel ON elabel.f_pid = item.f_id
+            set bill.del_flag = '1',
+             fess.del_flag = '1',
+             enclosure.del_flag = '1',
+             item.del_flag = '1'
+        where
+        bill.f_id in
+        <foreach item="fId" collection="array" open="(" separator="," close=")">
+            #{fId}
         </foreach>
     </delete>
 
-    <delete id="deleteKHTWarehousebillsByIds" parameterType="String">
-        delete
+
+    <!--delete
         bill.*,
         fess.*,
         enclosure.*
@@ -1732,6 +1754,20 @@
         bill.f_id in
         <foreach item="fId" collection="array" open="(" separator="," close=")">
             #{fId}
+        </foreach>-->
+
+    <delete id="deleteKHTWarehousebillsByIds" parameterType="String">
+        UPDATE
+        t_warehousebills bill
+        LEFT JOIN t_warehousebills_cntr fess ON fess.f_pid = bill.f_id
+        LEFT JOIN t_warehousebills_cntritems enclosure ON enclosure.f_pid = bill.f_id
+        set bill.del_flag = '1',
+         fess.del_flag = '1' ,
+         enclosure.del_flag = '1'
+        where
+        bill.f_id in
+        <foreach item="fId" collection="array" open="(" separator="," close=")">
+            #{fId}
         </foreach>
     </delete>
 
@@ -3514,6 +3550,7 @@
             LEFT JOIN sys_dict_data dict ON dict.dict_value = w.f_trademodeid
         <where>
             w.f_billtype = 'JSCCF'
+            and w.del_flag = '0'
             and dict.dict_type = 'data_trademodes'
             <if test="fFeeStatus != null and fFeeStatus != ''">and w.f_fee_status = #{fFeeStatus}</if>
             <if test="fBillstatus != null and fBillstatus != ''">and w.f_billstatus = #{fBillstatus}</if>
@@ -3570,6 +3607,8 @@
                 left join t_corps t3 on t3.f_id = t2.f_corpid
             where t1.f_billtype = 'SJRK'
                 and t1.f_billstatus = 40
+                and t1.del_flag = '0'
+                and t2.del_flag = '0'
             group by fName
         ) temp
         <where>
@@ -3586,6 +3625,8 @@
                 left join t_corps t3 on t3.f_id = t2.f_corpid
             where t1.f_billtype = 'SJRK'
                 and t1.f_billstatus = 40
+                and t1.del_flag = '0'
+                and t2.del_flag = '0'
             group by fName
         ) temp
         <where>

+ 18 - 4
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsfeesMapper.xml

@@ -130,6 +130,7 @@
             resultMap="TWarehousebillsfeesResult">
         <include refid="selectTWarehousebillsfeesVo"/>
         <where>
+            del_flag = '0'
             <if test="fPid != null ">and f_pid = #{fPid}</if>
             <if test="fLineno != null ">and f_lineno = #{fLineno}</if>
             <if test="fCorpid != null ">and f_corpid = #{fCorpid}</if>
@@ -189,11 +190,12 @@
         from t_warehousebillsfees
         where f_pid = #{fId}
           and f_billtype = 'SJCK'
+            and del_flag = '0'
     </select>
 
     <select id="selectWarehousebillsfeesByPId" parameterType="Long" resultMap="TWarehousebillsfeesResult">
         <include refid="selectTWarehousebillsfeesVo"/>
-        where f_pid = #{fId}
+        where f_pid = #{fId} and del_flag = '0'
     </select>
 
     <select id="selectReconciliation" resultType="java.lang.Integer">
@@ -239,6 +241,7 @@
         LEFT JOIN t_whgenleg t ON t.f_corpid = s.f_corpid
         WHERE
         s.f_dc = 'D'
+          AND s.del_flag = '0'
         <if test='fMonth != null and fMonth[0] != null and fMonth[0]!= ""'>
             and s.f_bsdate &gt;= #{fMonth[0]}
         </if>
@@ -274,6 +277,7 @@
         LEFT JOIN t_whgenleg t ON t.f_corpid = s.f_corpid
         WHERE
         s.f_dc = 'D'
+          and s.del_flag = '0'
         <if test='fMonth != null and fMonth[0] != null and fMonth[0]!= ""'>
             and s.f_bsdate &gt;= #{fMonth[0]}
         </if>
@@ -651,6 +655,7 @@
         LEFT JOIN t_fees tf ON tw.f_feeid = tf.f_id
         LEFT JOIN t_corps tc ON tw.f_corpid = tc.f_id
         where tw.f_pid = #{fPid}
+          and tw.del_flag = '0'
         and tw.f_billtype = 'KHDD'
         <if test="fDc != null  and fDc != ''">and tw.f_dc = #{fDc}</if>
     </select>
@@ -665,6 +670,7 @@
         LEFT JOIN t_fees tf ON tw.f_feeid = tf.f_id
         WHERE
         tw.f_pid = #{fPid}
+          and tw.del_flag = '0'
         AND tw.f_billtype = 'KHDD'
         <if test="fDc != null and fDc != ''">AND tw.f_dc = #{fDc}</if>
         GROUP BY feeName;
@@ -677,7 +683,8 @@
         from t_warehousebillsfees tw
         LEFT JOIN t_fees tf on tw.f_feeid = tf.f_id
         where
-        <if test="fPid != null and fPid != ''">tw.f_pid = #{fPid}</if>
+        tw.del_flag = '0'
+        <if test="fPid != null and fPid != ''">and tw.f_pid = #{fPid}</if>
         <if test="fDc != null and fDc != ''">and tw.f_dc = #{fDc}</if>
     </select>
 
@@ -760,6 +767,7 @@
         LEFT JOIN t_corps tp ON tp.f_id = tb.f_corpid
         WHERE
         tf.f_billstatus = 6
+          and tf.del_flag = '0'
         AND tf.f_dc = 'D'
         AND tb.f_typeid = 1
         and tb.f_review_date IS NOT NULL
@@ -859,6 +867,7 @@
         LEFT JOIN t_corps tp ON tp.f_id = te.f_corpid
         WHERE
         te.f_billtype = 'KHDZ'
+          and th.del_flag = '0'
         <if test="fLoadportid != null">and tw.f_loadportid = #{fLoadportid}</if>
         <if test="fDestportid != null">and tw.f_destportid = #{fDestportid}</if>
         <if test="fInvoceobj != null  and fInvoceobj != ''">and tw.f_invoceobj like concat('%', #{fInvoceobj}, '%')</if>
@@ -888,7 +897,7 @@
     <select id="selectTWarehousebillsfeesSrcId" parameterType="Long" resultType="long">
         select src_id
         FROM t_warehousebillsfees
-        where f_pid = #{fId}
+        where f_pid = #{fId} and del_flag = '0'
           AND src_id IS NOT NULL
     </select>
     <select id="accountsDue" resultType="map">
@@ -932,6 +941,7 @@
             LEFT JOIN t_corps tc ON tf.f_corpid = tc.f_id
             WHERE ifnull(tf.f_amount, 0) - ifnull(tf.f_stlamount, 0) >0
             AND tf.f_dc = 'D'
+            and tf.del_flag = '0'
             AND YEAR(tf.create_time) = YEAR(NOW())
             GROUP BY tf.f_corpid
             LIMIT 10
@@ -981,6 +991,7 @@
         LEFT JOIN t_fees te ON te.f_id = tf.f_feeid
         LEFT JOIN t_warehousebills tw on tf.f_pid = tw.f_id
         <where>
+            tf.del_flag = '0'
             <if test="fBillstatus != null  and fBillstatus != ''">and tf.f_billstatus = #{fBillstatus}</if>
             <if test="fDc != null  and fDc != ''">and tf.f_dc = #{fDc}</if>
             <if test="fMblno != null  and fMblno != ''">and tf.f_mblno like concat('%', #{fMblno}, '%')</if>
@@ -1068,6 +1079,7 @@
             ),dictIn.dict_label,NULL)
         ) dict ON dict.dict_value = twf.f_business_type
         <where>
+                      twf.del_flag = '0'
             <if test="fCorpid != null  and fCorpid != ''">and twf.f_corpid = #{fCorpid}</if>
             <if test="fMblno != null  and fMblno != ''">and twf.f_mblno like concat('%', #{fMblno}, '%')</if>
             <if test='fBsdateList != null and fBsdateList[0] != null and fBsdateList[0]!= ""'>
@@ -1114,6 +1126,7 @@
             t_fees tf
                 LEFT JOIN t_warehousebillsfees twf on tf.f_id = twf.f_feeid
         <where>
+            twf.del_flag = '0'
             <if test="fMblno != null  and fMblno != ''">and twf.f_mblno = #{fMblno}</if>
             <if test="fCorpid != null  and fCorpid != ''">and twf.f_corpid = #{fCorpid}</if>
             <if test="fDc != null  and fDc != ''">and twf.f_dc = #{fDc}</if>
@@ -1134,7 +1147,7 @@
             feeName
     </select>
     <select id="getCorpid" resultType="long">
-        SELECT f_corpid FROM  t_warehousebillsfees where f_id in
+        SELECT f_corpid FROM  t_warehousebillsfees where del_flag = '0' and  f_id in
         <foreach item="fId" collection="fIds" open="(" separator="," close=")">
             #{fId}
         </foreach>
@@ -1204,6 +1217,7 @@
         FROM
         t_warehousebillsfees tw
         <where>
+        tw.del_flag = '0'
             <if test="fPid != null ">and tw.f_pid = #{fPid}</if>
             <if test="fLineno != null ">and tw.f_lineno = #{fLineno}</if>
             <if test="fCorpid != null ">and tw.f_corpid = #{fCorpid}</if>

+ 13 - 8
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsitemsMapper.xml

@@ -120,6 +120,7 @@
             resultMap="TWarehousebillsitemsResult">
         <include refid="selectTWarehousebillsitemsVo"/>
         <where>
+            del_flag = '0'
             <if test="fPid != null ">and f_pid = #{fPid}</if>
             <if test="fLineno != null ">and f_lineno = #{fLineno}</if>
             <if test="fGoodsid != null ">and f_goodsid = #{fGoodsid}</if>
@@ -179,7 +180,7 @@
         where
         f_pid = #{fPid}
         and
-        f_billtype = #{fBilltype}
+        f_billtype = #{fBilltype} and del_flag = '0'
     </select>
 
     <select id="selectGoodsTransferitemsList" parameterType="TWarehousebillsitems" resultType="Map">
@@ -259,12 +260,12 @@
             LEFT JOIN sys_dict_data l ON l.dict_value = item.f_lntype
             AND l.dict_type = 'ln_way'
         WHERE
-            item.f_pid = #{fPid}
+            item.f_pid = #{fPid} and w.del_flag = '0' and item.del_flag = '0'
     </select>
 
     <select id="selectTWarehousebillsitemsById" parameterType="Long" resultMap="TWarehousebillsitemsResult">
         <include refid="selectTWarehousebillsitemsVo"/>
-        where f_id = #{fId}
+        where f_id = #{fId} and del_flag = '0'
     </select>
 
     <insert id="insertTWarehousebillsitems" parameterType="TWarehousebillsitems" useGeneratedKeys="true" keyProperty="fId">
@@ -495,18 +496,18 @@
     </update>
 
     <delete id="deleteTWarehousebillsitemsById" parameterType="Long">
-        delete from t_warehousebillsitems where f_id = #{fId}
+        UPDATE t_warehousebillsitems SET del_flag = '1' where f_id = #{fId}
     </delete>
 
     <delete id="deleteTWarehousebillsitemsByIds" parameterType="String">
-        delete from t_warehousebillsitems where f_id in
+        UPDATE t_warehousebillsitems SET del_flag = '1' where f_id in
         <foreach item="fId" collection="array" open="(" separator="," close=")">
             #{fId}
         </foreach>
     </delete>
 
     <delete id="deleteByFPid" parameterType="Long">
-        delete from t_warehousebillsitems where f_pid = #{fId}
+        UPDATE t_warehousebillsitems SET del_flag = '1' where f_pid = #{fId}
     </delete>
 
     <select id="selectStorageFeeItemList" parameterType="com.ruoyi.warehouseBusiness.domain.TWarehouseBills"
@@ -808,6 +809,7 @@
             t_warehousebillsitems
         WHERE
             f_pid = #{fPid}
+            and del_flag = '0'
             AND f_billstatus = 40
     </select>
 
@@ -817,7 +819,7 @@
         FROM
             t_warehousebillsitems
         WHERE
-            f_pid = #{fId}
+            f_pid = #{fId} and del_flag = '0'
     </select>
 
     <select id="selectItemsStatusByPid" resultMap="TWarehousebillsitemsResult" parameterType="long">
@@ -830,6 +832,7 @@
             t_warehousebillsitems
         WHERE
             f_pid = #{fId}
+          and del_flag = '0'
     </select>
 
     <update id="warehouseItemFollowUpdate" parameterType="Long">
@@ -846,7 +849,7 @@
         FROM
             t_warehousebillsitems
         WHERE f_chargedate IS NOT NULL
-        and f_pid = #{fPid}
+        and f_pid = #{fPid} and del_flag = '0'
         ORDER BY f_chargedate
         LIMIT 1
     </select>
@@ -900,6 +903,7 @@
         FROM
             t_warehousebillsitems
         WHERE
+        del_flag = '0'
         <foreach collection="ids" item="id" open="f_id in(" separator="," close=")">
             #{id}
         </foreach>
@@ -957,6 +961,7 @@
         from t_warehousebills t LEFT JOIN t_warehousebillsitems item ON item.f_pid = t.f_id
         where
             item.f_id IS NOT NULL
+        and t.del_flag = '0' and item.del_flag = '0'
             and (t.f_corpid = #{bills.fCorpid} or t.f_tocorpid = #{bills.fCorpid})
             and item.f_bsdate BETWEEN #{bills.itemBsDateList[0]} and #{bills.itemBsDateList[1]}
             and IF(item.f_billtype = "HQZY",  item.f_billstatus = 6, item.f_billstatus = 40)