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
<?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.DeviceInfoDao">
    <select id="getchildrenList" resultType="com.iailab.module.device.dto.DeviceInfoDTO">
        select id, name, workshop
        from t_device_info
        where pid = #{id}
    </select>
    <select id="getPageList" resultType="com.iailab.module.device.dto.DeviceInfoDTO">
        select a.*,b.health_score healthScore,b.health_evaluate healthEvaluate,b.is_health isHealth,b.evaluate_date
        evaluateDate,
        IFNULL((select device_id from t_device_account where device_name = a.name),0) deviceId
        from t_device_info a,
        t_device_health_evaluate b
        where a.id = b.device_id
        <if test="params.no != null and params.no != ''">
            and a.no like concat('%',#{params.no},'%')
        </if>
        <if test="params.name != null and params.name != ''">
            and a.name like concat('%',#{params.name},'%')
        </if>
        <if test="params.isMain != null and params.isMain != ''">
            and a.is_main = #{params.isMain}
        </if>
        <if test="params.isMain != null and params.isMain != ''">
            and a.is_main = #{params.isMain}
        </if>
 
 
    </select>
 
 
</mapper>