<?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.sys.modular.user.mapper.SysUserMapper">

    <select id="page" resultType="vip.xiaonuo.sys.modular.user.entity.SysUser">
        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>

    <delete id="deleteIgnoreInterceptor">
        DELETE FROM SYS_USER ${ew.customSqlSegment}
    </delete>
</mapper>
