<?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="shop.alien.mapper.LifeSysMapper">


    <select id="selectPageAndRoleName" resultType="shop.alien.entity.store.vo.LifeSysVo">
        SELECT
            ls.*,
            IFNULL(GROUP_CONCAT(DISTINCT lsr.role_name SEPARATOR ','), '') AS roleName,
            IFNULL(GROUP_CONCAT(DISTINCT lsr.role_id SEPARATOR ','), '') AS roleId
        FROM life_sys ls
                 LEFT JOIN life_sys_user_role lsur ON lsur.user_id = ls.id
                 LEFT JOIN life_sys_role lsr ON lsr.role_id = lsur.role_id
            ${ew.customSqlSegment}
    </select>
</mapper>
