| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import jodd.io.PathUtil; |
| | | import liquibase.pro.packaged.S; |
| | | import lombok.AllArgsConstructor; |
| | | import org.apache.poi.hssf.usermodel.HSSFSheet; |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
| | |
| | | import org.apache.poi.ss.util.CellRangeAddress; |
| | | import org.apache.poi.xssf.usermodel.XSSFSheet; |
| | | import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
| | | import org.python.antlr.ast.Str; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.log.annotation.ApiLog; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.modules.mountainrain.entity.Yucbig; |
| | | import org.springblade.modules.mountainrain.service.IBigriverService; |
| | | import org.springblade.modules.mountainrain.vo.BigriverVO; |
| | | import org.springblade.modules.mountainrain.wrapper.BigriverWrapper; |
| | | import org.springframework.core.io.ClassPathResource; |
| | | import org.springframework.core.io.Resource; |
| | |
| | | import javax.validation.Valid; |
| | | import java.awt.image.BufferedImage; |
| | | import java.io.*; |
| | | import java.math.BigDecimal; |
| | | import java.security.MessageDigest; |
| | | import java.text.DateFormat; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | String yue; |
| | | if (yues.length()==1){ |
| | | yue=0+yues; |
| | | } |
| | | else { |
| | | } else { |
| | | yue=yues; |
| | | } |
| | | String r = substring.substring(substring.indexOf("月")+1, substring.lastIndexOf("日")); |
| | |
| | | String a; |
| | | if (split[0].length()==1){ |
| | | a=0+yues; |
| | | } |
| | | else { |
| | | } else { |
| | | a=yues; |
| | | } |
| | | String ytime=year+"-"+a+"-"+split[1]+" "+split[2]+":00:00"; |
| | |
| | | |
| | | /** |
| | | * 主要河流导出预警模板 |
| | | * |
| | | * @param emp01 |
| | | * @throws IOException |
| | | * @throws InvalidFormatException |
| | |
| | | CellRangeAddress regionf = new CellRangeAddress(1, 1, 11, 16); |
| | | sheet.addMergedRegion(regionf); |
| | | FileOutputStream out = new FileOutputStream( "D://Software//nginx-1.20.0//dist//fzswz//excel//主要河流预警.xls"); |
| | | //FileOutputStream out = new FileOutputStream("D://Temp//主要河流预警.xls"); |
| | | wb.write(out); |
| | | out.close(); |
| | | } |
| | | |
| | | /*** |
| | | * MD5加码 生成32位md5码 |
| | | |
| | | /** |
| | | * 大江大河预报库读取 |
| | | * |
| | | * @return |
| | | */ |
| | | public static String string2MD5(String inStr) { |
| | | MessageDigest md5 = null; |
| | | @GetMapping("/selectYb") |
| | | public R selectYb(String time) throws ParseException { |
| | | //预警数据 |
| | | List listyj = new ArrayList(); |
| | | //无预警数据 |
| | | List listzc = new ArrayList(); |
| | | Map mnum = new HashMap(); |
| | | String s = iBigriverService.selectCode(); |
| | | String[] split = s.split(","); |
| | | String strArrays = ""; |
| | | for (int i = 0; i < split.length; i++) { |
| | | strArrays += "'" + split[i] + "',"; |
| | | } |
| | | String code = strArrays.substring(0, strArrays.length() - 1); |
| | | String substrings = time.substring(0, 10); |
| | | String ftimez = substrings + " 08:00:00"; |
| | | List<BigriverVO> list = iBigriverService.selectYb(ftimez, code); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | String stcd = list.get(i).getStcd(); |
| | | String ftime = list.get(i).getFtime(); |
| | | String substring = ftime.substring(0, 13); |
| | | String times = substring + ":00:00"; |
| | | String endTime = times; |
| | | Date dates = beforeHourToNowDate(time, 1); |
| | | DateFormat sdfc = new SimpleDateFormat("yyyy-MM-dd 08:00:00"); |
| | | String beginTime = sdfc.format(dates); |
| | | List<Map<String, Object>> list1 = iBigriverService.selecF(stcd, times, beginTime, endTime); |
| | | for (int c = 0; c < list1.size(); c++) { |
| | | list.get(i).setFbsw(list1.get(c).get("fbsw").toString()); |
| | | list.get(i).setFbll(list1.get(c).get("fbll").toString()); |
| | | list.get(i).setQzll(list1.get(c).get("qzll").toString()); |
| | | list.get(i).setQztime(list1.get(c).get("qztime").toString()); |
| | | list.get(i).setQzsw(list1.get(c).get("qzsw").toString()); |
| | | } |
| | | } |
| | | for (int i = 0; i < list.size(); i++) { |
| | | String yjsw = list.get(i).getYjsw(); |
| | | Double yjz = Double.parseDouble(yjsw); |
| | | BigDecimal ybsws = list.get(i).getYbsw(); |
| | | Double ybsw = ybsws.doubleValue(); |
| | | if (ybsw > yjz) { |
| | | if (mnum.containsKey(list.get(i).getStcd()) == true) { |
| | | } else { |
| | | mnum.put(list.get(i).getStcd(), i); |
| | | listyj.add(list.get(i)); |
| | | } |
| | | } else { |
| | | if (mnum.containsKey(list.get(i).getStcd()) == true) { |
| | | } else { |
| | | mnum.put(list.get(i).getStcd(), i); |
| | | listzc.add(list.get(i)); |
| | | } |
| | | } |
| | | } |
| | | Map map = new HashMap(); |
| | | map.put("yj", listyj); |
| | | map.put("zc", listzc); |
| | | List lists = new ArrayList(); |
| | | lists.add(map); |
| | | return R.data(lists); |
| | | } |
| | | |
| | | public static Date beforeHourToNowDate(String date, int hours) { |
| | | Calendar c = Calendar.getInstance(); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | try { |
| | | md5 = MessageDigest.getInstance("MD5"); |
| | | c.setTime(sdf.parse(date)); |
| | | //c.set(Calendar.HOUR_OF_DAY, c.get(Calendar.HOUR_OF_DAY) - hours); |
| | | c.set(Calendar.DATE, c.get(Calendar.DATE) - hours); |
| | | } catch (Exception e) { |
| | | System.out.println(e.toString()); |
| | | e.printStackTrace(); |
| | | return ""; |
| | | } |
| | | char[] charArray = inStr.toCharArray(); |
| | | byte[] byteArray = new byte[charArray.length]; |
| | | |
| | | for (int i = 0; i < charArray.length; i++) |
| | | byteArray[i] = (byte) charArray[i]; |
| | | byte[] md5Bytes = md5.digest(byteArray); |
| | | StringBuffer hexValue = new StringBuffer(); |
| | | for (int i = 0; i < md5Bytes.length; i++) { |
| | | int val = ((int) md5Bytes[i]) & 0xff; |
| | | if (val < 16) |
| | | hexValue.append("0"); |
| | | hexValue.append(Integer.toHexString(val)); |
| | | } |
| | | return hexValue.toString(); |
| | | |
| | | return c.getTime(); |
| | | } |
| | | |
| | | @GetMapping("/ss") |
| | | public void ss() { |
| | | String s = iBigriverService.selectCode(); |
| | | String[] split = s.split(","); |
| | | String strArrays = ""; |
| | | for (int i = 0; i < split.length; i++) { |
| | | strArrays += "'" + split[i] + "',"; |
| | | } |
| | | String code = strArrays.substring(0, strArrays.length() - 1); |
| | | System.out.println(code); |
| | | } |
| | | |
| | | /** |
| | | * 大江大河预报库读取 |
| | | * |
| | | * @return |
| | | */ |
| | | @GetMapping("/selectYbs") |
| | | public R selectYbs(String time) throws ParseException { |
| | | //预警数据 |
| | | List listyj = new ArrayList(); |
| | | //无预警数据 |
| | | List listzc = new ArrayList(); |
| | | Map mnum = new HashMap(); |
| | | String s = iBigriverService.selectCode(); |
| | | String[] split = s.split(","); |
| | | String strArrays = ""; |
| | | for (int i = 0; i < split.length; i++) { |
| | | strArrays += "'" + split[i] + "',"; |
| | | } |
| | | String code = strArrays.substring(0, strArrays.length() - 1); |
| | | List<Map<String, Object>> listz = new ArrayList<Map<String, Object>>(); |
| | | List<BigriverVO> list = iBigriverService.selectYb(time, code); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | Map<String, Object> map = new HashMap<String, Object>(); |
| | | String stcd = list.get(i).getStcd(); |
| | | String ftime = list.get(i).getFtime(); |
| | | String substring = ftime.substring(0, 13); |
| | | String times = substring + ":00:00"; |
| | | String endTime = times; |
| | | Date dates = beforeHourToNowDate(time, 1); |
| | | DateFormat sdfc = new SimpleDateFormat("yyyy-MM-dd 08:00:00"); |
| | | String beginTime = sdfc.format(dates); |
| | | map.put("beginTime", beginTime); |
| | | map.put("endTime", endTime); |
| | | map.put("stcd", stcd); |
| | | map.put("times", times); |
| | | listz.add(map); |
| | | } |
| | | List<Map<String, Object>> list1 = iBigriverService.selectStation(listz); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | for (int c = 0; c < list1.size(); c++) { |
| | | String stcd = list.get(i).getStcd(); |
| | | String stcdz = list1.get(i).get("STCD").toString(); |
| | | if (stcd == stcdz) { |
| | | list.get(i).setFbsw(list1.get(c).get("fbsw").toString()); |
| | | list.get(i).setFbll(list1.get(c).get("fbll").toString()); |
| | | list.get(i).setQzll(list1.get(c).get("qzll").toString()); |
| | | list.get(i).setQztime(list1.get(c).get("qztime").toString()); |
| | | list.get(i).setQzsw(list1.get(c).get("qzsw").toString()); |
| | | } else { |
| | | continue; |
| | | } |
| | | |
| | | } |
| | | } |
| | | for (int i = 0; i < list.size(); i++) { |
| | | String yjsw = list.get(i).getYjsw(); |
| | | Double yjz = Double.parseDouble(yjsw); |
| | | BigDecimal ybsws = list.get(i).getYbsw(); |
| | | Double ybsw = ybsws.doubleValue(); |
| | | if (ybsw > yjz) { |
| | | if (mnum.containsKey(list.get(i).getStcd()) == true) { |
| | | } else { |
| | | mnum.put(list.get(i).getStcd(), i); |
| | | listyj.add(list.get(i)); |
| | | } |
| | | } else { |
| | | if (mnum.containsKey(list.get(i).getStcd()) == true) { |
| | | } else { |
| | | mnum.put(list.get(i).getStcd(), i); |
| | | listzc.add(list.get(i)); |
| | | } |
| | | } |
| | | } |
| | | Map map = new HashMap(); |
| | | map.put("yj", listyj); |
| | | map.put("zc", listzc); |
| | | List lists = new ArrayList(); |
| | | lists.add(map); |
| | | return R.data(lists); |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | return c.getTime(); |
| | | } |
| | | |
| | | private static String ss(int i, int j, boolean b) { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | if (b) { |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + i); |
| | | } else { |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) - i); |
| | | } |
| | | calendar.add(Calendar.DATE, -j); |
| | | Date today = calendar.getTime(); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd 08:00:00"); |
| | | String result = format.format(today); |
| | | return result; |
| | | } |
| | | |
| | | @GetMapping("/cs") |
| | | public R cs() { |
| | | for (int c = 2; c < 25; c++) { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.add(Calendar.DATE, -c); //得到前一天 |
| | | Date date = calendar.getTime(); |
| | | DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String dateNow = df.format(df.format(date)); |
| | | int intervals = 31; |
| | | ArrayList passDaysList = new ArrayList<>(); |
| | | for (int i = 0; i < intervals; i++) { |
| | | passDaysList.add(ss(i, c, false)); |
| | | } |
| | | Collections.sort(passDaysList); |
| | | //String s = mountainrainService.selectCode(); |
| | | String s = regionWeightService.selectCode(); |
| | | String[] split = s.split(","); |
| | | String strArrays = ""; |
| | | for (int i = 0; i < split.length; i++) { |
| | | strArrays += "'" + split[i] + "',"; |
| | | } |
| | | String code = strArrays.substring(0, strArrays.length() - 1); |
| | | for (int i = 0; i < split.length; i++) { |
| | | Integer num = 30; |
| | | double v1 = 0; |
| | | String stcd = null; |
| | | for (int j = 0; j < passDaysList.size() - 2; j++) { |
| | | List<Map<String, Object>> map = mountainrainService.selectMtwo(passDaysList.get(j).toString(), passDaysList.get(j + 1).toString(), code); |
| | | if (map.size() == 0 || i > map.size() - 1) { |
| | | //stcd=split[i]; |
| | | break; |
| | | } |
| | | BigDecimal w = (BigDecimal) map.get(i).get("drp"); |
| | | double drp = w.doubleValue(); |
| | | stcd = map.get(i).get("STCD").toString(); |
| | | //计算湿度 |
| | | if (j == 0) { |
| | | v1 = formatDouble1((num + drp) * 0.85); |
| | | if (v1 > 60) { |
| | | v1 = 60; |
| | | } |
| | | } else { |
| | | v1 += drp; |
| | | v1 = formatDouble1(v1 * 0.85); |
| | | if (v1 > 60) { |
| | | v1 = 60; |
| | | } |
| | | } |
| | | } |
| | | if (stcd != null) { |
| | | if (v1 > 60) { |
| | | mountainrainService.soleInster(stcd, "60", dateNow); |
| | | } else { |
| | | String a = String.valueOf(v1); |
| | | mountainrainService.soleInster(stcd, a, dateNow); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | return R.data("成功"); |
| | | } |
| | | } |
| | | |
| | |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.text.DateFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | |
| | | return result; |
| | | } |
| | | |
| | | private static String ss(int i,int j, boolean b) { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | if (b) { |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + i); |
| | | } else { |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) - i); |
| | | } |
| | | calendar.add(Calendar.DATE, -j); |
| | | Date today = calendar.getTime(); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd 08:00:00"); |
| | | String result = format.format(today); |
| | | return result; |
| | | } |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.python.antlr.ast.Str; |
| | | import org.springblade.modules.mountainrain.entity.Mountainrain; |
| | | import org.springblade.modules.mountainrain.entity.Yucbig; |
| | | import org.springblade.modules.mountainrain.entity.Yucpptn; |
| | |
| | | */ |
| | | public interface BigriverMapper extends BaseMapper<Yucbig> { |
| | | List<Map<String, Object>> selctbgriver(); |
| | | |
| | | List<Map<String, Object>> selecF(String stcd, String times,String beginTime,String endTime); |
| | | List<Map<String, Object>> selectStation(List<Map<String, Object>> list); |
| | | String selectINfo(String stnm); |
| | | |
| | | |
| | | //大江大河预报库读取 |
| | | List<BigriverVO> selectYb(String time,String code); |
| | | String selectCode(); |
| | | } |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.springblade.modules.mountainrain.mapper.BigriverMapper"> |
| | | |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="Forecast" type="org.springblade.modules.mountainrain.vo.BigriverVO"> |
| | | <result column="stcd" property="stcd"/> |
| | | <result column="ftime" property="ftime"/> |
| | | <result column="ytime" property="ytime"/> |
| | | <result column="ybsw" property="ybsw"/> |
| | | <result column="yq" property="yq"/> |
| | | <result column="river" property="river"/> |
| | | <result column="stname" property="stname"/> |
| | | <result column="yjsw" property="yjsw"/> |
| | | <result column="addvnm" property="addvnm"/> |
| | | <result column="fbsw" property="fbsw"/> |
| | | <result column="fbll" property="fbll"/> |
| | | <result column="qzsw" property="qzsw"/> |
| | | <result column="qztime" property="qztime"/> |
| | | <result column="qzll" property="qzll"/> |
| | | </resultMap> |
| | | <!--大江大河--> |
| | | <select id="selctbgriver" resultType="java.util.Map"> |
| | | SELECT cs1.stcd as STCD, |
| | |
| | | FROM (SELECT stcd, ftime FROM sys_Yucbig) AS A |
| | | GROUP BY A.stcd |
| | | ) cs |
| | | INNER JOIN (SELECT stcd, stname, ftime, ytime, yuz, yjsw, river,qzsw,yq,drptime,qztime,drp,qzll,fbsw,fbll,dbi FROM sys_Yucbig) cs1 |
| | | INNER JOIN (SELECT stcd, |
| | | stname, |
| | | ftime, |
| | | ytime, |
| | | yuz, |
| | | yjsw, |
| | | river, |
| | | qzsw, |
| | | yq, |
| | | drptime, |
| | | qztime, |
| | | drp, |
| | | qzll, |
| | | fbsw, |
| | | fbll, |
| | | dbi |
| | | FROM sys_Yucbig) cs1 |
| | | ON cs.stcd = cs1.stcd and cs.ftime=cs1.ftime |
| | | INNER JOIN (SELECT LGTD, LTTD, STCD,ADDVCD,HNNM FROM ST_STBPRP_B) st ON st.STCD = cs1.stcd |
| | | INNER JOIN dbo.ST_ADDVCD_D ad ON ad.ADDVCD = st.ADDVCD |
| | |
| | | from dbo.ST_STBPRP_B |
| | | where STNM =#{stnm} |
| | | </select> |
| | | |
| | | <select id="selectYb" resultMap="Forecast"> |
| | | SELECT A.STCD AS stcd, |
| | | CONVERT(VARCHAR (100), A.IYMDH, 120) AS ftime, |
| | | CONVERT(VARCHAR (100), A.YMDH, 120) AS ytime, |
| | | ISNULL(A.Z, 0) AS ybsw, |
| | | ISNULL(A.Q, 0) AS yq, |
| | | B.river, |
| | | B.stname, |
| | | B.yjsw, |
| | | B.addvnm |
| | | FROM (SELECT STCD, IYMDH, YMDH, Z, Q FROM dbo.ST_FORECAST_F WHERE YMDH = #{time} AND STCD IN (${code})) A |
| | | LEFT JOIN (SELECT stcd, river, stname, yjsw, addvnm |
| | | FROM sys_bigriver |
| | | GROUP BY stcd, river, stname, yjsw, addvnm) B ON A.STCD = B.stcd order by A.IYMDH desc |
| | | </select> |
| | | |
| | | <select id="selectCode" resultType="java.lang.String"> |
| | | SELECT stuff(( |
| | | SELECT ',' + CONVERT(VARCHAR (25), stcd) |
| | | FROM sys_bigriver |
| | | GROUP BY stcd |
| | | FOR XML PATH ('')), |
| | | 1, |
| | | 1, |
| | | '' |
| | | ) AS siteids |
| | | </select> |
| | | |
| | | <!-- <select id="selecF" resultType="java.util.Map">--> |
| | | <!-- SELECT ISNULL(Z, 0) as Z,--> |
| | | <!-- ISNULL(Q, 0) as Q--> |
| | | <!-- FROM dbo.ST_RIVER_R--> |
| | | <!-- WHERE STCD = #{stcd}--> |
| | | <!-- AND TM = #{times}--> |
| | | <!-- </select>--> |
| | | |
| | | <select id="selecF" resultType="java.util.Map"> |
| | | SELECT CONVERT(VARCHAR (100), A.minTM, 120) as qztime, |
| | | A.minZ AS qzsw, |
| | | ISNULL(B.Q, 0) AS qzll, |
| | | ISNULL(C.Z, 0) as fbsw, |
| | | ISNULL(C.Q, 0) as fbll |
| | | FROM ( |
| | | SELECT DISTINCT s.STCD, |
| | | isnull(s.minZ, 0) AS minZ, |
| | | MAX(CASE s.minAgeNum WHEN 1 THEN s.TM ELSE '' END) OVER ( partition BY s.STCD ) minTM |
| | | FROM ( |
| | | SELECT STCD, |
| | | TM, |
| | | MIN(Z) OVER ( partition BY STCD ) minZ, |
| | | RANK() OVER ( partition BY STCD ORDER BY Z ) minAgeNum |
| | | FROM dbo.ST_RIVER_R |
| | | WHERE TM >= #{beginTime} |
| | | AND TM <= #{endTime} |
| | | AND STCD = #{stcd} |
| | | ) s |
| | | ) A |
| | | LEFT JOIN (SELECT Q, TM, STCD FROM dbo.ST_RIVER_R WHERE STCD = #{stcd}) B ON A.minTM = B.TM |
| | | AND B.STCD = A.STCD |
| | | LEFT JOIN ( |
| | | SELECT STCD, |
| | | ISNULL(Z, 0) AS Z, |
| | | ISNULL(Q, 0) AS Q |
| | | FROM dbo.ST_RIVER_R |
| | | WHERE STCD = #{stcd} |
| | | AND TM = #{times} |
| | | ) C ON C.STCD = A.STCD |
| | | </select> |
| | | |
| | | <select id="selectStation" resultType="java.util.Map"> |
| | | <foreach collection="list" item="item" open="" close="" separator="union ALL" index="index"> |
| | | SELECT CONVERT(VARCHAR (100), A.minTM, 120) as qztime, |
| | | A.minZ AS qzsw, |
| | | ISNULL(B.Q, 0) AS qzll, |
| | | ISNULL(C.Z, 0) as fbsw, |
| | | ISNULL(C.Q, 0) as fbll, |
| | | A.STCD |
| | | FROM ( |
| | | SELECT DISTINCT s.STCD, |
| | | isnull(s.minZ, 0) AS minZ, |
| | | MAX(CASE s.minAgeNum WHEN 1 THEN s.TM ELSE '' END) OVER ( partition BY s.STCD ) minTM |
| | | FROM ( |
| | | SELECT STCD, |
| | | TM, |
| | | MIN(Z) OVER ( partition BY STCD ) minZ, |
| | | RANK() OVER ( partition BY STCD ORDER BY Z ) minAgeNum |
| | | FROM dbo.ST_RIVER_R |
| | | WHERE TM >= #{item.beginTime} |
| | | AND TM <= #{item.endTime} |
| | | AND STCD =#{item.stcd} |
| | | ) s |
| | | ) A |
| | | LEFT JOIN (SELECT Q, TM, STCD FROM dbo.ST_RIVER_R WHERE STCD = #{item.stcd}) B ON A.minTM = B.TM |
| | | AND B.STCD = A.STCD |
| | | LEFT JOIN ( |
| | | SELECT STCD, |
| | | ISNULL(Z, 0) AS Z, |
| | | ISNULL(Q, 0) AS Q |
| | | FROM dbo.ST_RIVER_R |
| | | WHERE STCD =#{item.stcd} |
| | | AND TM =#{item.times} |
| | | ) C ON C.STCD = A.STCD |
| | | </foreach> |
| | | </select> |
| | | </mapper> |
| | |
| | | INNER JOIN dbo.ST_STBPRP_B st ON so.stcd = st.STCD |
| | | where datediff(day,stime, #{stime}) = 0 |
| | | </select> |
| | | |
| | | |
| | | <!-- <!–土壤湿度优化–>--> |
| | | <!-- <select id="ss" resultType="java.util.Map">--> |
| | | <!-- SELECT * FROM ST_PPTN_R WHERE DATEDIFF(dd, TM , '2021-06-29 08:00:00') <= 30 AND RIGHT(CONVERT(varchar(19),TM,120),5)='00:00'--> |
| | | <!-- </select>--> |
| | | </mapper> |
| | |
| | | void importBgr(List<BgrExcel> data, Boolean isCovered); |
| | | List<Map<String, Object>> selctbgriver(); |
| | | String selectINfo(String stnm); |
| | | //大江大河预报库读取 |
| | | List<BigriverVO> selectYb(String time,String code); |
| | | String selectCode(); |
| | | List<Map<String, Object>> selecF(String stcd, String times,String beginTime,String endTime); |
| | | List<Map<String, Object>> selectStation(List<Map<String, Object>> list); |
| | | } |
| | |
| | | public String selectINfo(String stnm) { |
| | | return baseMapper.selectINfo(stnm); |
| | | } |
| | | |
| | | @Override |
| | | public List<BigriverVO> selectYb(String time,String code) { |
| | | return baseMapper.selectYb(time,code); |
| | | } |
| | | |
| | | @Override |
| | | public String selectCode() { |
| | | return baseMapper.selectCode(); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> selecF(String stcd, String times,String beginTime,String endTime) { |
| | | return baseMapper.selecF(stcd,times,beginTime,endTime); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> selectStation(List<Map<String, Object>> list) { |
| | | return baseMapper.selectStation(list); |
| | | } |
| | | } |
| | |
| | | import org.springblade.modules.mountain.entity.Mountain; |
| | | import org.springblade.modules.mountainrain.entity.Yucbig; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class BigriverVO extends Yucbig { |
| | | private String addvnm; |
| | | private BigDecimal ybsw; |
| | | //private BigDecimal yq; |
| | | } |
| | |
| | | } else { |
| | | BigDecimal w = (BigDecimal) map.get(i).get("W"); |
| | | double W = w.doubleValue(); |
| | | if (W == 0.000) { |
| | | texta += "蓄水量暂无数据、"; |
| | | } else { |
| | | DecimalFormat df = new DecimalFormat("#0.00"); |
| | | texta += "蓄水量" + df.format(W) + "百万立方米、"; |
| | | } |
| | | } |
| | | if (map.get(i).get("OTQ") == null) { |
| | | texta += "出库流量暂无数据;"; |
| | |
| | | } else { |
| | | BigDecimal w = (BigDecimal) map.get(i).get("W"); |
| | | double W = w.doubleValue(); |
| | | if (W == 0.000) { |
| | | texth += "蓄水量暂无数据、"; |
| | | } else { |
| | | DecimalFormat df = new DecimalFormat("#0.00"); |
| | | texth += "蓄水量" + df.format(W) + "百万立方米、"; |
| | | } |
| | | } |
| | | if (map.get(i).get("OTQ") == null) { |
| | | texth += "出库流量暂无数据。"; |
| | |
| | | } else { |
| | | BigDecimal w = (BigDecimal) map.get(i).get("W"); |
| | | double W = w.doubleValue(); |
| | | if (W == 0.000) { |
| | | texta += "蓄水量暂无数据、"; |
| | | } else { |
| | | DecimalFormat df = new DecimalFormat("#0.00"); |
| | | texta += "蓄水量" + df.format(W) + "百万立方米、"; |
| | | } |
| | | } |
| | | if (map.get(i).get("OTQ") == null) { |
| | | texta += "出库流量暂无数据;"; |
| | |
| | | } else { |
| | | BigDecimal w = (BigDecimal) map.get(i).get("W"); |
| | | double W = w.doubleValue(); |
| | | if (W == 0.000) { |
| | | texth += "蓄水量暂无数据、"; |
| | | } else { |
| | | DecimalFormat df = new DecimalFormat("#0.00"); |
| | | texth += "蓄水量" + df.format(W) + "百万立方米、"; |
| | | } |
| | | } |
| | | if (map.get(i).get("OTQ") == null) { |
| | | texth += "出库流量暂无数据。"; |
| | |
| | | } else { |
| | | BigDecimal w = (BigDecimal) map.get(i).get("W"); |
| | | double W = w.doubleValue(); |
| | | if (W == 0.000) { |
| | | texta += "蓄水量暂无数据、"; |
| | | } else { |
| | | DecimalFormat df = new DecimalFormat("#0.00"); |
| | | texta += "蓄水量" + df.format(W) + "百万立方米、"; |
| | | } |
| | | } |
| | | if (map.get(i).get("OTQ") == null) { |
| | | texta += "出库流量暂无数据;"; |
| | |
| | | } else { |
| | | BigDecimal w = (BigDecimal) map.get(i).get("W"); |
| | | double W = w.doubleValue(); |
| | | if (W == 0.000) { |
| | | texth += "蓄水量暂无数据、"; |
| | | } else { |
| | | DecimalFormat df = new DecimalFormat("#0.00"); |
| | | texth += "蓄水量" + df.format(W) + "百万立方米、"; |
| | | } |
| | | } |
| | | if (map.get(i).get("OTQ") == null) { |
| | | texth += "出库流量暂无数据。"; |
| | |
| | | // //获取涨幅最大的信息 |
| | | // } |
| | | if (beginTime.equals(endTime)) { |
| | | } |
| | | else { |
| | | } else { |
| | | if (m1.size() != 0) { |
| | | Object maxKey = getMaxKey(m1); |
| | | String s1 = m1.get(maxKey).toString(); |
| | |
| | | if (RZ == 0) { |
| | | texta += "库水位暂无数据、"; |
| | | } else { |
| | | texta += "库水位" + RZ + "米、"; |
| | | texta += "库水位" + dfc.format(RZ) + "米、"; |
| | | } |
| | | if (v < 0) { |
| | | texta += "比昨日8时下降" + Math.abs(v) + "米、"; |
| | |
| | | if (RZ == 0) { |
| | | texth += "库水位暂无数据、"; |
| | | } else { |
| | | texth += "库水位" + RZ + "米、"; |
| | | texth += "库水位" + dfc.format(RZ) + "米、"; |
| | | } |
| | | if (v < 0) { |
| | | texth += "比昨日8时下降" + Math.abs(v) + "米、"; |
| | |
| | | if (RZ == 0) { |
| | | texta += "库水位暂无数据、"; |
| | | } else { |
| | | texta += "库水位" + RZ + "米、"; |
| | | texta += "库水位" + dfc.format(RZ) + "米、"; |
| | | } |
| | | if (v < 0) { |
| | | texta += "比昨日8时下降" + Math.abs(v) + "米、"; |
| | |
| | | if (RZ == 0) { |
| | | texth += "库水位暂无数据、"; |
| | | } else { |
| | | texth += "库水位" + RZ + "米、"; |
| | | texth += "库水位" + dfc.format(RZ) + "米、"; |
| | | } |
| | | if (v < 0) { |
| | | texth += "比昨日8时下降" + Math.abs(v) + "米、"; |
| | |
| | | if (RZ == 0) { |
| | | texta += "库水位暂无数据、"; |
| | | } else { |
| | | texta += "库水位" + RZ + "米、"; |
| | | texta += "库水位" + dfc.format(RZ) + "米、"; |
| | | } |
| | | if (v < 0) { |
| | | texta += "比昨日8时下降" + Math.abs(v) + "米、"; |
| | |
| | | if (RZ == 0) { |
| | | texth += "库水位暂无数据、"; |
| | | } else { |
| | | texth += "库水位" + RZ + "米、"; |
| | | texth += "库水位" + dfc.format(RZ) + "米、"; |
| | | } |
| | | if (v < 0) { |
| | | texth += "比昨日8时下降" + Math.abs(v) + "米、"; |
| | |
| | | GROUP BY STCD) cs4 ON cs4.STCD = rs.STCD |
| | | WHERE rs.TM > #{beginTime} |
| | | AND rs.TM <= #{endTime} |
| | | ORDER BY rs.TM DESC |
| | | ORDER BY rs.RZ DESC |
| | | </select> |
| | | |
| | | <select id="selectyjcd" resultType="java.util.HashMap"> |
| | |
| | | |
| | | <!--水库站水位流量过程接口--> |
| | | <select id="selectRsvrLists" resultType="java.util.HashMap"> |
| | | select * from dbo.ST_RIVER_R where STCD=#{code} |
| | | select rs.*,rv.WRZ from dbo.ST_RIVER_R rs |
| | | LEFT JOIN ( SELECT STCD, WRZ FROM dbo.ST_RVFCCH_B ) rv ON rv.STCD = rs.STCD |
| | | where rs.STCD=#{code} |
| | | <if test="dateBegin!=null and dateBegin!=''"> |
| | | AND TM >=#{dateBegin} |
| | | AND rs.TM >=#{dateBegin} |
| | | </if> |
| | | <if test="dateEnd!=null and dateEnd!=''"> |
| | | and TM<=#{dateEnd} |
| | | and rs.TM<=#{dateEnd} |
| | | </if> |
| | | ORDER BY TM DESC |
| | | ORDER BY rs.TM DESC |
| | | </select> |
| | | |
| | | |