From 9c492592e4360d1a517d75847e9049e0cc1a3b2c Mon Sep 17 00:00:00 2001
From: liuhaonan <31457034@qq.com>
Date: 星期四, 23 六月 2022 17:16:36 +0800
Subject: [PATCH] bug修复
---
ximon-admin/src/main/java/com/sandu/ximon/admin/service/LightTaskService.java | 2 +-
dao/src/main/resources/mapper/LightTaskMapper.xml | 51 ++++++++++++++++++++++-----------------------------
2 files changed, 23 insertions(+), 30 deletions(-)
diff --git a/dao/src/main/resources/mapper/LightTaskMapper.xml b/dao/src/main/resources/mapper/LightTaskMapper.xml
index cc8efe4..14cd62b 100644
--- a/dao/src/main/resources/mapper/LightTaskMapper.xml
+++ b/dao/src/main/resources/mapper/LightTaskMapper.xml
@@ -59,45 +59,38 @@
</if>
</select>
<select id="successCount" resultType="java.lang.Integer" parameterType="java.lang.Long">
- SELECT
- count(*)
- FROM
- light_task t1
- LEFT JOIN light_task_pole_relation t2 ON t1.task_id = t2.task_id
- WHERE
- t1.task_id = #{taskId}
+ SELECT count(*)
+ FROM light_task t1
+ LEFT JOIN light_task_pole_relation t2 ON t1.task_id = t2.task_id
+ WHERE t1.task_id = #{taskId}
AND t2.issue_status = 0
</select>
<select id="toTalCount" resultType="java.lang.Integer">
- SELECT
- count(*)
- FROM
- light_task t1
- LEFT JOIN light_task_pole_relation t2 ON t1.task_id = t2.task_id
- WHERE
- t1.task_id = #{taskId}
+ SELECT count(*)
+ FROM light_task t1
+ LEFT JOIN light_task_pole_relation t2 ON t1.task_id = t2.task_id
+ WHERE t1.task_id = #{taskId}
</select>
<select id="listTask" resultType="com.sandu.ximon.dao.domain.LightTask">
SELECT
- t1.*
+ t1.*
FROM
- light_task t1
- LEFT JOIN light_task_pole_relation t2 ON t1.task_id = t2.task_id
- LEFT JOIN pole t3 ON t3.id = t2.pole_id
- LEFT JOIN pole_binding t4 ON t3.id = t4.pole_id
- LEFT JOIN light t5 ON t5.device_code = t4.device_code
+ light_task t1
+ LEFT JOIN light_task_pole_relation t2 ON t1.task_id = t2.task_id
+ LEFT JOIN pole t3 ON t3.id = t2.pole_id
+ LEFT JOIN pole_binding t4 ON t3.id = t4.pole_id
+ LEFT JOIN light t5 ON t5.device_code = t4.device_code
WHERE
- 1=1
- <if test="userId != null">
- AND ( t1.task_name LIKE #{keyword} OR t5.device_code LIKE #{keyword} )
+ 1=1
+ <if test="keyword != null and keyword != ''">
+ AND ( t1.task_name LIKE CONCAT(CONCAT('%', #{keyword}), '%') OR t5.device_code LIKE CONCAT(CONCAT('%', #{keyword}), '%'))
</if>
-
- <if test="userId != null">
- AND ( t1.client_id =#{userId} OR t1.user_id =#{userId} )
- </if>
+ <if test="userId != null">
+ AND ( t1.client_id =#{userId} OR t1.user_id =#{userId} )
+ </if>
GROUP BY
- task_id
+ task_id
ORDER BY
- t1.${orderBy}
+ t1.${orderBy}
</select>
</mapper>
diff --git a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/LightTaskService.java b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/LightTaskService.java
index ae3cacf..52fea61 100644
--- a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/LightTaskService.java
+++ b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/LightTaskService.java
@@ -361,7 +361,7 @@
//鎺掑簭鏂瑰紡
String orderBy = orderByResult + " " + orderBySeq;
-// PageHelper.startPage(conditionVO.getPageNo(), conditionVO.getPageSize(), orderBy);
+ PageHelper.startPage(conditionVO.getPageNo(), conditionVO.getPageSize(), orderBy);
List<LightTask> list = baseMapper.listTask(SecurityUtils.getClientId(),keyword,orderBy);
--
Gitblit v1.9.3