From bfbb03c514b9e60485ea13d5679e6af2e8aeb354 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Wed, 23 Nov 2022 09:44:23 +0800
Subject: [PATCH] 20221117

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

diff --git a/src/main/resources/mapper/dapp/IgtOnHookPlanOrderItemDao.xml b/src/main/resources/mapper/dapp/IgtOnHookPlanOrderItemDao.xml
index 54c7bf7..1076fef 100644
--- a/src/main/resources/mapper/dapp/IgtOnHookPlanOrderItemDao.xml
+++ b/src/main/resources/mapper/dapp/IgtOnHookPlanOrderItemDao.xml
@@ -33,5 +33,88 @@
           and a.state = #{state}
     </select>
 
+    <select id="selectByMemberIdAndBelongNum" resultType="cc.mrbird.febs.dapp.entity.IgtOnHookPlanOrderItem">
+        SELECT
+            a.*
+        FROM igt_on_hook_plan_order_item a
+        where
+              a.member_id = #{memberId}
+          and a.belong_num = #{recordNum}
+            limit 1
+    </select>
+
+    <select id="selectTotalProfitByMemberIdAndStateAndIsgoal" resultType="java.math.BigDecimal">
+        SELECT
+            ifnull(sum(a.profit),0)
+        FROM igt_on_hook_plan_order a
+        where  a.member_id = #{memberId}
+          and a.state = #{state}
+    </select>
+
+    <select id="selectByIgtIdAndMemberId" resultType="cc.mrbird.febs.dapp.entity.IgtOnHookPlanOrderItem">
+        SELECT
+            a.*
+        FROM igt_on_hook_plan_order_item a
+        where a.order_id = #{orderId}
+          and a.member_id = #{memberId}
+        order by create_time desc
+    </select>
+
+    <select id="selectTotalAmountByCreateTimeAndOrderId" resultType="java.math.BigDecimal">
+        SELECT
+            ifnull(sum(a.amount),0)
+        FROM igt_on_hook_plan_order_item a
+        <where>
+            a.order_id = #{orderId}
+            and a.create_time &lt; #{endTime}
+            <if test="startTime != null">
+                and a.create_time > #{startTime}
+            </if>
+        </where>
+    </select>
+
+    <select id="selectByIsgoalAndOrderId" resultType="java.lang.Long">
+        SELECT
+            a.id
+        FROM igt_on_hook_plan_order_item a
+        where a.order_id = #{orderId}
+          and a.is_goal = #{isGoal}
+        order by create_time desc
+    </select>
+
+    <select id="selectByCreateTimeAndIsgoaAndOrderId" resultType="cc.mrbird.febs.dapp.entity.IgtOnHookPlanOrderItem">
+        SELECT
+            a.*
+        FROM igt_on_hook_plan_order_item a
+        where a.order_id = #{orderId}
+          and a.is_goal = #{isGoal}
+          and a.id &lt; #{id}
+        order by a.id desc
+        limit 1
+    </select>
+
+    <select id="selectOneByIgtIdAndMemberId" resultType="cc.mrbird.febs.dapp.entity.IgtOnHookPlanOrderItem">
+        SELECT
+            a.*
+        FROM igt_on_hook_plan_order_item a
+        where a.order_id = #{orderId}
+          and a.member_id = #{memberId}
+        order by a.id desc
+            limit 1
+    </select>
+
+    <select id="selectTotalAmountByIDAndOrderId" resultType="java.math.BigDecimal">
+        SELECT
+        ifnull(sum(a.amount),0)
+        FROM igt_on_hook_plan_order_item a
+        <where>
+            a.order_id = #{orderId}
+            and a.id &lt; #{end}
+            <if test="start != null">
+                and a.id > #{start}
+            </if>
+        </where>
+    </select>
+
 
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.1