城区管网指标检测增加详情(折线图)

This commit is contained in:
1378012178@qq.com 2025-08-28 09:02:43 +08:00
parent ec5ca72d97
commit 8eb5a81aca
3 changed files with 43 additions and 22 deletions

View File

@ -3,13 +3,17 @@ package org.jeecg.modules.heating.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.modules.heating.entity.HeatanalysisHistory;
import org.jeecg.modules.heating.service.HeatanalysisHistoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.List;
@ -17,29 +21,42 @@ import java.util.List;
@RestController
@RequestMapping("/heating/heatanalysishistory")
public class HeatanalysisHistoryController extends JeecgController<HeatanalysisHistory, HeatanalysisHistoryService> {
@Autowired
private HeatanalysisHistoryService service;
@Autowired
private HeatanalysisHistoryService service;
/**
* 分页列表查询
*
* @param heatanalysisHistory
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@GetMapping(value = "/page")
public Result<?> queryPageList(HeatanalysisHistory heatanalysisHistory, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
Page<HeatanalysisHistory> page = new Page<HeatanalysisHistory>(pageNo, pageSize);
IPage<HeatanalysisHistory> pageList = service.findPage(page, heatanalysisHistory);
/**
* 分页列表查询
*
* @param heatanalysisHistory
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@GetMapping(value = "/page")
public Result<?> queryPageList(HeatanalysisHistory heatanalysisHistory, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
@RequestParam(name = "SDateStr", required = false) String SDateStr,
@RequestParam(name = "EDateStr", required = false) String EDateStr, HttpServletRequest req) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
if(StringUtils.isNotBlank(SDateStr)){
heatanalysisHistory.setSDate(sdf.parse(SDateStr));
}
if(StringUtils.isNotBlank(EDateStr)){
heatanalysisHistory.setEDate(sdf.parse(EDateStr));
}
} catch (ParseException e) {
e.printStackTrace();
}
Page<HeatanalysisHistory> page = new Page<HeatanalysisHistory>(pageNo, pageSize);
IPage<HeatanalysisHistory> pageList = service.findPage(page, heatanalysisHistory);
return Result.ok(pageList);
}
}
@GetMapping(value = "/queryHistoryList")
public Result<?> queryHistoryList(HeatanalysisHistory heatanalysisHistory, HttpServletRequest req) {
return service.findHistoryList(heatanalysisHistory);
}
@GetMapping(value = "/queryHistoryList")
public Result<?> queryHistoryList(HeatanalysisHistory heatanalysisHistory, HttpServletRequest req) {
return service.findHistoryList(heatanalysisHistory);
}
}

View File

@ -3,6 +3,7 @@ package org.jeecg.modules.heating.entity;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecg.common.system.base.entity.JeecgEntity;

View File

@ -55,9 +55,12 @@
<if test="params.view002 != null and params.view002 != ''">
AND a.view002 = #{params.view002}
</if>
<if test="params.view004 != null and params.view004 != ''">
<if test="params.view004 != null and params.view004 != '' and params.view004 != -1">
AND a.view004 = #{params.view004}
</if>
<if test="params.view004 != null and params.view004 != '' and params.view004 == -1">
AND a.view004 is null
</if>
<if test="params.SDate != null">
AND a.datatime >= #{params.SDate}
</if>