From 2c03637a70a51b747db9fa02c10f5de7a32b2df1 Mon Sep 17 00:00:00 2001
From: wzy <wzy19931122ai@163.com>
Date: Sat, 29 Oct 2022 23:16:59 +0800
Subject: [PATCH] Merge branch 'IGT-dev' of http://120.27.238.55:7000/r/sys-dapp into IGT-dev
---
src/main/resources/mapper/dapp/IgtOnHookPlanOrderItemDao.xml | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 52 insertions(+), 0 deletions(-)
diff --git a/src/main/resources/mapper/dapp/IgtOnHookPlanOrderItemDao.xml b/src/main/resources/mapper/dapp/IgtOnHookPlanOrderItemDao.xml
index d6dbfaa..c5a9274 100644
--- a/src/main/resources/mapper/dapp/IgtOnHookPlanOrderItemDao.xml
+++ b/src/main/resources/mapper/dapp/IgtOnHookPlanOrderItemDao.xml
@@ -43,5 +43,57 @@
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>
+ order by create_time desc
+ </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.create_time < #{endTime}
+ order by create_time asc
+ limit 1
+ </select>
+
</mapper>
\ No newline at end of file
--
Gitblit v1.9.1