|
|
@@ -656,6 +656,103 @@
|
|
|
GROUP BY acc.corp_id,acc.mblno,acc.hblno, acc.branch_id
|
|
|
ORDER BY acc.corp_id,acc.mblno,acc.hblno, acc.branch_id
|
|
|
</select>
|
|
|
+ <select id="feeSummaryDetailExportNotList"
|
|
|
+ resultType="org.springblade.los.statisticAnalysis.FeeSummaryDetailNotRD">
|
|
|
+ SELECT
|
|
|
+ acc.corp_id,acc.corp_cn_name corpName, acc.branch_id,
|
|
|
+ acc.business_bill_no billNo,
|
|
|
+ acc.vessel_en_name vesselName,
|
|
|
+ acc.voyage_no voyageNo,
|
|
|
+ acc.mblno mblNo,
|
|
|
+ acc.hblno hblNo,
|
|
|
+ acc.business_type businessType,
|
|
|
+ acc.business_date AS etd,
|
|
|
+ acc.pod_en_name pod,
|
|
|
+ acc.pol_en_name pol,
|
|
|
+ acc.quantity_cntr_descr quantityCntrDescr,
|
|
|
+ acc.branch_name as branchId,
|
|
|
+ SUM(( CASE acc.account_dc WHEN 'D' THEN (acc.amount_dr_usd-stl_amount_dr_usd) WHEN 'C' THEN (acc.amount_cr_usd-stl_amount_cr_usd) ELSE 0 END ) ) AS amountUsdNot,
|
|
|
+ SUM(( CASE acc.account_dc WHEN 'D' THEN (acc.amount_dr-acc.stl_amount_dr) WHEN 'C' THEN (acc.amount_cr-acc.stl_amount_cr) ELSE 0 END ) ) AS amountNot,
|
|
|
+ SUM(IF(uninvoiced_amount,uninvoiced_amount,0)) AS amountInvoicing,
|
|
|
+ SUM(IF(uninvoiced_amount_usd,uninvoiced_amount_usd,0)) AS amountInvoicingUsd,
|
|
|
+ SUM(acc.amount_dr-IF(uninvoiced_amount,uninvoiced_amount,0)) AS amountInvoicingNot,
|
|
|
+ SUM(acc.amount_dr_usd-IF(uninvoiced_amount_usd,uninvoiced_amount_usd,0)) AS amountInvoicingUsdNot,
|
|
|
+ acc.src_cn_name srcCnName,
|
|
|
+ acc.operator_name operatorName
|
|
|
+ FROM
|
|
|
+ los_fin_acc_bills acc
|
|
|
+ WHERE
|
|
|
+ acc.is_deleted = '0'
|
|
|
+ <if test='fee.dc != null and fee.dc != "" and fee.dc == "D"'>
|
|
|
+ and (acc.amount_dr_usd-stl_amount_dr_usd != 0 or acc.amount_dr-acc.stl_amount_dr != 0)
|
|
|
+ </if>
|
|
|
+ <if test='fee.dc != null and fee.dc != "" and fee.dc == "C"'>
|
|
|
+ and (acc.amount_cr_usd-stl_amount_cr_usd != 0 or acc.amount_cr-acc.stl_amount_cr != 0)
|
|
|
+ </if>
|
|
|
+ <if test='fee.tenantId != null and fee.tenantId != ""'>
|
|
|
+ and acc.tenant_id = #{fee.tenantId}
|
|
|
+ </if>
|
|
|
+ <if test="fee.billNo != null and fee.billNo != ''">
|
|
|
+ and acc.business_bill_no like concat('%', #{fee.billNo}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="fee.mblNo != null and fee.mblNo != ''">
|
|
|
+ and acc.mblno like concat('%', #{fee.mblNo}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="fee.hblNo != null and fee.hblNo != ''">
|
|
|
+ and acc.hblNo like concat('%', #{fee.hblNo}, '%')
|
|
|
+ </if>
|
|
|
+ <if test='fee.vesselId != null and fee.vesselId != ""'>
|
|
|
+ and acc.vessel_id = #{fee.vesselId}
|
|
|
+ </if>
|
|
|
+ <if test='fee.voyageNo != null and fee.voyageNo != ""'>
|
|
|
+ and acc.voyage_no = #{fee.voyageNo}
|
|
|
+ </if>
|
|
|
+ <if test='fee.branchId != null and fee.branchId != ""'>
|
|
|
+ and acc.branch_id = #{fee.branchId}
|
|
|
+ </if>
|
|
|
+ <if test='fee.billBranchId != null and fee.billBranchId != ""'>
|
|
|
+ and acc.bill_branch_id = #{fee.billBranchId}
|
|
|
+ </if>
|
|
|
+ <if test='fee.teamId != null and fee.teamId != ""'>
|
|
|
+ and acc.team_id = #{fee.teamId}
|
|
|
+ </if>
|
|
|
+ <if test='fee.dc != null and fee.dc != ""'>
|
|
|
+ and acc.account_dc = #{fee.dc}
|
|
|
+ </if>
|
|
|
+ <if test='fee.billType != null and fee.billType != ""'>
|
|
|
+ and find_in_set(acc.bill_type , #{fee.billType})
|
|
|
+ </if>
|
|
|
+ <if test='fee.businessType != null and fee.businessType != ""'>
|
|
|
+ and acc.business_type = #{fee.businessType}
|
|
|
+ </if>
|
|
|
+ <if test='fee.clientId != null'>
|
|
|
+ and acc.bill_corp_id = #{fee.clientId}
|
|
|
+ </if>
|
|
|
+ <if test='fee.corpId != null'>
|
|
|
+ and acc.corp_id = #{fee.corpId}
|
|
|
+ </if>
|
|
|
+ <if test='fee.srcId != null'>
|
|
|
+ and acc.src_id = #{fee.srcId}
|
|
|
+ </if>
|
|
|
+ <if test='fee.isBusinessDate != null and fee.isBusinessDate != "" and fee.isBusinessDate == "1"'>
|
|
|
+ <if test='fee.etdStart != null and fee.etdStart != ""'>
|
|
|
+ and acc.business_date >= #{fee.etdStart}
|
|
|
+ </if>
|
|
|
+ <if test='fee.etdEnd != null and fee.etdEnd != ""'>
|
|
|
+ and acc.business_date <= #{fee.etdEnd}
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test='fee.isToExamineDate != null and fee.isToExamineDate != "" and fee.isToExamineDate == "1"'>
|
|
|
+ <if test='fee.etdStart != null and fee.etdStart != ""'>
|
|
|
+ and acc.approved_date >= #{fee.etdStart}
|
|
|
+ </if>
|
|
|
+ <if test='fee.etdEnd != null and fee.etdEnd != ""'>
|
|
|
+ and acc.approved_date <= #{fee.etdEnd}
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ GROUP BY acc.corp_id,acc.mblno,acc.hblno, acc.branch_id
|
|
|
+ ORDER BY acc.corp_id,acc.mblno,acc.hblno
|
|
|
+ </select>
|
|
|
<select id="agingAnalysis" resultType="org.springblade.los.statisticAnalysis.AgingAnalysisRD">
|
|
|
SELECT
|
|
|
<choose>
|