|
|
@@ -56,6 +56,28 @@
|
|
|
delete from finance_acc where Src_id = #{srcId}
|
|
|
</delete>
|
|
|
|
|
|
+ <select id="selBillBalance" resultMap="accResultMap">
|
|
|
+ SELECT
|
|
|
+ BCD.cname AS corpName,
|
|
|
+ SUM(FC.Amount) as amount,
|
|
|
+ SUM(FC.Settlement_Amount) AS settlementAmount,
|
|
|
+ SUM(FC.Amount) - SUM(FC.Settlement_Amount) as balance
|
|
|
+ FROM finance_acc FC
|
|
|
+ LEFT JOIN basic_corps_desc BCD ON BCD.id = FC.Corpid
|
|
|
+ <where>
|
|
|
+ FC.tenant_id = #{acc.tenantId}
|
|
|
+ and FC.is_deleted = 0
|
|
|
+ and FC.bill_type = #{acc.billType}
|
|
|
+ <if test="acc.createStartDate !=null and acc.createStartDate != ''">
|
|
|
+ AND create_time >= #{acc.createStartDate}
|
|
|
+ </if>
|
|
|
+ <if test="acc.createEndDate !=null and acc.createEndDate != ''">
|
|
|
+ AND create_time <= #{acc.createEndDate}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ GROUP BY FC.Corpid
|
|
|
+ HAVING SUM(FC.Amount-FC.Settlement_Amount) >= 100
|
|
|
+ </select>
|
|
|
|
|
|
<select id="selectAccPage" resultMap="accResultMap">
|
|
|
select * from finance_acc where is_deleted = 0
|