| | |
| | | <select id="selectHappyMemberListInPage" resultType="cc.mrbird.febs.mall.entity.MallMember"> |
| | | SELECT |
| | | a.*, |
| | | d.balance balance, |
| | | d.score score, |
| | | d.prize_score prizeScore, |
| | | d.commission commission, |
| | | d.total_score totalScore, |
| | | b.name storeMasterName, |
| | | c.name directorName |
| | | FROM mall_member a |
| | | left join happy_sale_level b on b.code = a.store_master |
| | | left join happy_member_level c on c.code = a.director |
| | | left join mall_member_wallet d on d.member_id = a.id |
| | | <where> |
| | | <if test="record != null" > |
| | | <if test="record.birthdayQuery!=null"> |
| | |
| | | IFNULL(c.balance,0) balance, |
| | | IFNULL(c.score,0) score, |
| | | IFNULL(c.prize_score,0) prizeScore, |
| | | IFNULL(c.commission,0) commission, |
| | | d.description levelName, |
| | | b.name |
| | | FROM mall_member a |
| | |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | |
| | | |
| | | <select id="selectTeamPage" resultType="cc.mrbird.febs.mall.vo.sale.ApiTeamListInfoVo"> |
| | | |
| | | SELECT |
| | | a. NAME memberName, |
| | | a.is_sale isSale, |
| | | a.CREATED_TIME createdTime, |
| | | ifnull( |
| | | ( |
| | | SELECT |
| | | count(c.id) |
| | | FROM |
| | | mall_order_info c |
| | | WHERE |
| | | a.id = c.member_id |
| | | and c.status = 4 |
| | | ), |
| | | 0 |
| | | ) orderCnt, |
| | | ifnull( |
| | | ( |
| | | SELECT |
| | | sum(b.amount) |
| | | FROM |
| | | mall_order_info b |
| | | WHERE |
| | | a.id = b.member_id |
| | | and b.status = 4 |
| | | ), |
| | | 0 |
| | | ) amount |
| | | FROM |
| | | mall_member a |
| | | <where> |
| | | and find_in_set(#{record.inviteId}, a.referrer_ids) |
| | | <if test="record != null" > |
| | | <if test="record.memberName != null and record.memberName != ''"> |
| | | and a.name like concat('%', #{record.memberName},'%') |
| | | </if> |
| | | <if test="record.startTime != null and record.startTime != ''"> |
| | | and a.CREATED_TIME >= #{record.startTime} |
| | | </if> |
| | | <if test="record.endTime != null and record.endTime != ''"> |
| | | and a.CREATED_TIME <= #{record.endTime} |
| | | </if> |
| | | </if> |
| | | </where> |
| | | order by a.CREATED_TIME desc |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="selectSalePage" resultType="cc.mrbird.febs.mall.vo.sale.ApiSaleListInfoVo"> |
| | | SELECT |
| | | c.name memberName, |
| | | a.CREATED_TIME createdTime, |
| | | a.cost_amount costAmount, |
| | | a.amount amount |
| | | FROM mall_achieve_record a |
| | | left join mall_order_info b on a.order_id = b.id |
| | | left join mall_member c on b.member_id = c.id |
| | | <where> |
| | | and a.member_id = #{record.memberId} |
| | | <if test="record != null" > |
| | | <if test="record.memberName != null and record.memberName != ''"> |
| | | and c.name like concat('%', #{record.memberName},'%') |
| | | </if> |
| | | <if test="record.startTime != null and record.startTime != ''"> |
| | | and a.CREATED_TIME >= #{record.startTime} |
| | | </if> |
| | | <if test="record.endTime != null and record.endTime != ''"> |
| | | and a.CREATED_TIME <= #{record.endTime} |
| | | </if> |
| | | </if> |
| | | </where> |
| | | order by a.CREATED_TIME desc |
| | | </select> |
| | | |
| | | </mapper> |