chenjiahe
2023-04-01 510678fe2f81501914ea4905fb7026b9c7be414f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!-- namespace:该mapper.xml映射文件的 唯一标识 -->
<mapper namespace="com.hx.phip.dao.mapper.RefundMapper">
 
    <!--一级支付方式记录返回-支付编号求和-->
    <select id="selectConsumePayList" resultType="com.hx.phip.vo.order.payment.PayMethodVo">
        SELECT ANY_VALUE(name) AS name
             ,numberNo
             ,ROUND(SUM(actualTotal-refundTotal),2) AS surplusTotal
             ,ROUND(SUM(actualTotal),2) AS payTotal
             ,ROUND(SUM(refundTotal),2) AS refundTotal
        FROM consume_pay
        WHERE isDel = 0 AND orderId = #{orderId} GROUP BY numberNo
    </select>
 
 
    <!--一级支付方式记录返回-支付编号求和-->
    <select id="selectConsumePayOneList" resultType="com.hx.phip.vo.order.payment.PayMethodVo">
        SELECT ANY_VALUE(name) AS name
             ,numberNo
             ,ROUND(SUM(actualTotal),2) AS surplusTotal
             ,ROUND(SUM(actualTotal),2) AS payTotal
        FROM consume_pay_item
        WHERE isDel = 0 AND typeId = #{typeId} GROUP BY numberNo
    </select>
 
    <!--二级支付方式记录返回-支付编号求和-->
    <select id="selectConsumePayTwoList" resultType="com.hx.phip.vo.order.payment.PayMethodVo" >
        SELECT ANY_VALUE(name) AS name
             ,numberNo
             ,ROUND(SUM(actualTotal),2) AS surplusTotal
             ,ROUND(SUM(actualTotal),2) AS payTotal
        FROM consume_pay_item_son
        WHERE isDel = 0 AND typeId = #{typeId} GROUP BY numberNo
    </select>
 
 
</mapper>