<?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="org.springblade.modules.system.mapper.UserAppMapper">


    <select id="getPageList" resultType="org.springblade.modules.system.vo.UserAppVO">

        SELECT
            bu.phone, bu.create_time, bu.real_name,bu.code,bu.account username, bua.*
        FROM
	        blade_user_app bua LEFT JOIN blade_user bu ON bua.user_id = bu.id
        WHERE 1=1

        <if test="param.username != null" >
            and bu.account like concat(concat('%', #{param.username}), '%')
        </if>

        <if test="param.code != null" >
            and bu.code like concat(concat('%', #{param.code}), '%')
        </if>

        <if test="param.realName != null" >
            and bu.real_name like concat(concat('%', #{param.realName}), '%')
        </if>

        <if test="param.enableAuth != null" >
            and bua.enable_auth = #{param.enableAuth}
        </if>

        <if test="param.state != null" >
            and bua.state = #{param.state}
        </if>
        order by bu.create_time desc

    </select>
</mapper>
