|
|
|
|
19
|
LEFT JOIN td_device s ON t.device_kind = s.device_type
|
19
|
LEFT JOIN td_device s ON t.device_kind = s.device_type
|
20
|
AND t.device_no = s.device_no AND s.`status` > -1
|
20
|
AND t.device_no = s.device_no AND s.`status` > -1
|
21
|
LEFT JOIN ta_machinery m ON s.machinery_id = m.machinery_id
|
21
|
LEFT JOIN ta_machinery m ON s.machinery_id = m.machinery_id
|
22
|
- WHERE
|
|
|
23
|
- t.device_kind = #{deviceType}
|
|
|
|
|
22
|
+ WHERE 1 = 1
|
|
|
23
|
+ <if test="deviceType != null and deviceType != ''">
|
|
|
24
|
+ AND t.device_kind = #{deviceType}
|
|
|
25
|
+ </if>
|
|
|
26
|
+ <if test="onlineStatus != null">
|
24
|
AND t.device_status = #{onlineStatus}
|
27
|
AND t.device_status = #{onlineStatus}
|
|
|
28
|
+ </if>
|
25
|
ORDER BY
|
29
|
ORDER BY
|
26
|
t.create_date DESC
|
30
|
t.create_date DESC
|
27
|
</select>
|
31
|
</select>
|