<?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="vip.xiaonuo.biz.modular.user.mapper.BizUserMapper">
    <select id="page" resultType="vip.xiaonuo.biz.modular.user.entity.BizUser">
        select
        a.*,
        sr.TARGET_ID ROLE_ID,
        GROUP_CONCAT(sro.NAME) as roleName
        from SYS_USER a
        left join SYS_RELATION sr on sr.OBJECT_ID = a.ID
        left join SYS_ROLE sro on sr.TARGET_ID = sro.ID
        <where>
            ${ew.sqlSegment}
        </where>
        GROUP BY a.ID
        ORDER BY a.CREATE_TIME ASC
    </select>


    <select id="driverPage" resultType="vip.xiaonuo.biz.modular.user.entity.BizUser">
        select
        a.ID,
        a.NAME,
        a.ACCOUNT,
        a.PHONE,
        a.NICKNAME,
        a.USER_STATUS,
        a.CREATE_TIME
        from SYS_USER a
        left join SYS_RELATION sr on sr.OBJECT_ID = a.ID
        <where>
            ${ew.sqlSegment}
        </where>
    </select>
</mapper>
