|
|
@@ -56,7 +56,7 @@
|
|
|
delete from finance_acc where Src_id = #{srcId}
|
|
|
</delete>
|
|
|
|
|
|
- <select id="selBillBalance" resultMap="accResultMap">
|
|
|
+ <select id="selBillBalance" resultType="org.springblade.finance.vojo.Acc">
|
|
|
SELECT
|
|
|
BCD.cname AS corpName,
|
|
|
IFNULL( BC.amount, 0 ) AS amount,
|
|
|
@@ -74,11 +74,17 @@
|
|
|
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 FC.create_time >= #{acc.createStartDate}
|
|
|
+ <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.createEndDate !=null and acc.createEndDate != ''">
|
|
|
- AND FC.create_time <= #{acc.createEndDate}
|
|
|
+ <if test='acc.createDateList != null and acc.createDateList[1] != null and acc.createDateList[1]!= ""'>
|
|
|
+ and FC.create_time <= #{acc.createDateList[1]}
|
|
|
+ </if>
|
|
|
+ <if test='acc.createStartDate != null and acc.createStartDate != ""'>
|
|
|
+ and FC.create_time >= #{acc.createStartDate}
|
|
|
+ </if>
|
|
|
+ <if test='acc.createEndDate != null and acc.createEndDate != ""'>
|
|
|
+ and FC.create_time <= #{acc.createEndDate}
|
|
|
</if>
|
|
|
</where>
|
|
|
GROUP BY
|
|
|
@@ -96,6 +102,24 @@
|
|
|
HAVING SUM(FC.Amount-FC.Settlement_Amount) >= 100
|
|
|
</select>
|
|
|
|
|
|
+ <select id="SumBillBalance" resultType="java.util.Map">
|
|
|
+ SELECT
|
|
|
+ SUM(CASE WHEN bill_type = '收费' THEN Amount ELSE 0 END) AS ysAmount,
|
|
|
+ SUM(CASE WHEN bill_type = '申请' THEN Amount ELSE 0 END) AS yfAmount
|
|
|
+ FROM
|
|
|
+ finance_acc
|
|
|
+ <where>
|
|
|
+ is_deleted = 0
|
|
|
+ and tenant_id = #{acc.tenantId}
|
|
|
+ <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>
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="selectAccPage" resultMap="accResultMap">
|
|
|
select * from finance_acc where is_deleted = 0
|
|
|
</select>
|