添加统计图
This commit is contained in:
parent
9e0eb48d50
commit
57807e4576
|
|
@ -14,6 +14,7 @@ import org.jeecg.modules.heating.service.HeatsourceService;
|
|||
import org.jeecg.modules.heating.service.HeatsourcestationService;
|
||||
import org.jeecg.modules.heating.service.ThermalcompanyService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
|
@ -132,4 +133,13 @@ public class HomeApi {
|
|||
return Result.ok(result);
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/getStaticList", method = RequestMethod.POST)
|
||||
public Result<?> getStaticList(@RequestBody HomeApiEntity dto) {
|
||||
Map<String,Object> result = new HashMap<>();
|
||||
List<Heatanalysis> list = heatanalysisService.getStaticList(dto);
|
||||
result.put("data",list);
|
||||
return Result.ok(result);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,4 +4,6 @@ import lombok.Data;
|
|||
|
||||
@Data
|
||||
public class HomeApiEntity {
|
||||
private String sourceId;
|
||||
private String startTime;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package org.jeecg.modules.heating.mapper;
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.jeecg.exportapi.entity.HomeApiEntity;
|
||||
import org.jeecg.modules.heating.entity.Heatanalysis;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -23,4 +24,6 @@ public interface HeatanalysisMapper extends BaseMapper<Heatanalysis> {
|
|||
Page<Heatanalysis> findExtractedTwoPage(Page<Heatanalysis> page, @Param("params") Heatanalysis heatanalysis);
|
||||
|
||||
void exeWater(Heatanalysis heatanalysis);
|
||||
|
||||
List<Heatanalysis> getStaticList(@Param("params") HomeApiEntity dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -523,4 +523,19 @@
|
|||
ORDER BY view001 asc ,view002 asc,view004 asc,DATATIME DESC
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getStaticList" resultType="org.jeecg.modules.heating.entity.Heatanalysis">
|
||||
SELECT t1.*
|
||||
FROM bl_heatanalysis_${params.startTime} t1
|
||||
INNER JOIN (
|
||||
SELECT
|
||||
DATE_FORMAT(datatime, '%Y-%m-%d %H') AS hour,
|
||||
MIN(datatime) AS min_time,
|
||||
min(id) as min_id
|
||||
FROM bl_heatanalysis_${params.startTime} where view002= #{params.sourceId} and view004 is null
|
||||
GROUP BY DATE_FORMAT(datatime, '%Y-%m-%d %H')
|
||||
) t2 ON t1.id = t2.min_id
|
||||
where t1.view002= #{params.sourceId} and t1.view004 is null
|
||||
ORDER BY t1.view002,t1.datatime
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package org.jeecg.modules.heating.service;
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.jeecg.common.system.base.service.JeecgService;
|
||||
import org.jeecg.exportapi.entity.HomeApiEntity;
|
||||
import org.jeecg.modules.heating.entity.Heatanalysis;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -24,4 +25,6 @@ public interface HeatanalysisService extends JeecgService<Heatanalysis> {
|
|||
IPage<Heatanalysis> findExtractedTwoPage(Page<Heatanalysis> page, Heatanalysis heatanalysis);
|
||||
|
||||
void exeWater(Heatanalysis heatanalysis);
|
||||
|
||||
List<Heatanalysis> getStaticList(HomeApiEntity dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.jeecg.common.system.base.service.impl.JeecgServiceImpl;
|
||||
import org.jeecg.common.util.DateUtils;
|
||||
import org.jeecg.exportapi.entity.HomeApiEntity;
|
||||
import org.jeecg.modules.heating.entity.Heatanalysis;
|
||||
import org.jeecg.modules.heating.mapper.HeatanalysisMapper;
|
||||
import org.jeecg.modules.heating.service.HeatanalysisService;
|
||||
|
|
@ -87,4 +88,9 @@ public class HeatanalysisServiceImpl extends JeecgServiceImpl<HeatanalysisMapper
|
|||
baseMapper.exeWater(heatanalysis);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Heatanalysis> getStaticList(HomeApiEntity dto) {
|
||||
return baseMapper.getStaticList(dto);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue