KKSU
2024-02-27 9fb1a68d11a8928f2ba602dd68dc00d19ca7429f
src/main/resources/mapper/modules/MallMemberMapper.xml
@@ -5,14 +5,23 @@
    <select id="selectMallMemberListInPage" resultType="cc.mrbird.febs.mall.entity.MallMember">
        SELECT
               m.*,
               a.name referrerName,
               a.account_login referrerName,
               IFNULL(c.balance,0) balance,
               IFNULL(c.score,0) score,
               IFNULL(c.prize_score,0) prizeScore,
               IFNULL(c.commission,0) commission,
               IFNULL(c.star,0) star,
               IFNULL(c.total_score,0) totalScore,
               d.description levelName
               IFNULL(c.voucher_cnt,0) voucherCnt,
               IFNULL(c.voucher_amount,0) voucherAmount,
               IFNULL(c.voucher_fire_cnt,0) voucherFireCnt,
                (SELECT
        sum(IFNULL(surplus_cnt, 0))
        FROM
        mall_score_record
        WHERE
        member_id = m.id) voucherCntSurplus,
        d.description levelName
        FROM mall_member m
        left join mall_member a on m.referrer_id = a.invite_id
        LEFT JOIN mall_member_wallet c on c.member_id = m.id
@@ -21,6 +30,9 @@
            <if test="record != null" >
                <if test="record.name!=null and record.name!=''">
                    and m.name like concat('%',  #{record.name},'%')
                </if>
                <if test="record.accountLogin!=null and record.accountLogin!=''">
                    and m.account_login like concat('%',  #{record.accountLogin},'%')
                </if>
                <if test="record.account!=null and record.account!=''">
                    and (
@@ -68,7 +80,11 @@
    </select>
    <select id="selectInfoByAccount" resultType="cc.mrbird.febs.mall.entity.MallMember">
        select * from mall_member where phone=#{account} or email=#{account} or invite_id=#{account}
        select * from mall_member where phone = #{account} or email = #{account} or invite_id=#{account}
    </select>
    <select id="selectInfoByAccountNew" resultType="cc.mrbird.febs.mall.entity.MallMember">
        select * from mall_member where phone = #{phone} and account_login = #{account}
    </select>
    <select id="selectInfoByInviteId" resultType="cc.mrbird.febs.mall.entity.MallMember">
@@ -82,7 +98,7 @@
    <select id="selectTeamListByInviteId" resultType="cc.mrbird.febs.mall.vo.TeamListVo">
        select
            a.id,
            a.name,
            a.account_login name,
            a.phone,
            a.invite_id,
            2 isCurrent,
@@ -161,6 +177,9 @@
        left join data_dictionary_custom a on a.code = m.level
        <where>
            <if test="record != null" >
                <if test="record.accountLogin!=null and record.accountLogin!=''">
                    and m.account_login like concat('%',  #{record.accountLogin},'%')
                </if>
                <if test="record.name!=null and record.name!=''">
                    and m.name like concat('%',  #{record.name},'%')
                </if>
@@ -431,4 +450,31 @@
        from mall_member
        where store_master = #{state}
    </select>
    <select id="selectByRole" resultType="cc.mrbird.febs.mall.entity.MallMember">
        select * from mall_member
        <where>
            <if test="type == 3">
                and creater = #{state}
            </if>
            <if test="type == 4">
                and partner = #{state}
            </if>
        </where>
    </select>
    <select id="selectByLevel" resultType="cc.mrbird.febs.mall.entity.MallMember">
        select * from mall_member
        where level = #{level}
    </select>
    <select id="selectByAccountLogin" resultType="cc.mrbird.febs.mall.entity.MallMember">
        select * from mall_member
        where account_login = #{accountLogin}
    </select>
    <select id="selectInfoByAccountLoginAndPwd" resultType="cc.mrbird.febs.mall.entity.MallMember">
        select * from mall_member
        where account_login = #{accountLogin} and password = #{password}
    </select>
</mapper>