|
|
@@ -9,8 +9,8 @@
|
|
|
<result column="Companyid" property="companyid"/>
|
|
|
<result column="parent_Companyid" property="parentCompanyid"/>
|
|
|
<result column="AccTypeID" property="acctypeid"/>
|
|
|
- <result column="AccDate" property="accdate"/>
|
|
|
- <result column="AccSysNo" property="accsysno"/>
|
|
|
+ <result column="AccDate" property="accDate"/>
|
|
|
+ <result column="AccSysNo" property="accSysNo"/>
|
|
|
<result column="Bill_type" property="billType"/>
|
|
|
<result column="TableName" property="tablename"/>
|
|
|
<result column="Src_SysNo" property="srcSysno"/>
|
|
|
@@ -20,7 +20,7 @@
|
|
|
<result column="Src_refno" property="srcRefno"/>
|
|
|
<result column="Src_Bill_NO" property="srcBillNo"/>
|
|
|
<result column="DC" property="dc"/>
|
|
|
- <result column="Corpid" property="corpid"/>
|
|
|
+ <result column="Corpid" property="corpId"/>
|
|
|
<result column="quantity" property="quantity"/>
|
|
|
<result column="Unit" property="unit"/>
|
|
|
<result column="Price" property="price"/>
|
|
|
@@ -47,69 +47,75 @@
|
|
|
|
|
|
|
|
|
<update id="updateByOrderId" parameterType="Long">
|
|
|
- UPDATE finance_acc set status = 0 WHERE Src_parent_id = #{orderId}
|
|
|
+ UPDATE finance_acc
|
|
|
+ set status = 0
|
|
|
+ WHERE Src_parent_id = #{orderId}
|
|
|
</update>
|
|
|
<delete id="deleteBySrcFeesId">
|
|
|
- delete from finance_acc where Src_fees_id = #{feesId}
|
|
|
+ delete
|
|
|
+ from finance_acc
|
|
|
+ where Src_fees_id = #{feesId}
|
|
|
</delete>
|
|
|
<delete id="deleteBySrcId">
|
|
|
- delete from finance_acc where Src_id = #{srcId}
|
|
|
+ delete
|
|
|
+ from finance_acc
|
|
|
+ where Src_id = #{srcId}
|
|
|
</delete>
|
|
|
|
|
|
<select id="selBillBalance" resultType="org.springblade.finance.vojo.Acc">
|
|
|
SELECT
|
|
|
- FC.Corpid AS corpId,
|
|
|
- BCD.cname AS corpName,
|
|
|
- IFNULL( BC.amount, 0 ) AS amount,
|
|
|
- IFNULL( FS.settlementAmount, 0 ) AS settlementAmount,
|
|
|
- IFNULL( IFNULL( BC.amount, 0 ) - IFNULL( FS.settlementAmount, 0 ), 0 ) AS balance,
|
|
|
- IFNULL( BO.in_overpayment, 0 ) AS inOverpayment
|
|
|
+ FC.Corpid AS corpId,
|
|
|
+ BCD.cname AS corpName,
|
|
|
+ IFNULL( BC.amount, 0 ) AS amount,
|
|
|
+ IFNULL( FS.settlementAmount, 0 ) AS settlementAmount,
|
|
|
+ IFNULL( IFNULL( BC.amount, 0 ) - IFNULL( FS.settlementAmount, 0 ), 0 ) AS balance,
|
|
|
+ IFNULL( BO.in_overpayment, 0 ) AS inOverpayment
|
|
|
FROM finance_acc FC
|
|
|
LEFT JOIN basic_corps_desc BCD ON BCD.id = FC.Corpid
|
|
|
LEFT JOIN business_overpayment BO ON BO.corp_id = FC.Corpid
|
|
|
LEFT JOIN (
|
|
|
- SELECT
|
|
|
- FC.Corpid AS corpId,
|
|
|
- SUM( FC.Amount ) AS amount
|
|
|
- FROM finance_acc FC
|
|
|
- <where>
|
|
|
- FC.tenant_id = #{acc.tenantId}
|
|
|
- and FC.is_deleted = 0
|
|
|
- and FC.bill_type = #{acc.billType}
|
|
|
- <if test='acc.createDateList != null and acc.createDateList[0] != null and acc.createDateList[0]!= ""'>
|
|
|
- and FC.create_time >= #{acc.createDateList[0]}
|
|
|
- </if>
|
|
|
- <if test='acc.createDateList != null and acc.createDateList[1] != null and acc.createDateList[1]!= ""'>
|
|
|
- and FC.create_time <= #{acc.createDateList[1]}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- GROUP BY
|
|
|
- FC.Corpid
|
|
|
+ SELECT
|
|
|
+ FC.Corpid AS corpId,
|
|
|
+ SUM( FC.Amount ) AS amount
|
|
|
+ FROM finance_acc FC
|
|
|
+ <where>
|
|
|
+ FC.tenant_id = #{acc.tenantId}
|
|
|
+ and FC.is_deleted = 0
|
|
|
+ and FC.bill_type = #{acc.billType}
|
|
|
+ <if test='acc.createDateList != null and acc.createDateList[0] != null and acc.createDateList[0]!= ""'>
|
|
|
+ and FC.create_time >= #{acc.createDateList[0]}
|
|
|
+ </if>
|
|
|
+ <if test='acc.createDateList != null and acc.createDateList[1] != null and acc.createDateList[1]!= ""'>
|
|
|
+ and FC.create_time <= #{acc.createDateList[1]}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ GROUP BY
|
|
|
+ FC.Corpid
|
|
|
) BC ON BC.corpId = FC.Corpid
|
|
|
LEFT JOIN (
|
|
|
- SELECT
|
|
|
- FS.Corp_id AS corpId,
|
|
|
- sum( FS.Amount ) AS settlementAmount
|
|
|
- FROM finance_settlement FS
|
|
|
- <where>
|
|
|
- FS.tenant_id = #{acc.tenantId}
|
|
|
- AND FS.is_deleted = 0
|
|
|
- AND FS.finance_status = '结算完成'
|
|
|
- <if test='acc.billType != null and acc.billType != "" and acc.billType == "申请"'>
|
|
|
- AND FS.bill_type = '付费'
|
|
|
- </if>
|
|
|
- <if test='acc.billType != null and acc.billType != "" and acc.billType == "收费"'>
|
|
|
- AND FS.bill_type = #{acc.billType}
|
|
|
- </if>
|
|
|
- <if test='acc.createDateList != null and acc.createDateList[0] != null and acc.createDateList[0]!= ""'>
|
|
|
- and FS.completion_time >= #{acc.createDateList[0]}
|
|
|
- </if>
|
|
|
- <if test='acc.createDateList != null and acc.createDateList[1] != null and acc.createDateList[1]!= ""'>
|
|
|
- and FS.completion_time <= #{acc.createDateList[1]}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- GROUP BY
|
|
|
- FS.Corp_id
|
|
|
+ SELECT
|
|
|
+ FS.Corp_id AS corpId,
|
|
|
+ sum( FS.Amount ) AS settlementAmount
|
|
|
+ FROM finance_settlement FS
|
|
|
+ <where>
|
|
|
+ FS.tenant_id = #{acc.tenantId}
|
|
|
+ AND FS.is_deleted = 0
|
|
|
+ AND FS.finance_status = '结算完成'
|
|
|
+ <if test='acc.billType != null and acc.billType != "" and acc.billType == "申请"'>
|
|
|
+ AND FS.bill_type = '付费'
|
|
|
+ </if>
|
|
|
+ <if test='acc.billType != null and acc.billType != "" and acc.billType == "收费"'>
|
|
|
+ AND FS.bill_type = #{acc.billType}
|
|
|
+ </if>
|
|
|
+ <if test='acc.createDateList != null and acc.createDateList[0] != null and acc.createDateList[0]!= ""'>
|
|
|
+ and FS.completion_time >= #{acc.createDateList[0]}
|
|
|
+ </if>
|
|
|
+ <if test='acc.createDateList != null and acc.createDateList[1] != null and acc.createDateList[1]!= ""'>
|
|
|
+ and FS.completion_time <= #{acc.createDateList[1]}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ GROUP BY
|
|
|
+ FS.Corp_id
|
|
|
) FS ON FS.corpId = FC.Corpid
|
|
|
<where>
|
|
|
FC.tenant_id = #{acc.tenantId}
|
|
|
@@ -125,9 +131,9 @@
|
|
|
|
|
|
<select id="SelChargeItem" resultType="org.springblade.finance.vojo.Acc">
|
|
|
SELECT
|
|
|
- FA.AccSysNo AS accSysNo,
|
|
|
- FA.quantity AS quantity,
|
|
|
- FA.Amount AS amount
|
|
|
+ FA.AccSysNo AS accSysNo,
|
|
|
+ FA.quantity AS quantity,
|
|
|
+ FA.Amount AS amount
|
|
|
FROM finance_acc FA
|
|
|
<where>
|
|
|
FA.tenant_id = #{acc.tenantId}
|
|
|
@@ -153,15 +159,15 @@
|
|
|
|
|
|
<select id="SelPayItem" resultType="org.springblade.finance.vojo.Acc">
|
|
|
SELECT
|
|
|
- FI.src_orderNo AS accSysNo,
|
|
|
- FI.quantity AS quantity,
|
|
|
- FI.this_amount AS amount,
|
|
|
- FS.subject_number AS subjectNumber,
|
|
|
- FS.ACCOUNT_bank AS accountBank,
|
|
|
- FS.ACCOUNT_NAME AS accountName,
|
|
|
- FS.ACCOUNT_no AS accountNo,
|
|
|
- FS.over_payment AS overPayment,
|
|
|
- FS.case_over_payment AS caseOverPayment
|
|
|
+ FI.src_orderNo AS accSysNo,
|
|
|
+ FI.quantity AS quantity,
|
|
|
+ FI.this_amount AS amount,
|
|
|
+ FS.subject_number AS subjectNumber,
|
|
|
+ FS.ACCOUNT_bank AS accountBank,
|
|
|
+ FS.ACCOUNT_NAME AS accountName,
|
|
|
+ FS.ACCOUNT_no AS accountNo,
|
|
|
+ FS.over_payment AS overPayment,
|
|
|
+ FS.case_over_payment AS caseOverPayment
|
|
|
FROM finance_settlement FS
|
|
|
LEFT JOIN finance_items FI ON FI.pid = FS.id
|
|
|
<where>
|
|
|
@@ -195,10 +201,12 @@
|
|
|
|
|
|
<select id="SumBillBalance" resultType="java.util.Map">
|
|
|
SELECT
|
|
|
- IFNULL( ROUND( SUM(CASE WHEN bill_type = '收费' THEN Amount - Settlement_Amount ELSE 0 END) / 10000, 2), 0) AS ysAmount,
|
|
|
- IFNULL( ROUND( SUM(CASE WHEN bill_type = '申请' THEN Amount - Settlement_Amount ELSE 0 END) / 10000, 2), 0) AS yfAmount
|
|
|
+ IFNULL( ROUND( SUM(CASE WHEN bill_type = '收费' THEN Amount - Settlement_Amount ELSE 0 END) / 10000, 2), 0) AS
|
|
|
+ ysAmount,
|
|
|
+ IFNULL( ROUND( SUM(CASE WHEN bill_type = '申请' THEN Amount - Settlement_Amount ELSE 0 END) / 10000, 2), 0) AS
|
|
|
+ yfAmount
|
|
|
FROM
|
|
|
- finance_acc
|
|
|
+ finance_acc
|
|
|
<where>
|
|
|
is_deleted = 0
|
|
|
and tenant_id = #{acc.tenantId}
|
|
|
@@ -206,20 +214,22 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="selectAccPage" resultMap="accResultMap">
|
|
|
- select * from finance_acc where is_deleted = 0
|
|
|
+ select *
|
|
|
+ from finance_acc
|
|
|
+ where is_deleted = 0
|
|
|
</select>
|
|
|
<select id="salaryMessage" resultType="org.springblade.finance.vo.CostMessage">
|
|
|
SELECT
|
|
|
- Corpid AS corpId,
|
|
|
- create_time AS accDate,
|
|
|
- IFNULL( SUM( Amount ), 0 ) AS amount,
|
|
|
- IFNULL( SUM( Settlement_Amount ), 0 ) AS settlementAmount,
|
|
|
- IFNULL( SUM( Amount ), 0 )- IFNULL( SUM( Settlement_Amount ), 0 ) AS outstandingAmount,
|
|
|
- IFNULL( SUM( Invoice_Amount ), 0 ) AS invoiceAmount
|
|
|
- FROM
|
|
|
- finance_acc
|
|
|
- WHERE
|
|
|
- is_deleted = 0
|
|
|
+ Corpid AS corpId,
|
|
|
+ create_time AS accDate,
|
|
|
+ IFNULL( SUM( Amount ), 0 ) AS amount,
|
|
|
+ IFNULL( SUM( Settlement_Amount ), 0 ) AS settlementAmount,
|
|
|
+ IFNULL( SUM( Amount ), 0 )- IFNULL( SUM( Settlement_Amount ), 0 ) AS outstandingAmount,
|
|
|
+ IFNULL( SUM( Invoice_Amount ), 0 ) AS invoiceAmount
|
|
|
+ FROM
|
|
|
+ finance_acc
|
|
|
+ WHERE
|
|
|
+ is_deleted = 0
|
|
|
AND ( Corpid IS NOT NULL OR Corpid = '' )
|
|
|
<if test="acc.tenantId!=null and acc.tenantId != ''">
|
|
|
AND tenant_id = #{acc.tenantId}
|
|
|
@@ -245,28 +255,28 @@
|
|
|
<if test="acc.corpId!=null">
|
|
|
AND Corpid = #{acc.corpId}
|
|
|
</if>
|
|
|
- GROUP BY
|
|
|
- Corpid
|
|
|
+ GROUP BY
|
|
|
+ Corpid
|
|
|
</select>
|
|
|
<select id="salaryProfit" resultType="org.springblade.finance.vo.CostMessage">
|
|
|
SELECT
|
|
|
- c.corpId AS corpId,
|
|
|
- d.accDate AS accDate,
|
|
|
- IFNULL( d.amount, 0 ) AS amount,
|
|
|
- IFNULL( c.amount, 0 ) AS handleAmount,
|
|
|
- IFNULL( d.amount, 0 ) - IFNULL( c.amount, 0 ) AS profitAmount
|
|
|
-FROM
|
|
|
- (
|
|
|
- SELECT
|
|
|
- Corpid AS corpId,
|
|
|
- create_time AS accDate,
|
|
|
- IFNULL( SUM( Amount ), 0 ) AS amount
|
|
|
- FROM
|
|
|
- finance_acc
|
|
|
- WHERE
|
|
|
- is_deleted = 0
|
|
|
- AND DC = 'c'
|
|
|
- AND ( Corpid IS NOT NULL OR Corpid = '' )
|
|
|
+ c.corpId AS corpId,
|
|
|
+ d.accDate AS accDate,
|
|
|
+ IFNULL( d.amount, 0 ) AS amount,
|
|
|
+ IFNULL( c.amount, 0 ) AS handleAmount,
|
|
|
+ IFNULL( d.amount, 0 ) - IFNULL( c.amount, 0 ) AS profitAmount
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ Corpid AS corpId,
|
|
|
+ create_time AS accDate,
|
|
|
+ IFNULL( SUM( Amount ), 0 ) AS amount
|
|
|
+ FROM
|
|
|
+ finance_acc
|
|
|
+ WHERE
|
|
|
+ is_deleted = 0
|
|
|
+ AND DC = 'c'
|
|
|
+ AND ( Corpid IS NOT NULL OR Corpid = '' )
|
|
|
<if test="acc.tenantId!=null and acc.tenantId != ''">
|
|
|
AND tenant_id = #{acc.tenantId}
|
|
|
</if>
|
|
|
@@ -285,20 +295,20 @@ FROM
|
|
|
<if test="acc.corpId!=null">
|
|
|
AND Corpid = #{acc.corpId}
|
|
|
</if>
|
|
|
- GROUP BY
|
|
|
- Corpid
|
|
|
- ) c
|
|
|
- LEFT JOIN (
|
|
|
- SELECT
|
|
|
- Corpid AS corpId,
|
|
|
- create_time AS accDate,
|
|
|
- IFNULL( SUM( Amount ), 0 ) AS amount
|
|
|
- FROM
|
|
|
- finance_acc
|
|
|
- WHERE
|
|
|
- is_deleted = 0
|
|
|
- AND DC = 'd'
|
|
|
- AND ( Corpid IS NOT NULL OR Corpid = '' )
|
|
|
+ GROUP BY
|
|
|
+ Corpid
|
|
|
+ ) c
|
|
|
+ LEFT JOIN (
|
|
|
+ SELECT
|
|
|
+ Corpid AS corpId,
|
|
|
+ create_time AS accDate,
|
|
|
+ IFNULL( SUM( Amount ), 0 ) AS amount
|
|
|
+ FROM
|
|
|
+ finance_acc
|
|
|
+ WHERE
|
|
|
+ is_deleted = 0
|
|
|
+ AND DC = 'd'
|
|
|
+ AND ( Corpid IS NOT NULL OR Corpid = '' )
|
|
|
<if test="acc.tenantId!=null and acc.tenantId != ''">
|
|
|
AND tenant_id = #{acc.tenantId}
|
|
|
</if>
|
|
|
@@ -317,27 +327,27 @@ FROM
|
|
|
<if test="acc.corpId!=null">
|
|
|
AND Corpid = #{acc.corpId}
|
|
|
</if>
|
|
|
- GROUP BY
|
|
|
- Corpid
|
|
|
- ) d ON d.corpId = c.corpId UNION ALL
|
|
|
-SELECT
|
|
|
- d.corpId AS corpId,
|
|
|
- d.accDate AS accDate,
|
|
|
- IFNULL( d.amount, 0 ) AS amount,
|
|
|
- IFNULL( c.amount, 0 ) AS handleAmount,
|
|
|
- IFNULL( d.amount, 0 ) - IFNULL( c.amount, 0 ) AS profitAmount
|
|
|
-FROM
|
|
|
- (
|
|
|
- SELECT
|
|
|
- Corpid AS corpId,
|
|
|
- create_time AS accDate,
|
|
|
- IFNULL( SUM( Amount ), 0 ) AS amount
|
|
|
- FROM
|
|
|
- finance_acc
|
|
|
- WHERE
|
|
|
- is_deleted = 0
|
|
|
- AND DC = 'd'
|
|
|
- AND ( Corpid IS NOT NULL OR Corpid = '' )
|
|
|
+ GROUP BY
|
|
|
+ Corpid
|
|
|
+ ) d ON d.corpId = c.corpId UNION ALL
|
|
|
+ SELECT
|
|
|
+ d.corpId AS corpId,
|
|
|
+ d.accDate AS accDate,
|
|
|
+ IFNULL( d.amount, 0 ) AS amount,
|
|
|
+ IFNULL( c.amount, 0 ) AS handleAmount,
|
|
|
+ IFNULL( d.amount, 0 ) - IFNULL( c.amount, 0 ) AS profitAmount
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ Corpid AS corpId,
|
|
|
+ create_time AS accDate,
|
|
|
+ IFNULL( SUM( Amount ), 0 ) AS amount
|
|
|
+ FROM
|
|
|
+ finance_acc
|
|
|
+ WHERE
|
|
|
+ is_deleted = 0
|
|
|
+ AND DC = 'd'
|
|
|
+ AND ( Corpid IS NOT NULL OR Corpid = '' )
|
|
|
<if test="acc.tenantId!=null and acc.tenantId != ''">
|
|
|
AND tenant_id = #{acc.tenantId}
|
|
|
</if>
|
|
|
@@ -356,20 +366,20 @@ FROM
|
|
|
<if test="acc.corpId!=null">
|
|
|
AND Corpid = #{acc.corpId}
|
|
|
</if>
|
|
|
- GROUP BY
|
|
|
- Corpid
|
|
|
- ) d
|
|
|
- LEFT JOIN (
|
|
|
- SELECT
|
|
|
- Corpid AS corpId,
|
|
|
- create_time AS accDate,
|
|
|
- IFNULL( SUM( Amount ), 0 ) AS amount
|
|
|
- FROM
|
|
|
- finance_acc
|
|
|
- WHERE
|
|
|
- is_deleted = 0
|
|
|
- AND DC = 'c'
|
|
|
- AND ( Corpid IS NOT NULL OR Corpid = '' )
|
|
|
+ GROUP BY
|
|
|
+ Corpid
|
|
|
+ ) d
|
|
|
+ LEFT JOIN (
|
|
|
+ SELECT
|
|
|
+ Corpid AS corpId,
|
|
|
+ create_time AS accDate,
|
|
|
+ IFNULL( SUM( Amount ), 0 ) AS amount
|
|
|
+ FROM
|
|
|
+ finance_acc
|
|
|
+ WHERE
|
|
|
+ is_deleted = 0
|
|
|
+ AND DC = 'c'
|
|
|
+ AND ( Corpid IS NOT NULL OR Corpid = '' )
|
|
|
<if test="acc.tenantId!=null and acc.tenantId != ''">
|
|
|
AND tenant_id = #{acc.tenantId}
|
|
|
</if>
|
|
|
@@ -388,9 +398,9 @@ FROM
|
|
|
<if test="acc.corpId!=null">
|
|
|
AND Corpid = #{acc.corpId}
|
|
|
</if>
|
|
|
- GROUP BY
|
|
|
- Corpid
|
|
|
- ) c ON d.corpId = c.corpId
|
|
|
+ GROUP BY
|
|
|
+ Corpid
|
|
|
+ ) c ON d.corpId = c.corpId
|
|
|
</select>
|
|
|
|
|
|
<select id="selectlastIssueAmount" resultType="java.util.Map">
|
|
|
@@ -416,9 +426,116 @@ FROM
|
|
|
<select id="selectListCorpId" resultType="java.lang.Long">
|
|
|
SELECT Corpid
|
|
|
FROM finance_acc
|
|
|
- WHERE
|
|
|
- is_deleted = 0 and tenant_id = #{tenantId}
|
|
|
+ WHERE is_deleted = 0
|
|
|
+ and tenant_id = #{tenantId}
|
|
|
GROUP BY Corpid
|
|
|
</select>
|
|
|
+ <select id="whetherStatistics" resultMap="accResultMap">
|
|
|
+ select
|
|
|
+ AccSysNo ,
|
|
|
+ Bill_type ,
|
|
|
+ Src_refno ,
|
|
|
+ Src_Bill_NO ,
|
|
|
+ Corpid ,
|
|
|
+ sum( IFNULL( quantity, 0 ) ) AS quantity,
|
|
|
+ sum( IFNULL( Amount, 0 ) ) AS Amount,
|
|
|
+ sum( IFNULL( Invoice_Amount, 0 ) ) AS Invoice_Amount,
|
|
|
+ sum( IFNULL( Settlement_Amount, 0 ) ) AS Settlement_Amount,
|
|
|
+ sum( IFNULL( Apply_Amount, 0 ) ) AS Apply_Amount,
|
|
|
+ sum( IFNULL( Check_Amount, 0 ) ) AS Check_Amount
|
|
|
+ from finance_acc
|
|
|
+ where is_deleted = 0
|
|
|
+ and status = 0
|
|
|
+ <if test="acc.srcParentId != null">
|
|
|
+ <if test="acc.flag != null and acc.flag == 1">
|
|
|
+ AND Amount >= Settlement_Amount
|
|
|
+ </if>
|
|
|
+ <if test="acc.flag != null and acc.flag == 2">
|
|
|
+ AND Amount >= Invoice_Amount
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="acc.corpId !=null">
|
|
|
+ <if test="acc.flag != null and acc.flag == 1">
|
|
|
+ AND Amount >= Settlement_Amount
|
|
|
+ </if>
|
|
|
+ <if test="acc.flag != null and acc.flag == 2">
|
|
|
+ AND Amount >= Invoice_Amount
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="acc.srcParentId == null and acc.corpId == null">
|
|
|
+ <if test="acc.flag != null and acc.flag == 1">
|
|
|
+ AND Amount >= Settlement_Amount
|
|
|
+ </if>
|
|
|
+ <if test="acc.flag != null and acc.flag == 2">
|
|
|
+ AND Amount >= Invoice_Amount
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="acc.createStartDate != null and acc.createEndDate != null">
|
|
|
+ AND between (create_time,#{acc.createStartDate} and #{acc.createEndDate})
|
|
|
+ </if>
|
|
|
+ <if test="acc.billType!=null and acc.billType != ''">
|
|
|
+ AND Bill_type like concat(concat('%', #{acc.billType}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="acc.accSysNo !=null and acc.accSysNo != ''">
|
|
|
+ AND AccSysNo like concat(concat('%', #{acc.accSysNo}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="acc.srcBillNo !=null and acc.srcBillNo != ''">
|
|
|
+ AND Src_Bill_NO like concat(concat('%', #{acc.srcBillNo}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="acc.corpId !=null">
|
|
|
+ AND Corpid = #{acc.corpId}
|
|
|
+ </if>
|
|
|
+ <if test="acc.itemType !=null and acc.itemType != ''">
|
|
|
+ AND item_type = #{acc.itemType}
|
|
|
+ </if>
|
|
|
+ <if test="acc.costType !=null and acc.costType != ''">
|
|
|
+ AND cost_type = #{acc.costType}
|
|
|
+ </if>
|
|
|
+ <if test="acc.createUser !=null">
|
|
|
+ AND create_user = #{acc.createUser}
|
|
|
+ </if>
|
|
|
+ <if test="acc.srcParentId !=null">
|
|
|
+ AND Src_parent_id = #{acc.srcParentId}
|
|
|
+ </if>
|
|
|
+ <if test="acc.srcSysno !=null and acc.srcSysno != ''">
|
|
|
+ AND Src_SysNo = #{acc.srcSysno}
|
|
|
+ </if>
|
|
|
+ <if test="acc.srcRefno !=null and acc.srcRefno != ''">
|
|
|
+ AND Src_refno = #{acc.srcRefno}
|
|
|
+ </if>
|
|
|
+ <if test="acc.dc !=null and acc.dc != ''">
|
|
|
+ AND DC = #{acc.dc}
|
|
|
+ </if>
|
|
|
+ <if test="acc.quantity !=null">
|
|
|
+ AND quantity like concat(concat('%', #{acc.quantity}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="acc.settlementAmount !=null">
|
|
|
+ AND Settlement_Amount like concat(concat('%', #{acc.settlementAmount}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="acc.checkStatus !=null and acc.checkStatus == 1">
|
|
|
+ AND Check_Amount > #{acc.checkAmount}
|
|
|
+ AND Settlement_Amount > #{acc.settlementAmount}
|
|
|
+ AND Invoice_Amount > #{acc.invoiceAmount}
|
|
|
+ </if>
|
|
|
+ <if test="acc.checkStatus !=null and acc.checkStatus == 2">
|
|
|
+ AND Check_Amount = #{acc.checkAmount}
|
|
|
+ AND Settlement_Amount = #{acc.settlementAmount}
|
|
|
+ AND Invoice_Amount = #{acc.invoiceAmount}
|
|
|
+ </if>
|
|
|
+ <if test="acc.tenantId !=null and acc.tenantId != ''">
|
|
|
+ AND tenant_id = #{acc.tenantId}
|
|
|
+ </if>
|
|
|
+ <if test="acc.settlementStatus !=null and acc.settlementStatus == 1">
|
|
|
+ AND Amount = Settlement_Amount
|
|
|
+ </if>
|
|
|
+ <if test="acc.settlementStatus !=null and acc.settlementStatus == 2">
|
|
|
+ AND Amount != Settlement_Amount
|
|
|
+ </if>
|
|
|
+ group By Src_refno,
|
|
|
+ Bill_type,
|
|
|
+ AccSysNo,
|
|
|
+ Src_Bill_NO,
|
|
|
+ Corpid
|
|
|
+ </select>
|
|
|
|
|
|
</mapper>
|