| 
					
				 | 
			
			
				@@ -54,6 +54,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <result property="fGoodsid" column="f_goodsid"/> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <result property="fBsdate" column="f_bsdate"/> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <result property="fBillingway" column="f_billingway"/> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <result property="fBsdate" column="f_bsdate"/> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <result property="fChargedate" column="f_chargedate"/> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <result property="fOriginalbilldate" column="f_originalbilldate"/> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <result property="fMblno" column="f_mblno"/> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -72,7 +73,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <sql id="selectTWhgenlegVo"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         select f_id, f_accyear, f_accmonth, f_corpid, f_mblno, f_originalbillno, f_warehouse_locationid, f_goodsid, f_trademodeid, f_preqty, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-         f_pregrossweight, f_warehouseid, f_prenetweight, f_chargedate, f_volumnD, f_qtyD, f_billingway, f_grossweightD, f_netweightD, f_volumnC, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+         f_pregrossweight, f_warehouseid, f_prenetweight, f_bsdate, f_chargedate, f_volumnD, f_qtyD, f_billingway, f_grossweightD, f_netweightD, f_volumnC, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           f_qtyC, f_grossweightC, f_qtyblc, f_grossweightblc, f_netweightC, f_netweightblc, f_cntrno, f_status, del_flag, f_marks, create_by, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            create_time, update_by, f_volumnblc, update_time, remark, f_business_type, f_originalbilldate, f_localcntrno,f_customno from t_whgenleg 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </sql> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -86,6 +87,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             left join sys_dept d on u.dept_id = d.dept_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fOriginalbillno != null  and fOriginalbillno != ''">and f_originalbillno = #{fOriginalbillno}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="fBsdate != null ">and f_bsdate = #{fBsdate}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fChargedate != null ">and f_chargedate = #{fChargedate}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fPreqty != null ">and f_preqty = #{fPreqty}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fWarehouseid != null ">and f_warehouseid = #{fWarehouseid}</if> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -120,12 +122,29 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fCntrno != null ">and f_cntrno = #{fCntrno}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fBusinessType != null ">and f_business_type = #{fBusinessType}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fMarks != null ">and f_marks = #{fMarks}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="fBsdate != null ">and f_bsdate = #{fBsdate}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="fWarehouseLocationid != null ">and f_warehouse_locationid = #{fWarehouseLocationid}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="fGoodsid != null ">and f_goodsid = #{fGoodsid}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="fTrademodeid != null ">and f_trademodeid = #{fTrademodeid}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    </select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+<!-- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <select id="selectTWhgenleg" parameterType="TWhgenleg" resultMap="TWhgenlegResult"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <include refid="selectTWhgenlegVo"/> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="fCorpid != null ">and f_corpid = #{fCorpid}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="fMblno != null ">and f_mblno = #{fMblno}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="fCntrno != null ">and f_cntrno = #{fCntrno}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="fBusinessType != null ">and f_business_type = #{fBusinessType}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="fMarks != null ">and f_marks = #{fMarks}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fOriginalbilldate != null ">and f_originalbilldate = #{fOriginalbilldate}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fWarehouseLocationid != null ">and f_warehouse_locationid = #{fWarehouseLocationid}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fGoodsid != null ">and f_goodsid = #{fGoodsid}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fTrademodeid != null ">and f_trademodeid = #{fTrademodeid}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+--> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <select id="selectTWhgenlegById" parameterType="Long" resultMap="TWhgenlegResult"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <include refid="selectTWhgenlegVo"/> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -147,6 +166,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fPregrossweight != null">f_pregrossweight,</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fWarehouseid != null">f_warehouseid,</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fPrenetweight != null">f_prenetweight,</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="fBsdate != null">f_bsdate,</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fChargedate != null">f_chargedate,</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fVolumnd != null">f_volumnD,</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fQtyd != null">f_qtyD,</if> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -187,6 +207,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fPregrossweight != null">#{fPregrossweight},</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fWarehouseid != null">#{fWarehouseid},</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fPrenetweight != null">#{fPrenetweight},</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="fBsdate != null">#{fBsdate},</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fChargedate != null">#{fChargedate},</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fVolumnd != null">#{fVolumnd},</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fQtyd != null">#{fQtyd},</if> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -231,6 +252,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fPregrossweight != null">f_pregrossweight = #{fPregrossweight},</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fWarehouseid != null">f_warehouseid = #{fWarehouseid},</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fPrenetweight != null">f_prenetweight = #{fPrenetweight},</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="fBsdate != null">f_bsdate = #{fBsdate},</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fChargedate != null">f_chargedate = #{fChargedate},</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fVolumnd != null">f_volumnD = #{fVolumnd},</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fQtyd != null">f_qtyD = #{fQtyd},</if> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -271,6 +293,53 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 f_netweightD = f_netweightD + #{map.warehousebillsitems.fNetweight}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 f_grossweightD = f_grossweightD + #{map.warehousebillsitems.fGrossweight}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 f_qtyblc = f_qtyblc + #{map.warehousebillsitems.fQty} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                ,f_chargedate = #{map.warehousebillsitems.fBsdate} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                <if test="map.warehousebillsitems.fCustomno != null  and map.warehousebillsitems.fCustomno != ''"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    ,f_customno = #{map.warehousebillsitems.fCustomno} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                <if test="map.warehousebillsitems.remark != null  and map.warehousebillsitems.remark != ''"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    ,remark = #{map.warehousebillsitems.remark} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            /*判断是否撤销入库*/ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="map.billType == 'SJRKRevoke'"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                f_qtyD = f_qtyD - #{map.warehousebillsitems.fQty}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                f_volumnD = f_volumnD - #{map.warehousebillsitems.fVolumn}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                f_netweightD = f_netweightD - #{map.warehousebillsitems.fNetweight}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                f_grossweightD = f_grossweightD - #{map.warehousebillsitems.fGrossweight}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                f_qtyblc = f_qtyblc - #{map.warehousebillsitems.fQty} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            /*判断是否出库*/ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="map.billType == 'SJCK'"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                f_qtyC = f_qtyC + #{map.warehousebillsitems.fQty}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                f_volumnC = f_volumnC + #{map.warehousebillsitems.fVolumn}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                f_netweightC = f_netweightC + #{map.warehousebillsitems.fNetweight}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                f_grossweightC = f_grossweightC + #{map.warehousebillsitems.fGrossweight}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                f_qtyblc = f_qtyblc - #{map.warehousebillsitems.fQty} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            /*判断是否撤销出库*/ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="map.billType == 'SJCKRevoke'"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                f_qtyC = f_qtyC - #{map.warehousebillsitems.fQty}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                f_volumnC = f_volumnC - #{map.warehousebillsitems.fVolumn}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                f_netweightC = f_netweightC - #{map.warehousebillsitems.fNetweight}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                f_grossweightC = f_grossweightC - #{map.warehousebillsitems.fGrossweight}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                f_qtyblc = f_qtyblc + #{map.warehousebillsitems.fQty} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            -- update_by = NOW() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </trim> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        where f_id = #{map.whgenlegId} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    </update> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+<!-- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <update id="updateTWhgenlegData" parameterType="Map"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        update t_whgenleg 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <trim prefix="SET" suffixOverrides=","> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            /*判断是否入库*/ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="map.billType == 'SJRK'"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                f_qtyD = f_qtyD + #{map.warehousebillsitems.fQty}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                f_volumnD = f_volumnD + #{map.warehousebillsitems.fVolumn}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                f_netweightD = f_netweightD + #{map.warehousebillsitems.fNetweight}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                f_grossweightD = f_grossweightD + #{map.warehousebillsitems.fGrossweight}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                f_qtyblc = f_qtyblc + #{map.warehousebillsitems.fQty} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 <if test="map.warehousebillsitems.fBilltype != null  and map.warehousebillsitems.fBilltype == 'HQZY'"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     ,f_chargedate = #{map.warehousebillsitems.fBsdate} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 </if> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -308,10 +377,11 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 f_grossweightC = f_grossweightC - #{map.warehousebillsitems.fGrossweight}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 f_qtyblc = f_qtyblc + #{map.warehousebillsitems.fQty} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            -- update_by = NOW() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            -- update_by = NOW() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </trim> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         where f_id = #{map.whgenlegId} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </update> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+--> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <delete id="deleteTWhgenlegById" parameterType="Long"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         delete from t_whgenleg where f_id = #{fId} 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -640,53 +710,53 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <select id="selectInventoryMapList" parameterType="TWhgenleg" resultType="Map"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         select 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        DISTINCT 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        leg.f_id AS fId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        leg.f_corpid AS fCorpIds, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        corp.f_name AS fCorpid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        ware.f_warehouse_information AS fWarehouseids, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        area.f_name AS fWarehouseLocationids, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        leg.f_originalbillno AS fOriginalbillno, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        leg.f_warehouse_locationid AS fWarehouseLocationid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        dict1.dict_label AS fTrademodeid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        goods.f_name AS fGoodsids, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        leg.f_trademodeid AS fTrademodeids, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        goods.f_packagespecs AS fPackagespecs, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        leg.f_goodsid AS fGoodsid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        IFNULL(SUM(leg.f_volumnD),0) AS fVolumnD, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        IFNULL(SUM(leg.f_qtyD),0) AS fQtyD, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        leg.f_mblno AS fMblno, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        IFNULL(SUM(leg.f_grossweightD),0) AS fGrossweightD, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        IFNULL(SUM(leg.f_netweightD),0) AS fNetweightD, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        IFNULL(SUM(leg.f_volumnC),0) AS fVolumnC, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        IFNULL(SUM(leg.f_volumnblc),0) AS fVolumnblc, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        SUM(leg.f_qtyC) AS fQtyC, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        leg.f_business_type AS fBusinessType, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        IFNULL(SUM(leg.f_grossweightC),0) AS fGrossweightC, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        IFNULL(SUM(leg.f_netweightC),0) AS fNetweightC, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        IFNULL(SUM(leg.f_qtyblc),0) AS fQtyblc, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        leg.f_billingway AS fBillingway, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        leg.f_chargedate AS fChargedate, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        IFNULL(SUM(leg.f_grossweightblc),0) AS fGrossweightblc, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        IFNULL(SUM(leg.f_netweightblc),0) AS fNetweightblc, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        dict.dict_label AS fBusinessTypes, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        leg.f_marks AS fMarks, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        DATE_FORMAT( leg.create_time, '%Y-%m-%d' ) AS createTime, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        DATE_FORMAT( leg.f_originalbilldate, '%Y-%m-%d' ) AS fOriginalbilldate, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        leg.f_cntrno AS fCntrno, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        leg.f_localcntrno fLocalcntrno 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            DISTINCT 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            leg.f_id AS fId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            leg.f_corpid AS fCorpIds, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            corp.f_name AS fCorpid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ware.f_warehouse_information AS fWarehouseids, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            area.f_name AS fWarehouseLocationids, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            leg.f_originalbillno AS fOriginalbillno, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            leg.f_warehouse_locationid AS fWarehouseLocationid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            dict1.dict_label AS fTrademodeid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            goods.f_name AS fGoodsids, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            leg.f_trademodeid AS fTrademodeids, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            goods.f_packagespecs AS fPackagespecs, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            leg.f_goodsid AS fGoodsid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            IFNULL(SUM(leg.f_volumnD),0) AS fVolumnD, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            IFNULL(SUM(leg.f_qtyD),0) AS fQtyD, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            leg.f_mblno AS fMblno, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            IFNULL(SUM(leg.f_grossweightD),0) AS fGrossweightD, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            IFNULL(SUM(leg.f_netweightD),0) AS fNetweightD, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            IFNULL(SUM(leg.f_volumnC),0) AS fVolumnC, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            IFNULL(SUM(leg.f_volumnblc),0) AS fVolumnblc, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            SUM(leg.f_qtyC) AS fQtyC, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            leg.f_business_type AS fBusinessType, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            IFNULL(SUM(leg.f_grossweightC),0) AS fGrossweightC, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            IFNULL(SUM(leg.f_netweightC),0) AS fNetweightC, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            IFNULL(SUM(leg.f_qtyblc),0) AS fQtyblc, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            leg.f_billingway AS fBillingway, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            leg.f_chargedate AS fChargedate, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            IFNULL(SUM(leg.f_grossweightblc),0) AS fGrossweightblc, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            IFNULL(SUM(leg.f_netweightblc),0) AS fNetweightblc, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            dict.dict_label AS fBusinessTypes, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            leg.f_marks AS fMarks, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            DATE_FORMAT( leg.create_time, '%Y-%m-%d' ) AS createTime, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            DATE_FORMAT( leg.f_originalbilldate, '%Y-%m-%d' ) AS fOriginalbilldate, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            leg.f_cntrno AS fCntrno, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            leg.f_localcntrno fLocalcntrno 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         FROM 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        t_whgenleg leg 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        left join sys_user u on leg.create_by = u.user_name 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        left join sys_user u1 on leg.create_by = u1.user_name 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        left join sys_dept d on u.dept_id = d.dept_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        LEFT JOIN t_corps corp ON corp.f_id = leg.f_corpid 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        LEFT JOIN t_customer_contact tc ON tc.f_pid = corp.f_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        LEFT JOIN t_goods goods ON goods.f_id = leg.f_goodsid 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        LEFT JOIN t_warehouse ware ON ware.f_id = leg.f_warehouse_locationid 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        LEFT JOIN sys_dict_data dict ON dict.dict_value = leg.f_business_type 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        LEFT JOIN t_warehouse_area area ON area.f_id = leg.f_warehouse_locationid 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        LEFT JOIN sys_dict_data dict1 ON dict1.dict_value = leg.f_trademodeid 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            t_whgenleg leg 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            left join sys_user u on leg.create_by = u.user_name 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            left join sys_user u1 on leg.create_by = u1.user_name 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            left join sys_dept d on u.dept_id = d.dept_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            LEFT JOIN t_corps corp ON corp.f_id = leg.f_corpid 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            LEFT JOIN t_customer_contact tc ON tc.f_pid = corp.f_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            LEFT JOIN t_goods goods ON goods.f_id = leg.f_goodsid 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            LEFT JOIN t_warehouse ware ON ware.f_id = leg.f_warehouse_locationid 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            LEFT JOIN sys_dict_data dict ON dict.dict_value = leg.f_business_type 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            LEFT JOIN t_warehouse_area area ON area.f_id = leg.f_warehouse_locationid 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            LEFT JOIN sys_dict_data dict1 ON dict1.dict_value = leg.f_trademodeid 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             dict.status = '0' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             AND dict1.status = '0' 
			 |