From 112b6a2ca8a55f056cc259b6bd9ed554fcc263f7 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Mon, 31 Oct 2022 14:58:04 +0800
Subject: [PATCH] 20221021
---
src/main/resources/mapper/dapp/IgtOnHookPlanOrderItemDao.xml | 45 +++++++++++++++++++++++++++++++++++++++++----
1 files changed, 41 insertions(+), 4 deletions(-)
diff --git a/src/main/resources/mapper/dapp/IgtOnHookPlanOrderItemDao.xml b/src/main/resources/mapper/dapp/IgtOnHookPlanOrderItemDao.xml
index 1064b1c..145c095 100644
--- a/src/main/resources/mapper/dapp/IgtOnHookPlanOrderItemDao.xml
+++ b/src/main/resources/mapper/dapp/IgtOnHookPlanOrderItemDao.xml
@@ -65,10 +65,13 @@
SELECT
ifnull(sum(a.amount),0)
FROM igt_on_hook_plan_order_item a
- where a.order_id = #{orderId}
- and a.create_time > #{startTime}
- and a.create_time < #{endTime}
- order by create_time desc
+ <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">
@@ -80,5 +83,39 @@
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