xiaoyong931011
2021-05-12 22210a5cf2fab56cf129fd313cfe448a2c2ef86b
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?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">
<mapper namespace="com.xcong.excoin.modules.yunding.mapper.BasicSettingMapper">
 
 
    <select id="getOrderList" resultType="com.xcong.excoin.modules.yunding.entity.YdOrderEntity">
        SELECT
        *
        FROM
        yd_order a
        left join yd_product b on b.id = a.product_id
        left join member c on c.id = a.member_id
        <if test="record != null">
            <where>
                <if test="record.state != null" >
                    and a.state=#{record.state}
                </if>
                <if test="record.account!=null and record.account!=''">
                    and (c.phone = #{record.account} or c.email = #{record.account} or c.invite_id=#{record.account})
                </if>
            </where>
        </if>
        ORDER BY a.create_time DESC
    </select>
 
    <select id="getYdProductList" resultType="com.xcong.excoin.modules.yunding.entity.YdProductEntity">
        SELECT
        *
        FROM
        yd_product a
    </select>
 
    <select id="getYdMemberList" resultType="com.xcong.excoin.modules.yunding.vo.YdMemberVo">
        SELECT
        *
        FROM
        member c
        <if test="record != null">
            <where>
                <if test="record.account!=null and record.account!=''">
                    and (c.phone = #{record.account} or c.email = #{record.account} or c.invite_id=#{record.account})
                </if>
            </where>
        </if>
        ORDER BY c.create_time DESC
    </select>
 
    <select id="selectPowerByMemberIdAndState" resultType="java.lang.Integer">
        SELECT
            IFNULL(sum(quantity),0)
        FROM
            yd_order a
        where a.member_id = #{memberId}
          and a.state = #{state}
    </select>
 
    <select id="selectAmountByMemberId" resultType="java.math.BigDecimal">
        SELECT
            IFNULL(sum(amount),0)
        FROM
            yd_order a
        where a.member_id = #{memberId}
    </select>
 
 
    <select id="selectChargeAmountByMemberIdAndStatus" resultType="java.math.BigDecimal">
        SELECT
            IFNULL(sum(amount),0)
        FROM
            member_coin_charge a
        where a.member_id = #{memberId}
          and a.status = #{status}
    </select>
 
    <select id="selectWithdrawAmountByMemberIdAndStatusAndIsInside" resultType="java.math.BigDecimal">
        SELECT
            IFNULL(sum(amount),0)
        FROM
            member_coin_withdraw a
        where a.member_id = #{memberId}
          and a.status = #{status}
          and a.is_inside = #{isInside}
    </select>
 
 
</mapper>