fix(search): 优化事件用户查询功能
- 修改CsEventUserPOMapper.xml中的搜索条件,同时支持名称和代码字段的模糊匹配 - 修复CsEventUserPOServiceImpl中线路ID判断逻辑,避免空字符串和null值导致的异常 - 调整MqttMessageHandler中消息发送的缩进格式,确保代码风格一致
This commit is contained in:
@@ -228,7 +228,7 @@
|
||||
<!-- 名称匹配(根据type区分线路名/设备名) -->
|
||||
<choose>
|
||||
<when test="csEventUserQueryPage.type != null and csEventUserQueryPage.type == 3">
|
||||
e.name LIKE CONCAT('%', #{csEventUserQueryPage.searchValue}, '%')
|
||||
(e.name LIKE CONCAT('%', #{csEventUserQueryPage.searchValue}, '%') OR b.code LIKE CONCAT('%', #{csEventUserQueryPage.searchValue}, '%'))
|
||||
</when>
|
||||
<otherwise>
|
||||
d.name LIKE CONCAT('%', #{csEventUserQueryPage.searchValue}, '%')
|
||||
@@ -338,7 +338,8 @@
|
||||
</if>
|
||||
<if test="csEventUserQueryPage!=null and csEventUserQueryPage.searchValue != null and csEventUserQueryPage.searchValue !=''">
|
||||
<if test="csEventUserQueryPage.type != null and csEventUserQueryPage.type !='' and csEventUserQueryPage.type == 3 ">
|
||||
AND e.name like concat('%',#{csEventUserQueryPage.searchValue},'%')
|
||||
-- AND e.name like concat('%',#{csEventUserQueryPage.searchValue},'%')
|
||||
AND (e.name LIKE CONCAT('%', #{csEventUserQueryPage.searchValue}, '%') OR b.code LIKE CONCAT('%', #{csEventUserQueryPage.searchValue}, '%'))
|
||||
</if>
|
||||
<if test="csEventUserQueryPage.type != null and csEventUserQueryPage.type !='' and csEventUserQueryPage.type != 3 ">
|
||||
AND d.name like concat('%',#{csEventUserQueryPage.searchValue},'%')
|
||||
|
||||
@@ -419,8 +419,7 @@ public class CsEventUserPOServiceImpl extends ServiceImpl<CsEventUserPOMapper, C
|
||||
List<String> portableDevIds = new ArrayList<>();
|
||||
if (Objects.equals(csEventUserQueryPage.getEngineeringid(),"1")
|
||||
|| Objects.equals(csEventUserQueryPage.getProjectId(),"2")
|
||||
|| !ObjectUtil.isNull(csEventUserQueryPage.getLineId())
|
||||
|| !StringUtils.isEmpty(csEventUserQueryPage.getLineId())) {
|
||||
|| (!ObjectUtil.isNull(csEventUserQueryPage.getLineId()) && !StringUtils.isEmpty(csEventUserQueryPage.getLineId()))) {
|
||||
portableDevIds = portableDevTree.stream().map(CsLedgerVO::getId).filter(
|
||||
id -> StringUtils.isEmpty(csEventUserQueryPage.getDeviceId()) ||
|
||||
Objects.equals(id, csEventUserQueryPage.getDeviceId())
|
||||
|
||||
Reference in New Issue
Block a user