增加大屏运维分页接口

This commit is contained in:
zy 2025-11-22 16:19:24 +08:00
parent caf88b6cd6
commit 8a46bc4454
5 changed files with 47 additions and 8 deletions

View File

@ -1,7 +1,9 @@
package org.jeecg.modules.appmana.controller;
import cn.hutool.core.lang.Assert;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -10,16 +12,16 @@ import org.apache.commons.lang3.StringUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.constant.enums.PollutionEnum;
import org.jeecg.common.entity.SurvDeviceDeploy;
import org.jeecg.common.entity.SurvMaintainRecord;
import org.jeecg.common.vo.params.StationMaintainPage;
import org.jeecg.modules.appmana.service.ISurvDeviceDeployService;
import org.jeecg.modules.appmana.service.ISurvMaintainRecordService;
import org.jeecg.modules.appmana.service.impl.CommonServiceImpl;
import org.jeecg.common.vo.VOBigScreenSurvQ;
import org.jeecg.common.vo.VOHisFormResult;
import org.jeecg.common.vo.VOHisResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.time.LocalDate;
import java.time.LocalDateTime;
@ -38,6 +40,8 @@ public class BigScreenControllerP2 {
private ISurvDeviceDeployService survDeviceDeployService;
@Autowired
private CommonServiceImpl commonService;
@Autowired
private ISurvMaintainRecordService maintainRecordService;
@ApiOperationSupport(order = 1)
@ApiOperation(value = "01. 查询设备下各检测项的历史数据", notes = "")
@ -78,4 +82,17 @@ public class BigScreenControllerP2 {
return Result.OK(voHisResult);
}
@ApiOperationSupport(order = 2)
@ApiOperation(value = "02. 站点运维分页", notes = "")
@GetMapping(value = "/stationMaintainPage")
public Result<IPage<SurvMaintainRecord>> stationMaintainPage(StationMaintainPage stationMaintainPage) {
Page<SurvMaintainRecord> page = new Page<SurvMaintainRecord>();
SurvMaintainRecord survMaintainRecord = new SurvMaintainRecord();
survMaintainRecord.setBeginDate(stationMaintainPage.getStartTime());
survMaintainRecord.setEndDate(stationMaintainPage.getEndTime());
IPage<SurvMaintainRecord> records = maintainRecordService.pages(page,survMaintainRecord);
return Result.OK(records);
}
}

View File

@ -43,5 +43,11 @@
<if test="query.maintainTime!=null">
and DATE_FORMAT(MAINTAIN_TIME, '%Y-%m-%d') = DATE_FORMAT(#{param2.maintainTime},'%Y-%m-%d')
</if>
<if test="query.beginDate!=null and query.beginDate!=''">
and MAINTAIN_TIME &gt;= CONCAT(#{query.beginDate}, ' 00:00:00')
</if>
<if test="query.endDate!=null and query.endDate!=''">
and MAINTAIN_TIME &lt;= CONCAT(#{query.endDate}, ' 23:59:59')
</if>
</select>
</mapper>

View File

@ -71,11 +71,11 @@
<select id="getCameraGroupByStation" resultType="org.jeecg.common.entity.SurvDeviceDeploy">
select s.STATION_CODE,group_concat(s.DEPLOY_CODE) as depCodes,group_concat(s.DEPLOY_DES) as depDess,group_concat(s.DEPLOY_PIC) as depPics,group_concat(s.DEVICE_URL) as depUrls
from surv_device_deploy s where s.DEPLOY_TYPE='camera' group by s.STATION_CODE
from surv_device_deploy s where s.IS_DEL = 0 AND s.DEPLOY_TYPE='camera' group by s.STATION_CODE
</select>
<select id="getDeviceByStation" resultMap="adResultMap">
select <include refid="baseSql"/> from surv_device_deploy where 1=1
select <include refid="baseSql"/> from surv_device_deploy where IS_DEL = 0
<if test="param1 != null and param1 != ''">
AND STATION_CODE = #{param1}
</if>
@ -85,11 +85,11 @@
</select>
<select id="getDeviceByCode" resultMap="baseResultMap">
select <include refid="baseSql"/> from surv_device_deploy where DEPLOY_CODE = #{deployCode}
select <include refid="baseSql"/> from surv_device_deploy where IS_DEL = 0 AND DEPLOY_CODE = #{deployCode}
</select>
<select id="getDeviceByStationNoCam" resultMap="adResultMap">
select <include refid="baseSql"/> from surv_device_deploy where DEPLOY_TYPE &lt;&gt; 'camera'
select <include refid="baseSql"/> from surv_device_deploy where IS_DEL = 0 AND DEPLOY_TYPE &lt;&gt; 'camera'
<if test="param1 != null and param1 != ''">
AND STATION_CODE = #{param1}
</if>
@ -101,6 +101,7 @@
<select id="getDeviceListByStations" resultMap="baseResultMap">
select <include refid="baseSql"/> from surv_device_deploy
<where>
AND IS_DEL = 0
<if test="deployTypeList != null and deployTypeList.size()>0">
and DEPLOY_TYPE IN
<foreach collection="deployTypeList" index="index" item="id" open="(" separator="," close=")">

View File

@ -104,4 +104,10 @@ public class SurvMaintainRecord implements Serializable {
@TableField(exist = false)
private String omName;
@TableField(exist = false)
private String beginDate;
@TableField(exist = false)
private String endDate;
}

View File

@ -0,0 +1,9 @@
package org.jeecg.common.vo.params;
import lombok.Data;
@Data
public class StationMaintainPage {
private String startTime;
private String endTime;
}