| | |
| | | GROUP BY m.id order by m.CREATED_TIME desc |
| | | </select> |
| | | |
| | | <select id="selectHappyMemberListInPage" resultType="cc.mrbird.febs.mall.entity.MallMember"> |
| | | SELECT |
| | | a.*, |
| | | 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 |
| | | <where> |
| | | <if test="record != null" > |
| | | <if test="record.birthdayQuery!=null"> |
| | | and date_format(a.birthday, '%m-%d') = date_format(#{record.birthdayQuery}, '%m-%d') |
| | | </if> |
| | | <if test="record.name!=null and record.name!=''"> |
| | | and a.name like concat('%', #{record.name},'%') |
| | | </if> |
| | | <if test="record.phone!=null and record.phone!=''"> |
| | | and a.phone like concat('%', #{record.phone},'%') |
| | | </if> |
| | | <if test="record.accountStatus!=null"> |
| | | and a.account_status = #{record.accountStatus} |
| | | </if> |
| | | <if test="record.director!=null"> |
| | | and a.director = #{record.director} |
| | | </if> |
| | | <if test="record.storeMaster!=null"> |
| | | and a.store_master = #{record.storeMaster} |
| | | </if> |
| | | <if test="record.accountType != null" > |
| | | and a.account_type = #{record.accountType} |
| | | </if> |
| | | <if test="record.level!=null and record.level!=''"> |
| | | and a.level=#{record.level} |
| | | </if> |
| | | <if test="record.checkOrder!=null"> |
| | | and a.check_order=#{record.checkOrder} |
| | | </if> |
| | | </if> |
| | | </where> |
| | | GROUP BY a.id order by a.CREATED_TIME desc |
| | | </select> |
| | | |
| | | <select id="getMallMemberInfoById" resultType="cc.mrbird.febs.mall.vo.MallMemberVo"> |
| | | SELECT a.id, |
| | | a.name, |
| | |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | |
| | | |
| | | <update id="updateLastLoginTime"> |
| | | update mall_member |
| | | set last_login_time = #{lastLoginTime} |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | |
| | | |
| | | <select id="selectTeamPage" resultType="cc.mrbird.febs.mall.vo.sale.ApiTeamListInfoVo"> |
| | | |
| | | SELECT |
| | | a.name memberName, |
| | | a.CREATED_TIME createdTime, |
| | | ( |
| | | SELECT |
| | | count(c.id) |
| | | FROM |
| | | mall_achieve_record c |
| | | where a.id = c.member_id |
| | | ) orderCnt, |
| | | ( |
| | | SELECT |
| | | sum(b.amount, 0) |
| | | FROM |
| | | mall_achieve_record b |
| | | where a.id = b.member_id |
| | | ) 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> |