增加各个数据表数据上床功能,切换数据库

This commit is contained in:
songjinsheng 2022-06-08 17:18:59 +08:00
parent a4976eff13
commit 2de946adb8
25 changed files with 397 additions and 70 deletions

View File

@ -17,7 +17,27 @@
<dependencies>
<!-- spring-boot-devtools -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
@ -42,6 +62,12 @@
<artifactId>knife4j-spring-boot-starter</artifactId>
<version>3.0.3</version>
</dependency>
<!-- postgresql驱动包-->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.20</version>
</dependency>
<!-- Mysql驱动包 -->
<dependency>

View File

@ -0,0 +1,302 @@
package com.ruoyi.web.controller.yada;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain_yada.*;
import com.ruoyi.system.service_yada.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.io.IOException;
import java.io.InputStream;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
@RestController
@RequestMapping(value = "/Special")
@Api(tags = "模板导入")
public class SpecialController {
@Resource
private IRegionVGIService regionVGIService;
@Resource
private IAustraliaMiddleEastService australiaMiddleEastService;
@Resource
private IAorestCoverageService service;
@Resource
private IVegetationCoverageService coverageService;
@Resource
private IRegionalSystemService systemService;
/**
*/
@RequestMapping(value = "/helpSaveExcel")
private AjaxResult helpSaveExcel(@RequestBody MultipartFile file) {
List<RegionVGIVO> value = saveExcel(file);
return IntoRegion(value);
}
/**
* 森林覆盖率模板导入
*/
@RequestMapping(value = "/helpExcelAorest")
private AjaxResult helpExcelAorest(@RequestBody MultipartFile file) {
List<AorestCoverageVO> value = saveExcelAorest(file);
return IntoAorestCoverage(value);
}
/**
*平均植被覆盖度和净初级生产力
*/
@RequestMapping(value = "/helpExcelnpp")
private AjaxResult helpExcelnpp(@RequestBody MultipartFile file) {
List<VegetationCoverageVO> value = saveExcelnpp(file);
return IntoVegetation(value);
}
/**
* 澳大利亚中部地区模板导入
*/
@RequestMapping(value = "/helpExcelAus")
private AjaxResult helpExcelAus(@RequestBody MultipartFile file) {
List<AustraliaMiddleEastVO> value = saveExcelAus(file);
return IntoAustralia(value);
}
/**
* 区域生态系统类型转移
*/
@RequestMapping(value = "/helpExcelRegion")
private AjaxResult helpExcelRegion(@RequestBody MultipartFile file) {
List<RegionalSystemVO> value = saveExcelRegion(file);
return IntoRegional(value);
}
public AjaxResult IntoRegional(List<RegionalSystemVO> eastVOS)
{
try {
for (int i = 0; i < eastVOS.size(); i++) {
eastVOS.get(i).setCreateTime(LocalDateTime.now());
systemService.IntoRegional(eastVOS.get(i));
}
return AjaxResult.success();
}
catch (Exception E){
E.getMessage();
return AjaxResult.error(E.getMessage());
}
}
public AjaxResult IntoAustralia(List<AustraliaMiddleEastVO> eastVOS) {
for (int i = 0; i < eastVOS.size(); i++) {
eastVOS.get(i).setCreateTime(LocalDateTime.now());
australiaMiddleEastService.IntoAustralia(eastVOS.get(i));
}
return AjaxResult.success();
}
public AjaxResult IntoRegion(List<RegionVGIVO> vgivo) {
for (int i = 0; i < vgivo.size(); i++) {
vgivo.get(i).setCreatedTime(LocalDateTime.now());
regionVGIService.IntoRegion(vgivo.get(i));
}
return AjaxResult.success();
}
public AjaxResult IntoAorestCoverage(List<AorestCoverageVO> eastVOS)
{
try {
for (int i = 0; i < eastVOS.size(); i++) {
eastVOS.get(i).setCreateTime(LocalDateTime.now());
service.IntoAorestCoverage(eastVOS.get(i));
}
return AjaxResult.success();
}
catch (Exception E){
E.getMessage();
return AjaxResult.error(E.getMessage());
}
}
public AjaxResult IntoVegetation(List<VegetationCoverageVO> eastVOS)
{
try {
for (int i = 0; i < eastVOS.size(); i++) {
eastVOS.get(i).setCreateTime(LocalDateTime.now());
coverageService.IntoVegetation(eastVOS.get(i));
}
return AjaxResult.success();
}
catch (Exception E){
E.getMessage();
return AjaxResult.error(E.getMessage());
}
}
private List<RegionVGIVO> saveExcel(MultipartFile file) {
try {
List<RegionVGIVO> Value = new ArrayList<>();
InputStream inputStream = file.getInputStream();
Workbook book;
Sheet sheet;
book = new XSSFWorkbook(inputStream);
sheet = book.getSheetAt(0);
for (int i = 1; i < sheet.getLastRowNum() + 1; i++) {
RegionVGIVO value = new RegionVGIVO();
Row row = sheet.getRow(i);
value.setCreatedTime(LocalDateTime.now());
value.setRegion(row.getCell(0).toString());
value.setRegionEn(row.getCell(1).toString());
value.setForest(Double.parseDouble(row.getCell(2).toString()));
value.setGrassland(Double.parseDouble(row.getCell(3).toString()));
value.setParticularYear(row.getCell(4).toString());
Value.add(value);
}
return Value;
} catch (IOException e) {
e.printStackTrace();
return null;
}
}
private List<AustraliaMiddleEastVO> saveExcelAus(MultipartFile file) {
try {
List<AustraliaMiddleEastVO> Value = new ArrayList<>();
InputStream inputStream = file.getInputStream();
Workbook book;
Sheet sheet;
book = new XSSFWorkbook(inputStream);
sheet = book.getSheetAt(0);
for (int i = 1; i < sheet.getLastRowNum() + 1; i++) {
AustraliaMiddleEastVO value = new AustraliaMiddleEastVO();
Row row = sheet.getRow(i);
value.setYearMonth(Double.parseDouble(row.getCell(0).toString()));
value.setMonth(Double.parseDouble(row.getCell(1).toString()));
value.setSstAnomalyIndex(Double.parseDouble(row.getCell(2).toString()));
value.setTemperatureAnomolies(Double.parseDouble(row.getCell(3).toString()));
value.setPrecipitationAnomolies(Double.parseDouble(row.getCell(4).toString()));
value.setVaiAnomolies(Double.parseDouble(row.getCell(5).toString()));
Value.add(value);
}
return Value;
} catch (IOException e) {
e.printStackTrace();
return null;
}
}
private List<AorestCoverageVO> saveExcelAorest(MultipartFile file) {
try {
List<AorestCoverageVO> Value = new ArrayList<>();
InputStream inputStream = file.getInputStream();
Workbook book;
Sheet sheet;
book = new XSSFWorkbook(inputStream);
sheet = book.getSheetAt(0);
for (int i = 1; i < sheet.getLastRowNum() + 1; i++) {
AorestCoverageVO value = new AorestCoverageVO();
Row row = sheet.getRow(i);
value.setRegion(row.getCell(0).toString());
value.setRegionEn(row.getCell(1).toString());
value.setProtectedLands(Double.parseDouble(row.getCell(2).toString()));
value.setNonProtectedLands(Double.parseDouble(row.getCell(3).toString()));
value.setMountain(Double.parseDouble(row.getCell(4).toString()));
value.setNonMountain(Double.parseDouble(row.getCell(5).toString()));
value.setCreateTime(LocalDateTime.now());
Value.add(value);
}
return Value;
} catch (IOException e) {
e.printStackTrace();
return null;
}
}
private List<VegetationCoverageVO> saveExcelnpp(MultipartFile file) {
try {
List<VegetationCoverageVO> Value = new ArrayList<>();
InputStream inputStream = file.getInputStream();
Workbook book;
Sheet sheet;
book = new XSSFWorkbook(inputStream);
sheet = book.getSheetAt(0);
for (int i = 1; i < sheet.getLastRowNum() + 1; i++) {
VegetationCoverageVO value = new VegetationCoverageVO();
Row row = sheet.getRow(i);
value.setRegion(row.getCell(0).toString());
value.setRegionEn(row.getCell(1).toString());
value.setProtectedLands(Double.parseDouble(row.getCell(4).toString()));
value.setNonProtectedLands(Double.parseDouble(row.getCell(5).toString()));
value.setMountain(Double.parseDouble(row.getCell(2).toString()));
value.setNonMountain(Double.parseDouble(row.getCell(3).toString()));
value.setCreateTime(LocalDateTime.now());
Value.add(value);
}
return Value;
} catch (IOException e) {
e.printStackTrace();
return null;
}
}
private List<RegionalSystemVO> saveExcelRegion(MultipartFile file) {
try {
List<RegionalSystemVO> Value = new ArrayList<>();
InputStream inputStream = file.getInputStream();
Workbook book;
Sheet sheet;
book = new XSSFWorkbook(inputStream);
sheet = book.getSheetAt(0);
for (int i = 1; i < sheet.getLastRowNum() + 1; i++) {
RegionalSystemVO value = new RegionalSystemVO();
Row row = sheet.getRow(i);
value.setRegion(row.getCell(0).toString());
value.setRegionEn(row.getCell(1).toString());
value.setTypeConversion(row.getCell(2).toString());
value.setTypeconversionEn(row.getCell(3).toString());
value.setProportionOfChangedAreas(Double.parseDouble(row.getCell(4).toString()));
value.setCreateTime(LocalDateTime.now());
Value.add(value);
}
return Value;
} catch (IOException e) {
e.printStackTrace();
return null;
}
}
}

