chenjiahe
2023-04-02 2a45d42cebd76d0f0add392c0e06d2cbbb36c63f
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?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="getConsumePayGroupByNumberNo" 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
             ,ANY_VALUE(isMoneyPay) AS IsMoneyPay
             ,ANY_VALUE(isExecute) AS isExecute
        FROM consume_pay
        WHERE isDel = 0 AND orderId = #{orderId} GROUP BY numberNo
    </select>
 
    <!--一级支付方式记录返回-支付编号求和-->
    <select id="getConsumePayOneGroupByNumberNo" 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
             ,ANY_VALUE(isMoneyPay) AS IsMoneyPay
             ,ANY_VALUE(isExecute) AS isExecute
        FROM consume_pay_item
        WHERE isDel = 0 AND typeId = #{typeId} GROUP BY numberNo
    </select>
 
    <!--二级支付方式记录返回-支付编号求和-->
    <select id="getConsumePayTwoGroupByNumberNo" 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
             ,ANY_VALUE(isMoneyPay) AS IsMoneyPay
             ,ANY_VALUE(isExecute) AS isExecute
        FROM consume_pay_item_son
        WHERE isDel = 0 AND typeId = #{typeId} GROUP BY numberNo
    </select>
 
    <!--一级支付方式记录返回-->
    <select id="selectConsumePayOneList" resultType="com.hx.phiappt.model.consume.ConsumePayItem">
        SELECT
            *
        FROM consume_pay_item
        WHERE isDel = 0 AND typeId = #{typeId}
    </select>
 
    <!--二级支付方式记录返回-->
    <select id="selectConsumePayTwoList" resultType="com.hx.phiappt.model.consume.ConsumePayItemSon" >
        SELECT
            *
        FROM consume_pay_item_son
        WHERE isDel = 0 AND typeId = #{typeId}
    </select>
 
 
</mapper>