Lius
2025-06-28 39f62fa03a2463652e971edfabab56313db6af10
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?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="org.jeecg.modules.mdc.mapper.MdcWorkshopInfoMapper">
 
 
    <select id="getBigScreenInfo" resultType="org.jeecg.modules.mdc.dto.MdcBigScreenEquipmentDto">
        SELECT
            mew.id id,
            a.EquipmentID equipmentId,
            me.equipment_name equipmentName,
            me.equipment_type equipmentType,
            met.equipment_type_pictures equipmentImage,
            a.Oporation equipmentStatus,
            mew.coordinate_left coordinateLeft,
            mew.coordinate_top coordinateTop,
            mew.vw vw,
            mew.vh vh,
            me.id equId
        FROM
            EquipmentLog a
            INNER JOIN ( SELECT EquipmentID, MAX ( CollectTime ) 'maxgdtime' FROM EquipmentLog GROUP BY EquipmentID ) b ON a.EquipmentID= b.EquipmentID
            INNER JOIN mdc_workshop_equipment mew ON mew.equipment_id = a.EquipmentID
            INNER JOIN mdc_equipment me ON me.equipment_id = a.EquipmentID
            INNER JOIN mdc_equipment_type met ON me.equipment_type = met.equipment_type_name
            AND a.CollectTime= b.maxgdtime
            AND mew.workshop_id = #{ workshopId }
    </select>
 
    <select id="listByUser" resultType="org.jeecg.modules.mdc.entity.MdcWorkshopInfo">
        SELECT
            DISTINCT t1.*
        FROM
            mdc_workshop_info t1
                LEFT JOIN sys_permission t2 ON t1.perms = t2.perms
                LEFT JOIN sys_role_permission t3 ON t2.id = t3.permission_id
                LEFT JOIN sys_role t4 ON t4.id = t3.role_id
                LEFT JOIN sys_user_role t5 ON t5.role_id = t4.id
        WHERE
            t5.user_id = #{ userId }
    </select>
</mapper>