From ac397945cddd60cdc1c95d79c17bfca074e5687e Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Thu, 27 Oct 2022 11:03:37 +0800
Subject: [PATCH] 20221021
---
src/main/resources/mapper/dapp/IgtOnHookPlanOrderDao.xml | 41 ++++++++++++++++++++++++++++++++++++++---
1 files changed, 38 insertions(+), 3 deletions(-)
diff --git a/src/main/resources/mapper/dapp/IgtOnHookPlanOrderDao.xml b/src/main/resources/mapper/dapp/IgtOnHookPlanOrderDao.xml
index eb05876..ed98061 100644
--- a/src/main/resources/mapper/dapp/IgtOnHookPlanOrderDao.xml
+++ b/src/main/resources/mapper/dapp/IgtOnHookPlanOrderDao.xml
@@ -13,7 +13,6 @@
update igt_on_hook_plan_order
set
ava_amount = ava_amount - #{amount},
- profit = profit + #{profit}
where
id = #{id}
and ava_amount - #{amount} <![CDATA[ >= ]]> 0
@@ -29,13 +28,49 @@
limit 1
</select>
- <update id="addAvaAmountAddProfitById">
+ <update id="AddProfitById">
update igt_on_hook_plan_order
set
- ava_amount = ava_amount + #{amount},
profit = profit + #{profit}
where
id = #{id}
</update>
+ <select id="selectSumProfitByMemberId" resultType="java.math.BigDecimal">
+ SELECT
+ ifnull(sum(a.profit),0)
+ FROM igt_on_hook_plan_order a
+ where a.member_id = #{memberId}
+ </select>
+
+ <select id="selectByCreateTime" resultType="cc.mrbird.febs.dapp.entity.IgtOnHookPlanOrder">
+ SELECT
+ a.*
+ FROM igt_on_hook_plan_order a
+ where and date_format(a.create_time, '%Y-%m-%d') = #{createTime}
+ </select>
+
+ <select id="findMemberPlanListInPage" resultType="cc.mrbird.febs.dapp.vo.AdminIgtOnHookPlanOrderVo">
+ SELECT
+ s.*,
+ m.username username
+ FROM
+ igt_on_hook_plan_order s
+ left join dapp_member m on m.id = s.member_id
+ <where>
+ <if test="record != null" >
+ <if test="record.description!=null and record.description!=''">
+ (s.member_id in (select id from dapp_member where FIND_IN_SET(#{record.description}, referer_ids)))
+ </if>
+ <if test="record.state!=null and record.state!=''">
+ and s.state= #{record.state}
+ </if>
+ <if test="record.profitState!=null and record.profitState!=''">
+ and s.profit_state= #{record.profitState}
+ </if>
+ </if>
+ </where>
+ order by s.create_time desc
+ </select>
+
</mapper>
\ No newline at end of file
--
Gitblit v1.9.1