瀏覽代碼

完善仓储费导出明细

sunhz 3 年之前
父節點
當前提交
2bf2b960a9
共有 1 個文件被更改,包括 22 次插入6 次删除
  1. 22 6
      ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsMapper.xml

+ 22 - 6
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsMapper.xml

@@ -683,9 +683,17 @@
                 <if test="fId != null and fId!= ''">
                     AND wi.f_mblno = (select distinct f_mblno from t_warehousebills where f_id = #{fId})
                     AND wi.f_warehouselocid in (
-                        select distinct wi.f_warehouselocid
-                        from t_warehousebillsitems wi left join t_warehousebillsfees wf on wf.src_id = wi.f_id
-                        where wf.f_pid = #{fId}
+                        SELECT DISTINCT * FROM (
+                            SELECT wi.f_warehouselocid
+                            FROM t_warehousebillsitems wi
+                            LEFT JOIN t_warehousebillsfees wf ON wf.src_id = wi.f_id
+                            WHERE wf.f_pid = #{fId} and wf.f_billtype = 'SJCK'
+                            UNION ALL
+                            SELECT wh.f_warehouse_locationid
+                            FROM t_whgenleg wh
+                            LEFT JOIN t_warehousebillsfees wf ON wf.src_id = wh.f_id
+                            WHERE wf.f_pid = #{fId} and wf.f_billtype = 'KCZZ'
+                        ) as wh
                     )
                 </if>
             </if>
@@ -695,9 +703,17 @@
                 <if test="fId != null and fId!= ''">
                     AND wi.f_mblno = (select distinct f_mblno from t_warehousebills where f_id = #{fId})
                     AND wi.f_transfer_warehouselocid in (
-                        select distinct wi.f_warehouselocid
-                        from t_warehousebillsitems wi left join t_warehousebillsfees wf on wf.src_id = wi.f_id
-                        where wf.f_pid = #{fId}
+                        SELECT DISTINCT * FROM (
+                            SELECT wi.f_warehouselocid
+                            FROM t_warehousebillsitems wi
+                            LEFT JOIN t_warehousebillsfees wf ON wf.src_id = wi.f_id
+                            WHERE wf.f_pid = #{fId} and wf.f_billtype = 'SJCK'
+                            UNION ALL
+                            SELECT wh.f_warehouse_locationid
+                            FROM t_whgenleg wh
+                            LEFT JOIN t_warehousebillsfees wf ON wf.src_id = wh.f_id
+                            WHERE wf.f_pid = #{fId} and wf.f_billtype = 'KCZZ'
+                        ) as wh
                     )
                 </if>
             </if>