于紫祥_1901
2020-10-27 2b3c06ae70b16b83063158d092094619579a4d7b
风场更新
5 files modified
38 ■■■■ changed files
src/main/java/com/moral/controller/ScreenController.java 6 ●●●● patch | view | raw | blame | history
src/main/java/com/moral/mapper/DeviceMapper.java 6 ●●●● patch | view | raw | blame | history
src/main/java/com/moral/service/DeviceService.java 4 ●●●● patch | view | raw | blame | history
src/main/java/com/moral/service/impl/DeviceServiceImpl.java 16 ●●●● patch | view | raw | blame | history
src/main/resources/mapper/DeviceMapper.xml 6 ●●●● patch | view | raw | blame | history
src/main/java/com/moral/controller/ScreenController.java
@@ -2023,7 +2023,7 @@
        Calendar calendar = Calendar.getInstance();
        calendar.set(Calendar.MINUTE, (calendar.get(Calendar.MINUTE) - 2));
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm");
        String time = df.format(calendar.getTime()) + ":00";
        //String time = df.format(calendar.getTime()) + ":00";
        int year = calendar.get(Calendar.YEAR);
        int month = calendar.get(Calendar.MONTH) + 1;
        String mon;
@@ -2033,7 +2033,7 @@
            mon = "" + month;
        }
        String table = "history_minutely_" + year + mon;
        List list = deviceService.byMonitorIdGetDeviceAndWind(monitorPointId, time, table);
        List list = deviceService.byMonitorIdGetDeviceAndWind(monitorPointId,table);
        return list;
    }
@@ -2054,7 +2054,7 @@
            mon = "" + month;
        }
        String table = "history_minutely_" + year + mon;
        List list = deviceService.byMonitorIdGetDeviceAndWindSpecial(monitorPointId, time, table);
        List list = deviceService.byMonitorIdGetDeviceAndWindSpecial(monitorPointId,table);
        return list;
    }
