From 0878c49058d5f11858a03738208b7c37c82a1591 Mon Sep 17 00:00:00 2001
From: Administrator <1144154118@qq.com>
Date: 星期一, 07 八月 2023 11:35:17 +0800
Subject: [PATCH] 巡检计划查询优化
---
ard-work/src/main/resources/mapper/app/ArdAppPatrolplanMapper.xml | 12 ++++++------
ard-work/src/main/java/com/ruoyi/app/patrolplan/service/impl/ArdAppPatrolplanServiceImpl.java | 1 +
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java | 2 ++
ard-work/src/main/java/com/ruoyi/app/patrolplan/domain/ArdAppPatrolplan.java | 7 +++++--
ard-work/src/main/java/com/ruoyi/app/patrolplan/controller/ArdAppPatrolplanController.java | 2 ++
5 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/app/patrolplan/controller/ArdAppPatrolplanController.java b/ard-work/src/main/java/com/ruoyi/app/patrolplan/controller/ArdAppPatrolplanController.java
index 71ce6f2..d16637b 100644
--- a/ard-work/src/main/java/com/ruoyi/app/patrolplan/controller/ArdAppPatrolplanController.java
+++ b/ard-work/src/main/java/com/ruoyi/app/patrolplan/controller/ArdAppPatrolplanController.java
@@ -79,6 +79,8 @@
@ApiOperation("鏌ヨ鍏ㄩ儴宸℃鍒楄〃鍙婃悳绱㈢瓫閫�")
public Results list(ArdAppPatrolplan ardAppPatrolplan)
{
+ String userId = SecurityUtils.getUserId();
+ ardAppPatrolplan.setUserId(userId);
if(ardAppPatrolplan.getPageNum()==null || ardAppPatrolplan.getPageNum() == 0){
ardAppPatrolplan.setPageNum(1);
}
diff --git a/ard-work/src/main/java/com/ruoyi/app/patrolplan/domain/ArdAppPatrolplan.java b/ard-work/src/main/java/com/ruoyi/app/patrolplan/domain/ArdAppPatrolplan.java
index 8700302..8f88fa5 100644
--- a/ard-work/src/main/java/com/ruoyi/app/patrolplan/domain/ArdAppPatrolplan.java
+++ b/ard-work/src/main/java/com/ruoyi/app/patrolplan/domain/ArdAppPatrolplan.java
@@ -1,6 +1,7 @@
package com.ruoyi.app.patrolplan.domain;
import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
@@ -25,6 +26,8 @@
private String userId;
@Excel(name = "鍒跺畾浜�")
+ @TableField(exist = false,select = false)
+ @JsonInclude(JsonInclude.Include.NON_DEFAULT )
private String nickName;
/** 鍛ㄦ湡 */
@@ -46,13 +49,13 @@
/**
* 宸℃鐐�
*/
- @TableField(exist = false)
+ @TableField(exist = false,select = false)
private String wellId;
/**
* 宸℃浜哄憳
*/
- @TableField(exist = false)
+ @TableField(exist = false,select = false)
private String pUser;
@Override
diff --git a/ard-work/src/main/java/com/ruoyi/app/patrolplan/service/impl/ArdAppPatrolplanServiceImpl.java b/ard-work/src/main/java/com/ruoyi/app/patrolplan/service/impl/ArdAppPatrolplanServiceImpl.java
index b0360cb..cb661e5 100644
--- a/ard-work/src/main/java/com/ruoyi/app/patrolplan/service/impl/ArdAppPatrolplanServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/app/patrolplan/service/impl/ArdAppPatrolplanServiceImpl.java
@@ -156,6 +156,7 @@
@Override
public Results oneById(String id) {
+
return null;
}
diff --git a/ard-work/src/main/resources/mapper/app/ArdAppPatrolplanMapper.xml b/ard-work/src/main/resources/mapper/app/ArdAppPatrolplanMapper.xml
index 4646180..7e82cdb 100644
--- a/ard-work/src/main/resources/mapper/app/ArdAppPatrolplanMapper.xml
+++ b/ard-work/src/main/resources/mapper/app/ArdAppPatrolplanMapper.xml
@@ -18,7 +18,7 @@
<sql id="selectArdAppPatrolplanVo">
select
ard_app_patrolplan.id,
- sys_user.nick_name,
+<!-- sys_user.nick_name,-->
ard_app_patrolplan.patro_end_time,
ard_app_patrolplan.user_id,
ard_app_patrolplan.cycle,
@@ -34,20 +34,20 @@
left join ard_app_patrolpoint as well on ard_app_patrolplan.id = well.patrolplan_id
left join ard_app_patroluser as users on ard_app_patrolplan.id = users.patrolplan_id
left join sys_user on ard_app_patrolplan.user_id = sys_user.user_id
- <where>
- <if test="userId != null and userId != ''"> and ard_app_patrolplan.user_id = #{userId}</if>
+ <where>
+ ard_app_patrolplan.user_id = #{userId}
<if test="cycle != null and cycle != ''"> and cycle = #{cycle}</if>
<if test="planName != null and planName != ''"> and plan_name like '%'||#{planName}||'%'</if>
<if test="patroBeginTime != null and patroBeginTime != ''"> and patro_begin_time >= #{patroBeginTime}</if>
<if test="patroEndTime != null and patroEndTime != ''"> and patro_end_time <= #{patroEndTime}</if>
<if test="wellId != null and wellId != ''">
- and well.alarmpoints_id = (select ard_alarmpoints_well.id from ard_alarmpoints_well where well_id = #{wellId})
+ and well.alarmpoints_id in (select ard_alarmpoints_well.id from ard_alarmpoints_well where well_id = #{wellId})
</if>
<if test="pUser != null and pUser != ''">
- and users.app_user_id = (select sys_user.user_id from sys_user where nick_name = #{pUser})
+ and users.app_user_id in (select sys_user.user_id from sys_user where nick_name = #{pUser})
</if>
</where>
- group by ard_app_patrolplan.id,sys_user.nick_name
+ group by ard_app_patrolplan.id
</select>
<select id="selectArdAppPatrolplanByPatroEndTime" parameterType="String" resultMap="ArdAppPatrolplanResult">
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java
index e2269f5..0903dc2 100644
--- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java
@@ -60,9 +60,11 @@
private Map<String, Object> params;
@TableField(exist = false)
+ @JsonInclude(JsonInclude.Include.NON_DEFAULT )
private Integer pageNum;
@TableField(exist = false)
+ @JsonInclude(JsonInclude.Include.NON_DEFAULT )
private Integer pageSize;
public Integer getPageNum() {
--
Gitblit v1.9.3