xiaoyong931011
2023-08-16 5e9a1a931194b0d9eba759774dcad39fef1dba0b
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<?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.DappSystemProfitDao">
 
    <select id="selectSystemProfitByState" resultType="cc.mrbird.febs.dapp.entity.DappSystemProfit">
        select a.*
        from dapp_system_profit a
        where state = #{state}
        order by id ASC
        limit 1
    </select>
 
    <select id="selectByIdForUpdate" resultType="cc.mrbird.febs.dapp.entity.DappSystemProfit">
        select a.*
        from dapp_system_profit a
        where a.id = #{id}
        and a.state = #{state}
    </select>
 
    <update id="updateLevelProfitById">
        update dapp_system_profit
        set level_Profit = #{levelProfit}
        where id = #{id}
    </update>
 
    <update id="updateStateById">
        update dapp_system_profit
        set state = #{state}
        where id = #{id}
    </update>
 
    <select id="selectByMemberIdAndState" resultType="cc.mrbird.febs.dapp.entity.DappSystemProfit">
        select a.*
        from dapp_system_profit a
        where state = #{state}
        and member_id = #{memberId}
            limit 1
    </select>
 
    <select id="selectSystemProfitOutByState" resultType="cc.mrbird.febs.dapp.entity.DappSystemProfit">
        select a.*
        from dapp_system_profit a
        where state = #{state}
        order by id desc
            limit 1
    </select>
 
    <select id="selectSystemProfitInByState" resultType="cc.mrbird.febs.dapp.entity.DappSystemProfit">
        select a.*
        from dapp_system_profit a
        where state = #{state}
        order by id ASC
            limit 1
    </select>
 
    <select id="selectSystemProfitInPage" resultType="cc.mrbird.febs.dapp.vo.AdminDappSystemProfitVo">
        select
               a.id id,
               a.create_time createTime,
               a.amount amount,
               a.state state,
               b.address address
        from
             dapp_system_profit a
        inner join dapp_member b on a.member_id = b.id
        <where>
            <if test="record.id != '' and record.id != null">
                and a.id = #{record.id}
            </if>
            <if test="record.address != '' and record.address != null">
                and b.address = #{record.address}
            </if>
            <if test="record.state != '' and record.state != null">
                and a.state = #{record.state}
            </if>
        </where>
        order by a.id desc
    </select>
 
    <select id="selectSystemProfitFlowListInPage" resultType="cc.mrbird.febs.dapp.vo.AdminSystemProfitFlowListVo">
        select
        a.create_time createTime,
        a.amount amount,
        a.status status,
        a.from_hash fromHash,
        a.type type,
        b.address address
        from
        dapp_fund_flow a
        inner join dapp_member b on a.member_id = b.id
        where a.system_profit_id = #{record.id}
        order by a.create_time asc
    </select>
 
    <select id="selectDappSysstemProfitByState" resultType="cc.mrbird.febs.dapp.entity.DappSystemProfit">
        select
            a.*
        from
            dapp_system_profit a
        where a.state = #{state}
        order by a.id asc
    </select>
 
    <select id="selectByMemberId" resultType="cc.mrbird.febs.dapp.entity.DappSystemProfit">
        select a.*
        from dapp_system_profit a
        where member_id = #{memberId}
            limit 1
    </select>
 
</mapper>