View File

@ -1,7 +0,0 @@
package com.ruoyi.web.controller.yada;
/**
* 专题报告
*/
public class SpecialReportController {
}

View File

@ -2,14 +2,16 @@
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.cj.jdbc.Driver
# driverClassName: com.mysql.cj.jdbc.Driver
driver-class-name: org.postgresql.Driver
druid:
# 主库数据源
master:
# url: jdbc:mysql://192.168.2.9:3306/nuoyi?useUnicode=true&characterEncoding=UTF-8&useSSL=false&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url: jdbc:mysql://192.168.2.9:3306/nuoyi?AllowPublicKeyRetrieval=True&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: saas
password: XKrs123.
url: jdbc:postgresql://192.168.2.9:5432/yada?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=Asia/Shanghai
username: sjs
password: song5325
# url: jdbc:mysql://192.168.2.9:3306/nuoyi?AllowPublicKeyRetrieval=True&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
# username: saas
# password: XKrs123.
# 从库数据源
slave:
# 从数据源开关/默认关闭
@ -31,8 +33,9 @@ spring:
minEvictableIdleTimeMillis: 300000
# 配置一个连接在池中最大生存的时间,单位是毫秒
maxEvictableIdleTimeMillis: 900000
# 配置检测连接是否有效
validationQuery: SELECT 1 FROM DUAL
# 配置检测连接是否有效select * from pg_stat_activity
# validationQuery: SELECT 1 FROM DUAL
validationQuery: SELECT version()
testWhileIdle: true
testOnBorrow: false
testOnReturn: false

