| | |
| | | a.phone, |
| | | a.invite_id, |
| | | a.account_level, |
| | | a.level, |
| | | 2 isCurrent, |
| | | a.created_time, |
| | | (select sum(e.amount) |
| | | from mall_order_info e |
| | | inner join mall_member b on e.member_id=b.ID |
| | | inner join mall_order_item c on e.id = c.order_id -- and c.is_normal=2 |
| | | where e.status <![CDATA[>= ]]> 4 and (b.invite_id=a.invite_id or b.referrer_id=a.invite_id)) amount, |
| | | where e.status = 4 and e.comment_state = 2 and (find_in_set(a.invite_id, b.referrer_ids) or b.invite_id = a.invite_id)) amount, |
| | | (select count(1) from mall_order_info b |
| | | inner join mall_member e on e.id=b.member_id and b.status <![CDATA[>= ]]> 4 |
| | | where find_in_set(a.invite_id, e.referrer_ids)) orderCnt, |
| | | inner join mall_member e on e.id=b.member_id and b.status = 4 and b.comment_state = 2 |
| | | where find_in_set(a.invite_id, e.referrer_ids) OR e.invite_id = a.invite_id) orderCnt, |
| | | (select count(1) from mall_member x where find_in_set(a.invite_id, x.referrer_ids)) cnt |
| | | from mall_member a |
| | | inner join mall_member_wallet p on a.id=p.member_id |
| | |
| | | |
| | | <select id="getAgentListInPage" resultType="cc.mrbird.febs.mall.vo.AdminAgentVo"> |
| | | |
| | | SELECT m.*,a.description levelName, |
| | | ifnull(( |
| | | SELECT |
| | | sum(b.amount) |
| | | FROM |
| | | mall_member e |
| | | INNER JOIN mall_order_info b ON e.id = b.member_id |
| | | AND b. STATUS = 4 |
| | | WHERE |
| | | e.invite_id = m.invite_id |
| | | OR e.referrer_id = m.invite_id |
| | | or find_in_set(m.invite_id, e.referrer_ids) |
| | | ),0) amount |
| | | SELECT m.*,a.description levelName |
| | | FROM mall_member m |
| | | left join data_dictionary_custom a on a.description = m.level |
| | | <where> |
| | | and m.level != '代理' |
| | | 1= 1 |
| | | and m.level != 'VIP' |
| | | <if test="record != null" > |
| | | <if test="record.name!=null and record.name!=''"> |
| | | and m.name like concat('%', #{record.name},'%') |
| | |
| | | SELECT |
| | | ifnull(sum(b.amount),0) |
| | | FROM |
| | | mall_member e |
| | | INNER JOIN mall_order_info b ON e.id = b.member_id |
| | | AND b. STATUS = 4 |
| | | mall_order_info b |
| | | INNER JOIN mall_member e ON e.id = b.member_id |
| | | and b.comment_state = 2 |
| | | WHERE |
| | | e.invite_id = #{inviteId} |
| | | OR e.referrer_id = #{inviteId} |
| | | or find_in_set(#{inviteId}, e.referrer_ids) |
| | | </select> |
| | | |
| | |
| | | <select id="selectAchieveByMemberId" resultType="java.math.BigDecimal"> |
| | | select IFNULL(sum(IFNULL(a.amount, 0)), 0) |
| | | from mall_order_info a |
| | | inner join mall_member b on a.member_id=b.ID |
| | | where 1=1 |
| | | and a.status <![CDATA[>= ]]> 4 |
| | | and a.comment_state = 2 |
| | | <if test="type == 1"> |
| | | and b.invite_id=#{inviteId} |
| | | </if> |
| | | <if test="type == 2"> |
| | | and find_in_set(#{inviteId}, b.referrer_ids) |
| | | AND a.member_id IN ( |
| | | SELECT |
| | | id |
| | | FROM |
| | | mall_member |
| | | WHERE |
| | | 1 = 1 |
| | | AND ( |
| | | find_in_set(#{inviteId}, referrer_ids) |
| | | OR invite_id = #{inviteId} |
| | | ) |
| | | ) |
| | | </if> |
| | | </select> |
| | | |
| | |
| | | where |
| | | id = #{id} |
| | | </update> |
| | | |
| | | <select id="selectMemberChargeListInPage" resultType="cc.mrbird.febs.mall.entity.MemberCoinChargeEntity"> |
| | | SELECT a.*, |
| | | b.name name |
| | | FROM member_coin_charge a |
| | | inner join mall_member b on a.member_id = b.id |
| | | <where> |
| | | <if test="record != null" > |
| | | <if test="record.name!=null and record.name!=''"> |
| | | and b.name like concat('%', #{record.name},'%') |
| | | </if> |
| | | <if test="record.address!=null and record.address!=''"> |
| | | and a.address like concat('%', #{record.address},'%') |
| | | </if> |
| | | </if> |
| | | </where> |
| | | order by a.CREATED_TIME desc |
| | | </select> |
| | | |
| | | <select id="getSumAmountByMemberId" resultType="java.math.BigDecimal"> |
| | | SELECT |
| | | IFNULL(sum(IFNULL(a.amount, 0)), 0) |
| | | FROM |
| | | mall_order_info a |
| | | WHERE |
| | | 1 = 1 |
| | | AND a.comment_state = 2 |
| | | and a.member_id = #{memberId} |
| | | </select> |
| | | </mapper> |