src/main/java/com/moral/mapper/DeviceMapper.java
@@ -71,12 +71,12 @@
    Device byMacGetDevice(@Param("mac") String mac);
    DeviceAndWind getDeviceAndWindByMac(@Param("mac") String mac, @Param("time") String time,
    DeviceAndWind getDeviceAndWindByMac(@Param("mac") String mac,
                                        @Param("table") String table);
    List<DeviceAndWind> byMonitorIdGetDeviceAndWind(@Param("id") int id, @Param("time") String time, @Param("table") String table);
    List<DeviceAndWind> byMonitorIdGetDeviceAndWind(@Param("id") int id, @Param("table") String table);
    DeviceAndWind byMacGetDeviceAndWind(@Param("mac") String mac, @Param("time") String time, @Param("table") String table);
    DeviceAndWind byMacGetDeviceAndWind(@Param("mac") String mac, @Param("table") String table);
    List<String> getMacsByMonitorPointIds(List<Integer> list);
src/main/java/com/moral/service/DeviceService.java
@@ -80,8 +80,8 @@
    Device byMacGetDevice(String mac);
    List<DeviceAndWind> byMonitorIdGetDeviceAndWind(String id,String time,String tab);
    List<DeviceAndWind> byMonitorIdGetDeviceAndWindSpecial(String id,String time,String tab);
    List<DeviceAndWind> byMonitorIdGetDeviceAndWind(String id,String tab);
    List<DeviceAndWind> byMonitorIdGetDeviceAndWindSpecial(String id,String tab);
    List<Device> getDeviceByCodeAndId(String code,String id);
src/main/java/com/moral/service/impl/DeviceServiceImpl.java
@@ -719,8 +719,8 @@
    }
    @Override
    public List byMonitorIdGetDeviceAndWind(String id,String time,String tab) {
        List<DeviceAndWind> deviceAndWinds=deviceMapper.byMonitorIdGetDeviceAndWind(Integer.parseInt(id),time,tab);
    public List byMonitorIdGetDeviceAndWind(String id,String tab) {
        List<DeviceAndWind> deviceAndWinds=deviceMapper.byMonitorIdGetDeviceAndWind(Integer.parseInt(id),tab);
        List loList=new ArrayList();
        List laList=new ArrayList();
        Double U=0.0;
@@ -876,7 +876,7 @@
    }
    @Override
    public List byMonitorIdGetDeviceAndWindSpecial(String id, String time, String tab) {
    public List byMonitorIdGetDeviceAndWindSpecial(String id, String tab) {
        MonitorPoint monitorPoint=monitorPointMapper.byIdGetMonitorPoint(Integer.parseInt(id));
        Integer areaCode=monitorPoint.getAreaCode();
        String townCode= monitorPoint.getTownCode()+"";
@@ -895,7 +895,7 @@
            List<Device> deviceList=deviceMapper.getDeviceByCode(parm);
            for (Device d : deviceList) {
                String mac=d.getMac();
                 DeviceAndWind deviceAndWind = deviceMapper.byMacGetDeviceAndWind(mac,time,tab);
                 DeviceAndWind deviceAndWind = deviceMapper.byMacGetDeviceAndWind(mac,tab);
                 if (deviceAndWind!=null){
                     deviceAndWinds.add(deviceAndWind);
                 }
@@ -907,7 +907,7 @@
            List<Device> deviceList=deviceMapper.getDeviceByCode(parm);
            for (Device d : deviceList) {
                String mac=d.getMac();
                DeviceAndWind deviceAndWind = deviceMapper.byMacGetDeviceAndWind(mac,time,tab);
                DeviceAndWind deviceAndWind = deviceMapper.byMacGetDeviceAndWind(mac,tab);
                if (deviceAndWind!=null){
                    deviceAndWinds.add(deviceAndWind);
                }
@@ -915,15 +915,15 @@
            length=2000;
            perdlen=280;
        }else if(monitorPointId==35){
         DeviceAndWind deviceAndWind=deviceMapper.getDeviceAndWindByMac("898607b0101730392253",time,tab);
         DeviceAndWind deviceAndWind1=deviceMapper.getDeviceAndWindByMac("p5dnd7a0392083",time,tab);
         DeviceAndWind deviceAndWind=deviceMapper.getDeviceAndWindByMac("898607b0101730392253",tab);
         DeviceAndWind deviceAndWind1=deviceMapper.getDeviceAndWindByMac("p5dnd7a0392083",tab);
         deviceAndWinds.add(deviceAndWind);
         deviceAndWinds.add(deviceAndWind1);
            length=2000;
            perdlen=50;
        }else {
            deviceAndWinds=deviceMapper.byMonitorIdGetDeviceAndWind(Integer.parseInt(id),time,tab);
            deviceAndWinds=deviceMapper.byMonitorIdGetDeviceAndWind(Integer.parseInt(id),tab);
            length=2000;
            perdlen=80;
        }
src/main/resources/mapper/DeviceMapper.xml
@@ -378,7 +378,7 @@
            as windSpeed, h.json->"$.e23[0]" as windDir,
            h.json->"$.e17[0]" as tVoc
            from ${table} h ,`device` as d
            where d.mac=h.mac and d.mac=#{mac} and h.time=#{time}
            where d.mac=h.mac and d.mac=#{mac} and h.time=(select max(time) from ${table})
 </select>
    <select id="byMonitorIdGetDeviceAndWind" resultType="com.moral.entity.DeviceAndWind">
          select d.longitude as longitude,d.latitude as latitude,
@@ -386,7 +386,7 @@
            as windSpeed, h.json->"$.e23[0]" as windDir,
            h.json->"$.e17[0]" as tVoc
            from ${table} as h ,`device` as d
            where d.mac=h.mac and h.time=#{time}
            where d.mac=h.mac and h.time=(select max(time) from ${table})
            and d.mac in (select d.mac from device , monitor_point as m where d.monitor_point_id=m.id and m.id=#{id})
    </select>
@@ -547,7 +547,7 @@
            as windSpeed, h.json->"$.e23[0]" as windDir,
            h.json->"$.e17[0]" as tVoc
            from ${table} as h ,`device` as d
            where d.mac=h.mac and h.time=#{time}
            where d.mac=h.mac and h.time=(select max(time) from ${table})
            and d.mac=#{mac}
    </select>
    <select id="getDeviceByCodeAndId" resultType="com.moral.entity.Device" resultMap="BaseResultMap">