|
|
@@ -12,7 +12,7 @@
|
|
|
FROM monitor_target t
|
|
|
LEFT JOIN monitor_target_region r ON r.monitor_target_id = t.id
|
|
|
WHERE t.DELETE_FLAG = 'NOT_DELETE'
|
|
|
- AND r.DELETE_FLAG = 'NOT_DELETE'
|
|
|
+-- AND r.DELETE_FLAG = 'NOT_DELETE'
|
|
|
<!-- <!– 动态条件:仅在 r 存在时检查 r 的 DELETE_FLAG –>-->
|
|
|
<!-- AND (r.DELETE_FLAG = 'NOT_DELETE' OR r.id IS NULL)-->
|
|
|
<!-- 动态条件:按房间ID查询 -->
|
|
|
@@ -47,17 +47,16 @@
|
|
|
FROM monitor_target t
|
|
|
LEFT JOIN monitor_target_region r ON r.monitor_target_id = t.id
|
|
|
WHERE t.DELETE_FLAG = 'NOT_DELETE'
|
|
|
- AND r.DELETE_FLAG = 'NOT_DELETE'
|
|
|
<!-- 动态条件:按名称或 sensor_code 或 name 模糊查询 -->
|
|
|
<if test="param.type != null and param.type.trim() != ''">
|
|
|
- <if test="param.name != null and param.name.trim() != '' and searchFlag == null">
|
|
|
+ <if test="param.searchKey != null and param.searchKey.trim() != '' and searchFlag == 'false'">
|
|
|
AND (
|
|
|
- t.name LIKE CONCAT('%', #{param.name}, '%')
|
|
|
- OR r.name LIKE CONCAT('%', #{param.name}, '%')
|
|
|
+ t.name LIKE CONCAT('%', #{param.searchKey}, '%')
|
|
|
+ OR r.name LIKE CONCAT('%', #{param.searchKey}, '%')
|
|
|
)
|
|
|
</if>
|
|
|
- <if test="param.name != null and param.name.trim() != '' and searchFlag != null">
|
|
|
- AND r.sensor_code LIKE CONCAT('%', #{param.name}, '%')
|
|
|
+ <if test="param.searchKey != null and param.searchKey.trim() != '' and searchFlag == 'true'">
|
|
|
+ AND r.sensor_code LIKE CONCAT('%', #{param.searchKey}, '%')
|
|
|
</if>
|
|
|
</if>
|
|
|
<!-- 动态条件:按创建用户查询 -->
|