| | |
| | | </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> |