| | |
| | | and ( |
| | | m.phone like concat('%', #{record.account},'%') |
| | | or m.email like concat('%', #{record.account},'%') |
| | | or m.bind_phone like concat('%', #{record.account},'%') |
| | | or m.invite_id like concat('%', #{record.account},'%') |
| | | ) |
| | | </if> |
| | |
| | | 2 isCurrent, |
| | | a.created_time, |
| | | (select sum(b.amount) from mall_member e |
| | | inner join mall_order_info b on e.id=b.member_id and b.status=4 |
| | | inner join mall_order_info b on e.id=b.member_id and b.status in (2, 3, 4) |
| | | where e.invite_id=a.invite_id or e.referrer_id=a.invite_id) amount, |
| | | (select count(1) from mall_member e |
| | | inner join mall_order_info b on e.id=b.member_id and b.status=4 |
| | | inner join mall_order_info b on e.id=b.member_id and b.status in (2, 3, 4) |
| | | where e.invite_id=a.invite_id or e.referrer_id=a.invite_id) orderCnt, |
| | | (select count(1) from mall_member x where x.referrer_id=a.invite_id) cnt |
| | | from mall_member a |
| | |
| | | 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 |
| | | inner join mall_order_info b on e.id=b.member_id and b.status in (2, 3, 4) |
| | | where e.invite_id=#{inviteId} or e.referrer_id=#{inviteId} |
| | | </select> |
| | | |
| | |
| | | select |
| | | IFNULL(count(1),0) |
| | | from mall_member e |
| | | inner join mall_order_info b on e.id=b.member_id and b.status=4 |
| | | inner join mall_order_info b on e.id=b.member_id and b.status in (2, 3, 4) |
| | | where e.invite_id=#{inviteId} or e.referrer_id=#{inviteId} |
| | | </select> |
| | | |
| | | <select id="selectByRefererId" resultType="cc.mrbird.febs.mall.entity.MallMember"> |
| | | select * from mall_member |
| | | where referrer_id=#{inviteId} |
| | | </select> |
| | | |
| | | <select id="selectChildAgentList" resultType="cc.mrbird.febs.mall.entity.MallMember"> |
| | | select * from mall_member |
| | | where (find_in_set(#{inviteId}, referrer_ids) or invite_id=#{inviteId}) and level=#{agentLevel} |
| | | </select> |
| | | |
| | | <select id="selectByInviteIds" resultType="cc.mrbird.febs.mall.entity.MallMember"> |
| | | select * from mall_member |
| | | where invite_id IN |
| | | <foreach collection = "list" item = "item" separator="," open = "(" close = ")" > |
| | | #{item} |
| | | </foreach > |
| | | order by id desc |
| | | </select> |
| | | |
| | | <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 |
| | | FROM mall_member m |
| | | left join data_dictionary_custom a on a.code = m.level |
| | | <where> |
| | | <if test="record != null" > |
| | | <if test="record.name!=null and record.name!=''"> |
| | | and m.name like concat('%', #{record.name},'%') |
| | | </if> |
| | | <if test="record.level!=null and record.level!=''"> |
| | | and m.level = #{record.level} |
| | | </if> |
| | | <if test="record.account!=null and record.account!=''"> |
| | | and m.phone like concat('%', #{record.account},'%') |
| | | </if> |
| | | </if> |
| | | </where> |
| | | group by m.id |
| | | order by m.CREATED_TIME desc |
| | | </select> |
| | | |
| | | <select id="selectChildAgentListByInviteId" resultType="cc.mrbird.febs.mall.entity.MallMember"> |
| | | select * from mall_member where referrer_id = #{inviteId} |
| | | </select> |
| | | |
| | | <select id="selectAllChildAgentListByInviteId" resultType="cc.mrbird.febs.mall.entity.MallMember"> |
| | | select * from mall_member where find_in_set(#{inviteId}, referrer_ids) |
| | | </select> |
| | | |
| | | <select id="selectMemberParentAgentList" resultType="cc.mrbird.febs.mall.entity.MallMember"> |
| | | select * from mall_member |
| | | where level not in ('ZERO_LEVEL', 'FIRST_LEVEL') and invite_id!=#{refererId} and invite_id IN |
| | | <foreach collection = "list" item = "item" separator="," open = "(" close = ")" > |
| | | #{item} |
| | | </foreach > |
| | | order by id desc |
| | | </select> |
| | | |
| | | <select id="getAgentLevelListInPage" resultType="cc.mrbird.febs.mall.vo.AdminAgentLevelVo"> |
| | | SELECT |
| | | a.id,b.description name |
| | | FROM |
| | | data_dictionary_custom a |
| | | left JOIN data_dictionary_custom b on a.code = b.code |
| | | where a.type = 'AGENT_LEVEL_REQUIRE' |
| | | GROUP BY a.id |
| | | ORDER BY |
| | | a.CREATED_TIME DESC |
| | | </select> |
| | | |
| | | <select id="getAgentChildInPage" resultType="cc.mrbird.febs.mall.vo.AdminAgentMemberVo"> |
| | | select m.*,a.description levelName from mall_member m |
| | | left join data_dictionary_custom a on a.code = m.level |
| | | where find_in_set(#{record.inviteId}, m.referrer_ids) |
| | | GROUP BY m.id |
| | | ORDER BY |
| | | m.CREATED_TIME DESC |
| | | </select> |
| | | |
| | | <select id="getRankAwardListInPage" resultType="cc.mrbird.febs.mall.vo.AdminRankAwardVo"> |
| | | select a.* from data_dictionary_custom a where a.type = 'RANK_AWARD' or a.type = 'RANK_AWARD_SETTING' |
| | | </select> |
| | | |
| | | |
| | | <select id="getAgentTeamAmountByInviteId" resultType="java.math.BigDecimal"> |
| | | 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 |
| | | WHERE |
| | | e.invite_id = #{inviteId} |
| | | OR e.referrer_id = #{inviteId} |
| | | or find_in_set(#{inviteId}, e.referrer_ids) |
| | | </select> |
| | | |
| | | <select id="getAppVersionListInPage" resultType="cc.mrbird.febs.mall.entity.AppVersion"> |
| | | select a.* from app_version a |
| | | </select> |
| | | |
| | | <select id="selectByIdAndNoLevel" resultType="cc.mrbird.febs.mall.entity.MallMember"> |
| | | select * from mall_member where referrer_id=#{refererId} and level != #{level} |
| | | </select> |
| | | </mapper> |