xiaoyong931011
2023-01-06 f07c7f23ede5e6cc3c2dae4715a3f0ccf879cbc8
src/main/resources/mapper/modules/MallMemberMapper.xml
@@ -77,15 +77,16 @@
            a.name,
            a.phone,
            a.invite_id,
            a.account_level,
            a.level,
            2 isCurrent,
            a.created_time,
            (select sum(e.amount)
             from mall_order_info e
                      inner join mall_member b on e.member_id=b.ID
                      inner join mall_order_item c on e.id = c.order_id -- and c.is_normal=2
             where e.status <![CDATA[>= ]]> 4 and (b.invite_id=a.invite_id or b.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 <![CDATA[>= ]]> 4
             where e.status = 4 and e.comment_state = 2 and find_in_set(a.invite_id, b.referrer_ids)) amount,
            (select count(1) from mall_order_info b
                      inner join mall_member e on e.id=b.member_id and b.status = 4 and b.comment_state = 2
             where find_in_set(a.invite_id, e.referrer_ids)) orderCnt,
            (select count(1) from mall_member x where find_in_set(a.invite_id, x.referrer_ids)) cnt
        from mall_member a
@@ -141,7 +142,7 @@
        FROM
        mall_member e
        INNER JOIN mall_order_info b ON e.id = b.member_id
        AND b. STATUS = 4
        AND b.STATUS = 4 and b.comment_state = 2
        WHERE
        e.invite_id = m.invite_id
        OR e.referrer_id = m.invite_id
@@ -150,7 +151,7 @@
        FROM mall_member m
        left join data_dictionary_custom a on a.description = m.level
        <where>
            and m.level != '代理'
            and m.level != 'VIP'
            <if test="record != null" >
                <if test="record.name!=null and record.name!=''">
                    and m.name like concat('%',  #{record.name},'%')
@@ -214,7 +215,8 @@
            FROM
                mall_member e
                    INNER JOIN mall_order_info b ON e.id = b.member_id
                    AND b. STATUS = 4
                    AND b.STATUS = 4
                    and b.comment_state = 2
            WHERE
                e.invite_id = #{inviteId}
               OR e.referrer_id = #{inviteId}
@@ -356,12 +358,13 @@
        from mall_order_info a
             inner join mall_member b on a.member_id=b.ID
        where 1=1
        and a.status <![CDATA[>= ]]> 4
        and a.status = 4
        and a.comment_state = 2
        <if test="type == 1">
            and b.invite_id=#{inviteId}
        </if>
        <if test="type == 2">
            and find_in_set(#{inviteId}, b.referrer_ids)
            and (find_in_set(#{inviteId}, b.referrer_ids) or b.invite_id=#{inviteId})
        </if>
    </select>
@@ -444,4 +447,22 @@
        where
            id = #{id}
    </update>
    <select id="selectMemberChargeListInPage" resultType="cc.mrbird.febs.mall.entity.MemberCoinChargeEntity">
        SELECT a.*,
               b.name name
        FROM member_coin_charge a
        inner join mall_member b on a.member_id = b.id
        <where>
            <if test="record != null" >
                <if test="record.name!=null and record.name!=''">
                    and b.name like concat('%',  #{record.name},'%')
                </if>
                <if test="record.address!=null and record.address!=''">
                    and a.address like concat('%',  #{record.address},'%')
                </if>
            </if>
        </where>
        order by a.CREATED_TIME desc
    </select>
</mapper>