Browse Source

岸线java定时更新

zoro 1 year ago
commit
a495fcd65d

+ 38 - 0
.gitignore

@@ -0,0 +1,38 @@
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### IntelliJ IDEA ###
+.idea/modules.xml
+.idea/jarRepositories.xml
+.idea/compiler.xml
+.idea/libraries/
+*.iws
+*.iml
+*.ipr
+
+### Eclipse ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
+
+### Mac OS ###
+.DS_Store

+ 85 - 0
pom.xml

@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-starter-parent</artifactId>
+        <version>2.3.12.RELEASE</version>
+        <relativePath/> <!-- lookup parent from repository -->
+    </parent>
+    <groupId>com.ghjg</groupId>
+    <artifactId>shoreline</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <name>shoreline</name>
+    <properties>
+        <java.version>8</java.version>
+    </properties>
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+            <version>3.4.1</version>
+        </dependency>
+
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>5.5.2</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-freemarker</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.oracle.database.jdbc</groupId>
+            <artifactId>ojdbc8</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>cn.easyproject</groupId>
+            <artifactId>orai18n</artifactId>
+            <version>12.1.0.2.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <finalName>shorelineSchedule</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <configuration>
+                    <image>
+                        <builder>paketobuildpacks/builder-jammy-base:latest</builder>
+                    </image>
+                    <excludes>
+                        <exclude>
+                            <groupId>org.projectlombok</groupId>
+                            <artifactId>lombok</artifactId>
+                        </exclude>
+                    </excludes>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

+ 19 - 0
src/main/java/com/ghjg/shoreline/Schedule/ShorelineSchedule.java

@@ -0,0 +1,19 @@
+package com.ghjg.shoreline.Schedule;
+
+import com.ghjg.shoreline.service.ShoreLineService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.PostConstruct;
+
+@Component
+public class ShorelineSchedule {
+    @Autowired
+    private ShoreLineService shoreLineService;
+    @Scheduled(cron = "0 0 1 * * ? ")
+    //@PostConstruct
+    public void shorelineUpdate(){
+        shoreLineService.updateAllThreeTable();
+    }
+}

+ 15 - 0
src/main/java/com/ghjg/shoreline/ShorelineApplication.java

@@ -0,0 +1,15 @@
+package com.ghjg.shoreline;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.scheduling.annotation.EnableScheduling;
+
+@SpringBootApplication
+@EnableScheduling
+@EnableAsync
+public class ShorelineApplication {
+    public static void main(String[] args) {
+        SpringApplication.run(ShorelineApplication.class, args);
+    }
+}

+ 27 - 0
src/main/java/com/ghjg/shoreline/dao/ShoreLineMangeFile.java

@@ -0,0 +1,27 @@
+package com.ghjg.shoreline.dao;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+@TableName("GHJG_CHANNEL.SHORELINE_MANAGE_FILE")
+public class ShoreLineMangeFile {
+    @TableId("ID")
+    private String id;
+    @TableField("FILE_TYPE")
+    private String fileType;
+    @TableField("FILE_NAME")
+    private String fileName;
+    @TableField("FILE_PATH")
+    private String filePath;
+    @TableField("IS_DELETE")
+    private Integer isDelete;
+    @TableField("CREATE_TIME")
+    private Date createTime;
+    @TableField("CO_ID")
+    private String coId;
+}

+ 200 - 0
src/main/java/com/ghjg/shoreline/dao/ShorelineManage.java

