shenyijian
2024-06-21 f20611265f7d34fd4fbcdfdaff6cb9cccd0b25fc
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sg/mapper/SgProjectPersonConfigMapper.xml
@@ -5,4 +5,44 @@
    <select id="selectByUserId" resultType="cn.gistack.sm.sg.DO.SgProjectPersonConfigDO">
        select  * from YWXT.SG_PROJECT_PERSON_CONFIG where USER_ID = #{userId}
    </select>
    <select id="getRoleList" resultType="java.lang.String">
        SELECT
         <!--   pro.id,
            pro.project_name,
            sgc.gx_device_type as deviceType,
            d.id as deviceId, -->
            sgc.role_id as roleId
        FROM
            ywxt.sg_project_info pro
                LEFT JOIN ywxt.sg_device d ON pro.id = d.program_id
                LEFT JOIN ywxt.sg_gx_config sgc ON d.device_type = sgc.gx_device_type
        where 1=1
        <if test="dto.projectId != null">
            and pro.id = #{dto.projectId}
        </if>
    </select>
    <select id="getList" resultType="cn.gistack.sm.sg.DO.SgProjectRolePersonV0">
        SELECT
            DISTINCT
            sgc.role_id as roleId,
            pro.id as projectId,
            pro.project_name,
            ro.role_name
            --   d.id as device_id,
            --   d.device_name
            , sppc.user_id
            , sppc.id
            , bu.real_name as userName
        FROM
            ywxt.sg_project_info pro
                LEFT JOIN ywxt.sg_device d ON pro.id = d.program_id
                Left JOIN ywxt.sg_gx_config sgc ON d.device_type = sgc.gx_device_type
                left join ywxt.blade_role ro on   ro.id = sgc.role_id
                left join ywxt.sg_project_person_config sppc  on sgc.role_id = sppc.rold_id and sppc.program_id = pro.id
                left join ywxt.blade_user bu on sppc.user_id = bu.id
        where 1=1 and pro.id = #{dto.projectId}
    </select>
    <select id="getUserByRole" resultType="java.util.Map">
        select id,real_name as realName from ywxt.blade_user where role_id = #{roleId}
    </select>
</mapper>