houzhongjian
2024-07-23 a6de490948278991e47952e90671ddba4555e9a2
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
<?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="com.iailab.module.device.dao.DeviceHealthAlarmDao">
 
    <resultMap id="alarmCommonResult" type="com.iailab.module.device.dto.DeviceHealthAlarmDTO">
        <result column="dev_name" property="devName"/>
        <result column="fault_time" property="faultTime"/>
        <collection property="deviceFaults" ofType="com.iailab.module.device.dto.DeviceFaultDTO">
            <result column="index_type" property="indexType"/>
            <result column="class_name" property="className"/>
            <result column="fault_name" property="faultName"/>
            <result column="solution" property="solution"/>
        </collection>
 
    </resultMap>
 
    <select id="getInfo" resultMap="alarmCommonResult"
            parameterType="java.lang.String">
        SELECT
            t1.dev_name,
            t1.fault_time,
            t2.fault_name,
            t3.class_name,
            t3.index_type,
            t3.solution
        FROM
            t_device_health_alarm t1,
            t_device_health_alarm_detail t2,
            t_device_fault t3
        WHERE
            t1.id = t2.alarm_id
          AND t2.fault_code = t3.fault_code
          AND t1.id = #{id}
    </select>
</mapper>