@@ -0,0 +1,200 @@
+package com.ghjg.shoreline.dao;
+
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @TableName SHORELINE_MANAGE
+ */
+@Data
+@TableName("GHJG_CHANNEL.SHORELINE_MANAGE")
+public class ShorelineManage {
+
+    /**
+     *
+     */
+    @TableField("OBJECTID")
+    private Long objectid;
+    /**
+     *
+     */
+    @TableField("LINE_CODE")
+    private String lineCode;
+    /**
+     *
+     */
+    @TableField("EXEQUATUR_CODE")
+    private String exequaturCode;
+    /**
+     *
+     */
+    @TableField("LINE_APPROVE_TYPE")
+    private String lineApproveType;
+    /**
+     *
+     */
+    @TableField("CERTIFICATION_STATUS")
+    private String certificationStatus;
+    /**
+     *
+     */
+    @TableField("LINE_USER")
+    private String lineUser;
+    /**
+     *
+     */
+    @TableField("CONTACT_ADDRESS")
+    private String contactAddress;
+    /**
+     *
+     */
+    @TableField("LINE_LOCATION")
+    private String lineLocation;
+    /**
+     *
+     */
+    @TableField("APPROVED_LENGTH")
+    private BigDecimal approvedLength;
+    /**
+     *
+     */
+    @TableField("MTQYSH")
+    private String mtqysh;
+    /**
+     *
+     */
+    @TableField("MAIN_USE")
+    private String mainUse;
+    /**
+     *
+     */
+    @TableField("NEAR_UP_USER")
+    private String nearUpUser;
+    /**
+     *
+     */
+    @TableField("NEAR_DOWN_USER")
+    private String nearDownUser;
+    /**
+     *
+     */
+    @TableField("CARD_FILL_UNIT")
+    private String cardFillUnit;
+    /**
+     *
+     */
+    @TableField("AUTHORITY_ORZ")
+    private String authorityOrz;
+    /**
+     *
+     */
+    @TableField("ISSUE_DATE")
+    private Date issueDate;
+    /**
+     *
+     */
+    @TableField("EFFECTIVE_DATE")
+    private Date effectiveDate;
+    /**
+     *
+     */
+    @TableField("EFFECTIVE_YEAR")
+    private String effectiveYear;
+    /**
+     *
+     */
+    @TableField("BELONG_AREA")
+    private String belongArea;
+    /**
+     *
+     */
+    @TableField("BELONG_STATION")
+    private String belongStation;
+    /**
+     *
+     */
+    @TableField("MAJOR_WATER_AREA_FACILITY")
+    private String majorWaterAreaFacility;
+    /**
+     *
+     */
+    @TableField("CONTROL_A_X")
+    private String controlAX;
+    /**
+     *
+     */
+    @TableField("CONTROL_A_Y")
+    private String controlAY;
+    /**
+     *
+     */
+    @TableField("CONTROL_B_X")
+    private String controlBX;
+    /**
+     *
+     */
+    @TableField("CONTROL_B_Y")
+    private String controlBY;
+    /**
+     *
+     */
+    @TableField("EXPLAIN")
+    private String explain;
+    /**
+     *
+     */
+    @TableField("LONGITUDE")
+    private String longitude;
+    /**
+     *
+     */
+    @TableField("LATITUDE")
+    private String latitude;
+    /**
+     *
+     */
+    @TableField("REMARK")
+    private String remark;
+    /**
+     *
+     */
+    @TableField("BELONG_COUNTRY")
+    private String belongCountry;
+    /**
+     *
+     */
+    @TableField("UPDATE_STATUS")
+    private String updateStatus;
+    /**
+     *
+     */
+    @TableField("LOCATION")
+    private String location;
+    /**
+     *
+     */
+    @TableField("LINE_TYPE")
+    private String lineType;
+
+    @TableField("FBDATE")
+    private Date fbDate;
+    @TableField("SAVE_DATE")
+    private Date saveDate;
+    @TableField("IS_SUBMIT")
+    private Integer isSubmit;
+    @TableField("IS_UPDATE")
+    private Integer isUpdate;
+
+    @TableField("UPDATE_USER")
+    private String updateUser;
+    @TableField("ID")
+    private String id;
+    @TableId("CODE")
+    private String code;
+}

+ 201 - 0
src/main/java/com/ghjg/shoreline/dao/ShorelineManageHistory.java

