From 1b0e20f11a920ba8c0c38e4c8fef58e8fa1fe0d2 Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Tue, 14 Jul 2020 19:41:31 +0800
Subject: [PATCH] Merge branch 'master' of https://gitee.com/chonggaoxiao/new_excoin

---
 src/main/resources/mapper/member/MemberWalletCoinDao.xml |   48 ++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 42 insertions(+), 6 deletions(-)

diff --git a/src/main/resources/mapper/member/MemberWalletCoinDao.xml b/src/main/resources/mapper/member/MemberWalletCoinDao.xml
index 9bd74b7..79979c5 100644
--- a/src/main/resources/mapper/member/MemberWalletCoinDao.xml
+++ b/src/main/resources/mapper/member/MemberWalletCoinDao.xml
@@ -1,7 +1,43 @@
-<?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.member.dao.MemberWalletCoinDao">
-
-
-
+<?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.member.dao.MemberWalletCoinDao">
+
+	<select id="selectMemberWalletCoinsByMemberId" resultType="com.xcong.excoin.modules.member.entity.MemberWalletCoinEntity">
+        select * from member_wallet_coin where member_id = #{memberId}
+    </select>
+    
+    <select id="selectWalletCoinBymIdAndCode" resultType="com.xcong.excoin.modules.member.entity.MemberWalletCoinEntity">
+        select * from member_wallet_coin where member_id = #{memberId} and wallet_code = #{walletCode}
+    </select>
+    
+    <update id="updateFrozenBalance" parameterType="map">
+		UPDATE member_wallet_coin
+		SET available_balance = available_balance - #{amount},
+		 	frozen_balance = frozen_balance + #{amount}
+		WHERE
+			id = #{id}
+		AND member_id = #{memberId}
+	</update>
+	
+	<update id="subFrozenBalance" parameterType="map">
+		UPDATE member_wallet_coin
+		SET available_balance = available_balance + #{amount},
+		 	frozen_balance = frozen_balance - #{amount}
+		WHERE
+			id = #{id}
+		AND member_id = #{memberId}
+	</update>
+    
+    
+	<update id="updateBlockBalance">
+		update member_wallet_coin
+		set
+		available_balance = IFNULL(available_balance, 0) + #{availableBalance},
+		total_balance = IFNULL(total_balance, 0) + #{availableBalance},
+		early_balance = IFNULL(early_balance, 0) + #{earlyBalance},
+		block_number  = IFNULL(block_number, 0) + #{blockNumber}
+		where id=#{id}
+	</update>
+
+
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.1