| | |
| | | </select> |
| | | |
| | | <select id="selectInfoByAccount" resultType="cc.mrbird.febs.mall.entity.MallMember"> |
| | | select * from mall_member where phone=#{account} or email=#{account} |
| | | select * from mall_member where phone=#{account} or email=#{account} or invite_id=#{account} |
| | | </select> |
| | | |
| | | <select id="selectInfoByInviteId" resultType="cc.mrbird.febs.mall.entity.MallMember"> |
| | |
| | | (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=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 |
| | | 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 |
| | | where a.referrer_id=#{inviteId} |
| | | </select> |
| | | |
| | | <select id="selectOwnAmountByInviteId" resultType="java.math.BigDecimal"> |
| | | <select id="selectOwnOrderAmountByInviteId" resultType="java.math.BigDecimal"> |
| | | select |
| | | sum(b.amount) |
| | | 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} |
| | | </select> |
| | | |
| | | <select id="selectOwnCntByInviteId" resultType="java.lang.Integer"> |
| | | select count(1) from mall_member x where x.referrer_id=#{inviteId} |
| | | select IFNULL(count(1),0) from mall_member x where x.referrer_id=#{inviteId} |
| | | </select> |
| | | |
| | | <select id="selectOwnOrderCntByInviteId" resultType="java.lang.Integer"> |
| | | 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 |
| | | where e.invite_id=#{inviteId} or e.referrer_id=#{inviteId} |
| | | </select> |
| | | </mapper> |