@@ -0,0 +1,201 @@
+package com.ghjg.shoreline.dao;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+* 
+* @TableName SHORELINE_MANAGE
+*/
+@Data
+@TableName("GHJG_CHANNEL.SHORELINE_MANAGE_HISTORY")
+public class ShorelineManageHistory {
+
+    @TableId("KEYID")
+    private String keyId;
+    @TableField("ID")
+    private String id;
+    /**
+    * 
+    */
+    @TableField("OBJECTID")
+    private Long objectid;
+    /**
+    * 
+    */
+    @TableField("LINE_CODE")
+    private String lineCode;
+    /**
+    * 
+    */
+    @TableField("EXEQUATUR_CODE")
+    private String exequaturCode;
+    /**
+    * 
+    */
+    @TableField("LINE_APPROVE_TYPE")
+    private String lineApproveType;
+    /**
+    * 
+    */
+    @TableField("CERTIFICATION_STATUS")
+    private String certificationStatus;
+    /**
+    * 
+    */
+    @TableField("LINE_USER")
+    private String lineUser;
+    /**
+    * 
+    */
+    @TableField("CONTACT_ADDRESS")
+    private String contactAddress;
+    /**
+    * 
+    */
+    @TableField("LINE_LOCATION")
+    private String lineLocation;
+    /**
+    * 
+    */
+    @TableField("APPROVED_LENGTH")
+    private BigDecimal approvedLength;
+    /**
+    * 
+    */
+    @TableField("MTQYSH")
+    private String mtqysh;
+    /**
+    * 
+    */
+    @TableField("MAIN_USE")
+    private String mainUse;
+    /**
+    * 
+    */
+    @TableField("NEAR_UP_USER")
+    private String nearUpUser;
+    /**
+    * 
+    */
+    @TableField("NEAR_DOWN_USER")
+    private String nearDownUser;
+    /**
+    * 
+    */
+    @TableField("CARD_FILL_UNIT")
+    private String cardFillUnit;
+    /**
+    * 
+    */
+    @TableField("AUTHORITY_ORZ")
+    private String authorityOrz;
+    /**
+    * 
+    */
+    @TableField("ISSUE_DATE")
+    private Date issueDate;
+    /**
+    * 
+    */
+    @TableField("EFFECTIVE_DATE")
+    private Date effectiveDate;
+    /**
+    * 
+    */
+    @TableField("EFFECTIVE_YEAR")
+    private String effectiveYear;
+    /**
+    * 
+    */
+    @TableField("BELONG_AREA")
+    private String belongArea;
+    /**
+    * 
+    */
+    @TableField("BELONG_STATION")
+    private String belongStation;
+    /**
+    * 
+    */
+    @TableField("MAJOR_WATER_AREA_FACILITY")
+    private String majorWaterAreaFacility;
+    /**
+    * 
+    */
+    @TableField("CONTROL_A_X")
+    private String controlAX;
+    /**
+    *
+    */
+    @TableField("CONTROL_A_Y")
+    private String controlAY;
+    /**
+    * 
+    */
+    @TableField("CONTROL_B_X")
+    private String controlBX;
+    /**
+    * 
+    */
+    @TableField("CONTROL_B_Y")
+    private String controlBY;
+    /**
+    * 
+    */
+    @TableField("EXPLAIN")
+    private String explain;
+    /**
+    * 
+    */
+    @TableField("LONGITUDE")
+    private String longitude;
+    /**
+    * 
+    */
+    @TableField("LATITUDE")
+    private String latitude;
+    /**
+    * 
+    */
+    @TableField("REMARK")
+    private String remark;
+    /**
+    * 
+    */
+    @TableField("BELONG_COUNTRY")
+    private String belongCountry;
+    /**
+    * 
+    */
+    @TableField("UPDATE_STATUS")
+    private String updateStatus;
+    /**
+    * 
+    */
+    @TableField("LOCATION")
+    private String location;
+    /**
+    * 
+    */
+    @TableField("LINE_TYPE")
+    private String lineType;
+
+    @TableField("FBDATE")
+    private Date fbDate;
+    @TableField("SAVE_DATE")
+    private Date saveDate;
+    @TableField("IS_SUBMIT")
+    private Integer isSubmit;
+    @TableField("UPDATE_USER")
+    private String updateUser;
+    @TableField("IS_UPDATE")
+    private Integer isUpdate;
+    @TableField("CODE")
+    private String code;
+}

