<?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.disk.mapper.ShareGroupUserMapper">

    <select id="queryGroupUserList" resultType="java.util.Map">
        SELECT
            t1.ID AS groupUserId,
            t1.GROUP_ID AS groupId,
            t3.NAME AS groupIdName,
            t1.USER_ID AS userId,
            t2.NAME AS userIdName,
            t1.IS_CREATER AS isCreater,
            IFNULL(( SELECT dd1.DICT_LABEL FROM (SELECT d1.DICT_LABEL,d1.DICT_VALUE  FROM  DEV_DICT d1 WHERE PARENT_ID = (SELECT d2.ID  FROM  DEV_DICT d2 WHERE d2.DICT_VALUE='GROUP_IS_CREATER') )dd1 WHERE dd1.DICT_VALUE= TRIM(t1.IS_CREATER) ),'') AS isCreaterName
        FROM SHARE_GROUP_USER t1
        LEFT JOIN SYS_USER t2 ON t1.USER_ID=t2.ID AND t2.DELETE_FLAG ='NOT_DELETE'
        LEFT JOIN SYS_USER t3 ON t1.GROUP_ID=t3.ID AND t3.DELETE_FLAG ='NOT_DELETE' AND t3.IS_RESOURCEACCOUNT ='1'
        where t1.DELETE_FLAG ='NOT_DELETE'
        <if test="groupId!=null and groupId != ''">
            and t1.GROUP_ID=#{groupId}
        </if>
        <if test="userId!=null and userId != ''">
            and t1.USER_ID=#{userId}
        </if>
    </select>
</mapper>
