Lius
2025-04-28 572466e8ebaa67f1809a97ecf912d30e8802fd98
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?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
            t3.id AS id,
            t2.EquipmentID AS equipmentId,
            t1.equipment_name AS equipmentName,
            t1.equipment_type AS equipmentType,
            t5.equipment_type_pictures AS equipmentImage,
            t2.oporation AS oporation,
            t1.equipment_status AS equipmentStatus,
            t3.coordinate_left AS coordinateLeft,
            t3.coordinate_top AS coordinateTop,
            t3.vw AS vw,
            t3.vh AS vh,
            t1.id AS equId
        FROM
            mdc_equipment t1
                LEFT JOIN
            equipment t2 ON t1.equipment_id = t2.EquipmentID
                LEFT JOIN
            mdc_workshop_equipment t3 ON t1.equipment_id = t3.equipment_id
                LEFT JOIN
            mdc_equipment_type t5 ON t1.equipment_type = t5.equipment_type_name
        WHERE
            EXISTS (
                SELECT 1
                FROM mdc_workshop_info t4
                WHERE t3.workshop_id = t4.id
                  AND t4.production_id = #{ productionId }
            );
    </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>
 
    <select id="productionListByUser" resultType="org.jeecg.modules.system.entity.MdcProduction">
        SELECT
            t1.*
        FROM
            mdc_production t1
                 LEFT JOIN mdc_user_production t2 ON t1.id = t2.pro_id
        WHERE
            t1.org_type = 2 AND t2.user_id = #{userId}
        ORDER BY t1.production_name
    </select>
</mapper>