+ 11 - 0
src/main/java/com/ghjg/shoreline/mapper/ShoreLineHistoryMapper.java

@@ -0,0 +1,11 @@
+package com.ghjg.shoreline.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ghjg.shoreline.dao.ShorelineManageHistory;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+@Mapper
+public interface ShoreLineHistoryMapper extends BaseMapper<ShorelineManageHistory> {
+}

+ 12 - 0
src/main/java/com/ghjg/shoreline/mapper/ShoreLineManageFileMapper.java

@@ -0,0 +1,12 @@
+package com.ghjg.shoreline.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ghjg.shoreline.dao.ShoreLineMangeFile;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface ShoreLineManageFileMapper extends BaseMapper<ShoreLineMangeFile> {
+}

+ 12 - 0
src/main/java/com/ghjg/shoreline/mapper/ShoreLineMapper.java

@@ -0,0 +1,12 @@
+package com.ghjg.shoreline.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ghjg.shoreline.dao.ShorelineManage;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+@Mapper
+public interface ShoreLineMapper extends BaseMapper<ShorelineManage> {
+    List<ShorelineManage> getPassDateList();
+}

+ 8 - 0
src/main/java/com/ghjg/shoreline/service/ShoreLineHistoryService.java

@@ -0,0 +1,8 @@
+package com.ghjg.shoreline.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ghjg.shoreline.dao.ShorelineManageHistory;
+
+
+public interface ShoreLineHistoryService extends IService<ShorelineManageHistory> {
+}

+ 10 - 0
src/main/java/com/ghjg/shoreline/service/ShoreLineMangeFileService.java

@@ -0,0 +1,10 @@
+package com.ghjg.shoreline.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ghjg.shoreline.dao.ShoreLineMangeFile;
+
+
+import java.util.List;
+
+public interface ShoreLineMangeFileService extends IService<ShoreLineMangeFile> {
+}

+ 9 - 0
src/main/java/com/ghjg/shoreline/service/ShoreLineService.java

@@ -0,0 +1,9 @@
+package com.ghjg.shoreline.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ghjg.shoreline.dao.ShorelineManage;
+
+public interface ShoreLineService extends IService<ShorelineManage> {
+    void updateAllThreeTable();
+
+}

+ 17 - 0
src/main/java/com/ghjg/shoreline/service/impl/ShoreLineHistoryServiceImpl.java

@@ -0,0 +1,17 @@
+package com.ghjg.shoreline.service.impl;
+
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ghjg.shoreline.dao.ShorelineManageHistory;
+import com.ghjg.shoreline.mapper.ShoreLineHistoryMapper;
+import com.ghjg.shoreline.service.ShoreLineHistoryService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+@Service
+public class ShoreLineHistoryServiceImpl extends ServiceImpl<ShoreLineHistoryMapper, ShorelineManageHistory> implements ShoreLineHistoryService {
+    @Resource
+    private ShoreLineHistoryMapper shoreLineHistoryMapper;
+}

+ 16 - 0
src/main/java/com/ghjg/shoreline/service/impl/ShoreLineMangeFileServiceImpl.java

@@ -0,0 +1,16 @@
+package com.ghjg.shoreline.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ghjg.shoreline.dao.ShoreLineMangeFile;
+import com.ghjg.shoreline.mapper.ShoreLineManageFileMapper;
+import com.ghjg.shoreline.service.ShoreLineMangeFileService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+@Service
+public class ShoreLineMangeFileServiceImpl extends ServiceImpl<ShoreLineManageFileMapper, ShoreLineMangeFile> implements ShoreLineMangeFileService {
+    @Resource
+    private ShoreLineManageFileMapper shoreLineManageFileMapper;
+}

+ 77 - 0
src/main/java/com/ghjg/shoreline/service/impl/ShoreLineServiceImpl.java

