| | |
| | | <parent> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-parent</artifactId> |
| | | <version>3.0.5</version> |
| | | <version>2.5.15</version> |
| | | <relativePath/> <!-- lookup parent from repository --> |
| | | </parent> |
| | | |
| | |
| | | <artifactId>web_01</artifactId> |
| | | <version>0.0.1-SNAPSHOT</version> |
| | | <name>web_01</name> |
| | | <packaging>war</packaging> |
| | | <description>web_01</description> |
| | | |
| | | <properties> |
| | |
| | | <dependency> |
| | | <groupId>org.mybatis.spring.boot</groupId> |
| | | <artifactId>mybatis-spring-boot-starter</artifactId> |
| | | <version>3.0.0</version> |
| | | <version>2.3.1</version> |
| | | |
| | | </dependency> |
| | | |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>com.mysql</groupId>--> |
| | | <!-- <artifactId>mysql-connector-j</artifactId>--> |
| | | <!-- <scope>runtime</scope>--> |
| | | <!-- </dependency>--> |
| | | <dependency> |
| | | <groupId>com.mysql</groupId> |
| | | <artifactId>mysql-connector-j</artifactId> |
| | | <scope>runtime</scope> |
| | | <groupId>mysql</groupId> |
| | | <artifactId>mysql-connector-java</artifactId> |
| | | <version>8.0.33</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.projectlombok</groupId> |
| | |
| | | |
| | | <build> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-maven-plugin</artifactId> |
| | | <version>3.0.5</version> |
| | | <configuration> |
| | | <excludes> |
| | | <exclude> |
| | | <groupId>org.projectlombok</groupId> |
| | | <artifactId>lombok</artifactId> |
| | | </exclude> |
| | | </excludes> |
| | | </configuration> |
| | | </plugin> |
| | | <!-- <plugin>--> |
| | | <!-- <groupId>org.springframework.boot</groupId>--> |
| | | <!-- <artifactId>spring-boot-maven-plugin</artifactId>--> |
| | | <!-- <version>3.0.5</version>--> |
| | | <!-- <configuration>--> |
| | | <!-- <excludes>--> |
| | | <!-- <exclude>--> |
| | | <!-- <groupId>org.projectlombok</groupId>--> |
| | | <!-- <artifactId>lombok</artifactId>--> |
| | | <!-- </exclude>--> |
| | | <!-- </excludes>--> |
| | | <!-- </configuration>--> |
| | | <!-- </plugin>--> |
| | | </plugins> |
| | | </build> |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.job.zsc; |
| | | |
| | | import org.springframework.boot.builder.SpringApplicationBuilder; |
| | | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; |
| | | |
| | | public class ServletInitializer extends SpringBootServletInitializer { |
| | | |
| | | @Override |
| | | protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { |
| | | return builder.sources(QianduanApplication.class); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.job.zsc.controller; |
| | | |
| | | |
| | | import com.job.zsc.pojo.AnalysisDustData; |
| | | import com.job.zsc.pojo.DustSiteData; |
| | | import com.job.zsc.pojo.PageBean; |
| | | import com.job.zsc.pojo.Result; |
| | | import com.job.zsc.service.FugitiveDustService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | @Slf4j |
| | | @RequestMapping("/dust") |
| | | @CrossOrigin |
| | | @RestController |
| | | public class FugitiveDustController { |
| | | @Autowired |
| | | private FugitiveDustService fugitiveDustService; |
| | | |
| | | |
| | | |
| | | //æ¬å° çæµç¹å岿°æ® å端å页 |
| | | @GetMapping("/history1") |
| | | public Result conditonQueryAbnormalData3(@RequestParam(defaultValue = "1") Integer page, |
| | | @RequestParam(defaultValue = "20")Integer pageSize, |
| | | String siteName,String mnCode,String beginTime, String endTime,String[] scenarioType ){ |
| | | PageBean pageBean = fugitiveDustService.page(page,pageSize,siteName,mnCode, beginTime,endTime,scenarioType); |
| | | return Result.success(pageBean); |
| | | } |
| | | |
| | | // è¿åçæµç¹æ°æ®ä¸çä¸åçåºæ¯ |
| | | @GetMapping("/scenario") |
| | | public Result conditonQueryHistoryData(){ |
| | | List<DustSiteData> list = fugitiveDustService.scenarioData(); |
| | | return Result.success(list); |
| | | } |
| | | // è¿åææç«ç¹åå |
| | | @GetMapping("/sitename") |
| | | public Result allSiteName(){ |
| | | List<DustSiteData> list = fugitiveDustService.allSiteName(); |
| | | return Result.success(list); |
| | | } |
| | | |
| | | // æ ¹æ®ç«ç¹åååæ¶é´æ®µæ¥è¯¢åå¼å |
| | | @GetMapping("/analysisdata") |
| | | public Result analysisdata( String siteName,String beginTime, String endTime){ |
| | | List<AnalysisDustData> list = fugitiveDustService.analysisdata(siteName,beginTime,endTime); |
| | | return Result.success(list); |
| | | } |
| | | } |
| | |
| | | return Result.success(list); |
| | | } |
| | | |
| | | // @GetMapping("/shopnum") |
| | | // public Result shopNum(){ |
| | | // String num = vue3FumeService.shopNum(); |
| | | // return Result.success(num); |
| | | // } |
| | | // è¿åå¯ä¾ç¬åçåºéºåç§° ï¼è¿äºåºéºåç§°æçæ¯ç¼©åç 对åºä¸pythonç¼ç ä¸è½ç¨MySQLå
¶ä»è¡¨çåºéºå代æ¿ï¼ |
| | | @GetMapping("/shopnamepy") |
| | | public Result shopnamePythonUse(){ |
| | | List<FumeHistoryData> list = vue3FumeService.shopnamePythonUse(); |
| | | return Result.success(list); |
| | | } |
| | | |
| | | |
| | | // è¿åå岿°æ®è¡¨çè·ä»çææ°æ¶é´ |
| | | @GetMapping("/lastesttime") |
| | | public Result lastestTimeFromHistoryData(){ |
| | | List<FumeHistoryData> list = vue3FumeService.lastestTimeFromHistoryData(); |
| | | return Result.success(list); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | List<AnalysisData> find(String shopname,String value,String begin, String end); |
| | | |
| | | @Insert("insert into from_web_analysis_data values(#{fumeDevId},#{fumeDate},#{fumeDayMin},#{fumeDayMax},#{fumeDayAverage},#{purifierOpenRate},#{fumeMinuteExceedingNum},#{fumeOverStandardRate},#{fumeDataEfficiency},#{dailyOnlineRate},#{noonOnlineRate},#{nightOnlineRate},#{keyOnlineRate},#{noonValidRate},#{nightValidRate},#{keyValidRate},#{noonOpeningCount},#{nightOpeningCount},#{keyOpeningRate},#{noonExceedingNum},#{nightExceedingNum},#{keyExceedingRate})") |
| | | @Insert("insert into fm_web_analysis_data values(#{fumeDevId},#{fumeDate},#{fumeDayMin},#{fumeDayMax},#{fumeDayAverage},#{purifierOpenRate},#{fumeMinuteExceedingNum},#{fumeOverStandardRate},#{fumeDataEfficiency},#{dailyOnlineRate},#{noonOnlineRate},#{nightOnlineRate},#{keyOnlineRate},#{noonValidRate},#{nightValidRate},#{keyValidRate},#{noonOpeningCount},#{nightOpeningCount},#{keyOpeningRate},#{noonExceedingNum},#{nightExceedingNum},#{keyExceedingRate})") |
| | | void write(AnalysisData analysisData); |
| | | |
| | | Integer search(String shopname,String value, String begin, String end); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.job.zsc.mapper; |
| | | |
| | | import com.job.zsc.pojo.AnalysisDustData; |
| | | import com.job.zsc.pojo.DustSiteData; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | public interface FugitiveDustMapper { |
| | | |
| | | List<DustSiteData> conditonQueryDustHistoryData(String siteName, String mnCode,String beginTime, String endTime,@Param("scenarioType") String[] scenarioType) ; |
| | | |
| | | @Select("select distinct Type_Name from monitor_site") |
| | | List<DustSiteData> scenarioData(); |
| | | |
| | | @Select("select DISTINCT name from ja_t_dust_site_info ") |
| | | List<DustSiteData> allSiteName(); |
| | | |
| | | List<AnalysisDustData> analysisdata( String siteName,String beginTime, String endTime); |
| | | } |
| | |
| | | List<FumeAbnormalData> earlyAndLastTime(); |
| | | |
| | | |
| | | @Select("select max(MV_Data_Time) as MV_Data_Time from fd_t_minutevalue") |
| | | List<FumeHistoryData> lastestTimeFromHistoryData(); |
| | | |
| | | @Select("select * from shop_names order by MV_ID") |
| | | List<FumeHistoryData> shopnamePythonUse(); |
| | | |
| | | |
| | | // è¿å设å¤ä¿¡æ¯è¡¨çæ¡æ° |
| | | // @Select("SELECT count(*) from ea_t_device_info") |
| | | // String shopNum(); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.job.zsc.pojo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.time.LocalDate; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class AnalysisDustData { |
| | | |
| | | private String mnCode; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate lst; |
| | | |
| | | private Double dayAvg; |
| | | private String dayOnline; |
| | | private String dayValid; |
| | | private String dayExceeding; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.job.zsc.pojo; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | // çæµç¹ |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class DustSiteData { |
| | | private String name; |
| | | private String address; |
| | | private String sName; |
| | | private String mnCode; |
| | | private String typeName; |
| | | private String dustValue; |
| | | private String lst; |
| | | private String quality; |
| | | private String groupName; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.job.zsc.service; |
| | | |
| | | import com.job.zsc.pojo.AnalysisDustData; |
| | | import com.job.zsc.pojo.DustSiteData; |
| | | import com.job.zsc.pojo.PageBean; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface FugitiveDustService { |
| | | |
| | | PageBean page(Integer page, Integer pageSize, String siteName, String mnCode, String beginTime, String endTime,String[] scenarioType); |
| | | |
| | | List<DustSiteData> scenarioData(); |
| | | |
| | | List<DustSiteData> allSiteName(); |
| | | |
| | | List<AnalysisDustData> analysisdata( String siteName,String beginTime, String endTime); |
| | | } |
| | |
| | | |
| | | List<FumeAbnormalData> earlyAndLastTime(); |
| | | |
| | | List<FumeHistoryData> lastestTimeFromHistoryData(); |
| | | |
| | | List<FumeHistoryData> shopnamePythonUse(); |
| | | |
| | | |
| | | // String shopNum(); |
| | | } |
| | |
| | | import com.job.zsc.mapper.AnalysisDataMapper; |
| | | import com.job.zsc.pojo.AnalysisData; |
| | | import com.job.zsc.service.AnalysisDataService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class AnalysisDataServiceImpl implements AnalysisDataService { |
| | | @Autowired |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.job.zsc.service.impl; |
| | | |
| | | import com.github.pagehelper.Page; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.job.zsc.mapper.FugitiveDustMapper; |
| | | import com.job.zsc.pojo.AnalysisDustData; |
| | | import com.job.zsc.pojo.DustSiteData; |
| | | import com.job.zsc.pojo.PageBean; |
| | | import com.job.zsc.service.FugitiveDustService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class FugitiveDustServiceImpl implements FugitiveDustService { |
| | | |
| | | @Autowired |
| | | private FugitiveDustMapper fugitiveDustMapper; |
| | | |
| | | @Override |
| | | public PageBean page(Integer page, Integer pageSize, String siteName, String mnCode, String beginTime, String endTime,String[] scenarioType) { |
| | | //设置å页忰 |
| | | PageHelper.startPage(page,pageSize); |
| | | //æ§è¡æ¥è¯¢ |
| | | List<DustSiteData> infoList=fugitiveDustMapper.conditonQueryDustHistoryData(siteName,mnCode,beginTime,endTime,scenarioType); |
| | | //è·åæ¥è¯¢ç»æ |
| | | Page<DustSiteData> p=(Page<DustSiteData>)infoList; |
| | | |
| | | //å°è£
PageBean对象*/ |
| | | PageBean pageBean=new PageBean(p.getTotal(),p.getResult()); |
| | | return pageBean; |
| | | } |
| | | |
| | | @Override |
| | | public List<DustSiteData> scenarioData() { |
| | | List<DustSiteData> list = fugitiveDustMapper.scenarioData(); |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public List<DustSiteData> allSiteName() { |
| | | List<DustSiteData> list = fugitiveDustMapper.allSiteName(); |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public List<AnalysisDustData> analysisdata( String siteName,String beginTime, String endTime) { |
| | | List<AnalysisDustData> list = fugitiveDustMapper.analysisdata(siteName,beginTime,endTime); |
| | | return list; |
| | | } |
| | | } |
| | |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public List<FumeHistoryData> lastestTimeFromHistoryData() { |
| | | List<FumeHistoryData> list = vue3FumeMapper.lastestTimeFromHistoryData(); |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public List<FumeHistoryData> shopnamePythonUse() { |
| | | List<FumeHistoryData> list = vue3FumeMapper.shopnamePythonUse(); |
| | | return list; |
| | | } |
| | | |
| | | // @Override |
| | | // public String shopNum() { |
| | | // String num = vue3FumeMapper.shopNum(); |
| | |
| | | package cn.flightfeather.supervision.infrastructure.utils |
| | | package com.job.zsc.utils |
| | | |
| | | import org.apache.commons.logging.LogFactory |
| | | import java.net.InetAddress |
| | |
| | | spring: |
| | | datasource: |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | # url: jdbc:mysql://localhost:3306/fume |
| | | # username: fume |
| | | # password: fume_feiyu2023 |
| | | |
| | | url: jdbc:mysql://localhost:3306/qianduan_sql |
| | | username: root |
| | | password: 1234 |
| | |
| | | configuration: |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | map-underscore-to-camel-case: true |
| | | |
| | | server: |
| | | port: 8081 |
| | |
| | | |
| | | |
| | | <select id="findByDevId" resultType="com.job.zsc.pojo.AnalysisData"> |
| | | select * from analysis_data |
| | | select * from fm_web_analysis_data |
| | | <where> |
| | | <if test="devId != null and devId != '' "> |
| | | fume_dev_id=#{devId} |
| | |
| | | </where> |
| | | </select> |
| | | |
| | | <!--ä¿¡æ¯åæ°æ®æªåå¼çæ°æ®è¡¨åæ ed_data--> |
| | | <!-- <select id="find" resultType="com.job.zsc.pojo.AnalysisData">--> |
| | | <!-- SELECT--> |
| | | <!-- equipment_number as fume_dev_id,--> |
| | | <!-- DATE(reporting_time) as fume_date,--> |
| | | <!-- MIN(smoke_pop_density) as fume_day_min,--> |
| | | |
| | | <!-- MAX(smoke_pop_density) as fume_day_max,--> |
| | | |
| | | <!-- AVG(smoke_pop_density) as fume_day_average,--> |
| | | |
| | | <!-- CONCAT(ROUND(SUM(CASE WHEN smoke_pop_density > 0 and purifier > 0 THEN 1 ELSE 0 END)/144 * 100, 2), '%') as purifier_open_rate,--> |
| | | <!-- SUM(CASE WHEN smoke_push_density >= 1 OR smoke_pop_density >= 1 THEN 1 ELSE 0 END) AS fume_minute_exceeding_num,--> |
| | | <!-- CONCAT(ROUND(SUM(CASE WHEN smoke_push_density >= 1 OR smoke_pop_density >= 1 THEN 1 ELSE 0 END)/COUNT(*) * 100, 2), '%') as fume_over_standard_rate,--> |
| | | <!-- CONCAT(ROUND(SUM(CASE WHEN smoke_push_density > 0 OR smoke_pop_density > 0 THEN 1 ELSE 0 END)/COUNT(*) * 100, 2), '%') as fume_data_efficiency,--> |
| | | |
| | | <!-- CONCAT(ROUND(COUNT(*)/144 * 100, 2), '%') as daily_online_rate,--> |
| | | <!-- CONCAT(ROUND(SUM(CASE WHEN TIME(attribution_time) BETWEEN '10:00:00' and '13:59:59' THEN 1 ELSE 0 END)/24 * 100, 2), '%') as noon_online_rate,--> |
| | | <!-- CONCAT(ROUND(SUM(CASE WHEN TIME(attribution_time) BETWEEN '17:00:00' and '20:59:59' THEN 1 ELSE 0 END)/24 * 100, 2), '%') as night_online_rate,--> |
| | | <!-- CONCAT(ROUND(SUM(CASE WHEN (TIME(attribution_time) BETWEEN '10:00:00' and '13:59:59') or (TIME(attribution_time) BETWEEN '17:00:00' and '20:59:59') THEN 1 ELSE 0 END)/48 * 100, 2), '%') as key_online_rate,--> |
| | | |
| | | <!-- CONCAT(ROUND(SUM(CASE WHEN TIME(attribution_time) BETWEEN '10:00:00' and '13:59:59' AND (smoke_push_density > 0 OR smoke_pop_density > 0) THEN 1 ELSE 0 END)/24 * 100, 2), '%') as noon_valid_rate,--> |
| | | <!-- CONCAT(ROUND(SUM(CASE WHEN TIME(attribution_time) BETWEEN '17:00:00' and '20:59:59' AND (smoke_push_density > 0 OR smoke_pop_density > 0) THEN 1 ELSE 0 END)/24* 100, 2), '%') as night_valid_rate,--> |
| | | <!-- CONCAT(ROUND(SUM(CASE WHEN ((TIME(attribution_time) BETWEEN '10:00:00' and '13:59:59') or (TIME(attribution_time) BETWEEN '17:00:00' and '20:59:59')) AND (smoke_push_density > 0 OR smoke_pop_density > 0) THEN 1 ELSE 0 END)/48* 100, 2), '%') as key_valid_rate,--> |
| | | |
| | | <!-- CONCAT(ROUND(SUM(CASE WHEN TIME(attribution_time) BETWEEN '10:00:00' and '13:59:59' THEN 1 ELSE 0 END) /24 * 100, 2), '%') as noon_opening_count,--> |
| | | <!-- CONCAT(ROUND(SUM(CASE WHEN TIME(attribution_time) BETWEEN '17:00:00' and '20:59:59' THEN 1 ELSE 0 END) /24 * 100, 2), '%') as night_opening_count,--> |
| | | <!-- CONCAT(ROUND(SUM(CASE WHEN (TIME(attribution_time) BETWEEN '10:00:00' and '13:59:59') or (TIME(attribution_time) BETWEEN '17:00:00' and '20:59:59') THEN 1 ELSE 0 END)/48 * 100, 2), '%') as 'key_opening_rate',--> |
| | | |
| | | <!-- SUM(CASE WHEN (TIME(attribution_time) BETWEEN '10:00:00' and '14:00:00') and (smoke_push_density >= 1 OR smoke_pop_density >= 1) THEN 1 ELSE 0 END) as noon_exceeding_num,--> |
| | | <!-- SUM(CASE WHEN (TIME(attribution_time) BETWEEN '17:00:00' and '21:00:00') and (smoke_push_density >= 1 OR smoke_pop_density >= 1) THEN 1 ELSE 0 END) as night_exceeding_num,--> |
| | | <!-- CONCAT(ROUND(SUM(CASE WHEN ((TIME(attribution_time) BETWEEN '10:00:00' and '13:59:59') or (TIME(attribution_time) BETWEEN '17:00:00' and '20:59:59'))and (smoke_push_density >= 1 OR smoke_pop_density >= 1) THEN 1 ELSE 0 END)/48 * 100, 2), '%') as key_exceeding_rate--> |
| | | <!-- FROM--> |
| | | <!-- ed_data--> |
| | | <!-- <where>--> |
| | | <!-- <if test="shopname != null and shopname != '' ">--> |
| | | <!-- shop_name like concat('%',#{shopname},'%')--> |
| | | <!-- </if>--> |
| | | <!-- <if test="value != null and value != '' ">--> |
| | | <!-- or shop_name like concat('%',#{value},'%')--> |
| | | <!-- </if>--> |
| | | <!-- <if test="begin != null and end != null">--> |
| | | <!-- and reporting_time between #{begin} and #{end}--> |
| | | <!-- </if>--> |
| | | <!-- </where>--> |
| | | <!-- GROUP BY equipment_number, DATE(reporting_time)--> |
| | | <!-- limit 0,500--> |
| | | <!-- </select>--> |
| | | <!--æ°è¡¨--> |
| | | <select id="find" resultType="com.job.zsc.pojo.AnalysisData"> |
| | | SELECT |
| | | equipment_number as fume_dev_id, |
| | | DATE(reporting_time) as fume_date, |
| | | MIN(smoke_pop_density) as fume_day_min, |
| | | a.MV_Stat_Code as fume_dev_id, |
| | | |
| | | MAX(smoke_pop_density) as fume_day_max, |
| | | DATE(a.MV_Data_Time) as fume_date, |
| | | MIN(a.MV_Fume_Concentration2) as fume_day_min, |
| | | |
| | | AVG(smoke_pop_density) as fume_day_average, |
| | | MAX(a.MV_Fume_Concentration2) as fume_day_max, |
| | | |
| | | CONCAT(ROUND(SUM(CASE WHEN smoke_pop_density > 0 and purifier > 0 THEN 1 ELSE 0 END)/144 * 100, 2), '%') as purifier_open_rate, |
| | | SUM(CASE WHEN smoke_push_density >= 1 OR smoke_pop_density >= 1 THEN 1 ELSE 0 END) AS fume_minute_exceeding_num, |
| | | CONCAT(ROUND(SUM(CASE WHEN smoke_push_density >= 1 OR smoke_pop_density >= 1 THEN 1 ELSE 0 END)/COUNT(*) * 100, 2), '%') as fume_over_standard_rate, |
| | | CONCAT(ROUND(SUM(CASE WHEN smoke_push_density > 0 OR smoke_pop_density > 0 THEN 1 ELSE 0 END)/COUNT(*) * 100, 2), '%') as fume_data_efficiency, |
| | | AVG(a.MV_Fume_Concentration2) as fume_day_average, |
| | | |
| | | CONCAT(ROUND(SUM(CASE WHEN a.MV_Fume_Concentration2 > 0 and a.MV_Purifier_Electricity > 0 THEN 1 ELSE 0 END)/144 * 100, 2), '%') as purifier_open_rate, |
| | | SUM(CASE WHEN a.MV_Fume_Concentration >= 1 OR a.MV_Fume_Concentration2 >= 1 THEN 1 ELSE 0 END) AS fume_minute_exceeding_num, |
| | | CONCAT(ROUND(SUM(CASE WHEN a.MV_Fume_Concentration >= 1 OR a.MV_Fume_Concentration2 >= 1 THEN 1 ELSE 0 END)/COUNT(*) * 100, 2), '%') as fume_over_standard_rate, |
| | | CONCAT(ROUND(SUM(CASE WHEN a.MV_Fume_Concentration > 0 OR a.MV_Fume_Concentration2 > 0 THEN 1 ELSE 0 END)/COUNT(*) * 100, 2), '%') as fume_data_efficiency, |
| | | |
| | | CONCAT(ROUND(COUNT(*)/144 * 100, 2), '%') as daily_online_rate, |
| | | CONCAT(ROUND(SUM(CASE WHEN TIME(attribution_time) BETWEEN '10:00:00' and '13:59:59' THEN 1 ELSE 0 END)/24 * 100, 2), '%') as noon_online_rate, |
| | | CONCAT(ROUND(SUM(CASE WHEN TIME(attribution_time) BETWEEN '17:00:00' and '20:59:59' THEN 1 ELSE 0 END)/24 * 100, 2), '%') as night_online_rate, |
| | | CONCAT(ROUND(SUM(CASE WHEN (TIME(attribution_time) BETWEEN '10:00:00' and '13:59:59') or (TIME(attribution_time) BETWEEN '17:00:00' and '20:59:59') THEN 1 ELSE 0 END)/48 * 100, 2), '%') as key_online_rate, |
| | | CONCAT(ROUND(SUM(CASE WHEN TIME(a.MV_Data_Time) BETWEEN '10:00:00' and '13:59:59' THEN 1 ELSE 0 END)/24 * 100, 2), '%') as noon_online_rate, |
| | | CONCAT(ROUND(SUM(CASE WHEN TIME(a.MV_Data_Time) BETWEEN '17:00:00' and '20:59:59' THEN 1 ELSE 0 END)/24 * 100, 2), '%') as night_online_rate, |
| | | CONCAT(ROUND(SUM(CASE WHEN (TIME(a.MV_Data_Time) BETWEEN '10:00:00' and '13:59:59') or (TIME(a.MV_Data_Time) BETWEEN '17:00:00' and '20:59:59') THEN 1 ELSE 0 END)/48 * 100, 2), '%') as key_online_rate, |
| | | |
| | | CONCAT(ROUND(SUM(CASE WHEN TIME(attribution_time) BETWEEN '10:00:00' and '13:59:59' AND (smoke_push_density > 0 OR smoke_pop_density > 0) THEN 1 ELSE 0 END)/24 * 100, 2), '%') as noon_valid_rate, |
| | | CONCAT(ROUND(SUM(CASE WHEN TIME(attribution_time) BETWEEN '17:00:00' and '20:59:59' AND (smoke_push_density > 0 OR smoke_pop_density > 0) THEN 1 ELSE 0 END)/24* 100, 2), '%') as night_valid_rate, |
| | | CONCAT(ROUND(SUM(CASE WHEN ((TIME(attribution_time) BETWEEN '10:00:00' and '13:59:59') or (TIME(attribution_time) BETWEEN '17:00:00' and '20:59:59')) AND (smoke_push_density > 0 OR smoke_pop_density > 0) THEN 1 ELSE 0 END)/48* 100, 2), '%') as key_valid_rate, |
| | | CONCAT(ROUND(SUM(CASE WHEN TIME(a.MV_Data_Time) BETWEEN '10:00:00' and '13:59:59' AND (a.MV_Fume_Concentration > 0 OR a.MV_Fume_Concentration2 > 0) THEN 1 ELSE 0 END)/24 * 100, 2), '%') as noon_valid_rate, |
| | | CONCAT(ROUND(SUM(CASE WHEN TIME(a.MV_Data_Time) BETWEEN '17:00:00' and '20:59:59' AND (a.MV_Fume_Concentration > 0 OR a.MV_Fume_Concentration2 > 0) THEN 1 ELSE 0 END)/24* 100, 2), '%') as night_valid_rate, |
| | | CONCAT(ROUND(SUM(CASE WHEN ((TIME(a.MV_Data_Time) BETWEEN '10:00:00' and '13:59:59') or (TIME(a.MV_Data_Time) BETWEEN '17:00:00' and '20:59:59')) AND (a.MV_Fume_Concentration > 0 OR a.MV_Fume_Concentration2 > 0) THEN 1 ELSE 0 END)/48* 100, 2), '%') as key_valid_rate, |
| | | |
| | | CONCAT(ROUND(SUM(CASE WHEN TIME(attribution_time) BETWEEN '10:00:00' and '13:59:59' THEN 1 ELSE 0 END) /24 * 100, 2), '%') as noon_opening_count, |
| | | CONCAT(ROUND(SUM(CASE WHEN TIME(attribution_time) BETWEEN '17:00:00' and '20:59:59' THEN 1 ELSE 0 END) /24 * 100, 2), '%') as night_opening_count, |
| | | CONCAT(ROUND(SUM(CASE WHEN (TIME(attribution_time) BETWEEN '10:00:00' and '13:59:59') or (TIME(attribution_time) BETWEEN '17:00:00' and '20:59:59') THEN 1 ELSE 0 END)/48 * 100, 2), '%') as 'key_opening_rate', |
| | | CONCAT(ROUND(SUM(CASE WHEN TIME(a.MV_Data_Time) BETWEEN '10:00:00' and '13:59:59' THEN 1 ELSE 0 END) /24 * 100, 2), '%') as noon_opening_count, |
| | | CONCAT(ROUND(SUM(CASE WHEN TIME(a.MV_Data_Time) BETWEEN '17:00:00' and '20:59:59' THEN 1 ELSE 0 END) /24 * 100, 2), '%') as night_opening_count, |
| | | CONCAT(ROUND(SUM(CASE WHEN (TIME(a.MV_Data_Time) BETWEEN '10:00:00' and '13:59:59') or (TIME(a.MV_Data_Time) BETWEEN '17:00:00' and '20:59:59') THEN 1 ELSE 0 END)/48 * 100, 2), '%') as 'key_opening_rate', |
| | | |
| | | SUM(CASE WHEN (TIME(attribution_time) BETWEEN '10:00:00' and '14:00:00') and (smoke_push_density >= 1 OR smoke_pop_density >= 1) THEN 1 ELSE 0 END) as noon_exceeding_num, |
| | | SUM(CASE WHEN (TIME(attribution_time) BETWEEN '17:00:00' and '21:00:00') and (smoke_push_density >= 1 OR smoke_pop_density >= 1) THEN 1 ELSE 0 END) as night_exceeding_num, |
| | | CONCAT(ROUND(SUM(CASE WHEN ((TIME(attribution_time) BETWEEN '10:00:00' and '13:59:59') or (TIME(attribution_time) BETWEEN '17:00:00' and '20:59:59'))and (smoke_push_density >= 1 OR smoke_pop_density >= 1) THEN 1 ELSE 0 END)/48 * 100, 2), '%') as key_exceeding_rate |
| | | SUM(CASE WHEN (TIME(a.MV_Data_Time) BETWEEN '10:00:00' and '14:00:00') and (a.MV_Fume_Concentration >= 1 OR a.MV_Fume_Concentration2 >= 1) THEN 1 ELSE 0 END) as noon_exceeding_num, |
| | | SUM(CASE WHEN (TIME(a.MV_Data_Time) BETWEEN '17:00:00' and '21:00:00') and (a.MV_Fume_Concentration >= 1 OR a.MV_Fume_Concentration2 >= 1) THEN 1 ELSE 0 END) as night_exceeding_num, |
| | | CONCAT(ROUND(SUM(CASE WHEN ((TIME(a.MV_Data_Time) BETWEEN '10:00:00' and '13:59:59') or (TIME(a.MV_Data_Time) BETWEEN '17:00:00' and '20:59:59'))and (a.MV_Fume_Concentration >= 1 OR a.MV_Fume_Concentration2 >= 1) THEN 1 ELSE 0 END)/48 * 100, 2), '%') as key_exceeding_rate |
| | | FROM |
| | | ed_data |
| | | fd_t_minutevalue as a |
| | | JOIN ea_t_device_info AS b ON a.MV_Stat_Code = b.DI_Code |
| | | <where> |
| | | <if test="shopname != null and shopname != '' "> |
| | | shop_name like concat('%',#{shopname},'%') |
| | | b.DI_Name like concat('%',#{shopname},'%') |
| | | </if> |
| | | <if test="value != null and value != '' "> |
| | | or shop_name like concat('%',#{value},'%') |
| | | or b.DI_Name like concat('%',#{value},'%') |
| | | </if> |
| | | <if test="begin != null and end != null"> |
| | | and reporting_time between #{begin} and #{end} |
| | | and a.MV_Data_Time between #{begin} and #{end} |
| | | </if> |
| | | </where> |
| | | GROUP BY equipment_number, DATE(reporting_time) |
| | | GROUP BY a.MV_Stat_Code, DATE(a.MV_Data_Time) |
| | | limit 0,500 |
| | | </select> |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "https://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.job.zsc.mapper.FugitiveDustMapper"> |
| | | |
| | | <select id="conditonQueryDustHistoryData" resultType="com.job.zsc.pojo.DustSiteData"> |
| | | select * |
| | | from monitor_site |
| | | <where> |
| | | <if test="siteName !=null and siteName != ''"> |
| | | Name like concat('%',#{siteName},'%') |
| | | </if> |
| | | <if test="mnCode !=null and mnCode != ''"> |
| | | and MN_Code = #{mnCode} |
| | | </if> |
| | | <if test="beginTime != null and endTime != null"> |
| | | and Lst between #{beginTime} and #{endTime} |
| | | </if> |
| | | |
| | | <if test="scenarioType != null and scenarioType != '' "> |
| | | and Type_Name in |
| | | <foreach item="item" collection="scenarioType" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | <!-- limit 0,1000--> |
| | | </select> |
| | | |
| | | <!--åææ°æ®--> |
| | | <select id="analysisdata" resultType="com.job.zsc.pojo.AnalysisDustData"> |
| | | select a.* from avg_dust_value as a join ja_t_dust_site_info as b on a.mn_code = b. mn_code |
| | | <where> |
| | | <if test="siteName !=null and siteName != ''"> |
| | | b.name = #{siteName} |
| | | </if> |
| | | |
| | | <if test="beginTime != null and endTime != null"> |
| | | and a.Lst between #{beginTime} and #{endTime} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |
| | |
| | | </select> |
| | | |
| | | <!-- å岿²¹çæ¥è¯¢--> |
| | | <!-- <select id="conditionQueryHistory" resultType="com.job.zsc.pojo.FumeHistoryData">--> |
| | | <!-- select a1.MV_ID,a1.MV_Stat_Code,b.DI_Name,a1.MV_Data_Time,a1.MV_Fume_Concentration2,a1.MV_Fan_Electricity,a1.MV_Purifier_Electricity--> |
| | | <!-- from fd_t_minutevalue as a1 , ea_t_device_info as b--> |
| | | <!-- <where>--> |
| | | <!-- <!– æ¡ä»¶ä¸ºç©ºæ¶æ¥è¯¢å
¨é¨–>--> |
| | | <!-- <if test="(devId ==null or devId == '') or (beginTime ==null and endTime == null)">--> |
| | | <!-- a1.MV_Stat_Code = b.DI_Code--> |
| | | <!-- </if>--> |
| | | <!-- <if test="devId != null and devId != '' ">--> |
| | | <!-- and a1.MV_Stat_Code = #{devId} and b.DI_Code = #{devId}--> |
| | | <!-- </if>--> |
| | | |
| | | <!-- <if test="beginTime != null and endTime != null">--> |
| | | <!-- and a1.MV_Data_Time between #{beginTime} and #{endTime}--> |
| | | <!-- </if>--> |
| | | <!-- </where>--> |
| | | <!-- order by MV_Data_Time asc--> |
| | | <!-- </select>--> |
| | | <!-- å岿²¹çæ¥è¯¢--> |
| | | <select id="conditionQueryHistory" resultType="com.job.zsc.pojo.FumeHistoryData"> |
| | | select a1.MV_ID,a1.MV_Stat_Code,b.DI_Name,a1.MV_Data_Time,a1.MV_Fume_Concentration2,a1.MV_Fan_Electricity,a1.MV_Purifier_Electricity |
| | | from fd_t_minutevalue as a1 , ea_t_device_info as b |
| | | SELECT d.DI_Name, c.* |
| | | FROM ( |
| | | SELECT a.* |
| | | FROM fd_t_minutevalue as a |
| | | LEFT JOIN fd_t_minutevalue as b ON a.MV_Data_Time = b.MV_Data_Time AND a.MV_Isduplication < b.MV_Isduplication |
| | | WHERE b.MV_ID IS NULL AND a.MV_Stat_Code = #{devId}) |
| | | as c,ea_t_device_info as d |
| | | |
| | | <!-- CREATE TEMPORARY TABLE IF NOT EXISTS temp_table AS--> |
| | | <!-- SELECT a.*--> |
| | | <!-- FROM fd_t_minutevalue AS a--> |
| | | <!-- LEFT JOIN fd_t_minutevalue AS b ON a.MV_Data_Time = b.MV_Data_Time AND a.MV_Isduplication < b.MV_Isduplication WHERE b.MV_ID IS NULL AND a.MV_Stat_Code = 'GLHB00000000016004'--> |
| | | |
| | | <where> |
| | | <!-- æ¡ä»¶ä¸ºç©ºæ¶æ¥è¯¢å
¨é¨--> |
| | | <if test="(devId ==null or devId == '') or (beginTime ==null and endTime == null)"> |
| | | a1.MV_Stat_Code = b.DI_Code |
| | | c.MV_Stat_Code = d.DI_Code |
| | | </if> |
| | | <if test="devId != null and devId != '' "> |
| | | and a1.MV_Stat_Code = #{devId} and b.DI_Code = #{devId} |
| | | and c.MV_Stat_Code = #{devId} and d.DI_Code = #{devId} |
| | | </if> |
| | | |
| | | <if test="beginTime != null and endTime != null"> |
| | | and a1.MV_Data_Time between #{beginTime} and #{endTime} |
| | | AND c.MV_Data_Time between #{beginTime} AND #{endTime} |
| | | </if> |
| | | </where> |
| | | order by MV_Data_Time asc |
| | | ORDER BY c.MV_Data_Time ASC; |
| | | </select> |
| | | |
| | | <!-- æ¡ä»¶æ¥è¯¢å¼å¸¸è¡¨--> |