From 19b525873d0e740d6ea31e939eb921bb711c8db6 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Mon, 05 Dec 2022 10:52:11 +0800
Subject: [PATCH] 20221130

---
 src/main/resources/mapper/dapp/DappSystemProfitDao.xml |   84 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 84 insertions(+), 0 deletions(-)

diff --git a/src/main/resources/mapper/dapp/DappSystemProfitDao.xml b/src/main/resources/mapper/dapp/DappSystemProfitDao.xml
index a584bc4..877e8b6 100644
--- a/src/main/resources/mapper/dapp/DappSystemProfitDao.xml
+++ b/src/main/resources/mapper/dapp/DappSystemProfitDao.xml
@@ -19,4 +19,88 @@
         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>
+
+    <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>
+
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.1