From a3243dabdec4b7c730002e98e9300a37f8f9930e Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Wed, 02 Nov 2022 15:17:39 +0800
Subject: [PATCH] 20221021
---
src/main/resources/mapper/dapp/IgtOnHookPlanOrderItemDao.xml | 84 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 84 insertions(+), 0 deletions(-)
diff --git a/src/main/resources/mapper/dapp/IgtOnHookPlanOrderItemDao.xml b/src/main/resources/mapper/dapp/IgtOnHookPlanOrderItemDao.xml
index 54c7bf7..145c095 100644
--- a/src/main/resources/mapper/dapp/IgtOnHookPlanOrderItemDao.xml
+++ b/src/main/resources/mapper/dapp/IgtOnHookPlanOrderItemDao.xml
@@ -33,5 +33,89 @@
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_item a
+ where a.member_id = #{memberId}
+ and a.is_goal = #{isGoal}
+ 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 < #{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 < #{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 < #{end}
+ <if test="start != null">
+ and a.id > #{start}
+ </if>
+ </where>
+ </select>
+
</mapper>
\ No newline at end of file
--
Gitblit v1.9.1