peng
12 小时以前 4372e6406222ce6b33f8c1c0703b460d39b5814e
framework/src/main/resources/mapper/lmk/CustomerMapper.xml
@@ -26,6 +26,7 @@
        <result property="gradeId" column="grade_id"/>
        <result property="experience" column="experience"/>
        <result property="createTime" column="create_time"/>
        <result property="blackId" column="blackId"/>
        <collection property="customerTagList"  ofType="cn.lili.modules.lmk.domain.vo.CustomerTagVO"
                    select="selectTagByMemberId"
                    column="id"
@@ -34,39 +35,36 @@
    <select id="getPage" resultMap="BaseResultMap">
        SELECT
            *
            LM.*
        FROM
            li_member lm
            li_member LM
        LEFT JOIN lmk_customer_black LMK ON LM.id = LMK.user_id and LMK.delete_flag = 0
        <where>
        <!-- 用户名模糊查询 -->
        <if test="query.username != null and query.username != ''">
            AND lm.username LIKE CONCAT('%', #{query.username}, '%')
            AND LM.username LIKE CONCAT('%', #{query.username}, '%')
        </if>
        <!-- 昵称模糊查询 -->
        <if test="query.nickName != null and query.nickName != ''">
            AND lm.nick_name LIKE CONCAT('%', #{query.nickName}, '%')
            AND LM.nick_name LIKE CONCAT('%', #{query.nickName}, '%')
        </if>
        <!-- 手机号码精确查询 -->
        <if test="query.mobile != null and query.mobile != ''">
            AND lm.mobile = #{query.mobile}
            AND LM.mobile = #{query.mobile}
        </if>
        <!-- 会员状态转 -->
        <if test="query.disabled != null and query.disabled != ''">
            AND lm.disabled = #{query.disabled}
            AND LM.disabled = #{query.disabled}
        </if>
        <!-- 商铺id -->
        <if test="query.storeId != null and query.storeId != ''">
            AND lm.store_id = #{query.storeId}
            AND LM.store_id = #{query.storeId}
        </if>
            AND EXISTS (
            SELECT 1
            FROM li_order lo
            WHERE lo.member_id = lm.id
            )
            AND LM.delete_flag = 0
        </where>
        ORDER BY lm.create_time DESC
    </select>