| | |
| | | a.level, |
| | | a.account_status, |
| | | a.CREATED_TIME, |
| | | c.balance, |
| | | IFNULL(c.balance,0) balance, |
| | | d.description levelName, |
| | | b.name |
| | | FROM mall_member a |
| | | LEFT JOIN mall_member b on a.referrer_id = b.invite_id |
| | | LEFT JOIN mall_member_wallet c on c.member_id = a.id |
| | | LEFT JOIN data_dictionary_custom d on d.code = a.level |
| | | where a.id = #{id} |
| | | GROUP BY a.id |
| | | </select> |
| | | |
| | | <select id="selectInfoByAccount" resultType="cc.mrbird.febs.mall.entity.MallMember"> |
| | |
| | | <select id="selectByIdAndNoLevel" resultType="cc.mrbird.febs.mall.entity.MallMember"> |
| | | select * from mall_member where referrer_id=#{refererId} and level != #{level} |
| | | </select> |
| | | |
| | | <select id="selectMallMemberByInviteIdAndLevel" resultType="cc.mrbird.febs.mall.entity.MallMember"> |
| | | SELECT |
| | | m.*, b. |
| | | VALUE |
| | | |
| | | FROM |
| | | mall_member m |
| | | LEFT JOIN data_dictionary_custom b ON m. LEVEL = b. CODE |
| | | WHERE |
| | | find_in_set(#{inviteId}, m.referrer_ids) |
| | | AND b.type = 'AGENT_LEVEL' |
| | | AND b.VALUE > ( |
| | | SELECT |
| | | VALUE |
| | | FROM |
| | | data_dictionary_custom a |
| | | WHERE |
| | | a. CODE = #{level} |
| | | AND a.type = 'AGENT_LEVEL' |
| | | ) |
| | | GROUP BY |
| | | m.id |
| | | </select> |
| | | </mapper> |