KKSU
2024-05-23 bc5265e2bc4d6a7da6f2dd5d6af6037d05761187
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
<?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="cc.mrbird.febs.dapp.mapper.DappAchieveMapper">
 
    <select id="selectInPage" resultType="cc.mrbird.febs.dapp.entity.DappAchieve">
        select
        a.*,
               b.address address
        from dapp_achieve a
        left join dapp_member b on a.member_id = b.id
        <where>
            <if test="record.state != null">
                and a.state = #{record.state}
            </if>
            <if test="record.address != null and record.address != ''">
                and b.address = #{record.address}
            </if>
        </where>
        order by a.create_time desc
    </select>
 
    <select id="dappAchieveItemInPage" resultType="cc.mrbird.febs.dapp.entity.DappAchieveItem">
        select
        a.*,
               b.address address
        from dapp_achieve_item a
        left join dapp_member b on a.member_id = b.id
        where a.achieve_id = #{record.id}
        order by a.create_time desc
    </select>
 
    <select id="selectListByMemberId" resultType="cc.mrbird.febs.dapp.entity.DappAchieve">
        select
        a.*
        from dapp_achieve a
        where a.member_id = #{memberId}
    </select>
 
    <select id="selectGoldAmountByMemberId" resultType="java.math.BigDecimal">
        select ifnull(sum(a.usdt_target), 0)
        from dapp_member_fund a
        where a.member_id = #{memberId}
    </select>
 
    <select id="selectCoinAmountByMemberId" resultType="java.math.BigDecimal">
        select ifnull(sum(a.coin_target), 0)
        from dapp_member_fund a
        where a.member_id = #{memberId}
    </select>
 
 
</mapper>