<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

<mapper namespace="com.pine.admin.modules.business.dao.CustomerDao">

    <!-- 可根据自己的需求，是否要使用 -->
    <resultMap type="com.pine.admin.modules.business.entity.Customer" id="entityMap">
        <result property="id" column="id"/>
        <result property="username" column="username"/>
        <result property="password" column="password"/>
        <result property="nickname" column="nickname"/>
        <result property="image" column="image"/>
        <result property="relename" column="relename"/>
        <result property="cardid" column="cardid"/>
        <result property="gender" column="gender"/>
        <result property="birthday" column="birthday"/>
    </resultMap>

    <sql id="Base_Column_List">
                 id,
                     username,
--                      password,
--                      nickname,
--                      image,
--                      relename,
--                      cardid,
--                      gender,
--                      birthday,
--                      monthly_income,
--                      marriage_status,
                     mobile,
--                      email,
--                      modified_email,
--                      check_code,
--                      province,
--                      city,
--                      county,
--                      detailaddress,
--                      interest,
--                      store_id,
--                      type,
--                      consumption_amount,
--                      paypassword,
--                      source,
--                      status,
--                      sign_num,
--                      is_mobile_verification,
--                      is_email_verification,
--                      login_error_count,
--                      del_flag,
--                      create_time,
--                      modify_time,
--                      del_time,
--                      lock_time,
--                      last_login_time,
--                      recommended,
--                      self_recommend_code,
--                      commission,
--                     belone_store_id
                        </sql>
    <!-- 根据Id查询-->
    <select id="selectByPrimaryKey" resultMap="entityMap" parameterType="java.lang.Integer">
        select
        <include refid="Base_Column_List"/>
        from ls_customer
        where id = #{id,jdbcType=INTEGER} and del_flag = '0'
    </select>

    <!-- 根据Id删除-->
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
		delete from ls_customer
		where id = #{id,jdbcType=INTEGER}
	</delete>

    <!-- 插入数据-->
    <insert id="insertSelective" parameterType="com.pine.admin.modules.business.entity.Customer"
            useGeneratedKeys="true" keyProperty="id">
        insert into ls_customer
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="username != null">username,</if>
            <if test="password != null">password,</if>
            <if test="nickname != null">nickname,</if>
            <if test="image != null">image,</if>
            <if test="relename != null">relename,</if>
            <if test="cardid != null">cardid,</if>
            <if test="gender != null">gender,</if>
            <if test="birthday != null">birthday,</if>
            <if test="monthlyIncome != null">monthly_income,</if>
            <if test="marriageStatus != null">marriage_status,</if>
            <if test="mobile != null">mobile,</if>
            <if test="email != null">email,</if>
            <if test="modifiedEmail != null">modified_email,</if>
            <if test="checkCode != null">check_code,</if>
            <if test="province != null">province,</if>
            <if test="city != null">city,</if>
            <if test="county != null">county,</if>
            <if test="detailaddress != null">detailaddress,</if>
            <if test="interest != null">interest,</if>
            <if test="storeId != null">store_id,</if>
            <if test="type != null">type,</if>
            <if test="consumptionAmount != null">consumption_amount,</if>
            <if test="paypassword != null">paypassword,</if>
            <if test="source != null">source,</if>
            <if test="status != null">status,</if>
            <if test="signNum != null">sign_num,</if>
            <if test="isMobileVerification != null">is_mobile_verification,</if>
            <if test="isEmailVerification != null">is_email_verification,</if>
            <if test="loginErrorCount != null">login_error_count,</if>
            <if test="delFlag != null">del_flag,</if>
            <if test="createTime != null">create_time,</if>
            <if test="modifyTime != null">modify_time,</if>
            <if test="delTime != null">del_time,</if>
            <if test="lockTime != null">lock_time,</if>
            <if test="lastLoginTime != null">last_login_time,</if>
            <if test="recommended != null">recommended,</if>
            <if test="selfRecommendCode != null">self_recommend_code,</if>
            <if test="commission != null">commission,</if>
            <if test="beloneStoreId != null">belone_store_id,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="username != null">#{username},</if>
            <if test="password != null">#{password},</if>
            <if test="nickname != null">#{nickname},</if>
            <if test="image != null">#{image},</if>
            <if test="relename != null">#{relename},</if>
            <if test="cardid != null">#{cardid},</if>
            <if test="gender != null">#{gender},</if>
            <if test="birthday != null">#{birthday},</if>
            <if test="monthlyIncome != null">#{monthlyIncome},</if>
            <if test="marriageStatus != null">#{marriageStatus},</if>
            <if test="mobile != null">#{mobile},</if>
            <if test="email != null">#{email},</if>
            <if test="modifiedEmail != null">#{modifiedEmail},</if>
            <if test="checkCode != null">#{checkCode},</if>
            <if test="province != null">#{province},</if>
            <if test="city != null">#{city},</if>
            <if test="county != null">#{county},</if>
            <if test="detailaddress != null">#{detailaddress},</if>
            <if test="interest != null">#{interest},</if>
            <if test="storeId != null">#{storeId},</if>
            <if test="type != null">#{type},</if>
            <if test="consumptionAmount != null">#{consumptionAmount},</if>
            <if test="paypassword != null">#{paypassword},</if>
            <if test="source != null">#{source},</if>
            <if test="status != null">#{status},</if>
            <if test="signNum != null">#{signNum},</if>
            <if test="isMobileVerification != null">#{isMobileVerification},</if>
            <if test="isEmailVerification != null">#{isEmailVerification},</if>
            <if test="loginErrorCount != null">#{loginErrorCount},</if>
            <if test="delFlag != null">#{delFlag},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="modifyTime != null">#{modifyTime},</if>
            <if test="delTime != null">#{delTime},</if>
            <if test="lockTime != null">#{lockTime},</if>
            <if test="lastLoginTime != null">#{lastLoginTime},</if>
            <if test="recommended != null">#{recommended},</if>
            <if test="selfRecommendCode != null">#{selfRecommendCode},</if>
            <if test="commission != null">#{commission},</if>
            <if test="beloneStoreId != null">#{beloneStoreId},</if>
        </trim>
    </insert>

    <!-- 更新数据-->
    <update id="updateByPrimaryKeySelective" parameterType="com.pine.admin.modules.business.entity.Customer">
        update ls_customer
        <set>
            <if test="id != null">id = #{id},</if>
            <if test="username != null">username = #{username},</if>
            <if test="password != null">password = #{password},</if>
            <if test="nickname != null">nickname = #{nickname},</if>
            <if test="image != null">image = #{image},</if>
            <if test="relename != null">relename = #{relename},</if>
            <if test="cardid != null">cardid = #{cardid},</if>
            <if test="gender != null">gender = #{gender},</if>
            <if test="birthday != null">birthday = #{birthday},</if>
            <if test="monthlyIncome != null">monthly_income = #{monthlyIncome},</if>
            <if test="marriageStatus != null">marriage_status = #{marriageStatus},</if>
            <if test="mobile != null">mobile = #{mobile},</if>
            <if test="email != null">email = #{email},</if>
            <if test="modifiedEmail != null">modified_email = #{modifiedEmail},</if>
            <if test="checkCode != null">check_code = #{checkCode},</if>
            <if test="province != null">province = #{province},</if>
            <if test="city != null">city = #{city},</if>
            <if test="county != null">county = #{county},</if>
            <if test="detailaddress != null">detailaddress = #{detailaddress},</if>
            <if test="interest != null">interest = #{interest},</if>
            <if test="storeId != null">store_id = #{storeId},</if>
            <if test="type != null">type = #{type},</if>
            <if test="consumptionAmount != null">consumption_amount = #{consumptionAmount},</if>
            <if test="paypassword != null">paypassword = #{paypassword},</if>
            <if test="source != null">source = #{source},</if>
            <if test="status != null">status = #{status},</if>
            <if test="signNum != null">sign_num = #{signNum},</if>
            <if test="isMobileVerification != null">is_mobile_verification = #{isMobileVerification},</if>
            <if test="isEmailVerification != null">is_email_verification = #{isEmailVerification},</if>
            <if test="loginErrorCount != null">login_error_count = #{loginErrorCount},</if>
            <if test="delFlag != null">del_flag = #{delFlag},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="modifyTime != null">modify_time = #{modifyTime},</if>
            <if test="delTime != null">del_time = #{delTime},</if>
            <if test="lockTime != null">lock_time = #{lockTime},</if>
            <if test="lastLoginTime != null">last_login_time = #{lastLoginTime},</if>
            <if test="recommended != null">recommended = #{recommended},</if>
            <if test="selfRecommendCode != null">self_recommend_code = #{selfRecommendCode},</if>
            <if test="commission != null">commission = #{commission},</if>
            <if test="beloneStoreId != null">belone_store_id = #{beloneStoreId},</if>
        </set>
        where id = #{id,jdbcType=INTEGER}
    </update>

    <!-- 分页查询-->
    <select id="queryByPage" parameterType="java.util.Map"
            resultMap="entityMap">
        select
        <include refid="Base_Column_List"/>
        from ls_customer
        <where>
            and del_flag = 'N'
            <if test="record.id != null and !&quot;&quot;.equals(record.id)">
                and id = #{record.id}
            </if>
            <if test="record.username != null and !&quot;&quot;.equals(record.username)">
                and username = #{record.username}
            </if>
            <if test="record.password != null and !&quot;&quot;.equals(record.password)">
                and password = #{record.password}
            </if>
            <if test="record.nickname != null and !&quot;&quot;.equals(record.nickname)">
                and nickname = #{record.nickname}
            </if>
            <if test="record.image != null and !&quot;&quot;.equals(record.image)">
                and image = #{record.image}
            </if>
            <if test="record.relename != null and !&quot;&quot;.equals(record.relename)">
                and relename = #{record.relename}
            </if>
            <if test="record.cardid != null and !&quot;&quot;.equals(record.cardid)">
                and cardid = #{record.cardid}
            </if>
            <if test="record.gender != null and !&quot;&quot;.equals(record.gender)">
                and gender = #{record.gender}
            </if>
            <if test="record.birthday != null and !&quot;&quot;.equals(record.birthday)">
                and birthday = #{record.birthday}
            </if>
            <if test="record.monthlyIncome != null and !&quot;&quot;.equals(record.monthlyIncome)">
                and monthly_income = #{record.monthlyIncome}
            </if>
            <if test="record.marriageStatus != null and !&quot;&quot;.equals(record.marriageStatus)">
                and marriage_status = #{record.marriageStatus}
            </if>
            <if test="record.mobile != null and !&quot;&quot;.equals(record.mobile)">
                and mobile = #{record.mobile}
            </if>
            <if test="record.email != null and !&quot;&quot;.equals(record.email)">
                and email = #{record.email}
            </if>
            <if test="record.modifiedEmail != null and !&quot;&quot;.equals(record.modifiedEmail)">
                and modified_email = #{record.modifiedEmail}
            </if>
            <if test="record.checkCode != null and !&quot;&quot;.equals(record.checkCode)">
                and check_code = #{record.checkCode}
            </if>
            <if test="record.province != null and !&quot;&quot;.equals(record.province)">
                and province = #{record.province}
            </if>
            <if test="record.city != null and !&quot;&quot;.equals(record.city)">
                and city = #{record.city}
            </if>
            <if test="record.county != null and !&quot;&quot;.equals(record.county)">
                and county = #{record.county}
            </if>
            <if test="record.detailaddress != null and !&quot;&quot;.equals(record.detailaddress)">
                and detailaddress = #{record.detailaddress}
            </if>
            <if test="record.interest != null and !&quot;&quot;.equals(record.interest)">
                and interest = #{record.interest}
            </if>
            <if test="record.storeId != null and !&quot;&quot;.equals(record.storeId)">
                and store_id = #{record.storeId}
            </if>
            <if test="record.type != null and !&quot;&quot;.equals(record.type)">
                and type = #{record.type}
            </if>
            <if test="record.consumptionAmount != null and !&quot;&quot;.equals(record.consumptionAmount)">
                and consumption_amount = #{record.consumptionAmount}
            </if>
            <if test="record.paypassword != null and !&quot;&quot;.equals(record.paypassword)">
                and paypassword = #{record.paypassword}
            </if>
            <if test="record.source != null and !&quot;&quot;.equals(record.source)">
                and source = #{record.source}
            </if>
            <if test="record.status != null and !&quot;&quot;.equals(record.status)">
                and status = #{record.status}
            </if>
            <if test="record.signNum != null and !&quot;&quot;.equals(record.signNum)">
                and sign_num = #{record.signNum}
            </if>
            <if test="record.isMobileVerification != null and !&quot;&quot;.equals(record.isMobileVerification)">
                and is_mobile_verification = #{record.isMobileVerification}
            </if>
            <if test="record.isEmailVerification != null and !&quot;&quot;.equals(record.isEmailVerification)">
                and is_email_verification = #{record.isEmailVerification}
            </if>
            <if test="record.loginErrorCount != null and !&quot;&quot;.equals(record.loginErrorCount)">
                and login_error_count = #{record.loginErrorCount}
            </if>
            <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
                and del_flag = #{record.delFlag}
            </if>
            <if test="record.createTime != null and !&quot;&quot;.equals(record.createTime)">
                and create_time = #{record.createTime}
            </if>
            <if test="record.modifyTime != null and !&quot;&quot;.equals(record.modifyTime)">
                and modify_time = #{record.modifyTime}
            </if>
            <if test="record.delTime != null and !&quot;&quot;.equals(record.delTime)">
                and del_time = #{record.delTime}
            </if>
            <if test="record.lockTime != null and !&quot;&quot;.equals(record.lockTime)">
                and lock_time = #{record.lockTime}
            </if>
            <if test="record.lastLoginTime != null and !&quot;&quot;.equals(record.lastLoginTime)">
                and last_login_time = #{record.lastLoginTime}
            </if>
            <if test="record.recommended != null and !&quot;&quot;.equals(record.recommended)">
                and recommended = #{record.recommended}
            </if>
            <if test="record.selfRecommendCode != null and !&quot;&quot;.equals(record.selfRecommendCode)">
                and self_recommend_code = #{record.selfRecommendCode}
            </if>
            <if test="record.commission != null and !&quot;&quot;.equals(record.commission)">
                and commission = #{record.commission}
            </if>
            <if test="record.beloneStoreId != null and !&quot;&quot;.equals(record.beloneStoreId)">
                and belone_store_id = #{record.beloneStoreId}
            </if>
        </where>
        order by id desc
    </select>

    <!-- 全部查询 -->
    <select id="queryAll" parameterType="java.util.Map"
            resultMap="entityMap">
        select
        <include refid="Base_Column_List"/>
        from ls_customer
        <where>
            and del_flag = 'N'
            <if test="id != null and !&quot;&quot;.equals(id)">
                and id = #{id}
            </if>
            <if test="username != null and !&quot;&quot;.equals(username)">
                and username = #{username}
            </if>
            <if test="password != null and !&quot;&quot;.equals(password)">
                and password = #{password}
            </if>
            <if test="nickname != null and !&quot;&quot;.equals(nickname)">
                and nickname = #{nickname}
            </if>
            <if test="image != null and !&quot;&quot;.equals(image)">
                and image = #{image}
            </if>
            <if test="relename != null and !&quot;&quot;.equals(relename)">
                and relename = #{relename}
            </if>
            <if test="cardid != null and !&quot;&quot;.equals(cardid)">
                and cardid = #{cardid}
            </if>
            <if test="gender != null and !&quot;&quot;.equals(gender)">
                and gender = #{gender}
            </if>
            <if test="birthday != null and !&quot;&quot;.equals(birthday)">
                and birthday = #{birthday}
            </if>
            <if test="monthlyIncome != null and !&quot;&quot;.equals(monthlyIncome)">
                and monthly_income = #{monthlyIncome}
            </if>
            <if test="marriageStatus != null and !&quot;&quot;.equals(marriageStatus)">
                and marriage_status = #{marriageStatus}
            </if>
            <if test="mobile != null and !&quot;&quot;.equals(mobile)">
                and mobile = #{mobile}
            </if>
            <if test="email != null and !&quot;&quot;.equals(email)">
                and email = #{email}
            </if>
            <if test="modifiedEmail != null and !&quot;&quot;.equals(modifiedEmail)">
                and modified_email = #{modifiedEmail}
            </if>
            <if test="checkCode != null and !&quot;&quot;.equals(checkCode)">
                and check_code = #{checkCode}
            </if>
            <if test="province != null and !&quot;&quot;.equals(province)">
                and province = #{province}
            </if>
            <if test="city != null and !&quot;&quot;.equals(city)">
                and city = #{city}
            </if>
            <if test="county != null and !&quot;&quot;.equals(county)">
                and county = #{county}
            </if>
            <if test="detailaddress != null and !&quot;&quot;.equals(detailaddress)">
                and detailaddress = #{detailaddress}
            </if>
            <if test="interest != null and !&quot;&quot;.equals(interest)">
                and interest = #{interest}
            </if>
            <if test="storeId != null and !&quot;&quot;.equals(storeId)">
                and store_id = #{storeId}
            </if>
            <if test="type != null and !&quot;&quot;.equals(type)">
                and type = #{type}
            </if>
            <if test="consumptionAmount != null and !&quot;&quot;.equals(consumptionAmount)">
                and consumption_amount = #{consumptionAmount}
            </if>
            <if test="paypassword != null and !&quot;&quot;.equals(paypassword)">
                and paypassword = #{paypassword}
            </if>
            <if test="source != null and !&quot;&quot;.equals(source)">
                and source = #{source}
            </if>
            <if test="status != null and !&quot;&quot;.equals(status)">
                and status = #{status}
            </if>
            <if test="signNum != null and !&quot;&quot;.equals(signNum)">
                and sign_num = #{signNum}
            </if>
            <if test="isMobileVerification != null and !&quot;&quot;.equals(isMobileVerification)">
                and is_mobile_verification = #{isMobileVerification}
            </if>
            <if test="isEmailVerification != null and !&quot;&quot;.equals(isEmailVerification)">
                and is_email_verification = #{isEmailVerification}
            </if>
            <if test="loginErrorCount != null and !&quot;&quot;.equals(loginErrorCount)">
                and login_error_count = #{loginErrorCount}
            </if>
            <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
                and del_flag = #{delFlag}
            </if>
            <if test="createTime != null and !&quot;&quot;.equals(createTime)">
                and create_time = #{createTime}
            </if>
            <if test="modifyTime != null and !&quot;&quot;.equals(modifyTime)">
                and modify_time = #{modifyTime}
            </if>
            <if test="delTime != null and !&quot;&quot;.equals(delTime)">
                and del_time = #{delTime}
            </if>
            <if test="lockTime != null and !&quot;&quot;.equals(lockTime)">
                and lock_time = #{lockTime}
            </if>
            <if test="lastLoginTime != null and !&quot;&quot;.equals(lastLoginTime)">
                and last_login_time = #{lastLoginTime}
            </if>
            <if test="recommended != null and !&quot;&quot;.equals(recommended)">
                and recommended = #{recommended}
            </if>
            <if test="selfRecommendCode != null and !&quot;&quot;.equals(selfRecommendCode)">
                and self_recommend_code = #{selfRecommendCode}
            </if>
            <if test="commission != null and !&quot;&quot;.equals(commission)">
                and commission = #{commission}
            </if>
            <if test="beloneStoreId != null and !&quot;&quot;.equals(beloneStoreId)">
                and belone_store_id = #{beloneStoreId}
            </if>
        </where>
        order by id desc
    </select>

    <!-- 根据条件查询一个 -->
    <select id="queryOne" parameterType="java.util.Map"
            resultMap="entityMap">
        select
        <include refid="Base_Column_List"/>
        from ls_customer
        <where>
            and del_flag = 'N'
            <if test="id != null and !&quot;&quot;.equals(id)">
                and id = #{id}
            </if>
            <if test="username != null and !&quot;&quot;.equals(username)">
                and username = #{username}
            </if>
            <if test="password != null and !&quot;&quot;.equals(password)">
                and password = #{password}
            </if>
            <if test="nickname != null and !&quot;&quot;.equals(nickname)">
                and nickname = #{nickname}
            </if>
            <if test="image != null and !&quot;&quot;.equals(image)">
                and image = #{image}
            </if>
            <if test="relename != null and !&quot;&quot;.equals(relename)">
                and relename = #{relename}
            </if>
            <if test="cardid != null and !&quot;&quot;.equals(cardid)">
                and cardid = #{cardid}
            </if>
            <if test="gender != null and !&quot;&quot;.equals(gender)">
                and gender = #{gender}
            </if>
            <if test="birthday != null and !&quot;&quot;.equals(birthday)">
                and birthday = #{birthday}
            </if>
            <if test="monthlyIncome != null and !&quot;&quot;.equals(monthlyIncome)">
                and monthly_income = #{monthlyIncome}
            </if>
            <if test="marriageStatus != null and !&quot;&quot;.equals(marriageStatus)">
                and marriage_status = #{marriageStatus}
            </if>
            <if test="mobile != null and !&quot;&quot;.equals(mobile)">
                and mobile = #{mobile}
            </if>
            <if test="email != null and !&quot;&quot;.equals(email)">
                and email = #{email}
            </if>
            <if test="modifiedEmail != null and !&quot;&quot;.equals(modifiedEmail)">
                and modified_email = #{modifiedEmail}
            </if>
            <if test="checkCode != null and !&quot;&quot;.equals(checkCode)">
                and check_code = #{checkCode}
            </if>
            <if test="province != null and !&quot;&quot;.equals(province)">
                and province = #{province}
            </if>
            <if test="city != null and !&quot;&quot;.equals(city)">
                and city = #{city}
            </if>
            <if test="county != null and !&quot;&quot;.equals(county)">
                and county = #{county}
            </if>
            <if test="detailaddress != null and !&quot;&quot;.equals(detailaddress)">
                and detailaddress = #{detailaddress}
            </if>
            <if test="interest != null and !&quot;&quot;.equals(interest)">
                and interest = #{interest}
            </if>
            <if test="storeId != null and !&quot;&quot;.equals(storeId)">
                and store_id = #{storeId}
            </if>
            <if test="type != null and !&quot;&quot;.equals(type)">
                and type = #{type}
            </if>
            <if test="consumptionAmount != null and !&quot;&quot;.equals(consumptionAmount)">
                and consumption_amount = #{consumptionAmount}
            </if>
            <if test="paypassword != null and !&quot;&quot;.equals(paypassword)">
                and paypassword = #{paypassword}
            </if>
            <if test="source != null and !&quot;&quot;.equals(source)">
                and source = #{source}
            </if>
            <if test="status != null and !&quot;&quot;.equals(status)">
                and status = #{status}
            </if>
            <if test="signNum != null and !&quot;&quot;.equals(signNum)">
                and sign_num = #{signNum}
            </if>
            <if test="isMobileVerification != null and !&quot;&quot;.equals(isMobileVerification)">
                and is_mobile_verification = #{isMobileVerification}
            </if>
            <if test="isEmailVerification != null and !&quot;&quot;.equals(isEmailVerification)">
                and is_email_verification = #{isEmailVerification}
            </if>
            <if test="loginErrorCount != null and !&quot;&quot;.equals(loginErrorCount)">
                and login_error_count = #{loginErrorCount}
            </if>
            <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
                and del_flag = #{delFlag}
            </if>
            <if test="createTime != null and !&quot;&quot;.equals(createTime)">
                and create_time = #{createTime}
            </if>
            <if test="modifyTime != null and !&quot;&quot;.equals(modifyTime)">
                and modify_time = #{modifyTime}
            </if>
            <if test="delTime != null and !&quot;&quot;.equals(delTime)">
                and del_time = #{delTime}
            </if>
            <if test="lockTime != null and !&quot;&quot;.equals(lockTime)">
                and lock_time = #{lockTime}
            </if>
            <if test="lastLoginTime != null and !&quot;&quot;.equals(lastLoginTime)">
                and last_login_time = #{lastLoginTime}
            </if>
            <if test="recommended != null and !&quot;&quot;.equals(recommended)">
                and recommended = #{recommended}
            </if>
            <if test="selfRecommendCode != null and !&quot;&quot;.equals(selfRecommendCode)">
                and self_recommend_code = #{selfRecommendCode}
            </if>
            <if test="commission != null and !&quot;&quot;.equals(commission)">
                and commission = #{commission}
            </if>
            <if test="beloneStoreId != null and !&quot;&quot;.equals(beloneStoreId)">
                and belone_store_id = #{beloneStoreId}
            </if>
        </where>
        LIMIT 1
    </select>
    <select id="getById" parameterType="java.lang.Long" resultType="com.pine.admin.modules.business.entity.Customer">
                select id,username,mobile from ls_customer where id = #{id} and del_flag = '0'
    </select>

    <update id="delete">
        UPDATE ls_customer SET del_flag = 'Y'
        <where>
            AND id = #{id}
        </where>
    </update>

    <update id="deleteIds" parameterType="java.util.ArrayList">
        UPDATE ls_customer SET del_flag = 'Y'
        WHERE id IN
        <foreach item='ids' collection="array" index="index" open="(" separator="," close=")">
            #{ids}
        </foreach>
    </update>

</mapper>