@@ -0,0 +1,77 @@
+package com.ghjg.shoreline.service.impl;
+
+
+import cn.hutool.core.lang.generator.SnowflakeGenerator;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ghjg.shoreline.dao.ShoreLineMangeFile;
+import com.ghjg.shoreline.dao.ShorelineManage;
+import com.ghjg.shoreline.dao.ShorelineManageHistory;
+import com.ghjg.shoreline.mapper.ShoreLineMapper;
+import com.ghjg.shoreline.service.ShoreLineHistoryService;
+import com.ghjg.shoreline.service.ShoreLineService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ghjg.shoreline.service.ShoreLineMangeFileService;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.UUID;
+
+@Service
+@Slf4j
+public class ShoreLineServiceImpl extends ServiceImpl<ShoreLineMapper, ShorelineManage> implements ShoreLineService {
+    @Resource
+    private ShoreLineMapper shoreLineMapper;
+    @Autowired
+    private ShoreLineHistoryService shoreLineHistoryService;
+    @Autowired
+    private ShoreLineMangeFileService fileService;
+
+    @Override
+    public void updateAllThreeTable() {
+        List<ShorelineManage> passDateList = shoreLineMapper.getPassDateList();
+        if (passDateList.isEmpty()) {
+            log.info("无需要更新的内容");
+        } else {
+            ArrayList<ShorelineManageHistory> shorelineManageHistories = new ArrayList<>();
+            ArrayList<ShoreLineMangeFile> shoreLineMangeFiles = new ArrayList<>();
+            for (ShorelineManage shorelineManage : passDateList) {
+                String lastId = shorelineManage.getId();
+                //先留存历史数据
+                ShorelineManageHistory shorelineManageHistory = new ShorelineManageHistory();
+                BeanUtils.copyProperties(shorelineManage, shorelineManageHistory);
+                shorelineManage.setUpdateUser("5043");
+                shorelineManageHistory.setKeyId(UUID.randomUUID().toString().replace("-",""));
+                shorelineManageHistories.add(shorelineManageHistory);
+
+                //更新现有数据
+                shorelineManage.setIsUpdate(1);
+                shorelineManage.setCertificationStatus("已过期");
+                shorelineManage.setUpdateUser("5043");
+                shorelineManage.setId(UUID.randomUUID().toString().replace("-",""));
+
+                //文件
+                List<ShoreLineMangeFile> files = fileService.list(Wrappers.<ShoreLineMangeFile>lambdaQuery().eq(ShoreLineMangeFile::getCoId, lastId));
+                if (!files.isEmpty()){
+                    //文件不空
+                    for (ShoreLineMangeFile file : files) {
+                        ShoreLineMangeFile shoreLineMangeFile = new ShoreLineMangeFile();
+                        BeanUtils.copyProperties(file,shoreLineMangeFile);
+                        shoreLineMangeFile.setCoId(shorelineManage.getId());
+                        shoreLineMangeFile.setId(new SnowflakeGenerator().next().toString());
+                        shoreLineMangeFiles.add(shoreLineMangeFile);
+                    }
+                }
+            }
+            this.updateBatchById(passDateList);
+            shoreLineHistoryService.saveBatch(shorelineManageHistories);
+            fileService.saveBatch(shoreLineMangeFiles);
+        }
+    }
+}

+ 14 - 0
src/main/resources/application.yaml

@@ -0,0 +1,14 @@
+server:
+  port: 7070
+spring:
+  datasource:
+    driver-class-name: oracle.jdbc.driver.OracleDriver
+    hikari:
+      idle-timeout: 30000
+      maximum-pool-size: 150
+    password: GHJG@123
+    url: jdbc:oracle:thin:@//172.17.190.5/orcl
+#    url: jdbc:oracle:thin:@//10.114.4.56/shhwdb
+    username: ghjg_basics
+  freemarker:
+    check-template-location: false

+ 198 - 0
src/main/resources/logback-spring.xml

