From 8dbaa58169feb425785b55427358a1be0b51dfca Mon Sep 17 00:00:00 2001 From: Helius <wangdoubleone@gmail.com> Date: Thu, 10 Mar 2022 16:19:22 +0800 Subject: [PATCH] fix --- src/main/resources/mapper/walletCoinOrder/ZhiYaRecordDao.xml | 77 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 76 insertions(+), 1 deletions(-) diff --git a/src/main/resources/mapper/walletCoinOrder/ZhiYaRecordDao.xml b/src/main/resources/mapper/walletCoinOrder/ZhiYaRecordDao.xml index 4075b09..7c7fde4 100644 --- a/src/main/resources/mapper/walletCoinOrder/ZhiYaRecordDao.xml +++ b/src/main/resources/mapper/walletCoinOrder/ZhiYaRecordDao.xml @@ -8,7 +8,82 @@ </select> <select id="selectByMemberIdAndOrderStatus" resultType="com.xcong.excoin.modules.coin.entity.ZhiYaRecordEntity"> - SELECT * FROM zhiya_record a where a.member_id= #{memberId} and a.order_status = #{orderStatus} + SELECT a.* FROM zhiya_record a where a.member_id= #{memberId} and a.order_status = #{orderStatus} + </select> + + <select id="selectByIdAndMemberId" resultType="com.xcong.excoin.modules.coin.entity.ZhiYaRecordEntity"> + SELECT a.* FROM zhiya_record a where a.member_id= #{memberId} and a.id = #{id} + </select> + + <select id="selectByMemberId" resultType="com.xcong.excoin.modules.coin.parameter.vo.ZhiyaInfoVo"> + SELECT a.* FROM zhiya_record a where a.member_id= #{memberId} + </select> + + <select id="selectByMemberIdInPage" resultType="com.xcong.excoin.modules.coin.parameter.vo.ZhiyaInfoVo"> + select a.*,(SELECT ifnull(sum(b.reward_amout),0) FROM zhiya_reward b where b.member_id = #{record.memberId} and b.record_no = a.order_no) rewardCnt from zhiya_record a + <if test="record != null"> + <where> + <if test="record.memberId != null" > + and a.member_id=#{record.memberId} + </if> + </where> + </if> + order by id desc + </select> + + <select id="selectZhiyaRewardByMemberIdInPage" resultType="com.xcong.excoin.modules.coin.parameter.vo.ZhiyaRewardVo"> + select * from zhiya_reward + <if test="record != null"> + <where> + <if test="record.memberId != null" > + and member_id=#{record.memberId} + </if> + <if test="record.recordNo != null" > + and record_no=#{record.recordNo} + </if> + </where> + </if> + order by id desc + </select> + + <select id="selectZhiYaRewardByStatueAndTime" resultType="com.xcong.excoin.modules.coin.entity.ZhiYaRecordEntity"> + SELECT a.* FROM zhiya_record a where a.order_status= #{orderStatus} and #{now} > a.effect_date + </select> + + + <select id="selectTotalGusdByStatueAndTime" resultType="long"> + SELECT ifnull(sum(a.zhiya_cnt),0) FROM zhiya_record a where a.order_status= #{orderStatus} and #{now} > a.effect_date + </select> + + <select id="selectZhiyaTeamRecordByMemberId" resultType="com.xcong.excoin.modules.coin.entity.ZhiYaTeam"> + SELECT a.* FROM zhiya_Team a where a.member_id= #{memberId} + </select> + + + <select id="selectZhiyaTeamRecordByMemberIdAndOrderNo" resultType="com.xcong.excoin.modules.coin.entity.ZhiyaRewardEntity"> + <![CDATA[ SELECT a.* FROM zhiya_reward a where a.member_id= #{memberId} and a.type = 1 and a.record_no = #{orderNo} + and DATE_FORMAT(a.create_time, '%Y-%m-%d') = DATE_FORMAT(#{now}, '%Y-%m-%d')]]> + </select> + + <select id="selectSumZhiyaCntByMemberIdAndOrderStatus" resultType="long"> + SELECT ifnull(sum(a.zhiya_cnt),0) FROM zhiya_record a where a.member_id= #{memberId} and a.order_status = #{orderStatus} + </select> + + <select id="selectSumRewardCntByMemberId" resultType="long"> + SELECT ifnull(sum(a.reward_amout),0) FROM zhiya_reward a where a.member_id= #{memberId} and type= 1 + </select> + + <select id="selectZhiyaRewardTypeToByMemberIdInPage" resultType="com.xcong.excoin.modules.coin.parameter.vo.ZhiyaRewardVo"> + select * from zhiya_reward + <if test="record != null"> + <where> + and type = 2 + <if test="record.memberId != null" > + and member_id=#{record.memberId} + </if> + </where> + </if> + order by id desc </select> </mapper> -- Gitblit v1.9.1