1.新增了站点信息查询的接口
2.修改了扬尘已有接口的参数以及sql语句
3.修改了用户登陆接口
| | |
| | | return Result.success(list); |
| | | } |
| | | |
| | | //æ¡ä»¶æ¥è¯¢å¼å¸¸æ°æ® |
| | | @GetMapping("/exceptiondata") |
| | | public Result getExceptionData(@RequestParam(defaultValue = "1") Integer page, |
| | | |
| | | //æ¡ä»¶æ¥è¯¢å¼å¸¸æ°æ® |
| | | @GetMapping("/exceptiondata") |
| | | public Result getExceptionData(@RequestParam(defaultValue = "1") Integer page, |
| | | @RequestParam(defaultValue = "20")Integer pageSize,String siteName,String [] exceptionType,String beginTime, String endTime){ |
| | | PageBean pageBean = fugitiveDustService.getExceptionData(page,pageSize,siteName,exceptionType,beginTime,endTime); |
| | | return Result.success(pageBean); |
| | | } |
| | | |
| | | |
| | | |
| | | //æ¡ä»¶æ¥è¯¢å¼å¸¸æ°æ® ä¸å页 |
| | | @GetMapping("/exceptiondata1") |
| | | public Result getExceptionAllData(String siteName,String [] exceptionType,String beginTime, String endTime){ |
| | |
| | | return Result.success(list); |
| | | } |
| | | |
| | | //å¢å è¡éåè¿ç»´å æ¡ä»¶æ¥è¯¢å¼å¸¸æ°æ® |
| | | @GetMapping("/exceptiondata2") |
| | | public Result getExceptionData2(@RequestParam(defaultValue = "1") Integer page, |
| | | @RequestParam(defaultValue = "20")Integer pageSize,String siteName,String [] exceptionType,String beginTime, String endTime,String [] street,String [] dutyCompany){ |
| | | PageBean pageBean = fugitiveDustService.getExceptionData2(page,pageSize,siteName,exceptionType,beginTime,endTime,street,dutyCompany); |
| | | return Result.success(pageBean); |
| | | } |
| | | //æ ¹æ®ææ®µæ¶é´å
æä¸ªå¼å¸¸ç±»åæ¥è¯¢å¯¹åºçåºéºåç§°å设å¤ç¼å· |
| | | @GetMapping("/sitenamecode") |
| | | public Result getExceptionSitenameAndCode(String exceptionType,String beginTime, String endTime){ |
| | | List<DustExceptionData> list = fugitiveDustService.getExceptionSitenameAndCode(exceptionType,beginTime,endTime); |
| | | public Result getExceptionSitenameAndCode(String exceptionType,String beginTime, String endTime,String [] street,String [] dutyCompany,String siteName){ |
| | | List<DustExceptionData> list = fugitiveDustService.getExceptionSitenameAndCode(exceptionType,beginTime,endTime,street,dutyCompany,siteName); |
| | | return Result.success(list); |
| | | } |
| | | |
| | | |
| | | // æ ¹æ®æ¶é´è¿å该å¼å¸¸ç±»åçä¸ªæ° |
| | | @GetMapping("/exceptionnum") |
| | | public Result exceptionNum(String exceptionType,String beginTime,String endTime){ |
| | | Integer list = fugitiveDustService.exceptionNum( exceptionType, beginTime, endTime); |
| | | public Result exceptionNum(String exceptionType,String beginTime,String endTime,String [] street,String [] dutyCompany,String siteName){ |
| | | Integer list = fugitiveDustService.exceptionNum( exceptionType, beginTime, endTime,street,dutyCompany,siteName); |
| | | return Result.success(list); |
| | | } |
| | | |
| | |
| | | //夿ï¼ç»å½ç¨æ·æ¯å¦åå¨ |
| | | if(login !=null ){ |
| | | |
| | | return Result.success("ç»éæå"); |
| | | return Result.success(login.getUiRealName()); |
| | | } |
| | | return Result.error("ç¨æ·åæå¯ç é误"); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.flightfeather.monitor.controller.dust; |
| | | |
| | | import com.flightfeather.monitor.domain.ds1.entity.DustSiteInfo; |
| | | import com.flightfeather.monitor.pojo.Result; |
| | | import com.flightfeather.monitor.pojo.RiskValuePojo; |
| | | import com.flightfeather.monitor.service.DustSiteInfoService; |
| | | import com.flightfeather.monitor.service.RiskValueService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName: DustSiteInfo |
| | | * @Description: TODO |
| | | * @author: yourname |
| | | */ |
| | | |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/dust/siteInfo") |
| | | @CrossOrigin |
| | | public class DustSiteInfoController { |
| | | @Autowired |
| | | private DustSiteInfoService dustSiteInfoService; |
| | | |
| | | |
| | | /** |
| | | * æ ¹æ®è®¾å¤ç¼ç æ¥è¯¢ç«ç¹åºæ¬ä¿¡æ¯ |
| | | * |
| | | * @param mnCode |
| | | * @return |
| | | */ |
| | | @GetMapping("/info") |
| | | public Result querySiteInfoBymnCode(String mnCode) { |
| | | |
| | | |
| | | List<DustSiteInfo> list = dustSiteInfoService.querySiteInfoBymnCode(mnCode); |
| | | return Result.success(list); |
| | | } |
| | | |
| | | @GetMapping("/dutyCompany") |
| | | public Result queryAllDutyCompany() { |
| | | |
| | | |
| | | List<DustSiteInfo> list = dustSiteInfoService.queryAllDutyCompany(); |
| | | return Result.success(list); |
| | | } |
| | | |
| | | @GetMapping("/street") |
| | | public Result queryStreet(String street) { |
| | | |
| | | |
| | | List<DustSiteInfo> list = dustSiteInfoService.queryStreet(street); |
| | | return Result.success(list); |
| | | } |
| | | } |
| | |
| | | |
| | | List<DustExceptionData> getExceptionData(String siteName, @Param("exceptionType")String[] exceptionType, String beginTime, String endTime); |
| | | |
| | | List<DustExceptionData> getExceptionSitenameAndCode(String exceptionType, String beginTime, String endTime); |
| | | List<DustExceptionData> getExceptionSitenameAndCode(String exceptionType, String beginTime, String endTime,@Param("street")String [] street,@Param("dutyCompany")String [] dutyCompany,String siteName); |
| | | |
| | | @Select("select count(*) from dust_exception_data as a join ja_t_dust_site_info as b on a.mn_code = b.mn_code where exception_type = #{exceptionType} and (begin_time between #{beginTime} and #{endTime} or end_time between #{beginTime} and #{endTime})") |
| | | Integer exceptionNum(String exceptionType, String beginTime, String endTime); |
| | | Integer exceptionNum(String exceptionType, String beginTime, String endTime,@Param("street")String [] street,@Param("dutyCompany")String [] dutyCompany,String siteName); |
| | | |
| | | List<DustSiteData> conditonQueryHistoryData(String siteName, String beginTime, String endTime); |
| | | |
| | |
| | | |
| | | |
| | | List<AnalysisDustData> analysisdataByTimeAndType(String beginTime, String endTime, String type); |
| | | |
| | | List<DustExceptionData> getExceptionData2(String siteName, @Param("exceptionType")String[] exceptionType, String beginTime, String endTime, @Param("street")String[] street, @Param("dutyCompany")String[] dutyCompany); |
| | | } |
| | |
| | | private String sName; |
| | | // ä¾åºå |
| | | private String dutyCompany; |
| | | private String groupName; |
| | | |
| | | |
| | | |
| | | private String mnCode; |
| | | private String typeName; |
| | | private double dustValue; |
| | | private double noiseValue; |
| | | |
| | | // private String lst; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime lst; |
| | | |
| | | private String quality; |
| | | private String groupName; |
| | | private String Grade; |
| | | private String flag; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.flightfeather.monitor.service; |
| | | |
| | | import com.flightfeather.monitor.domain.ds1.entity.DustSiteInfo; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName: DustSiteInfoService |
| | | * @Description: TODO |
| | | * @author: yourname |
| | | */ |
| | | |
| | | public interface DustSiteInfoService { |
| | | List<DustSiteInfo> querySiteInfoBymnCode(String mnCode); |
| | | |
| | | List<DustSiteInfo> queryAllDutyCompany(); |
| | | |
| | | List<DustSiteInfo> queryStreet(String street); |
| | | } |
| | |
| | | |
| | | PageBean getExceptionData(Integer page, Integer pageSize, String siteName, String[] exceptionType, String beginTime, String endTime); |
| | | |
| | | List<DustExceptionData> getExceptionSitenameAndCode(String exceptionType, String beginTime, String endTime); |
| | | List<DustExceptionData> getExceptionSitenameAndCode(String exceptionType, String beginTime, String endTime,String [] street,String [] dutyCompany,String siteName); |
| | | |
| | | Integer exceptionNum(String exceptionType, String beginTime, String endTime); |
| | | Integer exceptionNum(String exceptionType, String beginTime, String endTime,String [] street,String [] dutyCompany,String siteName); |
| | | |
| | | List<DustSiteData> conditonQueryHistoryData(String siteName, String beginTime, String endTime); |
| | | |
| | |
| | | List<AnalysisDustData> analysisdataByType(String month,String type); |
| | | |
| | | List<AnalysisDustData> analysisdataByTimeAndType(String beginTime, String endTime, String type); |
| | | |
| | | PageBean getExceptionData2(Integer page, Integer pageSize, String siteName, String[] exceptionType, String beginTime, String endTime, String[] street, String[] dutyCompany); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.flightfeather.monitor.service.impl; |
| | | |
| | | import com.flightfeather.monitor.domain.ds1.entity.DustSiteInfo; |
| | | import com.flightfeather.monitor.domain.ds1.mapper.DustSiteInfoMapper; |
| | | import com.flightfeather.monitor.service.DustSiteInfoService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import tk.mybatis.mapper.entity.Example; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class DustSiteInfoServiceImpl implements DustSiteInfoService { |
| | | |
| | | @Autowired |
| | | private DustSiteInfoMapper dustSiteInfoMapper; |
| | | @Override |
| | | public List<DustSiteInfo> querySiteInfoBymnCode(String mnCode) { |
| | | |
| | | Example example = new Example(DustSiteInfo.class); |
| | | example.createCriteria().andEqualTo("mnCode",mnCode); |
| | | List<DustSiteInfo> list = dustSiteInfoMapper.selectByExample(example); |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public List<DustSiteInfo> queryAllDutyCompany() { |
| | | Example example = new Example(DustSiteInfo.class); |
| | | example.setDistinct(true); |
| | | example.selectProperties("dutyCompany"); |
| | | List<DustSiteInfo> list = dustSiteInfoMapper.selectByExample(example); |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public List<DustSiteInfo> queryStreet(String street) { |
| | | Example example = new Example(DustSiteInfo.class); |
| | | example.setDistinct(true); |
| | | example.selectProperties("address"); |
| | | example.createCriteria().andLike("address","%"+street+"%"); |
| | | List<DustSiteInfo> list = dustSiteInfoMapper.selectByExample(example); |
| | | return list; |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | @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; |
| | | } |
| | | |
| | |
| | | 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; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | from dust_exception_data 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="exceptionType !=null and exceptionType != ''"> |
| | | a.exception_type = #{exceptionType} |
| | | and a.exception_type = #{exceptionType} |
| | | </if> |
| | | |
| | | <if test="beginTime != null and endTime != null"> |
| | | and (a.begin_time between #{beginTime} and #{endTime} or a.end_time between #{beginTime} and #{endTime}) |
| | | </if> |
| | | <if test="street != null and street != '' "> |
| | | and b.address in |
| | | <foreach item="item" collection="street" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="dutyCompany != null and dutyCompany != '' "> |
| | | and b.duty_company in |
| | | <foreach item="item" collection="dutyCompany" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | </select> |
| | |
| | | and a.type = #{type} |
| | | </if> |
| | | </where> |
| | | |
| | | </select> |
| | | |
| | | |
| | | <select id="analysisdataByTimeAndType" resultType="com.flightfeather.monitor.pojo.AnalysisDustData"> |
| | | select a.*,b.name,b.duty_company from dust_statistics_value as a join ja_t_dust_site_info as b on a.mn_code = b. mn_code |
| | | <where> |
| | |
| | | and a.type = #{type} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="getExceptionData2" resultType="com.flightfeather.monitor.pojo.DustExceptionData"> |
| | | |
| | | select a.* ,b.* |
| | | from dust_exception_data as a join ja_t_dust_site_info as b on a.mn_code = b.mn_code |
| | | <where> |
| | | <if test="street != null and street != '' "> |
| | | b.address in |
| | | <foreach item="item" collection="street" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test="dutyCompany != null and dutyCompany != '' "> |
| | | and b.duty_company in |
| | | <foreach item="item" collection="dutyCompany" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="siteName !=null and siteName != ''"> |
| | | and b.name like concat('%',#{siteName},'%') |
| | | </if> |
| | | |
| | | <if test="exceptionType != null and exceptionType != '' "> |
| | | and a.exception_type in |
| | | <foreach item="item" collection="exceptionType" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | |
| | | |
| | | <if test="beginTime != null and endTime != null"> |
| | | and (a.begin_time between #{beginTime} and #{endTime} or a.end_time between #{beginTime} and #{endTime}) |
| | | </if> |
| | | |
| | | |
| | | |
| | | </where> |
| | | |
| | | </select> |
| | | <select id="exceptionNum" resultType="java.lang.Integer"> |
| | | select count(*) |
| | | from dust_exception_data 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="exceptionType != null and exceptionType != '' "> |
| | | and a.exception_type = #{exceptionType} |
| | | </if> |
| | | |
| | | <if test="street != null and street != '' "> |
| | | and b.address in |
| | | <foreach item="item" collection="street" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test="dutyCompany != null and dutyCompany != '' "> |
| | | and b.duty_company in |
| | | <foreach item="item" collection="dutyCompany" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test="beginTime != null and endTime != null"> |
| | | and (a.begin_time between #{beginTime} and #{endTime} or a.end_time between #{beginTime} and #{endTime}) |
| | | </if> |
| | | |
| | | </where> |
| | | |
| | | </select> |
| | | |
| | | </mapper> |