@@ -0,0 +1,198 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 日志级别从低到高分为TRACE < DEBUG < INFO < WARN < ERROR < FATAL,如果设置为WARN,则低于WARN的信息都不会输出 -->
+<!-- scan:当此属性设置为true时,配置文档如果发生改变,将会被重新加载,默认值为true -->
+<!-- scanPeriod:设置监测配置文档是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。
+                 当scan为true时,此属性生效。默认的时间间隔为1分钟。 -->
+<!-- debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。 -->
+<configuration  scan="true" scanPeriod="10 seconds">
+    <contextName>logback</contextName>
+
+    <!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义后,可以使“${}”来使用变量。 -->
+    <property name="log.path" value="./shoreline" />
+
+    <!--0. 日志格式和颜色渲染 -->
+    <!-- 彩色日志依赖的渲染类 -->
+    <conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
+    <conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
+    <conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
+    <!-- 彩色日志格式 -->
+    <property name="CONSOLE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
+
+    <!--1. 输出到控制台-->
+    <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
+        <!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息-->
+        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+            <level>debug</level>
+
+        </filter>
+        <encoder>
+            <Pattern>${CONSOLE_LOG_PATTERN}</Pattern>
+            <!-- 设置字符集 -->
+            <charset>UTF-8</charset>
+        </encoder>
+    </appender>
+
+    <!--2. 输出到文档-->
+    <!-- 2.1 level为 DEBUG 日志,时间滚动输出  -->
+    <appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <!-- 正在记录的日志文档的路径及文档名 -->
+        <file>${log.path}/web_debug.log</file>
+        <!--日志文档输出格式-->
+        <encoder>
+            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
+            <charset>UTF-8</charset> <!-- 设置字符集 -->
+        </encoder>
+        <!-- 日志记录器的滚动策略,按日期,按大小记录 -->
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <!-- 日志归档 -->
+            <fileNamePattern>${log.path}/web-debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
+            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <maxFileSize>100MB</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+            <!--日志文档保留天数-->
+            <maxHistory>5</maxHistory>
+        </rollingPolicy>
+        <!-- 此日志文档只记录debug级别的 -->
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>debug</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+
+    <!-- 2.2 level为 INFO 日志,时间滚动输出  -->
+    <appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <!-- 正在记录的日志文档的路径及文档名 -->
+        <file>${log.path}/web_info.log</file>
+        <!--日志文档输出格式-->
+        <encoder>
+            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
+            <charset>UTF-8</charset>
+        </encoder>
+        <!-- 日志记录器的滚动策略,按日期,按大小记录 -->
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <!-- 每天日志归档路径以及格式 -->
+            <fileNamePattern>${log.path}/web-info-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
+            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <maxFileSize>20MB</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+            <!--日志文档保留天数-->
+            <maxHistory>10</maxHistory>
+        </rollingPolicy>
+        <!-- 此日志文档只记录info级别的 -->
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>info</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+
+    <!-- 2.3 level为 WARN 日志,时间滚动输出  -->
+    <appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <!-- 正在记录的日志文档的路径及文档名 -->
+        <file>${log.path}/web_warn.log</file>
+        <!--日志文档输出格式-->
+        <encoder>
+            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
+            <charset>UTF-8</charset> <!-- 此处设置字符集 -->
+        </encoder>
+        <!-- 日志记录器的滚动策略,按日期,按大小记录 -->
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <fileNamePattern>${log.path}/web-warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
+            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <maxFileSize>20MB</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+            <!--日志文档保留天数-->
+            <maxHistory>5</maxHistory>
+        </rollingPolicy>
+        <!-- 此日志文档只记录warn级别的 -->
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>warn</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+
+    <!-- 2.4 level为 ERROR 日志,时间滚动输出  -->
+    <appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <!-- 正在记录的日志文档的路径及文档名 -->
+        <file>${log.path}/web_error.log</file>
+        <!--日志文档输出格式-->
+        <encoder>
+            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
+            <charset>UTF-8</charset> <!-- 此处设置字符集 -->
+        </encoder>
+        <!-- 日志记录器的滚动策略,按日期,按大小记录 -->
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <fileNamePattern>${log.path}/web-error-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
+            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <maxFileSize>20MB</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+            <!--日志文档保留天数-->
+            <maxHistory>5</maxHistory>
+        </rollingPolicy>
+        <!-- 此日志文档只记录ERROR级别的 -->
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>ERROR</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+
+    <logger name="com.InterfaceServices.mapper" level="DEBUG" />
+    <logger name="io.lettuce.core.protocol" level="ERROR">
+        <appender-ref ref="ERROR_FILE" />
+    </logger>
+    <!--
+        <logger>用来设置某一个包或者具体的某一个类的日志打印级别、
+        以及指定<appender><logger>仅有一个name属性,
+        一个可选的level和一个可选的addtivity属性。
+        name:用来指定受此logger约束的某一个包或者具体的某一个类。
+        level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF,
+              还有一个特俗值INHERITED或者同义词NULL,代表强制执行上级的级别。
+              如果未设置此属性,那么当前logger将会继承上级的级别。
+        addtivity:是否向上级logger传递打印信息。默认是true。
+        <logger name="org.springframework.web" level="info"/>
+        <logger name="org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor" level="INFO"/>
+    -->
+
+    <!--
+        使用mybatis的时候,sql语句是debug下才会打印,而这里我们只配置了info,所以想要查看sql语句的话,有以下两种操作:
+        第一种把<root level="info">改成<root level="DEBUG">这样就会打印sql,不过这样日志那边会出现很多其他消息
+        第二种就是单独给dao下目录配置debug模式,代码如下,这样配置sql语句会打印,其他还是正常info级别:
+        【logging.level.org.mybatis=debug logging.level.dao=debug】
+     -->
+
+    <!--
+        root节点是必选节点,用来指定最基础的日志输出级别,只有一个level属性
+        level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF,
+        不能设置为INHERITED或者同义词NULL。默认是DEBUG
+        可以包含零个或多个元素,标识这个appender将会添加到这个logger。
+    -->
+
+    <!-- 4. 最终的策略 -->
+    <!-- 4.1 开发环境:打印控制台-->
+    <!-- <springProfile name="dev">
+        <logger name="com.sdcm.pmp" level="debug"/>
+    </springProfile> -->
+
+    <root level="info">
+        <appender-ref ref="CONSOLE" />
+        <appender-ref ref="DEBUG_FILE" />
+        <appender-ref ref="INFO_FILE" />
+        <appender-ref ref="WARN_FILE" />
+        <appender-ref ref="ERROR_FILE" />
+    </root>
+
+    <!-- 4.2 生产环境:输出到文档
+    <springProfile name="pro">
+        <root level="info">
+            <appender-ref ref="CONSOLE" />
+            <appender-ref ref="DEBUG_FILE" />
+            <appender-ref ref="INFO_FILE" />
+            <appender-ref ref="ERROR_FILE" />
+            <appender-ref ref="WARN_FILE" />
+        </root>
+    </springProfile> -->
+
+</configuration>

+ 4 - 0
src/main/resources/mapper/ShoreLineHistoryMapper.xml

@@ -0,0 +1,4 @@
+<?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.ghjg.shoreline.mapper.ShoreLineHistoryMapper">
+</mapper>

+ 4 - 0
src/main/resources/mapper/ShoreLineManageFileMapper.xml

@@ -0,0 +1,4 @@
+<?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.ghjg.shoreline.mapper.ShoreLineManageFileMapper">
+</mapper>

+ 9 - 0
src/main/resources/mapper/ShoreLineMapper.xml

@@ -0,0 +1,9 @@
+<?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.ghjg.shoreline.mapper.ShoreLineMapper">
+    <select id="getPassDateList" resultType="com.ghjg.shoreline.dao.ShorelineManage">
+        select * from ghjg_channel.shoreline_manage
+        where EFFECTIVE_DATE &lt;= sysdate
+        and (certification_status = '已发证' or certification_status = '批文')
+    </select>
+</mapper>