xiaoyong931011
2022-12-01 9b3a67db63c2a51c1e97501b9e73f792a5f55bf8
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
<?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
        for update
    </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}
        for update
    </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>
 
</mapper>