From f5e6133809c553cfd9fb28ee61019927c547c374 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Wed, 08 Dec 2021 15:58:33 +0800
Subject: [PATCH] 20211208  fish

---
 src/main/resources/mapper/fish/CannonOwnRecordDao.xml |   56 ++++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 52 insertions(+), 4 deletions(-)

diff --git a/src/main/resources/mapper/fish/CannonOwnRecordDao.xml b/src/main/resources/mapper/fish/CannonOwnRecordDao.xml
index ba3b187..760748c 100644
--- a/src/main/resources/mapper/fish/CannonOwnRecordDao.xml
+++ b/src/main/resources/mapper/fish/CannonOwnRecordDao.xml
@@ -7,14 +7,62 @@
     </select>
 
     <select id="selectCannonOwnRecordsByMemberId" resultType="com.xcong.excoin.modules.fish.vo.OwnCannonVo">
-        select a.*,b.gold_consume goldConsume
-        from cannon_own_record a
-        left join cannon_setting b on a.cannon_code = b.code
-        where a.member_id = #{memberId}
+        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" />
+            <result property="image" column="image" />
+        </collection>
+    </resultMap>
+
+    <select id="getAwards" resultMap="awardsMap">
+        select
+            a.consume,
+            b.quantity,
+            b.image,
+            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>
\ No newline at end of file

--
Gitblit v1.9.1