<?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="cn.ey.biz.module.system.dal.mapper.permission.UserRoleMapper">

    <select id="getUserRoleGpnRoCode" resultType="cn.ey.biz.module.system.controller.admin.permission.vo.userRole.UserRoleExcelVO">
        SELECT
        ur.id,
        ur.user_id,
        ur.role_id,
        u.gpn AS gpn,
        r.role_code AS roleCode
        FROM
        system_user_role ur
        LEFT JOIN system_users u ON u.id = ur.user_id
        LEFT JOIN system_role r ON r.role_id = ur.role_id
        WHERE
        ur.deleted = 0
        AND u.gpn IS NOT NULL
        AND r.role_code IS NOT NULL
    </select>

</mapper>

