<?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.changhu.mapper.ManagementMapper">
    <select id="miniProgramUserPager" resultType="com.changhu.pojo.vo.UnitMiniProgramUserPagerVo">
        select
        mpu.*
        from mini_program_user mpu
        where
        mpu.delete_flag = 0
        and mpu.identity = #{identity.value}
        and mpu.unit_id = ${@com.changhu.common.utils.UserUtil@getUnitId()}
        <if test="params.name!=null and params.name!=''">
            and mpu.name like concat('%',#{params.name},'%')
        </if>
        <if test="params.telephone!=null and params.telephone!=''">
            and mpu.telephone like concat('%',#{params.telephone},'%')
        </if>
        <if test="params.sex!=null">
            and mpu.sex = #{params.sex.value}
        </if>
        <if test="params.isEnable!=null">
            and mpu.is_enable = #{params.isEnable.value}
        </if>
        order by mpu.create_time desc
    </select>
</mapper>