|
@@ -302,7 +302,53 @@
|
|
|
</where>
|
|
</where>
|
|
|
order by klt.generate_time desc
|
|
order by klt.generate_time desc
|
|
|
</select>
|
|
</select>
|
|
|
|
|
+ <!--数量统计规则:未筛选,统计所有。需要根据企业方,排除已保存,已撤回两个状态-->
|
|
|
<select id="countSum" resultType="com.sckw.payment.model.vo.res.LedgerCountSumVo">
|
|
<select id="countSum" resultType="com.sckw.payment.model.vo.res.LedgerCountSumVo">
|
|
|
|
|
+ select IFNULL(count(1), 0) "ledgerCount"
|
|
|
|
|
+ from kwp_ledger_trade klt
|
|
|
|
|
+ inner join kwp_ledger_trade_unit kltu
|
|
|
|
|
+ on klt.id = kltu.t_ledger_id and kltu.del_flag = 0 and
|
|
|
|
|
+ kltu.unit_type = #{tradeReq.unitType,jdbcType=INTEGER}
|
|
|
|
|
+ inner join kwp_ledger_trade_unit kltu2
|
|
|
|
|
+ on klt.id = kltu2.t_ledger_id and kltu2.del_flag = 0 and
|
|
|
|
|
+ kltu2.unit_type = #{tradeReq.unitTypeTwo,jdbcType=INTEGER}
|
|
|
|
|
+ <where>
|
|
|
|
|
+ klt.del_flag = 0
|
|
|
|
|
+ and kltu2.top_ent_id = #{tradeReq.entId,jdbcType=BIGINT}
|
|
|
|
|
+ <if test="tradeReq.status != null">
|
|
|
|
|
+ and klt.status = #{tradeReq.status}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="status != null and status.size() > 0">
|
|
|
|
|
+ and klt.status not in
|
|
|
|
|
+ <foreach collection="status" item="id" close=")" open="(" separator=",">
|
|
|
|
|
+ #{id,jdbcType=BIGINT}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="tradeReq.trading != null">
|
|
|
|
|
+ and klt.trading = #{tradeReq.trading,jdbcType=INTEGER}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="tradeReq.endCreateTime != null and tradeReq.endCreateTime != '' and tradeReq.startCreateTime != null and tradeReq.startCreateTime != ''">
|
|
|
|
|
+ and klt.generate_time between #{tradeReq.startCreateTime,jdbcType=TIMESTAMP}
|
|
|
|
|
+ and #{tradeReq.endCreateTime,jdbcType=TIMESTAMP}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="tradeReq.keywords != null and tradeReq.keywords != ''">
|
|
|
|
|
+ and (
|
|
|
|
|
+ klt.t_ledger_no like concat('%'
|
|
|
|
|
+ , #{tradeReq.keywords,jdbcType=VARCHAR}
|
|
|
|
|
+ , '%')
|
|
|
|
|
+ or kltu.firm_name like concat('%'
|
|
|
|
|
+ , #{tradeReq.keywords,jdbcType=VARCHAR}
|
|
|
|
|
+ , '%')
|
|
|
|
|
+ or kltu.contacts like concat('%'
|
|
|
|
|
+ , #{tradeReq.keywords,jdbcType=VARCHAR}
|
|
|
|
|
+ , '%')
|
|
|
|
|
+ )
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <!--金额统计规则:未筛选状态,统计已完成的对账单,结算金额。筛选状态统计具体的状态-->
|
|
|
|
|
+ <select id="countSumMoney" resultType="com.sckw.payment.model.vo.res.LedgerCountSumVo">
|
|
|
select IFNULL(count(1), 0) "ledgerCount",
|
|
select IFNULL(count(1), 0) "ledgerCount",
|
|
|
sum(klt.settle_price) "totalPrice"
|
|
sum(klt.settle_price) "totalPrice"
|
|
|
from kwp_ledger_trade klt
|
|
from kwp_ledger_trade klt
|
|
@@ -318,6 +364,9 @@
|
|
|
<if test="tradeReq.status != null">
|
|
<if test="tradeReq.status != null">
|
|
|
and klt.status = #{tradeReq.status}
|
|
and klt.status = #{tradeReq.status}
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+ <if test="tradeReq.status == null">
|
|
|
|
|
+ and klt.status = 4
|
|
|
|
|
+ </if>
|
|
|
<if test="status != null and status.size() > 0">
|
|
<if test="status != null and status.size() > 0">
|
|
|
and klt.status not in
|
|
and klt.status not in
|
|
|
<foreach collection="status" item="id" close=")" open="(" separator=",">
|
|
<foreach collection="status" item="id" close=")" open="(" separator=",">
|
|
@@ -346,6 +395,7 @@
|
|
|
</if>
|
|
</if>
|
|
|
</where>
|
|
</where>
|
|
|
</select>
|
|
</select>
|
|
|
|
|
+
|
|
|
<select id="countOrder" resultType="java.util.Map">
|
|
<select id="countOrder" resultType="java.util.Map">
|
|
|
SELECT count(1) "0",
|
|
SELECT count(1) "0",
|
|
|
count(IF(klt.status = 1, 1, NULL)) "1",
|
|
count(IF(klt.status = 1, 1, NULL)) "1",
|