10 Commits

Author SHA1 Message Date
Song 552afab108 no message 2023-06-20 09:57:03 +08:00
Song 2da5ba5137 no message 2023-03-15 09:08:14 +08:00
Song 32cca20d3a 删除功能更改 2023-03-08 09:39:41 +08:00
Song bc3cd91c6a 文件下载 2023-03-07 13:53:43 +08:00
Song 4b48e7f55e 添加新功能
报告生成
2022-12-02 09:43:07 +08:00
Song 48e607e8b1 报告修改 2022-11-17 17:23:48 +08:00
zangshuaihua cf9644ef29 2022/10/21提交 2022-10-21 08:56:20 +08:00
zangshuaihua a4e9124c1e 2022/10/19提交 2022-10-19 17:15:02 +08:00
zangshuaihua 1b1088f683 2022/10/19提交 2022-10-19 17:10:11 +08:00
zangshuaihua 6c336b6513 shate 2022-10-18 17:59:40 +08:00
43 changed files with 1807 additions and 340 deletions
Binary file not shown.
+5 -10
View File
@@ -18,23 +18,15 @@
<dependencies>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.0.1</version>
<version>4.1.2</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.0.1</version>
<version>4.1.2</version>
</dependency>
@@ -93,6 +85,9 @@
<artifactId>ruoyi-generator</artifactId>
</dependency>
</dependencies>
<build>
@@ -24,6 +24,8 @@ public class RuoYiApplication
{
// System.setProperty("spring.devtools.restart.enabled", "false");
SpringApplication.run(RuoYiApplication.class, args);
System.out.println();
File diff suppressed because it is too large Load Diff
@@ -95,6 +95,7 @@ public class LandUseController {
value1.setProductCode2(value.get(i).getProductCode2());
value1.setProductCode3(value.get(i).getProductCode3());
value1.setYear(value.get(i).getYear());
value1.setRegionName(value.get(i).getRegionName());
} else if (value.get(i).getLandUse().equals("Buildings") && value.get(i).getZone().equals(zonenew.get(j))) {
value1.setBuildings(value.get(i).getArea());
value1.setZone(value.get(i).getZone());
@@ -102,12 +103,14 @@ public class LandUseController {
value1.setProductCode2(value.get(i).getProductCode2());
value1.setProductCode3(value.get(i).getProductCode3());
value1.setYear(value.get(i).getYear());
value1.setRegionName(value.get(i).getRegionName());
} else if (value.get(i).getLandUse().equals("Roads") && value.get(i).getZone().equals(zonenew.get(j))) {
value1.setRoads(value.get(i).getArea());
value1.setProductCode1(value.get(i).getProductCode1());
value1.setProductCode2(value.get(i).getProductCode2());
value1.setProductCode3(value.get(i).getProductCode3());
value1.setYear(value.get(i).getYear());
value1.setRegionName(value.get(i).getRegionName());
} else if (value.get(i).getLandUse().equals("Water") && value.get(i).getZone().equals(zonenew.get(j))) {
value1.setWater(value.get(i).getArea());
value1.setZone(value.get(i).getZone());
@@ -115,6 +118,7 @@ public class LandUseController {
value1.setProductCode2(value.get(i).getProductCode2());
value1.setProductCode3(value.get(i).getProductCode3());
value1.setYear(value.get(i).getYear());
value1.setRegionName(value.get(i).getRegionName());
} else if (value.get(i).getLandUse().equals("Forest") && value.get(i).getZone().equals(zonenew.get(j))) {
value1.setForest(value.get(i).getArea());
value1.setZone(value.get(i).getZone());
@@ -122,6 +126,7 @@ public class LandUseController {
value1.setProductCode2(value.get(i).getProductCode2());
value1.setProductCode3(value.get(i).getProductCode3());
value1.setYear(value.get(i).getYear());
value1.setRegionName(value.get(i).getRegionName());
} else if (value.get(i).getLandUse().equals("Grass") && value.get(i).getZone().equals(zonenew.get(j))) {
value1.setGrass(value.get(i).getArea());
value1.setZone(value.get(i).getZone());
@@ -129,6 +134,7 @@ public class LandUseController {
value1.setProductCode2(value.get(i).getProductCode2());
value1.setProductCode3(value.get(i).getProductCode3());
value1.setYear(value.get(i).getYear());
value1.setRegionName(value.get(i).getRegionName());
} else if (value.get(i).getLandUse().equals("Soil") && value.get(i).getZone().equals(zonenew.get(j))) {
value1.setSoil(value.get(i).getArea());
value1.setZone(value.get(i).getZone());
@@ -136,6 +142,7 @@ public class LandUseController {
value1.setProductCode2(value.get(i).getProductCode2());
value1.setProductCode3(value.get(i).getProductCode3());
value1.setYear(value.get(i).getYear());
value1.setRegionName(value.get(i).getRegionName());
} else if (value.get(i).getLandUse().equals("Desert") && value.get(i).getZone().equals(zonenew.get(j))) {
value1.setDesert(value.get(i).getArea());
value1.setZone(value.get(i).getZone());
@@ -143,6 +150,7 @@ public class LandUseController {
value1.setProductCode2(value.get(i).getProductCode2());
value1.setProductCode3(value.get(i).getProductCode3());
value1.setYear(value.get(i).getYear());
value1.setRegionName(value.get(i).getRegionName());
} else if (value.get(i).getLandUse().equals("Rocks") && value.get(i).getZone().equals(zonenew.get(j))) {
value1.setRocks(value.get(i).getArea());
value1.setZone(value.get(i).getZone());
@@ -150,6 +158,7 @@ public class LandUseController {
value1.setProductCode2(value.get(i).getProductCode2());
value1.setProductCode3(value.get(i).getProductCode3());
value1.setYear(value.get(i).getYear());
value1.setRegionName(value.get(i).getRegionName());
} else if (value.get(i).getLandUse().equals("Other") && value.get(i).getZone().equals(zonenew.get(j))) {
value1.setOther(value.get(i).getArea());
value1.setZone(value.get(i).getZone());
@@ -157,6 +166,7 @@ public class LandUseController {
value1.setProductCode2(value.get(i).getProductCode2());
value1.setProductCode3(value.get(i).getProductCode3());
value1.setYear(value.get(i).getYear());
value1.setRegionName(value.get(i).getRegionName());
}
}
lanUseNews.add(value1);
@@ -57,7 +57,6 @@ public class TopographicFactorController {
{
Max=ce.getLevel5();
}
}
for (int i=0;i<Seeding.size();i++)
{
@@ -6,14 +6,14 @@ spring:
driver-class-name: org.postgresql.Driver
druid:
master:
# url: jdbc:postgresql://rs-middleware-postgres:5432/itba?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=Asia/Shanghai
# username: gis
# password: AQBSdU5bT27AKxAAvKoWQdGpSuNRCHjC4B8DVA
url: jdbc:postgresql://rs-middleware-postgres:5432/itba?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=Asia/Shanghai
username: gis
password: AQBSdU5bT27AKxAAvKoWQdGpSuNRCHjC4B8DVA
#url: jdbc:postgresql://192.168.2.9:5432/saudiArabia?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=Asia/Shanghai
url: jdbc:postgresql://121.36.229.60:5432/saudiArabia?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=Asia/Shanghai
username: sjs
password: song5325
# url: jdbc:postgresql://121.36.229.60:5432/saudiArabia?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=Asia/Shanghai
# username: sjs
# password: song5325
# 从库数据源
slave:
# 从数据源开关/默认关闭
@@ -60,16 +60,16 @@ spring:
# redis 配置
redis:
# 地址
#host: rs-middleware-redis
host: localhost
host: rs-middleware-redis
#host: localhost
# 端口,默认为6379
#port: 14096
port: 6379
# 数据库索引
database: 0
# 密码
#password: SenseTime@2019
password: sdust2020
password: SenseTime@2019
#password: sdust2020
# 连接超时时间
timeout: 10s
lettuce:
+18
View File
@@ -140,6 +140,24 @@
<artifactId>commons-beanutils</artifactId>
<version>1.9.4</version>
</dependency>
<!--<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.24</version>
</dependency>-->
<!-- <dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>11.0.2</version>
</dependency>
-->
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.3.7</version>
</dependency>
</dependencies>
@@ -0,0 +1,276 @@
package com.ruoyi.common.utils;
import org.apache.poi.hpsf.Section;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.ss.usermodel.HeaderFooter;
import org.apache.poi.ss.usermodel.Picture;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.ss.util.CellReference;
import org.apache.poi.util.Units;
import org.apache.poi.wp.usermodel.HeaderFooterType;
import org.apache.poi.wp.usermodel.Paragraph;
import org.apache.poi.xddf.usermodel.chart.*;
import org.apache.poi.xwpf.model.XWPFHeaderFooterPolicy;
import org.apache.poi.xwpf.usermodel.*;
import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.text.DecimalFormat;
import java.util.List;
import org.apache.poi.xwpf.usermodel.XWPFChart;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.*;
/**
* @Description: poi工具类
* @Date: 2022/10/11
* @Author shuaihua zang
*/
public class BarChart
{
public static Double fun(Double value)
{
BigDecimal bg=new BigDecimal(value);
return bg.setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue();
}
private void setXWPFRunStyle(XWPFRun r1,String font,int fontSize) {
r1.setFontSize(fontSize);
CTRPr rpr = r1.getCTR().isSetRPr() ? r1.getCTR().getRPr() : r1.getCTR().addNewRPr();
CTFonts fonts = rpr.isSetRFonts() ? rpr.getRFonts() : rpr.addNewRFonts();
fonts.setAscii(font);
fonts.setEastAsia(font);
fonts.setHAnsi(font);
}
public static void createHeader(XWPFDocument doc, String orgFullName){
try {
CTSectPr sectPr = doc.getDocument().getBody().addNewSectPr();
XWPFHeaderFooterPolicy headerFooterPolicy = new XWPFHeaderFooterPolicy(doc, sectPr);
XWPFHeader header = headerFooterPolicy.createHeader(XWPFHeaderFooterPolicy.DEFAULT);
XWPFParagraph paragraph = header.createParagraph();
paragraph.setAlignment(ParagraphAlignment.BOTH); //设置段落左对齐
paragraph.setBorderBottom(Borders.THICK); //设置下划线
// paragraph.setSpacingLineRule(LineSpacingRule.AUTO);
paragraph.setSpacingBetween(40,LineSpacingRule.EXACT);
// paragraph.setAlignment(ParagraphAlignment.CENTER);
XWPFRun run = paragraph.createRun();
run.setBold(false);
run.setFontSize(9);
/*
* 取到图片的字节流
* */
String logoFilePath="shate.png";
if (StringUtils.isNotEmpty(logoFilePath)) {
File file=new File(logoFilePath);
InputStream is = new FileInputStream(file);
XWPFPicture picture = run.addPicture(is, XWPFDocument.PICTURE_TYPE_JPEG, logoFilePath, Units.toEMU(60), Units.toEMU(30));
String blipID = "";
for(XWPFPictureData picturedata : header.getAllPackagePictures()) { //这段必须有,不然打开的logo图片不显示
blipID = header.getRelationId(picturedata);
}
picture.getCTPicture().getBlipFill().getBlip().setEmbed(blipID);
run.addTab();
is.close();
}
/*
* 添加字体页眉
* */
if (StringUtils.isNotEmpty(orgFullName)) {
run = paragraph.createRun();
run.setText(" "+orgFullName);
}
} catch (FileNotFoundException e) {
throw new RuntimeException(e);
} catch (IOException e) {
throw new RuntimeException(e);
} catch (InvalidFormatException e) {
throw new RuntimeException(e);
}
}
//绘制折线图
public static void drawLine(XWPFDocument document, String[] xAxisData,Double[] yAxisData) throws Exception {
XWPFChart xChart = document.createChart(15 * Units.EMU_PER_CENTIMETER, 10 * Units.EMU_PER_CENTIMETER);
// xChart.setTitleText("海拔"); // 图表标题
xChart.setTitleOverlay(false);
// 5、X轴(分类轴)相关设置
// 创建X轴,并且指定位置
XDDFCategoryAxis xAxis = xChart.createCategoryAxis(AxisPosition.BOTTOM);
XDDFCategoryDataSource xAxisSource = XDDFDataSourcesFactory.fromArray(xAxisData); // 设置X轴数据
// xAxis.setTitle("海拔km²");
// 6、Y轴(值轴)相关设置
XDDFValueAxis yAxis = xChart.createValueAxis(AxisPosition.LEFT); // 创建Y轴,指定位置轴标题
XDDFNumericalDataSource<Double> yAxisSource = XDDFDataSourcesFactory.fromArray(yAxisData); // 设置Y轴数据
yAxis.setTitle("km²");
// 7、创建折线图对象
XDDFLineChartData lineChart = (XDDFLineChartData) xChart.createData(ChartTypes.LINE, xAxis, yAxis);
// 8、加载折线图数据集
XDDFLineChartData.Series lineSeries = (XDDFLineChartData.Series) lineChart.addSeries(xAxisSource, yAxisSource);
lineSeries.setSmooth(false); // 线条样式:true平滑曲线,false折线
lineSeries.setMarkerSize((short) 6); // 标记点大小
lineSeries.setMarkerStyle(MarkerStyle.CIRCLE); // 标记点样式
// 9、绘制折线图
xChart.plot(lineChart);
}
public static void drawTable(XWPFDocument document, String[] xAxisData,Double[] yAxisData) throws Exception {
// 创建chart图表对象,抛出异常
// XWPFChart chart = document.createChart(15 * Units.EMU_PER_CENTIMETER, 10 * Units.EMU_PER_CENTIMETER);
XWPFChart chart=document.createChart(15 * Units.EMU_PER_CENTIMETER, 11 * Units.EMU_PER_CENTIMETER);
chart.setTitleText("");
chart.setTitleOverlay(false); // 图例是否覆盖标题
chart.setChartBottomMargin(50);
// X轴(分类轴)相关设置
XDDFCategoryAxis xAxis =chart.createCategoryAxis(AxisPosition.BOTTOM); // 创建X轴,并且指定位置
xAxis.setTitle(""); // x轴标题
XDDFCategoryDataSource xAxisSource = XDDFDataSourcesFactory.fromArray(xAxisData); // 设置X轴数据
// Y轴(值轴)相关设置
//chart.createValueAxis(AxisPosition.LEFT);
XDDFValueAxis yAxis = chart.createValueAxis(AxisPosition.LEFT); // 创建Y轴,指定位置
yAxis.setTitle("Area(km²)"); // Y轴标题
yAxis.setCrossBetween(AxisCrossBetween.BETWEEN); // 设置图柱的位置:BETWEEN居中
XDDFNumericalDataSource<Double> yAxisSource = XDDFDataSourcesFactory.fromArray(yAxisData); // 设置Y轴数据
ChartTypes chartTypes = ChartTypes.BAR;
// 创建柱状图对象
XDDFBarChartData barChart = (XDDFBarChartData) chart.createData(chartTypes, xAxis, yAxis);
barChart.setBarDirection(BarDirection.COL); // 设置柱状图的方向:BAR横向,COL竖向,默认是BAR
barChart.setVaryColors(false);
// 加载柱状图数据集
XDDFBarChartData.Series barSeries = (XDDFBarChartData.Series) barChart.addSeries(xAxisSource, yAxisSource);
barSeries.setTitle(" ", null); // 图例标题
// 绘制柱状图
chart.plot(barChart);
}
//插入图片
public static void insertPic(XWPFDocument document,String fileAddress)
{
XWPFParagraph Paragraph = document.createParagraph();
Paragraph.setAlignment(ParagraphAlignment.CENTER);//对齐方式
XWPFRun run = Paragraph.createRun();
try (FileInputStream is = new FileInputStream
(fileAddress)) {
run.addPicture(is, XWPFDocument.PICTURE_TYPE_PNG,
fileAddress,
Units.toEMU(392), Units.toEMU(280)); // 200x200 pixels
} catch (Exception e) {
e.printStackTrace();
}
}
//创建段落并插入文字
public static void createParagraphAndInsertWord(XWPFDocument document,String date) {
XWPFParagraph Paragraph = document.createParagraph();
//设置行距固定值20磅
//setLineSpace(Paragraph,30);
Paragraph.setAlignment(ParagraphAlignment.LEFT);//对齐方式
//paragraph_2.setFirstLineIndent(400);//首行缩进
XWPFRun run = Paragraph.createRun();
run.setText(date);
run.setBold(false);//加粗
run.setFontSize(12);
run.setFontFamily("Times New Roman");
}
//创建一级标题的内容
public static void createFirstLevelTopic(XWPFDocument document,String date)
{
XWPFParagraph Paragraph = document.createParagraph();
Paragraph.setAlignment(ParagraphAlignment.LEFT);//对齐方式
//BarChart.setLineSpace(Paragraph,30);
XWPFRun run = Paragraph.createRun();
run.setText(date);
run.setBold(true);//加粗
run.setFontSize(16);
run.setFontFamily("Times New Roman");
}
//创建二级标题的内容
public static void createSecondLevelTopic(XWPFDocument document,String date)
{
XWPFParagraph Paragraph = document.createParagraph();
Paragraph.setAlignment(ParagraphAlignment.LEFT);//对齐方式
//BarChart.setLineSpace(Paragraph,30);
XWPFRun run = Paragraph.createRun();
run.setText(date);
run.setBold(true);//加粗
run.setFontSize(12);
run.setFontFamily("Times New Roman");
}
//创建图片标题的内容
public static void setPicTitle(XWPFDocument document,String date)
{
XWPFParagraph Paragraph = document.createParagraph();
// Paragraph.setAlignment(ParagraphAlignment.CENTER);
//// 边框
// Paragraph.setBorderBottom(Borders.NIL);
// Paragraph.setBorderTop(Borders.NIL);
// Paragraph.setBorderRight(Borders.NIL);
// Paragraph.setBorderLeft(Borders.NIL);
// Paragraph.setBorderBetween(Borders.SINGLE);
// Paragraph.setSpacingAfter(5);
// Paragraph.setSpacingBeforeLines(5);
// Paragraph.setSpacingBetween(5);
Paragraph.setAlignment(ParagraphAlignment.CENTER);//对齐方式
BarChart.setLineSpace(Paragraph,25);
XWPFRun run = Paragraph.createRun();
// run.addCarriageReturn();
run.setText(date);
run.setBold(true);//加粗
run.setFontSize(10);
// run.setFontFamily("Times New Roman");
}
//设置题目
public static void setTitle(XWPFDocument document,String date)
{
XWPFParagraph title = document.createParagraph();
title.setAlignment(ParagraphAlignment.CENTER);
XWPFRun runTitle = title.createRun();
runTitle.setText(date);
runTitle.setBold(true);
runTitle.setFontSize(20);
runTitle.setFontFamily("Times New Roman");
}
//设置行间距
public static void setLineSpace(XWPFParagraph titleParagraph,int size) {
CTP ctp = titleParagraph.getCTP();
CTPPr ppr = ctp.isSetPPr() ? ctp.getPPr() : ctp.addNewPPr();
CTSpacing spacing = ppr.isSetSpacing()? ppr.getSpacing() : ppr.addNewSpacing();
spacing.setAfter(BigInteger.valueOf(0));
spacing.setBefore(BigInteger.valueOf(0));
//设置行距类型为 EXACT
spacing.setLineRule(STLineSpacingRule.EXACT);
//1磅数是20
spacing.setLine(BigInteger.valueOf(size*20));
}
public static String getDoubleNumber(Double d)
{
DecimalFormat df = new DecimalFormat("#.00");
return df.format(d);
}
public static String changeDate(String date)
{
String s1 = date.substring(0, 4);
String s2 = date.substring(4, 6);
String s3 = date.substring(6, date.length());
return s1+"-"+s2+"-"+s3;
}
}
@@ -0,0 +1,108 @@
package com.ruoyi.common.utils;
import java.io.IOException;
import java.io.InputStream;
import org.apache.poi.openxml4j.opc.OPCPackage;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
import org.apache.xmlbeans.XmlException;
import org.apache.xmlbeans.XmlToken;
import org.openxmlformats.schemas.drawingml.x2006.main.CTNonVisualDrawingProps;
import org.openxmlformats.schemas.drawingml.x2006.main.CTPositiveSize2D;
import org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing.CTInline;
/**
* @Author shuaihua zang
* @date 2022/10/8
* word导出图片所需的工具类
*/
public class CustomXWPFDocument extends XWPFDocument{
public CustomXWPFDocument(InputStream in) throws IOException {
super(in);
}
public CustomXWPFDocument() {
super();
}
public CustomXWPFDocument(OPCPackage pkg) throws IOException {
super(pkg);
}
/**
* @param id
* @param width
* 宽
* @param height
* 高
* @param paragraph
* 段落
*/
public void createPicture(int id, int width, int height,
XWPFParagraph paragraph) {
final int EMU = 9525;
width *= EMU;
height *= EMU;
String blipId = super.getRelationId(super.getAllPictures().get(id));
CTInline inline = paragraph.createRun().getCTR().addNewDrawing()
.addNewInline();
String picXml = ""
+ "<a:graphic xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\">"
+ " <a:graphicData uri=\"http://schemas.openxmlformats.org/drawingml/2006/picture\">"
+ " <pic:pic xmlns:pic=\"http://schemas.openxmlformats.org/drawingml/2006/picture\">"
+ " <pic:nvPicPr>" + " <pic:cNvPr id=\""
+ id
+ "\" name=\"Generated\"/>"
+ " <pic:cNvPicPr/>"
+ " </pic:nvPicPr>"
+ " <pic:blipFill>"
+ " <a:blip r:embed=\""
+ blipId
+ "\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\"/>"
+ " <a:stretch>"
+ " <a:fillRect/>"
+ " </a:stretch>"
+ " </pic:blipFill>"
+ " <pic:spPr>"
+ " <a:xfrm>"
+ " <a:off x=\"0\" y=\"0\"/>"
+ " <a:ext cx=\""
+ width
+ "\" cy=\""
+ height
+ "\"/>"
+ " </a:xfrm>"
+ " <a:prstGeom prst=\"rect\">"
+ " <a:avLst/>"
+ " </a:prstGeom>"
+ " </pic:spPr>"
+ " </pic:pic>"
+ " </a:graphicData>" + "</a:graphic>";
inline.addNewGraphic().addNewGraphicData();
XmlToken xmlToken = null;
try {
xmlToken = XmlToken.Factory.parse(picXml);
} catch (XmlException xe) {
xe.printStackTrace();
}
inline.set(xmlToken);
inline.setDistT(0);
inline.setDistB(0);
inline.setDistL(0);
inline.setDistR(0);
CTPositiveSize2D extent = inline.addNewExtent();
extent.setCx(width);
extent.setCy(height);
CTNonVisualDrawingProps docPr = inline.addNewDocPr();
docPr.setId(id);
docPr.setName("图片名称");
docPr.setDescr("描述信息");
}
}
@@ -0,0 +1,146 @@
package com.ruoyi.common.utils;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class StringFilterUtil {
/** 过滤字符串,去除[]中的内容,包括[]
* @param input
* @return
*/
public static String filterForBetween(String input, char startChar, char endChar) {
int head = input.indexOf(startChar); // 标记第一个使用左括号的位置
if (head == -1) {
return input; // 如果context中不存在括号,什么也不做,直接跑到函数底端返回初值str
} else {
int next = head + 1; // 从head+1起检查每个字符
int count = 1; // 记录括号情况
do {
if (input.charAt(next) == startChar)
count++;
else if (input.charAt(next) == endChar)
count--;
next++; // 更新即将读取的下一个字符的位置
if (count == 0) // 已经找到匹配的括号
{
String temp = input.substring(head, next); // 将两括号之间的内容及括号提取到temp中
input = input.replace(temp, ""); // 用空内容替换,复制给context
head = input.indexOf(endChar); // 找寻下一个左括号
next = head + 1; // 标记下一个左括号后的字符位置
count = 1; // count的值还原成1
}
} while (head != -1); // 如果在该段落中找不到左括号了,就终止循环
}
return input; // 返回更新后的context
}
/**
* str.replaceAll("\\s*", ""); //s* 可以匹配空格、制表符、换页符等空白字符的其中任意一个。
* str.replaceAll(" +",""); //去掉所有空格,包括首尾、中间
* str.replaceAll(" ", ""); //去掉所有空格,包括首尾、中间
* str.replace(" ",""); //去除所有空格,包括首尾、中间
* str.trim(); //去掉首尾空格
* @param inputStr
* @return
*/
public static String filterForBlank(String inputStr){
if(inputStr.length()==0||inputStr==null) {
return "";
}
return inputStr.replace(" ", "");
}
/** 过滤字符串,只允许字母和数字
* @param inputStr
* @return
*/
public static String filterForChars(String inputStr) {
if(inputStr.length()==0||inputStr==null) {
return "";
}
String regEx = "[^a-zA-Z0-9]";
Pattern p = Pattern.compile(regEx);
Matcher m = p.matcher(inputStr);
return m.replaceAll("").trim();
}
/**过滤字符串,替换特殊字符
* <pre>
* StringFilterUtil.filterForSpechars(null)
* </pre>
* @param inputStr
* @return
*/
public static String filterForSpechars(String inputStr) {
if(inputStr.length()==0||inputStr==null) {
return "";
}
String regEx = "[`~!@#$%^&*()+=|{}':;',\\[\\].<>/?~@#¥%……&*()——+|{}【】‘;:”“’。,、?]";
Pattern p = Pattern.compile(regEx);
Matcher m = p.matcher(inputStr);
return m.replaceAll("").trim();
}
/**过滤字符串,去除html标记
* <pre>
* StringFilterUtil.filterForHtml(null) = ""
* StringFilterUtil.filterForHtml("") = ""
* StringFilterUtil.filterForHtml("<td>content</td>") = "content"
* </pre>
* @param inputStr
* @return
*/
public static String filterForHtml(String inputStr) {
if(inputStr.length()==0||inputStr==null) {
return "";
}
String regEx = "<.+?>";
Pattern p = Pattern.compile(regEx, Pattern.DOTALL);
Matcher m = p.matcher(inputStr);
return m.replaceAll("");
}
/**过滤字符串,查询href条件
* <pre>
* StringFilterUtil.filterForHref(null)
* </pre>
* @param inputStr
* @return
*/
public static String filterForHref(String inputStr) {
if(inputStr.length()==0||inputStr==null) {
return "";
}
String regEx = "href=\"(.+?)\"";
Pattern p = Pattern.compile(regEx);
Matcher m = p.matcher(inputStr);
if(m.find()) {
return m.group(1);
}else {
return "";
}
}
/**过滤字符串,匹配http://地址//,获取Url地址
* @param inputStr
* @return
* 备注:地址后需要以空格结束
*/
public static String filterForUrl(String inputStr) {
if(inputStr.length()==0||inputStr==null) {
return "";
}
String regEx = "(http://|https://){1}[\\w\\.\\-/:]+";
Pattern p = Pattern.compile(regEx);
Matcher m = p.matcher(inputStr);
StringBuffer buffer = new StringBuffer();
while(m.find()){
buffer.append(m.group());
buffer.append("\r\n");
}
return buffer.toString();
}
}
@@ -10,7 +10,7 @@ import java.util.List;
* @Author: JinSheng Song
* @Date: 2022/7/11 15:32
*/
public class DateUpload
public class DateUpload extends SysSTEntity
{
private String id;
@@ -0,0 +1,15 @@
package com.ruoyi.system.domain_shate;
import java.util.List;
public class RegionName {
private List<RegionNameVO> regionName;
public List<RegionNameVO> getRegionName() {
return regionName;
}
public void setRegionName(List<RegionNameVO> regionName) {
this.regionName = regionName;
}
}
@@ -0,0 +1,29 @@
package com.ruoyi.system.domain_shate;
public class RegionNameVO {
/**
* 历史
*/
private String originalName;
/**
* 当前
*/
private String currentName;
public String getOriginalName() {
return originalName;
}
public void setOriginalName(String originalName) {
this.originalName = originalName;
}
public String getCurrentName() {
return currentName;
}
public void setCurrentName(String currentName) {
this.currentName = currentName;
}
}
@@ -24,6 +24,8 @@ public class SeedingSuccessRate extends SysSTEntity
private Double seedingSuccessArea;
private Double seedingSuccess;
private String imageDate;
@@ -141,6 +143,7 @@ public class SeedingSuccessRate extends SysSTEntity
this.productCode3 = productCode3;
this.createdBy = createdBy;
this.createdTime = createdTime;
}
public String getYear() {
@@ -5,6 +5,8 @@ package com.ruoyi.system.domain_shate;
* @Date: 2022/7/11 10:02
*/
public class SysSTEntity {
private String regionName;
private String link;
public String getLink() {
@@ -14,4 +16,12 @@ public class SysSTEntity {
public void setLink(String link) {
this.link = link;
}
public String getRegionName() {
return regionName;
}
public void setRegionName(String regionName) {
this.regionName = regionName;
}
}
@@ -0,0 +1,30 @@
package com.ruoyi.system.domain_shate;
import java.sql.DataTruncation;
/**
* @Author: JinSheng Song
* @Date: 2022/11/14 16:20
*/
public class WordHelp {
private String year;
private String[] zone;
public String getYear() {
return year;
}
public void setYear(String year) {
this.year = year;
}
public String[] getZone() {
return zone;
}
public void setZone(String[] zone) {
this.zone = zone;
}
}
@@ -0,0 +1,24 @@
package com.ruoyi.system.domain_shate;
public class WordVo {
private String [] zoneList;
private String[] year;
public String[] getZoneList() {
return zoneList;
}
public void setZoneList(String[] zoneList) {
this.zoneList = zoneList;
}
public String[] getYear() {
return year;
}
public void setYear(String[] year) {
this.year = year;
}
}
@@ -4,7 +4,7 @@ package com.ruoyi.system.domain_shate;
* @Author: JinSheng Song
* @Date: 2022/7/23 16:38
*/
public class lanUseNew
public class lanUseNew extends SysSTEntity
{
private Integer id;
@@ -70,12 +70,14 @@ public interface DateUploadMapper {
@Param("name") String name,
@Param("dateTime") String dateTime);
List<String> queryZone();
DateUpload selectShpfile(@Param("zone") String zone,
@Param("type") String type,
@Param("dateTime") String dateTime,
@Param("year") String year);
DateUpload selectShp(@Param("zone") String zone,
List<DateUpload> selectShp(@Param("zone") String zone,
@Param("type") String type,
@Param("dateTime") String dateTime);
@@ -14,6 +14,9 @@ public interface PlantingSuitabilityMapper
{
List<PlantingSuitability> sqlSeeding(@Param("zone") String zone);
PlantingSuitability sqlSeeding1(@Param("zone") String zone,
@Param("year") String year);
Integer InsertSeeding(PlantingSuitability suitability);
List<PlantingSuitability> sqlYear();
@@ -21,4 +21,8 @@ public interface VegetationHealthMapper
List<VegetationHealth> sqlYear();
Integer insertSeeding(VegetationHealth health);
List<VegetationHealth> sqlInfo(@Param("zone")String zone,
@Param("year")String year);
}
@@ -0,0 +1,49 @@
package com.ruoyi.system.mapper_shate;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface updateAllRegionNameMapper {
Integer altitude(@Param("regionName") String regionName,
@Param("regionName1") String regionName1);
Integer Aspect(@Param("regionName") String regionName,
@Param("regionName1") String regionName1);
Integer Slope(@Param("regionName") String regionName,
@Param("regionName1") String regionName1);
Integer salinization(@Param("regionName") String regionName,
@Param("regionName1") String regionName1);
Integer moisture(@Param("regionName") String regionName,
@Param("regionName1") String regionName1);
Integer desertification(@Param("regionName") String regionName,
@Param("regionName1") String regionName1);
Integer road(@Param("regionName") String regionName,
@Param("regionName1") String regionName1);
Integer water(@Param("regionName") String regionName,
@Param("regionName1") String regionName1);
Integer landuse(@Param("regionName") String regionName,
@Param("regionName1") String regionName1);
Integer dataUpload(@Param("regionName") String regionName,
@Param("regionName1") String regionName1);
Integer suitability(@Param("regionName") String regionName,
@Param("regionName1") String regionName1);
Integer waterArea(@Param("regionName") String regionName,
@Param("regionName1") String regionName1);
Integer seedSuccess(@Param("regionName") String regionName,
@Param("regionName1") String regionName1);
Integer healthy(@Param("regionName") String regionName,
@Param("regionName1") String regionName1);
}
@@ -14,6 +14,8 @@ import java.util.StringTokenizer;
*/
public interface IDateUploadService {
List<String> queryZone();
List<DateUpload> selectUpload( String zone,
String type,
String type1,
@@ -1,7 +1,10 @@
package com.ruoyi.system.service_shate;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain_shate.LandUse;
import com.ruoyi.system.domain_shate.RegionNameVO;
import com.ruoyi.system.domain_shate.SeedingSuccessRate;
import com.ruoyi.system.domain_shate.UplodFile;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -21,4 +24,8 @@ public interface ILandUseServices
List<LandUse> sqlYear();
UplodFile mainClass(String zone,String year);
AjaxResult updateAllRegionName(List<RegionNameVO> region);
}
@@ -13,6 +13,8 @@ public interface IPlantingSuitabilityService
{
List<PlantingSuitability> sqlSeeding(String zone);
PlantingSuitability sqlSeeding1(String zone,String year);
Integer InsertSeeding(PlantingSuitability suitability);
List<PlantingSuitability> sqlYear();
@@ -20,4 +20,7 @@ public interface ISeedingSuccessService {
Integer InsertSeeding2(SeedingSuccessRate eastVO);
Integer Delete(String zone,String imageDate,String name);
}
@@ -15,6 +15,8 @@ public interface IVegetationHealthServices {
List<VegetationHealth> sqlSeeding(String zone,String name,String year);
List<VegetationHealth> sqlYear();
List<VegetationHealth> sqlInfo(String zone,String year);
Integer insertSeeding(VegetationHealth health);
}
@@ -19,6 +19,11 @@ public class DateUploadServiceImpl implements IDateUploadService {
@Resource
private DateUploadMapper mapper;
@Override
public List<String> queryZone() {
return mapper.queryZone();
}
@Override
public List<DateUpload> selectUpload(String zone,String type,String type1,String type2,String year, String dateWithSway,String name,String dateTime) {
return mapper.selectUpload(zone,type,type1,type2,year,dateWithSway,name,dateTime);
@@ -41,7 +46,7 @@ public class DateUploadServiceImpl implements IDateUploadService {
@Override
public DateUpload selectShp(String zone, String type, String dateTime) {
return mapper.selectShp(zone,type,dateTime);
return mapper.selectShp(zone,type,dateTime).get(0);
}
@Override
@@ -1,35 +1,61 @@
package com.ruoyi.system.service_shate.impl;
import com.ruoyi.system.domain_shate.LandUse;
import com.ruoyi.system.domain_shate.SeedingSuccessRate;
import com.ruoyi.system.mapper_shate.LandUseMapper;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain_shate.*;
import com.ruoyi.system.mapper_shate.*;
import com.ruoyi.system.service_shate.ILandUseServices;
import com.ruoyi.system.service_shate.IRegionalFactorService;
import com.ruoyi.system.service_shate.ISoilFactorService;
import com.ruoyi.system.service_shate.ITopographicFactorService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.Year;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
/**
* @Author: JinSheng Song
* @Date: 2022/7/8 11:20
*/
@Service
public class LandUseServiceipml implements ILandUseServices
{
public class LandUseServiceipml implements ILandUseServices {
@Resource
private PlantingSuitabilityMapper plantingSuitabilityMapper;
@Resource
private SeedingSuccessMapper seedingSuccessMapper;
@Resource
private VegetationHealthMapper vegetationHealthMapper;
@Resource
private LandUseMapper mapper;
@Resource
private updateAllRegionNameMapper updateAllRegionNameMapper;
@Resource
private ITopographicFactorService factorService;
@Resource
private ISoilFactorService soilFactorService;
@Resource
private IRegionalFactorService regionalFactorService;
@Override
public List<LandUse> sqlSeeding(String zone, String[] landUses,String year) {
List<LandUse> value=mapper.sqlSeeding(zone, landUses,year);
public List<LandUse> sqlSeeding(String zone, String[] landUses, String year) {
List<LandUse> value = mapper.sqlSeeding(zone, landUses, year);
return value;
}
@Override
public List<LandUse> sqlSeeding1(String zone, String year) {
List<LandUse> value=mapper.sqlSeeding1(zone,year);
List<LandUse> value = mapper.sqlSeeding1(zone, year);
return value;
}
@@ -42,4 +68,81 @@ public class LandUseServiceipml implements ILandUseServices
public List<LandUse> sqlYear() {
return mapper.sqlYear();
}
@Override
public UplodFile mainClass(String zone, String year) {
UplodFile file = new UplodFile();
//播种成活率
List<SeedingSuccessRate> information= seedingSuccessMapper.sqlSeeding(zone,year);
//植被健康状况
List<VegetationHealth> vegetationHealths=vegetationHealthMapper.sqlInfo(zone,year);
//种植适宜性
List<PlantingSuitability> plantingSuitabilities=plantingSuitabilityMapper.sqlSeeding(zone);
//海拔
List<Altitude> altitude = factorService.sqlAltitude(zone, year);
//坡度
List<Slope> slopes = factorService.sqlSlope(zone, year);
//坡向
List<Aspect> aspects = factorService.sqlAspect(zone, year);
//沙化指数
List<SoilDesertification> desertifications = soilFactorService.sqlDesert(zone, year);
//湿度指数
List<SoilMoisture> moistures = soilFactorService.sqlMoisture(zone, year);
//盐渍化指数
List<SoilSalinization> salinizations = soilFactorService.sqlSalin(zone, year);
//水域因子
List<WaterFactor> waterFactors = regionalFactorService.sqlWater(zone, year);
//道路因子
List<RoadFactor> roadFactors = regionalFactorService.sqlRoad(zone, year);
file.setInformation(information);
file.setVegetationHealths(vegetationHealths);
file.setPlantingSuitabilities(plantingSuitabilities);
file.setWaterFactors(waterFactors);
file.setRoadFactors(roadFactors);
file.setSoilMoistures(moistures);
file.setSoilSalinizations(salinizations);
file.setSoilDesertifications(desertifications);
file.setAspects(aspects);
file.setSlopes(slopes);
file.setAltitudes(altitude);
return file;
}
@Override
public AjaxResult updateAllRegionName(List<RegionNameVO> region) {
try {
List<RegionNameVO> regionNameLists = region.stream().distinct().collect(Collectors.toList());
regionNameLists.forEach(e -> {
try {
Thread.currentThread().sleep(100);
} catch (InterruptedException ex) {
throw new RuntimeException(ex);
}
String regionName = e.getCurrentName();
String regionName1 = e.getOriginalName();
System.out.println("输出参数"+regionName+regionName1);
updateAllRegionNameMapper.desertification(regionName, regionName1);
updateAllRegionNameMapper.altitude(regionName, regionName1);
updateAllRegionNameMapper.Aspect(regionName, regionName1);
updateAllRegionNameMapper.Slope(regionName, regionName1);
updateAllRegionNameMapper.salinization(regionName, regionName1);
updateAllRegionNameMapper.moisture(regionName, regionName1);
updateAllRegionNameMapper.road(regionName, regionName1);
updateAllRegionNameMapper.water(regionName, regionName1);
updateAllRegionNameMapper.landuse(regionName, regionName1);
updateAllRegionNameMapper.dataUpload(regionName,regionName1);
updateAllRegionNameMapper.suitability(regionName,regionName1);
updateAllRegionNameMapper.waterArea(regionName,regionName1);
updateAllRegionNameMapper.seedSuccess(regionName,regionName1);
updateAllRegionNameMapper.healthy(regionName,regionName1);
});
return AjaxResult.success("成功!");
}
catch (Exception e)
{
return AjaxResult.error(e.getMessage());
}
}
}
@@ -22,6 +22,12 @@ public class PlantingSuitabilityServiceIpml implements IPlantingSuitabilityServi
return value;
}
@Override
public PlantingSuitability sqlSeeding1(String zone, String year) {
PlantingSuitability value=mapper.sqlSeeding1(zone,year);
return value;
}
@Override
public Integer InsertSeeding(PlantingSuitability suitability) {
return mapper.InsertSeeding(suitability);
@@ -22,6 +22,7 @@ public class SeedingSuccessServiceimpl implements ISeedingSuccessService
public List<SeedingSuccessRate> sqlSeeding(String zone, String year)
{
List<SeedingSuccessRate> vaue =mapper.sqlSeeding(zone,year);
return vaue;
}
@@ -30,8 +30,15 @@ public class VegetationHealthServiceimpl implements IVegetationHealthServices
return mapper.sqlYear();
}
@Override
public List<VegetationHealth> sqlInfo(String zone,String year) {
return mapper.sqlInfo(zone,year);
}
@Override
public Integer insertSeeding(VegetationHealth health) {
return mapper.insertSeeding(health);
}
}
@@ -29,12 +29,13 @@
<result property="size" column="size"/>
<result property="month" column="month"/>
<result property="route" column="route"/>
<result property="regionName" column="region_name"/>
</resultMap>
<sql id="columns">
<![CDATA[
ID,Zone,data_id ,year1,route,link,type,month ,type1,type2,file_name,data_time,created_time,type,data_id,area,band_index,bands,cols,depth,description,extent,name,projection,resolution,size
ID,Zone,region_name,data_id ,year1,route,link,type,month ,type1,type2,file_name,data_time,created_time,type,data_id,area,band_index,bands,cols,depth,description,extent,name,projection,resolution,size
]]>
</sql>
@@ -60,6 +61,9 @@
<!-- </if>-->
</select>
<select id="queryZone" resultType="string">
SELECT DISTINCT Zone FROM data_upload
</select>
<select id="selectUpload" resultMap="RM_Upload">
SELECT <include refid="columns"/> FROM data_upload
@@ -137,6 +141,7 @@
<![CDATA[
INSERT INTO Data_Upload (
zone ,
region_name,
type ,
type1 ,
type2,
@@ -160,6 +165,7 @@
month,
created_time
) VALUES (
#{zone,jdbcType=VARCHAR},
#{zone,jdbcType=VARCHAR},
#{type,jdbcType=VARCHAR},
#{type1,jdbcType=VARCHAR},
@@ -4,9 +4,9 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper_shate.LandUseMapper">
<resultMap id="RM_Seeding" type="com.ruoyi.system.domain_shate.LandUse">
<result property="id" column="id"/>
<result property="zone" column="zone"/>
<result property="regionName" column="region_name"/>
<result property="landUse" column="Land_use"/>
<result property="area" column="area"/>
<result property="total" column="total"/>
@@ -22,7 +22,7 @@
<sql id="columns">
<![CDATA[
ID,zone,land_use,year1,total,area,percent,Image_date,Product_code1,Product_code2,Product_code3,created_by
ID,zone,region_name,land_use,year1,total,area,percent,Image_date,Product_code1,Product_code2,Product_code3,created_by
]]>
</sql>
@@ -43,6 +43,7 @@
SELECT <include refid="columns"/> FROM landuse
where 1=1
<if test="zone!= null and zone !=''">
AND zone = #{zone}
</if>
<if test="year!= null and year !=''">
@@ -52,13 +53,14 @@
</select>
<select id="sqlYear" resultMap="RM_Seeding">
SELECT distinct year1,ZONE FROM landuse ORDER BY ZONE
SELECT distinct year1,ZONE,region_name FROM landuse ORDER BY ZONE
</select>
<insert id="insertSeeding">
<![CDATA[
INSERT INTO landuse (
zone ,
region_name,
Land_use,
total,
area ,
@@ -70,6 +72,7 @@
year1,
created_by
) VALUES (
#{zone,jdbcType=VARCHAR},
#{zone,jdbcType=VARCHAR},
#{landUse,jdbcType=DOUBLE},
#{total,jdbcType=DOUBLE},
@@ -7,6 +7,7 @@
<result property="id" column="id"/>
<result property="zone" column="zone"/>
<result property="regionName" column="region_name"/>
<result property="verySuitable" column="very_suitable"/>
<result property="suitable" column="Suitable"/>
<result property="notSuitable" column="Not_Suitable"/>
@@ -22,7 +23,7 @@
<sql id="columns">
<![CDATA[
ID,zone,very_suitable,year1,Suitable,Not_Suitable,Total_Area,Image_date,Product_code1,Product_code2,Product_code3,created_by,created_time
ID,zone,region_name,very_suitable,year1,Suitable,Not_Suitable,Total_Area,Image_date,Product_code1,Product_code2,Product_code3,created_by,created_time
]]>
</sql>
@@ -34,14 +35,27 @@
</if>
</select>
<select id="sqlSeeding1" resultMap="RM_Seeding">
SELECT <include refid="columns"/> FROM suitability
WHERE 1=1
<if test="zone!= null and zone !=''">
AND zone = #{zone}
</if>
<if test="year!= null and year !=''">
AND year1 = #{year}
</if>
</select>
<select id="sqlYear" resultMap="RM_Seeding">
SELECT distinct year1,ZONE FROM suitability
SELECT distinct year1,ZONE,region_name FROM suitability
</select>
<insert id="InsertSeeding">
<![CDATA[
INSERT INTO suitability (
zone ,
region_name,
very_suitable,
Suitable ,
Not_Suitable ,
@@ -53,6 +67,7 @@
year1,
created_by
) VALUES (
#{zone,jdbcType=VARCHAR},
#{zone,jdbcType=VARCHAR},
#{verySuitable,jdbcType=DOUBLE},
#{suitable,jdbcType=DOUBLE},
@@ -6,6 +6,7 @@
<resultMap id="RM_Seeding" type="com.ruoyi.system.domain_shate.WaterFactor">
<result property="id" column="id"/>
<result property="zone" column="zone"/>
<result property="regionName" column="region_name"/>
<result property="level1" column="level1"/>
<result property="level2" column="level2"/>
<result property="level3" column="level3"/>
@@ -23,6 +24,7 @@
<resultMap id="RM_Road" type="com.ruoyi.system.domain_shate.RoadFactor">
<result property="id" column="id"/>
<result property="zone" column="zone"/>
<result property="regionName" column="region_name"/>
<result property="level1" column="level1"/>
<result property="level2" column="level2"/>
<result property="level3" column="level3"/>
@@ -39,6 +41,7 @@
<resultMap id="RM_Region" type="com.ruoyi.system.domain_shate.RegionIndex">
<result property="id" column="id"/>
<result property="zone" column="zone"/>
<result property="regionName" column="region_name"/>
<result property="waterArea" column="Water_area"/>
<result property="roadLength" column="Road_length"/>
<result property="imageDate" column="Image_date"/>
@@ -59,7 +62,7 @@
<sql id="columns">
<![CDATA[
ID,zone,level5,year1,level1,level2,level3,level4,Image_date,Product_code1,Product_code2,created_by
ID,zone,region_name,level5,year1,level1,level2,level3,level4,Image_date,Product_code1,Product_code2,created_by
]]>
</sql>
<sql id="Region">
@@ -97,7 +100,7 @@
</select>
<select id="sqlRegion" resultMap="RM_Region">
select a.zone as zone,a.year1 as year1,a.water_area as water_area,
select a.zone as zone,a.year1 as year1,a.water_area as water_area,a.region_name as region_name,
b.road_length as road_length,a.image_date as image_date,
a.product_code as product_code,b.product_code as product_code1
FROM water_area a join road_length b
@@ -113,7 +116,7 @@
</select>
<select id="sqlYear1" resultMap="RM_Region">
SELECT distinct year1,ZONE FROM water_area
SELECT distinct year1,ZONE,region_name FROM water_area
</select>
<select id="sqlRoad" resultMap="RM_Road">
@@ -127,13 +130,14 @@
</if>
</select>
<select id="sqlYear2" resultMap="RM_Road">
SELECT distinct year1,ZONE FROM road
SELECT distinct year1,ZONE,region_name FROM road
</select>
<insert id="InsertWater">
<![CDATA[
INSERT INTO water (
zone ,
region_name,
level1,
level2 ,
level3 ,
@@ -145,6 +149,7 @@
year1,
created_by
) VALUES (
#{zone,jdbcType=VARCHAR},
#{zone,jdbcType=VARCHAR},
#{level1,jdbcType=DOUBLE},
#{level2,jdbcType=DOUBLE},
@@ -163,6 +168,7 @@
<![CDATA[
INSERT INTO road (
zone ,
region_name,
level1,
level2 ,
level3 ,
@@ -174,6 +180,7 @@
year1,
created_by
) VALUES (
#{zone,jdbcType=VARCHAR},
#{zone,jdbcType=VARCHAR},
#{level1,jdbcType=DOUBLE},
#{level2,jdbcType=DOUBLE},
@@ -194,11 +201,13 @@
<![CDATA[
INSERT INTO water_area (
zone ,
region_name,
Water_area,
Image_date ,
Product_code,
year1
) VALUES (
#{zone,jdbcType=VARCHAR},
#{zone,jdbcType=VARCHAR},
#{waterArea,jdbcType=DOUBLE},
#{imageDate,jdbcType=VARCHAR},
@@ -7,11 +7,12 @@
<result property="id" column="id"/>
<result property="zone" column="zone"/>
<result property="regionName" column="region_name"/>
<result property="plantingArea" column="Planting_area"/>
<result property="seedingSuccessArea" column="Seeding_success_area"/>
<result property="seedingSuccess" column="seeding_success"/>
<result property="imageDate" column="Image_date"/>
<result property="productCode1" column="Product_code1"/>
<result property="productCode1" column="productCode1"/>
<result property="productCode2" column="Product_code2"/>
<result property="productCode3" column="Product_code3"/>
<result property="year" column="year1"/>
@@ -28,6 +29,7 @@
<select id="sqlSeeding" resultMap="RM_Seeding">
select distinct a.product_code2 as Product_code2,
a.region_name as region_name,
a.zone as zone,
a.seeding_success_rate as seeding_success,
a.product_code1 as productCode1,
@@ -49,7 +51,7 @@
</select>
<select id="sqlYear" resultMap="RM_Seeding">
SELECT distinct year1,ZONE FROM "seed_Success"
SELECT distinct year1,ZONE,region_name FROM "seed_Success"
</select>
<insert id="InsertSeeding2">
@@ -74,12 +76,14 @@
<![CDATA[
INSERT INTO "seed_Success" (
zone ,
region_name,
seeding_Success_Rate ,
Image_date ,
Product_code1 ,
year1 ,
Product_code2
) VALUES (
#{zone,jdbcType=VARCHAR},
#{zone,jdbcType=VARCHAR},
#{seedingSuccess,jdbcType=DOUBLE},
#{imageDate,jdbcType=VARCHAR},
@@ -6,6 +6,7 @@
<resultMap id="RM_Desert" type="com.ruoyi.system.domain_shate.SoilDesertification">
<result property="id" column="id"/>
<result property="zone" column="zone"/>
<result property="regionName" column="region_name"/>
<result property="level1" column="level1"/>
<result property="level2" column="level2"/>
<result property="level3" column="level3"/>
@@ -22,6 +23,7 @@
<resultMap id="RM_Moisture" type="com.ruoyi.system.domain_shate.SoilMoisture">
<result property="id" column="id"/>
<result property="zone" column="zone"/>
<result property="regionName" column="region_name"/>
<result property="level1" column="level1"/>
<result property="level2" column="level2"/>
<result property="level3" column="level3"/>
@@ -38,6 +40,7 @@
<resultMap id="RM_Salin" type="com.ruoyi.system.domain_shate.SoilSalinization">
<result property="id" column="id"/>
<result property="zone" column="zone"/>
<result property="regionName" column="region_name"/>
<result property="level1" column="level1"/>
<result property="level2" column="level2"/>
<result property="level3" column="level3"/>
@@ -53,7 +56,7 @@
<sql id="columns">
<![CDATA[
ID,zone,level5,year1,level1,level2,level3,level4,Image_date,Product_code1,Product_code2,created_by
ID,zone,region_name,level5,year1,level1,level2,level3,level4,Image_date,Product_code1,Product_code2,created_by
]]>
</sql>
@@ -70,7 +73,7 @@
</select>
<select id="sqlYear" resultMap="RM_Desert">
SELECT distinct year1,ZONE FROM desertification
SELECT distinct year1,ZONE,region_name FROM desertification
</select>
<select id="sqlMoisture" resultMap="RM_Moisture">
@@ -85,7 +88,7 @@
</select>
<select id="sqlYear1" resultMap="RM_Moisture">
SELECT distinct year1,ZONE FROM moisture
SELECT distinct year1,ZONE,region_name FROM moisture
</select>
<select id="sqlSalin" resultMap="RM_Salin">
@@ -100,13 +103,14 @@
</select>
<select id="sqlYear2" resultMap="RM_Salin">
SELECT distinct year1,ZONE FROM salinization
SELECT distinct year1,ZONE,region_name FROM salinization
</select>
<insert id="InsertDesert">
<![CDATA[
INSERT INTO desertification (
zone ,
region_name,
level1,
level2 ,
level3 ,
@@ -118,6 +122,7 @@
year1,
created_by
) VALUES (
#{zone,jdbcType=VARCHAR},
#{zone,jdbcType=VARCHAR},
#{level1,jdbcType=DOUBLE},
#{level2,jdbcType=DOUBLE},
@@ -136,6 +141,7 @@
<![CDATA[
INSERT INTO moisture (
zone ,
region_name,
level1,
level2 ,
level3 ,
@@ -147,6 +153,7 @@
year1,
created_by
) VALUES (
#{zone,jdbcType=VARCHAR},
#{zone,jdbcType=VARCHAR},
#{level1,jdbcType=DOUBLE},
#{level2,jdbcType=DOUBLE},
@@ -166,6 +173,7 @@
<![CDATA[
INSERT INTO salinization (
zone ,
region_name,
level1,
level2 ,
level3 ,
@@ -177,6 +185,7 @@
year1,
created_by
) VALUES (
#{zone,jdbcType=VARCHAR},
#{zone,jdbcType=VARCHAR},
#{level1,jdbcType=DOUBLE},
#{level2,jdbcType=DOUBLE},
@@ -6,6 +6,7 @@
<resultMap id="RM_Altitude" type="com.ruoyi.system.domain_shate.Altitude">
<result property="id" column="id"/>
<result property="zone" column="zone"/>
<result property="regionName" column="region_name"/>
<result property="level1" column="level1"/>
<result property="level2" column="level2"/>
<result property="level3" column="level3"/>
@@ -22,6 +23,7 @@
<resultMap id="RM_Aspect" type="com.ruoyi.system.domain_shate.Aspect">
<result property="id" column="id"/>
<result property="zone" column="zone"/>
<result property="regionName" column="region_name"/>
<result property="north" column="North"/>
<result property="northeast" column="Northeast"/>
<result property="east" column="East"/>
@@ -41,6 +43,7 @@
<resultMap id="RM_Slope" type="com.ruoyi.system.domain_shate.Slope">
<result property="id" column="id"/>
<result property="zone" column="zone"/>
<result property="regionName" column="region_name"/>
<result property="level1" column="level1"/>
<result property="level2" column="level2"/>
<result property="level3" column="level3"/>
@@ -55,13 +58,13 @@
<sql id="columns">
<![CDATA[
ID,zone,level5,year1,level1,level2,level3,level4,Image_date,Product_code1,Product_code2,created_by
ID,zone,region_name,level5,year1,level1,level2,level3,level4,Image_date,Product_code1,Product_code2,created_by
]]>
</sql>
<sql id="Aspect">
<![CDATA[
ID,zone,north,year1,northeast,east,southeast,south,southwest,west,northwest,Image_date,Product_code1,Product_code2,created_by
ID,zone,region_name,north,year1,northeast,east,southeast,south,southwest,west,northwest,Image_date,Product_code1,Product_code2,created_by
]]>
</sql>
@@ -77,7 +80,7 @@
</select>
<select id="sqlYear" resultMap="RM_Altitude">
SELECT distinct year1,ZONE FROM Altitude
SELECT distinct year1,ZONE,region_name FROM Altitude
</select>
@@ -93,7 +96,7 @@
</select>
<select id="sqlYear1" resultMap="RM_Slope">
SELECT distinct year1,ZONE FROM Slope
SELECT distinct year1,ZONE,region_name FROM Slope
</select>
<select id="sqlAspect" resultMap="RM_Aspect">
@@ -108,13 +111,14 @@
</select>
<select id="sqlYear2" resultMap="RM_Aspect">
SELECT distinct year1,ZONE FROM Aspect
SELECT distinct year1,ZONE,region_name FROM Aspect
</select>
<insert id="InsertAltitude">
<![CDATA[
INSERT INTO Altitude (
zone ,
region_name,
level1,
level2 ,
level3 ,
@@ -126,6 +130,7 @@
year1,
created_by
) VALUES (
#{zone,jdbcType=VARCHAR},
#{zone,jdbcType=VARCHAR},
#{level1,jdbcType=DOUBLE},
#{level2,jdbcType=DOUBLE},
@@ -145,6 +150,7 @@
<![CDATA[
INSERT INTO Aspect (
zone ,
region_name,
North,
Northeast ,
East ,
@@ -159,6 +165,7 @@
year1,
created_by
) VALUES (
#{zone,jdbcType=VARCHAR},
#{zone,jdbcType=VARCHAR},
#{north,jdbcType=DOUBLE},
#{northeast,jdbcType=DOUBLE},
@@ -181,6 +188,7 @@
<![CDATA[
INSERT INTO Slope (
zone ,
region_name,
level1,
level2 ,
level3 ,
@@ -192,6 +200,7 @@
year1,
created_by
) VALUES (
#{zone,jdbcType=VARCHAR},
#{zone,jdbcType=VARCHAR},
#{level1,jdbcType=DOUBLE},
#{level2,jdbcType=DOUBLE},
@@ -7,6 +7,7 @@
<result property="id" column="id"/>
<result property="zone" column="zone"/>
<result property="regionName" column="region_name"/>
<result property="healthy" column="healthy"/>
<result property="normal" column="Normal"/>
<result property="notHealthy" column="Not_Healthy"/>
@@ -77,6 +78,16 @@
<select id="sqlYear" resultMap="RM_Seeding">
SELECT distinct year1,ZONE FROM healthy
</select>
<select id="sqlInfo" resultMap="RM_Seeding">
select * from healthy
where 1=1
<if test="zone!= null and zone !=''">
AND zone = #{zone}
</if>
<if test="year!= null and year !=''">
AND year1=#{year}
</if>
</select>
</mapper>
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper_shate.updateAllRegionNameMapper">
<update id="altitude">
UPDATE altitude SET region_name=#{regionName} where region_name=#{regionName1}
</update>
<update id="Aspect">
UPDATE Aspect SET region_name=#{regionName} where region_name=#{regionName1}
</update>
<update id="Slope">
UPDATE Slope SET region_name=#{regionName} where region_name=#{regionName1}
</update>
<update id="salinization">
UPDATE salinization SET region_name=#{regionName} where region_name=#{regionName1}
</update>
<update id="moisture">
UPDATE moisture SET region_name=#{regionName} where region_name=#{regionName1}
</update>
<update id="desertification">
UPDATE desertification SET region_name=#{regionName} where region_name=#{regionName1}
</update>
<update id="road">
UPDATE road SET region_name=#{regionName} where region_name=#{regionName1}
</update>
<update id="water">
UPDATE water SET region_name=#{regionName} where region_name=#{regionName1}
</update>
<update id="landuse">
UPDATE landuse SET region_name=#{regionName} where region_name=#{regionName1}
</update>
<update id="dataUpload">
UPDATE data_upload SET region_name=#{regionName} where region_name=#{regionName1}
</update>
<update id="suitability">
UPDATE suitability SET region_name=#{regionName} where region_name=#{regionName1}
</update>
<update id="waterArea">
UPDATE water_area SET region_name=#{regionName} where region_name=#{regionName1}
</update>
<update id="seedSuccess">
UPDATE "seed_Success" SET region_name=#{regionName} where region_name=#{regionName1}
</update>
<update id="healthy">
UPDATE healthy SET region_name=#{regionName} where region_name=#{regionName1}
</update>
<!-- <update id="healthy">-->
<!-- UPDATE vegetation_Distribution SET region_name=#{regionName} where region_name=#{regionName1}-->
<!-- </update>-->
</mapper>