View File

@ -85,7 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="dictType != null and dictType != ''">#{dictType},</if>
<if test="sort != null">#{sort},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
current_timestamp
)
</insert>
@ -105,7 +105,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
dict_type = #{dictType},
sort = #{sort},
update_by = #{updateBy},
update_time = sysdate()
update_time = current_timestamp
</set>
where column_id = #{columnId}
</update>

View File

@ -164,7 +164,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="genPath != null and genPath != ''">#{genPath},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
current_timestamp
)
</insert>
@ -187,7 +187,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="options != null and options != ''">options = #{options},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if>
update_time = sysdate()
update_time = current_timestamp
</set>
where table_id = #{tableId}
</update>

View File

@ -86,7 +86,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="jobMessage != null and jobMessage != ''">#{jobMessage},</if>
<if test="status != null and status != ''">#{status},</if>
<if test="exceptionInfo != null and exceptionInfo != ''">#{exceptionInfo},</if>
sysdate()
current_timestamp
)
</insert>

View File

@ -75,7 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status !=null">status = #{status},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate()
update_time = current_timestamp
</set>
where job_id = #{jobId}
</update>
@ -104,7 +104,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null and status != ''">#{status},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
current_timestamp
)
</insert>

View File

@ -10,7 +10,9 @@ public class AustraliaMiddleEastVO extends SysBaseEntity
{
private String id;
private LocalDate yearMonth;
private Double yearMonth;
private Double month;
private Double sstAnomalyIndex;
@ -28,11 +30,11 @@ public class AustraliaMiddleEastVO extends SysBaseEntity
this.id = id;
}
public LocalDate getYearMonth() {
public Double getYearMonth() {
return yearMonth;
}
public void setYearMonth(LocalDate yearMonth) {
public void setYearMonth(Double yearMonth) {
this.yearMonth = yearMonth;
}
@ -68,4 +70,11 @@ public class AustraliaMiddleEastVO extends SysBaseEntity
this.vaiAnomolies = vaiAnomolies;
}
public Double getMonth() {
return month;
}
public void setMonth(Double month) {
this.month = month;
}
}

View File

@ -23,7 +23,7 @@ public class RegionVGIVO implements Serializable {
private Double grassland;
private Integer particularYear;
private String particularYear;
private String createdBy;
@ -85,11 +85,11 @@ public class RegionVGIVO implements Serializable {
this.grassland = grassland;
}
public Integer getParticularYear() {
public String getParticularYear() {
return particularYear;
}
public void setParticularYear(Integer particularYear) {
public void setParticularYear(String particularYear) {
this.particularYear = particularYear;
}

View File

@ -5,7 +5,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<mapper namespace="com.ruoyi.system.mapper_yada.AorestCoverageMapper">
<resultMap id="RM_AorestCoverage" type="com.ruoyi.system.domain_yada.AorestCoverageVO">
<result property="id" column="id"/>
<result property="particularYear" column="particular_year"/>
<result property="region" column="region"/>
@ -36,7 +35,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="IntoAorestCoverage">
<![CDATA[
INSERT INTO forest_coverage (
id ,
particular_year ,
region ,
region_en ,
@ -47,7 +45,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
created_by,
created_time
) VALUES (
#{id,jdbcType=VARCHAR},
#{particularYear,jdbcType=VARCHAR},
#{region,jdbcType=VARCHAR},
#{regionEn,jdbcType=VARCHAR},

View File

@ -6,6 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap id="RM_AustraliaMiddleEast" type="com.ruoyi.system.domain_yada.AustraliaMiddleEastVO">
<result property="yearMonth" column="particular_month"/>
<result property="month" column="month"/>
<result property="id" column="ID"/>
<result property="sstAnomalyIndex" column="sst_anomaly_index"/>
<result property="temperatureAnomolies" column="temperature_anomolies"/>
@ -18,7 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="columns">
<![CDATA[
ID,particular_month,sst_anomaly_index,temperature_anomolies,precipitation_anomolies,vai_anomolies,created_by,created_time
ID,particular_month,sst_anomaly_index,temperature_anomolies,precipitation_anomolies,vai_anomolies,created_by,created_time,month
]]>
</sql>
@ -34,8 +35,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="IntoAustralia">
<![CDATA[
INSERT INTO central_and_eastern_australia (
ID ,
particular_month ,
month,
sst_anomaly_index ,
temperature_anomolies ,
precipitation_anomolies ,
@ -43,8 +44,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
created_by ,
created_time
) VALUES (
#{id,jdbcType=VARCHAR},
#{yearMonth,jdbcType=TIMESTAMP},
#{yearMonth,jdbcType=INTEGER},
#{month,jdbcType=INTEGER},
#{sstAnomalyIndex,jdbcType=DOUBLE},
#{temperatureAnomolies,jdbcType=DOUBLE},
#{precipitationAnomolies,jdbcType=DOUBLE},

View File

@ -50,9 +50,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
) VALUES (
#{id,jdbcType=VARCHAR},
#{region,jdbcType=VARCHAR},
#{region_en,jdbcType=VARCHAR},
#{type_name,jdbcType=VARCHAR},
#{type_name_en,jdbcType=TIMESTAMP},
#{regionEn,jdbcType=VARCHAR},
#{typeName,jdbcType=VARCHAR},
#{typeNameEn,jdbcType=TIMESTAMP},
#{forest,jdbcType=DOUBLE},
#{createdBy,jdbcType=VARCHAR},
#{createdTime,jdbcType=DATE},

View File

@ -35,7 +35,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="IntoRegional">
<![CDATA[
INSERT INTO proportion_of_ecosystem_type_transfer (
id ,
region ,
region_en ,
type_conversion ,
@ -45,7 +44,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
created_by ,
created_time
) VALUES (
#{id,jdbcType=VARCHAR},
#{region,jdbcType=VARCHAR},
#{regionEn,jdbcType=VARCHAR},
#{typeConversion,jdbcType=VARCHAR},
@ -53,7 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{proportionOfChangedAreas,jdbcType=DOUBLE},
#{particularYear,jdbcType=VARCHAR},
#{createBy,jdbcType=VARCHAR},
#{createTime,jdbcType=DATE}
#{createTime,jdbcType=TIMESTAMP}
)
]]>
</insert>

View File

@ -80,7 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="configType != null and configType != ''">#{configType},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="remark != null and remark != ''">#{remark},</if>
sysdate()
current_timestamp
)
</insert>
@ -93,7 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="configType != null and configType != ''">config_type = #{configType},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if>
update_time = sysdate()
update_time = current_timestamp
</set>
where config_id = #{configId}
</update>

View File

@ -109,7 +109,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="email != null and email != ''">#{email},</if>
<if test="status != null">#{status},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
current_timestamp
)
</insert>
@ -125,7 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="email != null">email = #{email},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate()
update_time = current_timestamp
</set>
where dept_id = #{deptId}
</update>

View File

@ -84,7 +84,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null">status = #{status},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate()
update_time = current_timestamp
</set>
where dict_code = #{dictCode}
</update>
@ -117,7 +117,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null">#{status},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
current_timestamp
)
</insert>

View File

@ -79,7 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null">status = #{status},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate()
update_time = current_timestamp
</set>
where dict_id = #{dictId}
</update>
@ -98,7 +98,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null">#{status},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
current_timestamp
)
</insert>

View File

@ -28,7 +28,7 @@
</resultMap>
<sql id="selectMenuVo">
select menu_id, menu_name, parent_id, order_num, path, component, `query`, is_frame, is_cache, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time
select menu_id, menu_name, parent_id, order_num, path, component, `query`, is_frame, is_cache, menu_type, visible, status, nullif(perms,'') as perms, icon, create_time
from sys_menu
</sql>
@ -49,13 +49,13 @@
</select>
<select id="selectMenuTreeAll" resultMap="SysMenuResult">
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.query, m.visible, m.status, nullif(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
from sys_menu m where m.menu_type in ('M', 'C') and m.status = 0
order by m.parent_id, m.order_num
</select>
<select id="selectMenuListByUserId" parameterType="SysMenu" resultMap="SysMenuResult">
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.query, m.visible, m.status, nullif (m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
from sys_menu m
left join sys_role_menu rm on m.menu_id = rm.menu_id
left join sys_user_role ur on rm.role_id = ur.role_id
@ -74,7 +74,7 @@
</select>
<select id="selectMenuTreeByUserId" parameterType="Long" resultMap="SysMenuResult">
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.query, m.visible, m.status, nullif(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
from sys_menu m
left join sys_role_menu rm on m.menu_id = rm.menu_id
left join sys_user_role ur on rm.role_id = ur.role_id
@ -143,7 +143,7 @@
<if test="icon !=null and icon != ''">icon = #{icon},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate()
update_time = current_timestamp
</set>
where menu_id = #{menuId}
</update>
@ -184,7 +184,7 @@
<if test="icon != null and icon != ''">#{icon},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
current_timestamp
)
</insert>

View File

@ -58,7 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null and status != ''">#{status}, </if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
current_timestamp
)
</insert>
@ -70,7 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="noticeContent != null">notice_content = #{noticeContent}, </if>
<if test="status != null and status != ''">status = #{status}, </if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate()
update_time = current_timestamp
</set>
where notice_id = #{noticeId}
</update>

View File

@ -30,7 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertOperlog" parameterType="SysOperLog">
insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time)
values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, sysdate())
values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, current_timestamp)
</insert>
<select id="selectOperLogList" parameterType="SysOperLog" resultMap="SysOperLogResult">

View File

@ -81,7 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null and status != ''">status = #{status},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate()
update_time = current_timestamp
</set>
where post_id = #{postId}
</update>
@ -104,7 +104,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null and status != ''">#{status},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
current_timestamp
)
</insert>

View File

@ -117,7 +117,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null and status != ''">#{status},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
current_timestamp
)
</insert>
@ -133,7 +133,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null and status != ''">status = #{status},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate()
update_time = current_timestamp
</set>
where role_id = #{roleId}
</update>

View File

@ -170,7 +170,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null and status != ''">#{status},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="remark != null and remark != ''">#{remark},</if>
sysdate()
current_timestamp
)
</insert>
@ -190,7 +190,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="loginDate != null">login_date = #{loginDate},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if>
update_time = sysdate()
update_time = current_timestamp
</set>
where user_id = #{userId}
</update>

View File

@ -35,7 +35,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="IntoVegetation">
<![CDATA[
INSERT INTO fvc_npp (
id ,
particular_year ,
region ,
region_en ,
@ -46,12 +45,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
created_by ,
created_time
) VALUES (
#{id,jdbcType=VARCHAR},
#{particularYear,jdbcType=VARCHAR},
#{region,jdbcType=VARCHAR},
#{regionEn,jdbcType=VARCHAR},
#{protectedLands,jdbcType=DOUBLE},
#{nonProtectedLand,jdbcType=DOUBLE},
#{nonProtectedLands,jdbcType=DOUBLE},
#{mountain,jdbcType=DOUBLE},
#{nonMountain,jdbcType=DOUBLE},
#{createBy,jdbcType=VARCHAR},