From 6c4ca033bf15f7bb6fa01f15e06212ad5ba0868d Mon Sep 17 00:00:00 2001 From: wzy <wzy19931122ai@163.com> Date: Sat, 15 May 2021 17:59:26 +0800 Subject: [PATCH] Merge branch 'yunding' of http://120.27.238.55:7000/r/exchange into yunding --- src/main/resources/mapper/yunding/YdOrderDao.xml | 39 +++++++++++++++++++++++++++++++++++++++ 1 files changed, 39 insertions(+), 0 deletions(-) diff --git a/src/main/resources/mapper/yunding/YdOrderDao.xml b/src/main/resources/mapper/yunding/YdOrderDao.xml index 3075f61..8045a9f 100644 --- a/src/main/resources/mapper/yunding/YdOrderDao.xml +++ b/src/main/resources/mapper/yunding/YdOrderDao.xml @@ -96,4 +96,43 @@ inner join yd_product c on c.id = a.product_id where a.type=1 </select> + + <update id="updateOrderProfit"> + update yd_order + set total_profit=total_profit+#{profit}, + today_profit=#{profit} + where id=#{id} + </update> + + <select id="selectAllPowerByMemberIdAndElse" resultType="java.lang.Integer"> + select ifnull(sum(quantity),0) from yd_order where type = 1 and member_id in ( + select member_id from member + where find_in_set(#{inviteId}, referer_ids) or invite_id=#{inviteId} + ) + </select> + + <select id="getTeamInfoList" resultType="com.xcong.excoin.modules.yunding.vo.TeamInfoVo"> + SELECT + a.phone phone, + ( + SELECT + IFNULL(sum(b.quantity),0) + FROM + yd_order b + WHERE + b.member_id = a.id + AND b.type = 1 + ) powerNum + FROM + member a + WHERE + a.referer_id = #{record.inviteId} + ORDER BY + powerNum DESC + </select> + + <select id="selectMemberByInviteId" resultType="com.xcong.excoin.modules.member.entity.MemberEntity"> + select * from member + where find_in_set(#{inviteId}, a.referer_ids) or invite_id=#{inviteId} + </select> </mapper> \ No newline at end of file -- Gitblit v1.9.1