| | |
| | | and date_format(achieve_time, '%Y-%m-%d') = date_format(#{date}, '%Y-%m-%d'); |
| | | </select> |
| | | |
| | | <select id="selectSumAchieveByMemberIdList" resultType="java.math.BigDecimal"> |
| | | select IFNULL(sum(IFNULL(amount,0)),0) |
| | | from mall_achieve_record |
| | | where member_id IN |
| | | <foreach collection = "list" item = "item" separator="," open = "(" close = ")" > |
| | | #{item} |
| | | </foreach > |
| | | </select> |
| | | |
| | | <select id="selectListByDate" resultType="cc.mrbird.febs.dapp.entity.MallAchieveRecord"> |
| | | select * from mall_achieve_record |
| | | where date_format(achieve_time, '%Y-%m-%d') = date_format(#{date}, '%Y-%m-%d'); |
| | | </select> |
| | | |
| | | <select id="selectListByMemberId" resultType="cc.mrbird.febs.dapp.entity.MallAchieveRecord"> |
| | | select * from mall_achieve_record |
| | | where member_id = #{memberId} |
| | | and is_normal = 1 |
| | | order by CREATE_TIME asc |
| | | </select> |
| | | |
| | | <select id="selectAchieveTotalByMemberIdAndCreateTime" resultType="java.math.BigDecimal"> |
| | | select IFNULL(sum(IFNULL(amount,0)),0) from mall_achieve_record |
| | | where |
| | | member_id = #{memberId} |
| | | and pay_time >= #{date} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectAchieveTotalByCreateTime" resultType="java.math.BigDecimal"> |
| | | select IFNULL(sum(IFNULL(amount,0)),0) from mall_achieve_record |
| | | where pay_time >= #{date} |
| | | </select> |
| | | |
| | | <select id="selectAchieveByMemberId" resultType="java.math.BigDecimal"> |
| | | select IFNULL(sum(IFNULL(a.amount, 0)), 0) |
| | | from mall_achieve_record a |
| | | inner join dapp_member b on a.member_id = b.ID |
| | | where is_normal = 1 |
| | | <if test="type == 1"> |
| | | and b.invite_id=#{inviteId} |
| | | </if> |
| | | <if test="type == 2"> |
| | | and find_in_set(#{inviteId}, b.referer_ids) |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="selectTeamListByInviteId" resultType="cc.mrbird.febs.dapp.vo.TeamChildListVo"> |
| | | select |
| | | a.invite_id inviteId, |
| | | a.address address, |
| | | a.account_type accountType, |
| | | a.create_time createTime |
| | | from dapp_member a |
| | | where a.referrer_id=#{inviteId} |
| | | </select> |
| | | |
| | | <select id="selectCountByInvitedId" resultType="cc.mrbird.febs.dapp.entity.MallAchieveRecord"> |
| | | select * |
| | | from mall_achieve_record a |
| | | inner join dapp_member b on a.member_id = b.ID |
| | | where is_normal = 1 |
| | | <if test="type == 1"> |
| | | and b.invite_id=#{inviteId} |
| | | </if> |
| | | <if test="type == 2"> |
| | | and (find_in_set(#{inviteId}, b.referer_ids) or b.invite_id=#{inviteId}) |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |