From e2392116cd6f875cdc2f46bc04b04d5305f21b56 Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期四, 23 十一月 2023 13:25:04 +0800 Subject: [PATCH] 1. 修改日统计值的排序查询逻辑 --- src/main/java/com/flightfeather/monitor/service/impl/FugitiveDustServiceImpl.java | 93 ++++++++++++++++++++++++++++------------------ 1 files changed, 57 insertions(+), 36 deletions(-) diff --git a/src/main/java/com/flightfeather/monitor/service/impl/FugitiveDustServiceImpl.java b/src/main/java/com/flightfeather/monitor/service/impl/FugitiveDustServiceImpl.java index 36c1e97..aafa6d7 100644 --- a/src/main/java/com/flightfeather/monitor/service/impl/FugitiveDustServiceImpl.java +++ b/src/main/java/com/flightfeather/monitor/service/impl/FugitiveDustServiceImpl.java @@ -1,13 +1,16 @@ package com.flightfeather.monitor.service.impl; +import com.flightfeather.monitor.domain.ds1.mapper.DustStatisticsValueMapper; import com.flightfeather.monitor.mapper.FugitiveDustMapper; import com.flightfeather.monitor.pojo.*; import com.flightfeather.monitor.service.FugitiveDustService; +import com.flightfeather.monitor.utils.StringUtil; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.web.bind.annotation.RequestParam; import java.time.LocalDateTime; import java.util.List; @@ -19,18 +22,21 @@ @Autowired private FugitiveDustMapper fugitiveDustMapper; + @Autowired + private DustStatisticsValueMapper dustStatisticsValueMapper; + @Override - public PageBean page(Integer page, Integer pageSize, String siteName, String mnCode, String beginTime, String endTime,String[] scenarioType) { + public PageBean page(Integer page, Integer pageSize, String siteName, String mnCode, String beginTime, String endTime, String[] scenarioType) { //璁剧疆鍒嗛〉鍙傛暟 - PageHelper.startPage(page,pageSize); + PageHelper.startPage(page, pageSize); //鎵ц鏌ヨ - List<DustSiteData> infoList=fugitiveDustMapper.conditonQueryDustHistoryData(siteName,mnCode,beginTime,endTime,scenarioType); + List<DustSiteData> infoList = fugitiveDustMapper.conditonQueryDustHistoryData(siteName, mnCode, beginTime, endTime, scenarioType); //鑾峰彇鏌ヨ缁撴灉 - Page<DustSiteData> p=(Page<DustSiteData>)infoList; + Page<DustSiteData> p = (Page<DustSiteData>) infoList; //灏佽PageBean瀵硅薄*/ - PageBean pageBean=new PageBean(p.getTotal(),p.getResult()); - return pageBean; + PageBean pageBean = new PageBean(p.getTotal(), p.getResult()); + return pageBean; } @Override @@ -46,29 +52,29 @@ } @Override - public List<AnalysisDustData> analysisdata( String siteName,String beginTime, String endTime,String type) { - List<AnalysisDustData> list = fugitiveDustMapper.analysisdata(siteName,beginTime,endTime,type); + public List<AnalysisDustData> analysisdata(String siteName, String beginTime, String endTime, String type) { + List<AnalysisDustData> list = fugitiveDustMapper.analysisdata(siteName, beginTime, endTime, type); return list; } @Override public List<AnalysisDustData> analysisByTime(String siteName, String beginTime, String endTime) { - List<AnalysisDustData> list = fugitiveDustMapper.analysisByTime(siteName,beginTime,endTime); + List<AnalysisDustData> list = fugitiveDustMapper.analysisByTime(siteName, beginTime, endTime); return list; } @Override - public PageBean pageAnalysisTime(Integer page, Integer pageSize, String siteName, String beginTime, String endTime) { + public PageBean pageAnalysisTime(Integer page, Integer pageSize, String siteName, String beginTime, + String endTime, String orderProp, + Boolean asc) { //璁剧疆鍒嗛〉鍙傛暟 - PageHelper.startPage(page,pageSize); - //鎵ц鏌ヨ - List<AnalysisDustData> infoList=fugitiveDustMapper.analysisByTime(siteName,beginTime,endTime); + Page<AnalysisDustData> p = PageHelper.startPage(page, pageSize); //鑾峰彇鏌ヨ缁撴灉 - Page<AnalysisDustData> p=(Page<AnalysisDustData>)infoList; + String prop = StringUtil.INSTANCE.camelCaseToUnderline(orderProp); + dustStatisticsValueMapper.selectByOrder(siteName, beginTime, endTime, prop, asc); - //灏佽PageBean瀵硅薄*/ - PageBean pageBean=new PageBean(p.getTotal(),p.getResult()); - return pageBean; + //灏佽PageBean瀵硅薄 + return new PageBean(p.getTotal(), p.getResult()); } @Override @@ -80,39 +86,39 @@ @Override public PageBean getExceptionData(Integer page, Integer pageSize, String siteName, String[] exceptionType, String beginTime, String endTime) { //璁剧疆鍒嗛〉鍙傛暟 - PageHelper.startPage(page,pageSize); + PageHelper.startPage(page, pageSize); - List<DustExceptionData> infoList = fugitiveDustMapper.getExceptionData(siteName,exceptionType,beginTime,endTime); + List<DustExceptionData> infoList = fugitiveDustMapper.getExceptionData(siteName, exceptionType, beginTime, endTime); //鑾峰彇鏌ヨ缁撴灉 - Page<DustExceptionData> p=(Page<DustExceptionData>)infoList; + Page<DustExceptionData> p = (Page<DustExceptionData>) infoList; //灏佽PageBean瀵硅薄*/ - PageBean pageBean=new PageBean(p.getTotal(),p.getResult()); + PageBean pageBean = new PageBean(p.getTotal(), p.getResult()); - return pageBean; + return pageBean; } @Override - public List<DustExceptionData> getExceptionSitenameAndCode(String exceptionType, String beginTime, String endTime) { - List<DustExceptionData> list = fugitiveDustMapper.getExceptionSitenameAndCode(exceptionType,beginTime,endTime); + public List<DustExceptionData> getExceptionSitenameAndCode(String exceptionType, String beginTime, String endTime, String[] street, String[] dutyCompany, String siteName) { + List<DustExceptionData> list = fugitiveDustMapper.getExceptionSitenameAndCode(exceptionType, beginTime, endTime, street, dutyCompany, siteName); return list; } @Override - public Integer exceptionNum(String exceptionType, String beginTime, String endTime) { - Integer list = fugitiveDustMapper.exceptionNum(exceptionType,beginTime,endTime); + public Integer exceptionNum(String exceptionType, String beginTime, String endTime, String[] street, String[] dutyCompany, String siteName) { + Integer list = fugitiveDustMapper.exceptionNum(exceptionType, beginTime, endTime, street, dutyCompany, siteName); return list; } @Override public List<DustSiteData> conditonQueryHistoryData(String siteName, String beginTime, String endTime) { - List<DustSiteData> list = fugitiveDustMapper.conditonQueryHistoryData(siteName,beginTime,endTime); + List<DustSiteData> list = fugitiveDustMapper.conditonQueryHistoryData(siteName, beginTime, endTime); return list; } @Override public List<DustExceptionData> getExceptionAllData(String siteName, String[] exceptionType, String beginTime, String endTime) { - List<DustExceptionData> list = fugitiveDustMapper.getExceptionData(siteName,exceptionType,beginTime,endTime); + List<DustExceptionData> list = fugitiveDustMapper.getExceptionData(siteName, exceptionType, beginTime, endTime); return list; } @@ -124,22 +130,22 @@ @Override public List<AnalysisDustData> analysisAll(String siteName, String beginTime, String endTime) { - List<AnalysisDustData> list = fugitiveDustMapper.analysisByTime(siteName,beginTime,endTime); + List<AnalysisDustData> list = fugitiveDustMapper.analysisByTime(siteName, beginTime, endTime); return list; } @Override public List<DustSiteData> conditonQueryhistoryallData(String siteName, String mnCode, String beginTime, String endTime, String[] scenarioType) { - List<DustSiteData> list = fugitiveDustMapper.conditonQueryDustHistoryData(siteName,mnCode,beginTime,endTime,scenarioType); + List<DustSiteData> list = fugitiveDustMapper.conditonQueryDustHistoryData(siteName, mnCode, beginTime, endTime, scenarioType); return list; } @Override public void addAuditNotes(AuditInfo auditInfo) { - if(auditInfo.getAuditStatus()==3){ + if (auditInfo.getAuditStatus() == 3) { auditInfo.setUpdateTime(LocalDateTime.now()); auditInfo.setCreateTime(LocalDateTime.now()); - }else{ + } else { auditInfo.setCreateTime(LocalDateTime.now()); } @@ -161,7 +167,7 @@ @Override public List<DustExceptionData> getHasAuditedData(String beginTime, String endTime) { - List<DustExceptionData> list = fugitiveDustMapper.getHasAuditedData(beginTime,endTime); + List<DustExceptionData> list = fugitiveDustMapper.getHasAuditedData(beginTime, endTime); return list; } @@ -173,21 +179,36 @@ @Override public List<DustExceptionData> getSiteNameByTimeAndExceptionType(String[] exceptionType, String beginTime, String endTime) { - List<DustExceptionData> list = fugitiveDustMapper.getSiteNameByTimeAndExceptionType(exceptionType,beginTime,endTime); + List<DustExceptionData> list = fugitiveDustMapper.getSiteNameByTimeAndExceptionType(exceptionType, beginTime, endTime); return list; } @Override public List<AnalysisDustData> analysisdataByType(String month, String type) { - List<AnalysisDustData> list = fugitiveDustMapper.analysisdataByType(month,type); + List<AnalysisDustData> list = fugitiveDustMapper.analysisdataByType(month, type); return list; } @Override public List<AnalysisDustData> analysisdataByTimeAndType(String beginTime, String endTime, String type) { - List<AnalysisDustData> list = fugitiveDustMapper.analysisdataByTimeAndType(beginTime,endTime,type); + List<AnalysisDustData> list = fugitiveDustMapper.analysisdataByTimeAndType(beginTime, endTime, type); return list; } + @Override + public PageBean getExceptionData2(Integer page, Integer pageSize, String siteName, String[] exceptionType, String beginTime, String endTime, String[] street, String[] dutyCompany) { + //璁剧疆鍒嗛〉鍙傛暟 + PageHelper.startPage(page, pageSize); + + List<DustExceptionData> infoList = fugitiveDustMapper.getExceptionData2(siteName, exceptionType, beginTime, endTime, street, dutyCompany); + //鑾峰彇鏌ヨ缁撴灉 + Page<DustExceptionData> p = (Page<DustExceptionData>) infoList; + + //灏佽PageBean瀵硅薄*/ + PageBean pageBean = new PageBean(p.getTotal(), p.getResult()); + + return pageBean; + } + } -- Gitblit v1.9.3