|
|
@@ -398,7 +398,7 @@
|
|
|
</if>
|
|
|
<if test="acc.mblno != null and acc.mblno != ''">
|
|
|
<if test="acc.vagueM == null or acc.vagueM == ''">
|
|
|
- AND fee.mblno like CONCAT(CONCAT('%', #{acc.mblno}), '%')
|
|
|
+ AND find_in_set(fee.mblno,#{acc.mblno})
|
|
|
</if>
|
|
|
<if test="acc.vagueM != null and acc.vagueM != ''">
|
|
|
and find_in_set(fee.mblno,#{acc.mblno})
|
|
|
@@ -406,7 +406,7 @@
|
|
|
</if>
|
|
|
<if test="acc.hblno != null and acc.hblno != ''">
|
|
|
<if test="acc.vagueH == null or acc.vagueH == ''">
|
|
|
- AND fee.hblno like CONCAT(CONCAT('%', #{acc.hblno}), '%')
|
|
|
+ and find_in_set(fee.hblno,#{acc.hblno})
|
|
|
</if>
|
|
|
<if test="acc.vagueH != null and acc.vagueH != ''">
|
|
|
and find_in_set(fee.hblno,#{acc.hblno})
|
|
|
@@ -899,5 +899,209 @@
|
|
|
where is_deleted = '0'
|
|
|
and pid = #{billId}
|
|
|
</select>
|
|
|
+ <select id="listAccBillV2" resultType="org.springblade.los.finance.fee.vo.FinAccBillsVO">
|
|
|
+ SELECT
|
|
|
+ acc.*,
|
|
|
+ fee.business_type as businessType,
|
|
|
+ fee.bill_type as billType,
|
|
|
+ fee.id as sourceId,
|
|
|
+ fee.cur_code as curCode,
|
|
|
+ fee.account_year as accountYear,
|
|
|
+ fee.account_month as accountMonth,
|
|
|
+ fee.account_day as accountDay,
|
|
|
+ fee.src_type as srcType,
|
|
|
+ fee.src_id as srcId,
|
|
|
+ fee.src_cn_name as srcCnName,
|
|
|
+ fee.src_en_name as srcEnName,
|
|
|
+ fee.line_id as lineId,
|
|
|
+ fee.line_cn_name as lineCnName,
|
|
|
+ fee.line_en_name as lineEnName,
|
|
|
+ fee.cntr_no as cntrNo,
|
|
|
+ SUM(fee.quantity) as quantity,
|
|
|
+ fee.unit_no as unitNo,
|
|
|
+ SUM(fee.price) as price,
|
|
|
+ fee.fee_id as feeId,
|
|
|
+ fee.fee_code as feeCode,
|
|
|
+ fee.fee_cn_name as feeCnName,
|
|
|
+ fee.fee_en_name as feeEnName,
|
|
|
+ fee.exrate as exrate,
|
|
|
+ fee.is_tax as isTax,
|
|
|
+ fee.tax_type as taxType,
|
|
|
+ fee.tax_rate as taxRate,
|
|
|
+ fee.surcharge_rate as surchargeRate,
|
|
|
+ SUM(fee.amount_discount) as amountDiscount,
|
|
|
+ SUM(fee.amount_net) as amountNet,
|
|
|
+ SUM(fee.amount_tax) as amountTax,
|
|
|
+ SUM(fee.amount) as amount,
|
|
|
+ SUM(fee.amount_tax_loc) as amountTaxLoc,
|
|
|
+ SUM(fee.amount_net_loc) as amountNetLoc,
|
|
|
+ SUM(fee.amount_discount_loc) as amountDiscountLoc,
|
|
|
+ SUM(fee.amount_loc) as amountLoc,
|
|
|
+ SUM(fee.stl_ttl_amount) as stlTtlAmount,
|
|
|
+ SUM(fee.invoice_amount_loc) as invoiceAmountLoc,
|
|
|
+ IF
|
|
|
+ ( sum( fee.uninvoiced_amount ), sum( fee.uninvoiced_amount ), 0.00 ) AS uninvoicedAmount,
|
|
|
+ IF
|
|
|
+ ( sum( fee.unsettled_amount ), sum( fee.unsettled_amount ), 0.00 ) AS unsettledAmount,
|
|
|
+ IF
|
|
|
+ ( sum( fee.applied_amount ), sum( fee.applied_amount ), 0.00 ) AS appliedAmount,
|
|
|
+ IF
|
|
|
+ ( sum( fee.applied_amount_stl ), sum( fee.applied_amount_stl ), 0.00 ) AS appliedAmountStl,
|
|
|
+ IF
|
|
|
+ ( sum( fee.reconciliation_amount ), sum( fee.reconciliation_amount ), 0.00 ) AS reconciliationAmount,
|
|
|
+ IF
|
|
|
+ ( sum( fee.applied_invoice_amount ), sum( fee.applied_invoice_amount ), 0.00 ) AS appliedInvoiceAmount,
|
|
|
+ IF
|
|
|
+ ( sum( fee.applied_invoice_amount_stl ), sum( fee.applied_invoice_amount_stl ), 0.00 ) AS
|
|
|
+ appliedInvoiceAmountStl,
|
|
|
+ fee.is_signfor as isSignfor,
|
|
|
+ fee.signfor_id as signforId,
|
|
|
+ fee.signfor_name as signforName,
|
|
|
+ fee.signfor_date as signforDate,
|
|
|
+ acc.quantity_cntr_descr as quantityCntrDescr,
|
|
|
+ corp.account_period_type as accountPeriodType
|
|
|
+ FROM
|
|
|
+ los_fee_center fee
|
|
|
+ LEFT JOIN los_b_corps corp ON corp.id = fee.corp_id
|
|
|
+ LEFT JOIN los_fin_acc_bills acc ON acc.id = fee.acc_bill_id
|
|
|
+ WHERE
|
|
|
+ acc.is_deleted = '0'
|
|
|
+ AND fee.is_deleted = '0'
|
|
|
+ <if test='acc.branchId != null and acc.branchId != ""'>
|
|
|
+ and acc.branch_id = #{acc.branchId}
|
|
|
+ </if>
|
|
|
+ <if test='acc.type != null and acc.type != "" and acc.type == "1"'>
|
|
|
+ <if test='acc.isChecked != null and acc.isChecked == "0"'>
|
|
|
+ and acc.is_checked in (0,1,2)
|
|
|
+ </if>
|
|
|
+ <if test='acc.isChecked != null and acc.isChecked == "1"'>
|
|
|
+ and acc.is_checked in (0,1)
|
|
|
+ </if>
|
|
|
+ <if test='acc.isChecked != null and acc.isChecked == "2"'>
|
|
|
+ and acc.is_checked = 0
|
|
|
+ </if>
|
|
|
+ <if test='acc.isChecked != null and acc.isChecked == "3"'>
|
|
|
+ and acc.is_checked = 1
|
|
|
+ </if>
|
|
|
+ <if test='acc.isChecked != null and acc.isChecked == "4"'>
|
|
|
+ and acc.is_checked = 2
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test='acc.type != null and acc.type != "" and acc.type == "4"'>
|
|
|
+ and acc.invoice_status != 3
|
|
|
+ </if>
|
|
|
+ <if test='acc.type != null and acc.type != "" and acc.type == "5"'>
|
|
|
+ and fee.voucher_status = '0'
|
|
|
+ </if>
|
|
|
+ <if test="acc.dc != null and acc.dc != ''">
|
|
|
+ and fee.dc = #{acc.dc}
|
|
|
+ </if>
|
|
|
+ <if test="acc.auditStatus != null and acc.auditStatus !=''">
|
|
|
+ and fee.audit_status = #{acc.auditStatus}
|
|
|
+ </if>
|
|
|
+ <if test="acc.corpCnName != null and acc.corpCnName != ''">
|
|
|
+ and fee.corp_id = #{acc.corpCnName}
|
|
|
+ </if>
|
|
|
+ <if test="acc.isSignfor != null">
|
|
|
+ and fee.is_signfor = #{acc.isSignfor}
|
|
|
+ </if>
|
|
|
+ <if test="acc.curCode != null and acc.curCode != ''">
|
|
|
+ and fee.cur_code = #{acc.curCode}
|
|
|
+ </if>
|
|
|
+ <if test="acc.srcType != null and acc.srcType != ''">
|
|
|
+ and fee.src_type = #{acc.srcType}
|
|
|
+ </if>
|
|
|
+ <if test="acc.srcCnName != null and acc.srcCnName != ''">
|
|
|
+ and fee.src_id = #{acc.srcCnName}
|
|
|
+ </if>
|
|
|
+ <if test="acc.isCleared != null">
|
|
|
+ and acc.is_cleared = #{acc.isCleared}
|
|
|
+ </if>
|
|
|
+ <if test="acc.feeCnName != null and acc.feeCnName != ''">
|
|
|
+ and find_in_set (fee.fee_cn_name,#{acc.feeCnName})
|
|
|
+ </if>
|
|
|
+ <if test="acc.billNo != null and acc.billNo != ''">
|
|
|
+ and find_in_set(fee.bill_no,#{acc.billNo})
|
|
|
+ </if>
|
|
|
+ <if test="acc.accBillNo != null and acc.accBillNo != ''">
|
|
|
+ and find_in_set(fee.acc_bill_no,#{acc.accBillNo})
|
|
|
+ </if>
|
|
|
+ <if test="acc.mblno != null and acc.mblno != ''">
|
|
|
+ <if test="acc.vagueM == null or acc.vagueM == ''">
|
|
|
+ AND find_in_set(fee.mblno,#{acc.mblno})
|
|
|
+ </if>
|
|
|
+ <if test="acc.vagueM != null and acc.vagueM != ''">
|
|
|
+ and find_in_set(fee.mblno,#{acc.mblno})
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="acc.hblno != null and acc.hblno != ''">
|
|
|
+ <if test="acc.vagueH == null or acc.vagueH == ''">
|
|
|
+ and find_in_set(fee.hblno,#{acc.hblno})
|
|
|
+ </if>
|
|
|
+ <if test="acc.vagueH != null and acc.vagueH != ''">
|
|
|
+ and find_in_set(fee.hblno,#{acc.hblno})
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="acc.billDateStart != null and acc.billDateStart != ''">
|
|
|
+ and DATE_FORMAT(acc.bill_date,'%Y-%m-%d') >= DATE_FORMAT(#{acc.billDateStart},'%Y-%m-%d')
|
|
|
+ </if>
|
|
|
+ <if test="acc.billDateEnd != null and acc.billDateEnd != ''">
|
|
|
+ and DATE_FORMAT(acc.bill_date,'%Y-%m-%d') <= DATE_FORMAT(#{acc.billDateEnd},'%Y-%m-%d')
|
|
|
+ </if>
|
|
|
+ <if test="acc.businessDateStart != null and acc.businessDateStart != ''">
|
|
|
+ and DATE_FORMAT(acc.business_date,'%Y-%m-%d') >= DATE_FORMAT(#{acc.businessDateStart},'%Y-%m-%d')
|
|
|
+ </if>
|
|
|
+ <if test="acc.businessDateEnd != null and acc.businessDateEnd != ''">
|
|
|
+ and DATE_FORMAT(acc.business_date,'%Y-%m-%d') <= DATE_FORMAT(#{acc.businessDateEnd},'%Y-%m-%d')
|
|
|
+ </if>
|
|
|
+ <if test="acc.approveTimeStart != null and acc.approveTimeStart != ''">
|
|
|
+ and fee.approve_time >= #{acc.approveTimeStart}
|
|
|
+ </if>
|
|
|
+ <if test="acc.approveTimeEnd != null and acc.approveTimeEnd != ''">
|
|
|
+ and fee.approve_time <= #{acc.approveTimeEnd}
|
|
|
+ </if>
|
|
|
+ <if test="acc.signforDateStart != null and acc.signforDateStart != '' ">
|
|
|
+ and fee.signfor_date >= #{acc.signforDateStart}
|
|
|
+ </if>
|
|
|
+ <if test="acc.signforDateEnd != null and acc.signforDateEnd != '' ">
|
|
|
+ and fee.signfor_date <= #{acc.signforDateEnd}
|
|
|
+ </if>
|
|
|
+ <if test="acc.queryAmount != null and acc.queryAmount != ''">
|
|
|
+ and (acc.amount_dr_loc = #{acc.queryAmount} or acc.amount_cr_loc = #{acc.queryAmount})
|
|
|
+ </if>
|
|
|
+ <if test="acc.businessType != null and acc.businessType != ''">
|
|
|
+ and find_in_set(fee.business_type,#{acc.businessType})
|
|
|
+ </if>
|
|
|
+ <if test="acc.invoiceStatus != null">
|
|
|
+ and fee.invoice_status = #{acc.invoiceStatus}
|
|
|
+ </if>
|
|
|
+ <if test="acc.vesselCnName != null and acc.vesselCnName != ''">
|
|
|
+ and ( acc.vessel_cn_name like concat('%', #{acc.vesselCnName}, '%') or acc.vessel_en_name like concat('%',
|
|
|
+ #{acc.vesselCnName}, '%') )
|
|
|
+ </if>
|
|
|
+ <if test="acc.voyageNo != null and acc.voyageNo != ''">
|
|
|
+ and acc.voyage_no like concat('%', #{acc.voyageNo}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="acc.checkBillNo != null and acc.checkBillNo != ''">
|
|
|
+ and fee.check_bill_no like concat('%', #{acc.checkBillNo}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="acc.threeInspectionsNo != null and acc.threeInspectionsNo != ''">
|
|
|
+ and acc.three_inspections_no like concat('%', #{acc.threeInspectionsNo}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="acc.receivableAdvance != null">
|
|
|
+ and (acc.amount_dr_loc = #{acc.receivableAdvance} or acc.amount_cr_loc = #{acc.receivableAdvance})
|
|
|
+ </if>
|
|
|
+ <if test="acc.invoiceNo != null and acc.invoiceNo != ''">
|
|
|
+ and fee.invoice_no like concat('%', #{acc.invoiceNo}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="acc.createUserName != null and acc.createUserName != ''">
|
|
|
+ and acc.create_user = #{acc.createUserName}
|
|
|
+ </if>
|
|
|
+ <if test="acc.bookingNo != null and acc.bookingNo != ''">
|
|
|
+ and acc.booking_no like concat('%', #{acc.bookingNo}, '%')
|
|
|
+ </if>
|
|
|
+ GROUP BY acc.branch_id, acc.corp_id,acc.business_bill_id,acc.amount_dr,fee.cur_code,acc.mblno,acc.hblno
|
|
|
+ ORDER BY acc.create_time
|
|
|
+ </select>
|
|
|
|
|
|
</mapper>
|