1.新增了站点信息查询的接口
2.修改了扬尘已有接口的参数以及sql语句
3.修改了用户登陆接口
已修改7个文件
已添加3个文件
280 ■■■■■ 文件已修改
src/main/java/com/flightfeather/monitor/controller/FugitiveDustController.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/flightfeather/monitor/controller/LoginController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/flightfeather/monitor/controller/dust/DustSiteInfoController.java 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/flightfeather/monitor/mapper/FugitiveDustMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/flightfeather/monitor/pojo/DustSiteData.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/flightfeather/monitor/service/DustSiteInfoService.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/flightfeather/monitor/service/FugitiveDustService.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/flightfeather/monitor/service/impl/DustSiteInfoServiceImpl.java 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/flightfeather/monitor/service/impl/FugitiveDustServiceImpl.java 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/FugitiveDustMapper.xml 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/flightfeather/monitor/controller/FugitiveDustController.java
@@ -75,6 +75,7 @@
        return Result.success(list);
    }
//条件查询异常数据
@GetMapping("/exceptiondata")
public Result getExceptionData(@RequestParam(defaultValue = "1") Integer page,
@@ -82,6 +83,9 @@
    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){
@@ -89,18 +93,25 @@
        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);
    }
src/main/java/com/flightfeather/monitor/controller/LoginController.java
@@ -24,7 +24,7 @@
        //判断:登录用户是否存在
        if(login !=null ){
            return Result.success("登陆成功");
            return Result.success(login.getUiRealName());
        }
        return Result.error("用户名或密码错误");
    }
src/main/java/com/flightfeather/monitor/controller/dust/DustSiteInfoController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,59 @@
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);
    }
}
src/main/java/com/flightfeather/monitor/mapper/FugitiveDustMapper.java
@@ -28,10 +28,9 @@
    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);
@@ -59,4 +58,6 @@
    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);
}
src/main/java/com/flightfeather/monitor/pojo/DustSiteData.java
@@ -17,16 +17,19 @@
    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;
}
src/main/java/com/flightfeather/monitor/service/DustSiteInfoService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,19 @@
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);
}
src/main/java/com/flightfeather/monitor/service/FugitiveDustService.java
@@ -23,9 +23,9 @@
    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);
@@ -53,4 +53,6 @@
    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);
}
src/main/java/com/flightfeather/monitor/service/impl/DustSiteInfoServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,45 @@
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;
    }
}
src/main/java/com/flightfeather/monitor/service/impl/FugitiveDustServiceImpl.java
@@ -93,14 +93,14 @@
    }
    @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;
    }
@@ -189,5 +189,20 @@
        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;
    }
}
src/main/resources/mapper/FugitiveDustMapper.xml
@@ -145,12 +145,27 @@
        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>
@@ -210,8 +225,9 @@
                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>
@@ -223,7 +239,78 @@
                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>