xiaoyong931011
2021-12-07 0b4ddcc6cd1b3ca9973ba4bf1732be010a7de4e2
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
<?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.fish.dao.CannonOwnRecordDao">
 
    <select id="selectCannonOwnRecordsByMemberIdAndCannonCode" resultType="com.xcong.excoin.modules.fish.entity.CannonOwnRecord">
        select a.* from cannon_own_record a where a.member_id = #{memberId} and a.cannon_code = #{code}
    </select>
 
    <select id="selectCannonOwnRecordsByMemberId" resultType="com.xcong.excoin.modules.fish.vo.OwnCannonVo">
        select
               a.*,
               case when b.id is null then 2 else 1 end isHas
        from cannon_setting a
          left join cannon_own_record b on a.code=b.cannon_code and b.member_id=#{memberId}
    </select>
 
    <select id="selectCannonOwnRecordsByIdAndMemberId" resultType="com.xcong.excoin.modules.fish.entity.CannonOwnRecord">
        select a.* from cannon_own_record a where a.member_id = #{memberId} and a.id = #{id}
    </select>
 
 
    <resultMap id="awardsMap" type="com.xcong.excoin.modules.fish.vo.AwardsVo">
        <result property="consume" column="consume" />
        <collection property="awardVo" ofType="com.xcong.excoin.modules.fish.vo.AwardVo" >
            <result property="name" column="name" />
            <result property="quantity" column="quantity" />
        </collection>
    </resultMap>
 
    <select id="getAwards" resultMap="awardsMap">
        select
            a.consume,
            b.quantity,
            b.name
        from cannon_award_set a
        inner join cannon_award b on a.code = b.activity_code
        where b.type = 1;
    </select>
 
 
 
    <select id="getCannonAwardSet" resultType="com.xcong.excoin.modules.fish.entity.CannonAwardSet">
        select a.* from cannon_award_set a
    </select>
 
 
 
    <select id="selectCannonAward" resultType="com.xcong.excoin.modules.fish.entity.CannonAward">
        select a.* from cannon_award a where a.type = 1;
    </select>
 
 
 
    <select id="selectCannonAwardByCode" resultType="com.xcong.excoin.modules.fish.entity.CannonAward">
        select a.* from cannon_award a where a.code = #{code}
    </select>
 
 
 
    <select id="selectCannonAccountMoneyChangeByMemberId" resultType="java.lang.Integer">
        select COUNT(a.id) from cannon_account_money_change a where a.type = 4
    </select>
 
 
 
</mapper>