<?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.UserDataRoleMapper">

    <select id="getUserDataRoleGpnName" resultType="cn.ey.biz.module.system.controller.admin.permission.vo.userRole.UserDataRoleExcelVO">
        SELECT
        udr.id,
        udr.user_id,
        udr.role_id,
        u.gpn AS gpn,
        r.NAME AS NAME
        FROM
        system_user_data_role udr
        LEFT JOIN system_users u ON u.id = udr.user_id
        LEFT JOIN system_data_role r ON r.id = udr.role_id
        WHERE
        udr.deleted = 0
        AND u.gpn IS NOT NULL
        AND r.NAME IS NOT NULL
    </select>

</mapper>

