| 
					
				 | 
			
			
				@@ -39,14 +39,14 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <result property="fApplyMoney" column="f_apply_money"/> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <result property="fAccountId" column="f_account_id"/> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <result property="fMake" column="f_make"/> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        <result property="fVslid"    column="f_vslid"    /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        <result property="fVoyid"    column="f_voyid"    /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        <result property="fLoadportid"    column="f_loadportid"    /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        <result property="fDestportid"    column="f_destportid"    /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        <result property="fDc"    column="f_dc"    /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        <result property="fBankNumber"    column="f_bank_number"    /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        <result property="fReconciliation"    column="f_reconciliation"    /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        <result property="invoiceRemarks"    column="invoice_remarks"    /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <result property="fVslid" column="f_vslid"/> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <result property="fVoyid" column="f_voyid"/> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <result property="fLoadportid" column="f_loadportid"/> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <result property="fDestportid" column="f_destportid"/> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <result property="fDc" column="f_dc"/> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <result property="fBankNumber" column="f_bank_number"/> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <result property="fReconciliation" column="f_reconciliation"/> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <result property="invoiceRemarks" column="invoice_remarks"/> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </resultMap> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <sql id="selectTFeeVo"> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -148,7 +148,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fAmtcr != null ">and ware.f_amtcr = #{fAmtcr}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fBilltype != null  and fBilltype != ''">and ware.f_billtype = #{fBilltype}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fBillstatus != null  and fBillstatus != ''">and ware.f_billstatus = #{fBillstatus}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            <if test="fRemarks != null  and fRemarks != ''">and ware.f_remarks like concat('%', #{fRemarks}, '%') </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="fRemarks != null  and fRemarks != ''">and ware.f_remarks like concat('%', #{fRemarks}, '%')</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fFromDate != null ">and ware.f_from_date = #{fFromDate}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fAccbilldate != null ">and ware.f_accbilldate = #{fAccbilldate}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fToDate != null ">and ware.f_to_date = #{fToDate}</if> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -226,7 +226,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fAmtcr != null ">and f.f_amtcr = #{fAmtcr}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fBilltype != null  and fBilltype != ''">and f.f_billtype = #{fBilltype}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fBillstatus != null  and fBillstatus != ''">and f.f_billstatus = #{fBillstatus}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            <if test="fRemarks != null  and fRemarks != ''">and ware.f_remarks like concat('%', #{fRemarks}, '%') </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="fRemarks != null  and fRemarks != ''">and ware.f_remarks like concat('%', #{fRemarks}, '%')</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fAccbilldate != null ">and f.f_accbilldate = #{fAccbilldate}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fDeptid != null ">and f.f_deptid = #{fDeptid}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -271,7 +271,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         f.f_ctrlcorpid AS fCtrlcorpid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         pro.dict_label AS chargingMethod, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         f.invoice_no AS invoiceNo, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        f.bank AS  fBank, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.bank AS fBank, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         f.water_bill_no AS waterBillNo, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         f.f_corpid AS fCorpid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         c.f_name AS fCorpidName, 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -333,7 +333,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fAmtcr != null ">and f.f_amtcr = #{fAmtcr}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fBilltype != null  and fBilltype != ''">and f.f_billtype = #{fBilltype}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fBillstatus != null  and fBillstatus != ''">and f.f_billstatus = #{fBillstatus}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            <if test="fRemarks != null  and fRemarks != ''">and ware.f_remarks like concat('%', #{fRemarks}, '%') </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="fRemarks != null  and fRemarks != ''">and ware.f_remarks like concat('%', #{fRemarks}, '%')</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fAccbilldate != null ">and f.f_accbilldate = #{fAccbilldate}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fDeptid != null ">and f.f_deptid = #{fDeptid}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -361,18 +361,20 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 and f.create_time <= #{applyTime[1]} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="chargingMethod != null ">and f.charging_method = #{chargingMethod}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            <if test="invoiceNo != null ">and f.invoice_no like concat('%', #{invoiceNo}, '%') </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="invoiceNo != null ">and f.invoice_no like concat('%', #{invoiceNo}, '%')</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="bank != null ">and f.bank like concat('%', #{bank}, '%')</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            <if test="waterBillNo != null ">and f.water_bill_no like concat('%', #{waterBillNo}, '%') </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="waterBillNo != null ">and f.water_bill_no like concat('%', #{waterBillNo}, '%')</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="fSystemType != null and fSystemType != ''">and f.f_system_type = #{fSystemType}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="createBy != null and createBy != ''">and f.create_by = #{createBy}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            <if test="fVslid != null "> and f.f_vslid = #{fVslid}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            <if test="fVoyid != null "> and f.f_voyid = #{fVoyid}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            <if test="fLoadportid != null "> and f.f_loadportid = #{fLoadportid}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            <if test="fDestportid != null "> and f.f_destportid = #{fDestportid}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            <if test="fDc != null  and fDc != ''"> and f.f_dc = #{fDc}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            <if test="fBankNumber != null  and fBankNumber != ''"> and f.f_bank_number like concat('%', #{fBankNumber}, '%')</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            <if test="fReconciliation != null "> and f.f_reconciliation = #{fReconciliation}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="fVslid != null ">and f.f_vslid = #{fVslid}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="fVoyid != null ">and f.f_voyid = #{fVoyid}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="fLoadportid != null ">and f.f_loadportid = #{fLoadportid}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="fDestportid != null ">and f.f_destportid = #{fDestportid}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="fDc != null  and fDc != ''">and f.f_dc = #{fDc}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="fBankNumber != null  and fBankNumber != ''">and f.f_bank_number like concat('%', #{fBankNumber}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                '%') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <if test="fReconciliation != null ">and f.f_reconciliation = #{fReconciliation}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         ORDER BY f.f_id desc 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </select> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -639,42 +641,42 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <select id="warehouseBillsFeesList" resultType="java.util.Map"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         SELECT 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            w.f_id AS fSrcid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            t.f_id AS fSrcpid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            t.f_corpid AS fCorpid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            c.f_name AS fName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            c.f_id AS fId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            c.f_name AS fFeesName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            t.f_bscorpno AS fBscorpno, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            w.f_mblno AS fMblno, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            w.f_product_name AS fProductName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            w.f_bsdate AS fBsdate, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            t.f_billtype AS fBilltype, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            t.f_review_date AS fReviewDate, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            w.f_feeid AS fFeeid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            w.src_bill_no AS srcBillNo, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            w.f_marks AS fMarks, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            w.f_chargedate AS fChargedate, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            w.f_billing_days AS fBillingDays, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            w.f_billing_deadline AS fBillingDeadline, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            w.f_inventory_days AS fInventoryDays, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            w.f_originalbilldate AS fOriginalbilldate, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            f.f_name AS fFeeName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            w.f_dc AS fSrcdc, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            CASE 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            WHEN w.f_dc = 'D' THEN 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            '收' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            WHEN w.f_dc = 'C' THEN 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            '付' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            END AS fSrcdcName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            ifnull( w.f_amount, 0 ) - ifnull( w.f_stlamount, 0 ) AS fAmtdr, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            ifnull( w.f_amount, 0 ) - ifnull( w.f_stlamount, 0 ) AS fAmt, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            w.f_business_type AS fBusinessType 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.f_id AS fSrcid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        t.f_id AS fSrcpid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        t.f_corpid AS fCorpid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        c.f_name AS fName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        c.f_id AS fId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        c.f_name AS fFeesName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        t.f_bscorpno AS fBscorpno, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.f_mblno AS fMblno, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.f_product_name AS fProductName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.f_bsdate AS fBsdate, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        t.f_billtype AS fBilltype, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        t.f_review_date AS fReviewDate, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.f_feeid AS fFeeid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.src_bill_no AS srcBillNo, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.f_marks AS fMarks, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.f_chargedate AS fChargedate, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.f_billing_days AS fBillingDays, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.f_billing_deadline AS fBillingDeadline, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.f_inventory_days AS fInventoryDays, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.f_originalbilldate AS fOriginalbilldate, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.f_name AS fFeeName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.f_dc AS fSrcdc, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        CASE 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        WHEN w.f_dc = 'D' THEN 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        '收' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        WHEN w.f_dc = 'C' THEN 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        '付' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        END AS fSrcdcName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        ifnull( w.f_amount, 0 ) - ifnull( w.f_stlamount, 0 ) AS fAmtdr, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        ifnull( w.f_amount, 0 ) - ifnull( w.f_stlamount, 0 ) AS fAmt, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.f_business_type AS fBusinessType 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         FROM 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            t_warehousebillsfees w 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            LEFT JOIN t_warehousebills t ON t.f_id = w.f_pid 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            LEFT JOIN t_corps c ON c.f_id = w.f_corpid 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            LEFT JOIN t_fees f ON w.f_feeid = f.f_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        t_warehousebillsfees w 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        LEFT JOIN t_warehousebills t ON t.f_id = w.f_pid 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        LEFT JOIN t_corps c ON c.f_id = w.f_corpid 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        LEFT JOIN t_fees f ON w.f_feeid = f.f_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <if test="map.tWareHouseFees.fCorpid != null  and map.tWareHouseFees.fCorpid != ''">and w.f_corpid = 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 #{map.tWareHouseFees.fCorpid} 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1164,45 +1166,45 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <select id="warehouseBillsFeesListAccamount" resultType="java.util.Map"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         SELECT 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            w.f_id AS fSrcid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            t.f_id AS fSrcpid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            t.f_corpid AS fCorpid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            c.f_name AS fName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            c.f_name AS fFeesName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            t.f_bscorpno AS fBscorpno, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            w.f_mblno AS fMblno, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            w.f_product_name AS fProductName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            w.f_bsdate AS fBsdate, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            t.f_billtype AS fBilltype, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            t.f_review_date AS fReviewDate, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            w.f_marks AS fMarks, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            w.f_feeid AS fFeeid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            w.f_billtype AS fBilltype, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            w.f_chargedate AS fChargedate, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            w.f_originalbilldate AS fOriginalbilldate, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            w.f_billing_deadline AS fBillingDeadline, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            w.f_billing_days AS fBillingDays, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            w.f_inventory_days AS fInventoryDays, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            f.f_name AS fFeeName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            w.f_dc AS fSrcdc, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            CASE 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            WHEN w.f_dc = 'D' THEN 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            '收' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            WHEN w.f_dc = 'C' THEN 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            '付' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            END AS fSrcdcName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            ifnull( w.f_amount, 0 ) - ifnull( w.f_accamount, 0 ) AS fAmtdr, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            ifnull( w.f_amount, 0 ) - ifnull( w.f_accamount, 0 ) AS fAmt, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            dict.dict_label AS fFeeunitid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            w.f_qty AS fQty, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            w.f_unitprice AS fUnitprice, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            w.f_business_type AS fBusinessType 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.f_id AS fSrcid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        t.f_id AS fSrcpid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        t.f_corpid AS fCorpid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        c.f_name AS fName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        c.f_name AS fFeesName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        t.f_bscorpno AS fBscorpno, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.f_mblno AS fMblno, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.f_product_name AS fProductName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.f_bsdate AS fBsdate, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        t.f_billtype AS fBilltype, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        t.f_review_date AS fReviewDate, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.f_marks AS fMarks, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.f_feeid AS fFeeid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.f_billtype AS fBilltype, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.f_chargedate AS fChargedate, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.f_originalbilldate AS fOriginalbilldate, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.f_billing_deadline AS fBillingDeadline, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.f_billing_days AS fBillingDays, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.f_inventory_days AS fInventoryDays, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.f_name AS fFeeName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.f_dc AS fSrcdc, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        CASE 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        WHEN w.f_dc = 'D' THEN 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        '收' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        WHEN w.f_dc = 'C' THEN 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        '付' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        END AS fSrcdcName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        ifnull( w.f_amount, 0 ) - ifnull( w.f_accamount, 0 ) AS fAmtdr, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        ifnull( w.f_amount, 0 ) - ifnull( w.f_accamount, 0 ) AS fAmt, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        dict.dict_label AS fFeeunitid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.f_qty AS fQty, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.f_unitprice AS fUnitprice, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.f_business_type AS fBusinessType 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         FROM 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            t_warehousebillsfees w 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            LEFT JOIN t_warehousebills t ON t.f_id = w.f_pid 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            LEFT JOIN t_corps c ON c.f_id = w.f_corpid 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            LEFT JOIN t_fees f ON w.f_feeid = f.f_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            LEFT JOIN sys_dict_data dict ON dict.dict_value = w.f_feeUnitid 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        t_warehousebillsfees w 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        LEFT JOIN t_warehousebills t ON t.f_id = w.f_pid 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        LEFT JOIN t_corps c ON c.f_id = w.f_corpid 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        LEFT JOIN t_fees f ON w.f_feeid = f.f_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        LEFT JOIN sys_dict_data dict ON dict.dict_value = w.f_feeUnitid 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             dict.status = '0' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             AND dict.dict_type = 'data_unitfees' 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -2050,122 +2052,126 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             '%') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <if test="fBillno != null  and fBillno != ''">and tf.f_billno like concat('%', #{fBillno}, '%')</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        <if test="fBillstatus != null and fBillstatus != '' and fBillstatus != 'null' ">and tf.f_billstatus = #{fBillstatus}</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <if test="fBillstatus != null and fBillstatus != '' and fBillstatus != 'null' ">and tf.f_billstatus = 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            #{fBillstatus} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         ORDER BY tf.f_id desc 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <!--凯和检索费用信息--> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <select id="FinancialFeesList" resultType="java.util.Map"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    SELECT 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    w.f_id AS fSrcid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    t.f_id AS fSrcpid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    w.f_corpid AS fCorpid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    w.fName AS fName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    t.f_mblno AS fMblno, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    w.f_bsdate AS fBsdate, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    t.f_billtype AS fBilltype, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    t.f_review_date AS fReviewDate, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    w.f_feeid AS fFeeid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    w.src_bill_no AS srcBillNo, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    w.f_marks AS fMarks, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    f.f_name AS fFeeName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    w.f_dc AS fSrcdc, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    w.f_qty AS fQty, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    w.f_unitprice AS fUnitPrice, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    w.f_amount AS fAmount, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    w.f_feeUnitid AS fFeeUnitId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    pr.dict_label AS fFeeUnitName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    t.f_vslid AS fVslid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    t.f_voyid AS fVoyid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    tv.f_name AS fvslName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    ty.f_no AS fvoyName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    tre.f_name AS fLoadPortName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    ts.f_name As fDestPortName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    w.f_billstatus AS fBillStatus, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    t.f_loadportid AS fLoadportid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    t.f_destportid AS fDestportid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    tn.f_name AS cntrName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    ti.f_cntrcount AS fCntrCount, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    <if test='map.tWareHouseFees.fBilltype != null and map.tWareHouseFees.fBilltype != "" and map.tWareHouseFees.fBilltype == "KHDZ" '> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        ifnull( w.f_amount, 0 ) - ifnull( w.f_accamount, 0 ) AS fAmtdr, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        ifnull( w.f_amount, 0 ) - ifnull( w.f_accamount, 0 ) AS fAmt, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    <if test='map.tWareHouseFees.fBilltype != null and map.tWareHouseFees.fBilltype != "" and map.tWareHouseFees.fBilltype == "KHSF" '> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        ifnull( w.f_amount, 0 ) - ifnull( w.f_stlamount, 0 ) AS fAmtdr, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        ifnull( w.f_amount, 0 ) - ifnull( w.f_stlamount, 0 ) AS fAmt, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    <if test='map.tWareHouseFees.fBilltype != null and map.tWareHouseFees.fBilltype != "" and map.tWareHouseFees.fBilltype == "KHFF" '> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        ifnull( w.f_amount, 0 ) - ifnull( w.f_stlamount, 0 ) AS fAmtdr, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        ifnull( w.f_amount, 0 ) - ifnull( w.f_stlamount, 0 ) AS fAmt, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    CASE 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    WHEN w.f_dc = 'D' THEN '收' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    WHEN w.f_dc = 'C' THEN '付' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    END AS fSrcdcName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    CASE 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    WHEN w.f_billstatus = '1' THEN '新建' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    WHEN w.f_billstatus = '2' THEN '暂存' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    WHEN w.f_billstatus = '3' THEN '驳回' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    WHEN w.f_billstatus = '4' THEN '提交' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    WHEN w.f_billstatus = '5' THEN '审批中' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    WHEN w.f_billstatus = '6' THEN '通过' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    END AS fBillStatusName 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    FROM 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    t_warehousebills t 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    LEFT JOIN ( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    SELECT 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    f.f_id AS f_id, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    f.f_pid AS f_pid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    f.f_lineno AS f_lineno, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    f.f_corpid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    f.f_feeid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    f.f_feeUnitid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    f.f_qty, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    f.f_unitprice, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    f.f_amount, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    f.f_currency, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    f.f_exrate, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    f.f_taxrate, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    f.f_dc, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    f.f_billstatus, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    f.f_statement_no, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    f.f_accamount, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    f.f_accamount_date, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    f.f_stlamount_no, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    f.f_stlamount, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    f.f_stlamount_date, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    f.f_invnos, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    f.f_invamount, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    f.f_askamount, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    f.f_chargedate, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    f.f_status, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    f.remark, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    f.f_mblno, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    f.f_product_name, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    f.src_bill_no, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    f.f_billing_days, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    f.f_inventory_days, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    f.f_marks, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    f.f_billing_deadline, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    f.f_originalbilldate, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    f.f_billtype, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    f.f_business_type, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    f.f_bsdate, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    c.f_id AS fId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    c.f_name AS fName 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    FROM 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    t_warehousebillsfees AS f 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    LEFT JOIN t_corps AS c ON f.f_corpid = c.f_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    ) w ON w.f_pid = t.f_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    LEFT JOIN t_fees f ON w.f_feeid = f.f_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    LEFT JOIN sys_dict_data pr ON pr.dict_value = w.f_feeUnitid 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    AND pr.dict_type = 'data_unitfees' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    LEFT JOIN t_vessel tv ON t.f_vslid = tv.f_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    LEFT JOIN t_voyage ty ON t.f_voyid = ty.f_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    LEFT JOIN t_address tre ON tre.f_id = t.f_loadportid 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    LEFT JOIN t_address ts ON ts.f_id = t.f_destportid 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    LEFT JOIN t_warehousebills_cntr ti ON ti.f_pid = t.f_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    LEFT JOIN t_cntr tn ON tn.f_id = ti.f_cntrid 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        SELECT 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.f_id AS fSrcid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        t.f_id AS fSrcpid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.f_corpid AS fCorpid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.fName AS fName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        t.f_mblno AS fMblno, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.f_bsdate AS fBsdate, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        t.f_billtype AS fBilltype, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        t.f_review_date AS fReviewDate, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.f_feeid AS fFeeid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.src_bill_no AS srcBillNo, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.f_marks AS fMarks, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.f_name AS fFeeName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.f_dc AS fSrcdc, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.f_qty AS fQty, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.f_unitprice AS fUnitPrice, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.f_amount AS fAmount, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.f_feeUnitid AS fFeeUnitId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        pr.dict_label AS fFeeUnitName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        t.f_vslid AS fVslid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        t.f_voyid AS fVoyid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        tv.f_name AS fvslName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        ty.f_no AS fvoyName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        tre.f_name AS fLoadPortName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        ts.f_name As fDestPortName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        w.f_billstatus AS fBillStatus, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        t.f_loadportid AS fLoadportid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        t.f_destportid AS fDestportid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        tn.f_name AS cntrName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        ti.f_cntrcount AS fCntrCount, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <if test='map.tWareHouseFees.fBilltype != null and map.tWareHouseFees.fBilltype != "" and map.tWareHouseFees.fBilltype == "KHDZ" '> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ifnull( w.f_amount, 0 ) - ifnull( w.f_accamount, 0 ) AS fAmtdr, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ifnull( w.f_amount, 0 ) - ifnull( w.f_accamount, 0 ) AS fAmt, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <if test='map.tWareHouseFees.fBilltype != null and map.tWareHouseFees.fBilltype != "" and map.tWareHouseFees.fBilltype == "KHSF" '> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ifnull( w.f_amount, 0 ) - ifnull( w.f_stlamount, 0 ) AS fAmtdr, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ifnull( w.f_amount, 0 ) - ifnull( w.f_stlamount, 0 ) AS fAmt, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <if test='map.tWareHouseFees.fBilltype != null and map.tWareHouseFees.fBilltype != "" and map.tWareHouseFees.fBilltype == "KHFF" '> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ifnull( w.f_amount, 0 ) - ifnull( w.f_stlamount, 0 ) AS fAmtdr, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ifnull( w.f_amount, 0 ) - ifnull( w.f_stlamount, 0 ) AS fAmt, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        </if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        CASE 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        WHEN w.f_dc = 'D' THEN '收' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        WHEN w.f_dc = 'C' THEN '付' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        END AS fSrcdcName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        CASE 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        WHEN w.f_billstatus = '1' THEN '新建' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        WHEN w.f_billstatus = '2' THEN '暂存' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        WHEN w.f_billstatus = '3' THEN '驳回' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        WHEN w.f_billstatus = '4' THEN '提交' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        WHEN w.f_billstatus = '5' THEN '审批中' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        WHEN w.f_billstatus = '6' THEN '通过' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        END AS fBillStatusName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        tg.f_name AS goodName 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        FROM 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        t_warehousebills t 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        LEFT JOIN ( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        SELECT 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.f_id AS f_id, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.f_pid AS f_pid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.f_lineno AS f_lineno, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.f_corpid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.f_feeid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.f_feeUnitid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.f_qty, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.f_unitprice, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.f_amount, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.f_currency, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.f_exrate, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.f_taxrate, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.f_dc, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.f_billstatus, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.f_statement_no, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.f_accamount, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.f_accamount_date, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.f_stlamount_no, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.f_stlamount, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.f_stlamount_date, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.f_invnos, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.f_invamount, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.f_askamount, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.f_chargedate, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.f_status, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.remark, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.f_mblno, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.f_product_name, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.src_bill_no, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.f_billing_days, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.f_inventory_days, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.f_marks, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.f_billing_deadline, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.f_originalbilldate, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.f_billtype, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.f_business_type, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        f.f_bsdate, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        c.f_id AS fId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        c.f_name AS fName 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        FROM 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        t_warehousebillsfees AS f 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        LEFT JOIN t_corps AS c ON f.f_corpid = c.f_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        ) w ON w.f_pid = t.f_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        LEFT JOIN t_fees f ON w.f_feeid = f.f_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        LEFT JOIN sys_dict_data pr ON pr.dict_value = w.f_feeUnitid 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        AND pr.dict_type = 'data_unitfees' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        LEFT JOIN t_vessel tv ON t.f_vslid = tv.f_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        LEFT JOIN t_voyage ty ON t.f_voyid = ty.f_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        LEFT JOIN t_address tre ON tre.f_id = t.f_loadportid 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        LEFT JOIN t_address ts ON ts.f_id = t.f_destportid 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        LEFT JOIN t_warehousebills_cntr ti ON ti.f_pid = t.f_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        LEFT JOIN t_cntr tn ON tn.f_id = ti.f_cntrid 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        LEFT JOIN t_goods tg ON ti.f_goodsid = tg.f_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             t.f_typeid = 1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             and w.f_billstatus = 6 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -2281,5 +2287,54 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         where 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         f.f_id = #{fId} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <select id="exportFinancial" parameterType="TFee" resultType="com.ruoyi.shipping.excel.ExportFinancial"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        SELECT 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        @rank:=@rank + 1 AS rankNo, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        tp.fMblNo AS fMblNo, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        tp.portOfDeparture AS portOfDeparture, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        tp.destinationPort AS destinationPort, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        tp.goodName AS goodName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        IFNULL(tp.fCnTrCount,0) AS fCnTrCount, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        tp.specification AS specification, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        IFNULL(tp.fUnitPrice,0) AS fUnitPrice, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        IFNULL(tp.fAmount,0) AS fAmount 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        FROM 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        ( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            SELECT 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	        tw.f_mblno AS fMblNo, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	        ts.f_name AS portOfDeparture, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	        ty.f_name AS destinationPort, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	        tg.f_name AS goodName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	        IFNULL(temp.fCnTrCount,0) AS fCnTrCount, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	        tr.f_name AS specification, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	        CASE 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	            WHEN temp.fCnTrCount != 0 THEN temp.fAmount/temp.fCnTrCount 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	        ELSE 0 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	        END AS fUnitPrice, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	        IFNULL(temp.fAmount,0) AS fAmount 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            FROM 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                SELECT 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	            td.f_srcpid AS pId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	            IFNULL(SUM(tr.f_cntrcount),0) AS fCnTrCount, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	            IFNULL(SUM(tf.f_amount),0) AS fAmount 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                FROM 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	            t_fee_do td 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	            LEFT JOIN 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	            t_warehousebills tw ON tw.f_id = td.f_srcpid 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	            LEFT JOIN t_warehousebillsfees tf ON tf.f_id = td.f_srcid 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	            LEFT JOIN t_warehousebills_cntr tr ON tr.f_pid = tw.f_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	            WHERE td.f_pid = #{id} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	            GROUP BY td.f_srcpid 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            )temp 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            LEFT JOIN t_warehousebills tw ON tw.f_id = temp.pId 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            LEFT JOIN t_address ts ON tw.f_loadportid = ts.f_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            LEFT JOIN t_address ty ON tw.f_destportid = ty.f_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            LEFT JOIN t_warehousebills_cntr tc ON tc.f_pid = tw.f_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            LEFT JOIN t_cntr tr ON tr.f_id = tc.f_cntrid 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            LEFT JOIN t_goods tg ON tc.f_goodsid = tg.f_id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        )tp, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        (SELECT @rank:= 0) b 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    </select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 </mapper> 
			 |