소스 검색

库存总账导出问题

lichao 3 년 전
부모
커밋
bb98a6b1be
1개의 변경된 파일20개의 추가작업 그리고 14개의 파일을 삭제
  1. 20 14
      ruoyi-warehouse/src/main/resources/mapper/reportManagement/TWhgenlegMapper.xml

+ 20 - 14
ruoyi-warehouse/src/main/resources/mapper/reportManagement/TWhgenlegMapper.xml

@@ -1048,20 +1048,22 @@
         <where>
             dict.status = '0'
             AND dict1.status = '0'
+            AND leg.f_qtyD != 0
+            <if test="isMblno != null and isMblno == 0 ">
+                AND leg.f_qtyblc != 0
+                AND leg.f_grossweightblc != 0
+                AND leg.f_netweightblc != 0
+            </if>
             AND dict.dict_type = 'storage_type'
             AND dict1.dict_type = 'data_trademodes'
-            AND leg.f_qtyD != 0
-            AND leg.f_qtyblc != 0
             <if test="fOriginalbillno != null  and fOriginalbillno != ''">and leg.f_originalbillno = #{fOriginalbillno}</if>
+            <if test="fTel != null  and fTel != ''">and tc.f_tel = #{fTel}</if>
             <if test="fPreqty != null ">and leg.f_preqty = #{fPreqty}</if>
             <if test="fCorpid != null ">and leg.f_corpid = #{fCorpid}</if>
             <if test="fShipper != null and fShipper != ''">and leg.f_shipper like concat('%', #{fShipper}, '%')</if>
-            <if test='orgStorageDate != null and orgStorageDate[0] != null and orgStorageDate[0]!= ""'>
-                and leg.f_originalbilldate &gt;= #{orgStorageDate[0]}
-            </if>
-            <if test='orgStorageDate != null and orgStorageDate[1] != null and orgStorageDate[1]!= ""'>
-                and leg.f_originalbilldate &lt;= #{orgStorageDate[1]}
-            </if>
+            <if test="fMblno != null ">and leg.f_mblno LIKE  concat('%', #{fMblno}, '%') </if>
+            <if test='orgStorageDate != null and orgStorageDate[0] != null and orgStorageDate[0]!= ""'>and leg.f_originalbilldate &gt;= #{orgStorageDate[0]}</if>
+            <if test='orgStorageDate != null and orgStorageDate[1] != null and orgStorageDate[1]!= ""'>and leg.f_originalbilldate &lt;= #{orgStorageDate[1]}</if>
             <if test="fPregrossweight != null ">and leg.f_pregrossweight = #{fPregrossweight}</if>
             <if test="fPrenetweight != null ">and leg.f_prenetweight = #{fPrenetweight}</if>
             <if test="fQtyd != null ">and leg.f_qtyD = #{fQtyd}</if>
@@ -1079,18 +1081,22 @@
             <if test="fNetweightc != null ">and leg.f_netweightC = #{fNetweightc}</if>
             <if test="fGrossweightblc != null ">and leg.f_grossweightblc = #{fGrossweightblc}</if>
             <if test="fNetweightblc != null ">and leg.f_netweightblc = #{fNetweightblc}</if>
-            <if test="fCntrno != null  and fCntrno != ''">and leg.f_cntrno LIKE  concat('%', #{fCntrno}, '%')</if>
-            <if test="fMblno != null ">and leg.f_mblno LIKE  concat('%', #{fMblno}, '%') </if>
             <if test="fStatus != null  and fStatus != ''">and leg.f_status = #{fStatus}</if>
             <if test="fWarehouseid != null ">and leg.f_warehouseid = #{fWarehouseid} </if>
-            <if test="fLocation != null  and fLocation ==1 ">
-                and leg.f_warehouse_locationid = #{fWarehouseLocationid}
+            <if test="fLocation != null and fLocation ==1 ">and leg.f_warehouse_locationid = #{fWarehouseLocationid}</if>
+            <if test="fCntrno != null  and fCntrno != ''">and leg.f_cntrno  LIKE  concat('%', #{fCntrno}, '%')</if>
+            <if test="fLocalcntrno != null  and fLocalcntrno != ''">and leg.f_localcntrno  LIKE  concat('%', #{fLocalcntrno}, '%')</if>
+            <if test="fLocation != null  and fLocation ==0 ">and ware.ancestors  LIKE  concat('%', #{fWarehouseLocationid}, '%')</if>
+            <if test="isCntrno == null">
+                GROUP BY leg.f_corpid, leg.f_originalbillno, leg.f_originalbilldate, leg.f_warehouse_locationid, leg.f_goodsid, leg.f_trademodeid
             </if>
-            <if test="fLocation != null  and fLocation ==0 ">
-                and ware.ancestors  LIKE  concat('%', #{fWarehouseLocationid}, '%')
+            <if test="isCntrno == 1 ">
+                GROUP BY leg.f_corpid, leg.f_originalbillno, leg.f_originalbilldate, leg.f_warehouse_locationid, leg.f_goodsid, leg.f_trademodeid,leg.f_cntrno
             </if>
+            <if test="isCntrno == 2 ">GROUP BY leg.f_corpid, leg.f_mblno, leg.f_goodsid, leg.f_warehouseid</if>
         </where>
         ${params.dataScope}
+        order by leg.f_bsdate desc
     </select>
 
     <select id="selectWhgenlegList" resultType="java.util.Map">