城区管网指标检测增加详情(折线图)
This commit is contained in:
parent
ec5ca72d97
commit
8eb5a81aca
|
|
@ -3,13 +3,17 @@ package org.jeecg.modules.heating.controller;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.api.vo.Result;
|
||||||
import org.jeecg.common.system.base.controller.JeecgController;
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
import org.jeecg.modules.heating.entity.HeatanalysisHistory;
|
import org.jeecg.modules.heating.entity.HeatanalysisHistory;
|
||||||
import org.jeecg.modules.heating.service.HeatanalysisHistoryService;
|
import org.jeecg.modules.heating.service.HeatanalysisHistoryService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -17,29 +21,42 @@ import java.util.List;
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/heating/heatanalysishistory")
|
@RequestMapping("/heating/heatanalysishistory")
|
||||||
public class HeatanalysisHistoryController extends JeecgController<HeatanalysisHistory, HeatanalysisHistoryService> {
|
public class HeatanalysisHistoryController extends JeecgController<HeatanalysisHistory, HeatanalysisHistoryService> {
|
||||||
@Autowired
|
@Autowired
|
||||||
private HeatanalysisHistoryService service;
|
private HeatanalysisHistoryService service;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页列表查询
|
* 分页列表查询
|
||||||
*
|
*
|
||||||
* @param heatanalysisHistory
|
* @param heatanalysisHistory
|
||||||
* @param pageNo
|
* @param pageNo
|
||||||
* @param pageSize
|
* @param pageSize
|
||||||
* @param req
|
* @param req
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping(value = "/page")
|
@GetMapping(value = "/page")
|
||||||
public Result<?> queryPageList(HeatanalysisHistory heatanalysisHistory, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
public Result<?> queryPageList(HeatanalysisHistory heatanalysisHistory, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||||
Page<HeatanalysisHistory> page = new Page<HeatanalysisHistory>(pageNo, pageSize);
|
@RequestParam(name = "SDateStr", required = false) String SDateStr,
|
||||||
IPage<HeatanalysisHistory> pageList = service.findPage(page, heatanalysisHistory);
|
@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);
|
return Result.ok(pageList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping(value = "/queryHistoryList")
|
@GetMapping(value = "/queryHistoryList")
|
||||||
public Result<?> queryHistoryList(HeatanalysisHistory heatanalysisHistory, HttpServletRequest req) {
|
public Result<?> queryHistoryList(HeatanalysisHistory heatanalysisHistory, HttpServletRequest req) {
|
||||||
return service.findHistoryList(heatanalysisHistory);
|
return service.findHistoryList(heatanalysisHistory);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package org.jeecg.modules.heating.entity;
|
||||||
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.jeecg.common.system.base.entity.JeecgEntity;
|
import org.jeecg.common.system.base.entity.JeecgEntity;
|
||||||
|
|
|
||||||
|
|
@ -55,9 +55,12 @@
|
||||||
<if test="params.view002 != null and params.view002 != ''">
|
<if test="params.view002 != null and params.view002 != ''">
|
||||||
AND a.view002 = #{params.view002}
|
AND a.view002 = #{params.view002}
|
||||||
</if>
|
</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}
|
AND a.view004 = #{params.view004}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="params.view004 != null and params.view004 != '' and params.view004 == -1">
|
||||||
|
AND a.view004 is null
|
||||||
|
</if>
|
||||||
<if test="params.SDate != null">
|
<if test="params.SDate != null">
|
||||||
AND a.datatime >= #{params.SDate}
|
AND a.datatime >= #{params.SDate}
|
||||||
</if>
|
</if>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue