Jelajahi Sumber

修改为JPA

tianyun 3 tahun lalu
induk
melakukan
41d7be005d

+ 45 - 32
springboot-main/pom.xml

@@ -10,9 +10,37 @@
     <modelVersion>4.0.0</modelVersion>
 
     <artifactId>springboot-main</artifactId>
+    <properties>
+        <querydsl.version>4.2.1</querydsl.version>
+    </properties>
 
     <build>
         <plugins>
+            <plugin>
+                <groupId>com.mysema.maven</groupId>
+                <artifactId>apt-maven-plugin</artifactId>
+                <version>1.1.3</version>
+                <dependencies>
+                    <dependency>
+                        <groupId>com.querydsl</groupId>
+                        <artifactId>querydsl-apt</artifactId>
+                        <version>${querydsl.version}</version>
+                    </dependency>
+                </dependencies>
+                <executions>
+                    <!--设置插件生效的maven生命周期-->
+                    <execution>
+                        <goals>
+                            <goal>process</goal>
+                        </goals>
+                        <configuration>
+                            <!--配置生成文件的目录-->
+                            <outputDirectory>src/generated-sources/java/</outputDirectory>
+                            <processor>com.querydsl.apt.jpa.JPAAnnotationProcessor</processor>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
             <!--maven项目打包-->
             <plugin>
                 <groupId>org.springframework.boot</groupId>
@@ -23,30 +51,6 @@
                 </configuration>
             </plugin>
 
-            <!--mybatis.generator maven插件-->
-            <plugin>
-                <groupId>org.mybatis.generator</groupId>
-                <artifactId>mybatis-generator-maven-plugin</artifactId>
-                <version>1.3.7</version>
-
-                <configuration>
-                    <configurationFile>src/main/resources/mybatis-generator.xml</configurationFile>
-                    <overwrite>true</overwrite>
-                </configuration>
-
-                <dependencies>
-                    <dependency>
-                        <groupId>mysql</groupId>
-                        <artifactId>mysql-connector-java</artifactId>
-                        <version>8.0.16</version>
-                    </dependency>
-                    <dependency>
-                        <groupId>com.itfsw</groupId>
-                        <artifactId>mybatis-generator-plugin</artifactId>
-                        <version>1.3.7</version>
-                    </dependency>
-                </dependencies>
-            </plugin>
         </plugins>
     </build>
 
@@ -133,11 +137,21 @@
             <version>1.6.2</version>
         </dependency>
 
-        <!--mybatis-->
+        <!--JPA-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-jpa</artifactId>
+        </dependency>
+        <!--引入querydsl-jpa依赖-->
+        <dependency>
+            <groupId>com.querydsl</groupId>
+            <artifactId>querydsl-jpa</artifactId>
+            <version>${querydsl.version}</version>
+        </dependency>
         <dependency>
-            <groupId>org.mybatis.spring.boot</groupId>
-            <artifactId>mybatis-spring-boot-starter</artifactId>
-            <version>1.3.2</version>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <version>8.0.16</version>
         </dependency>
         <dependency>
             <groupId>com.alibaba</groupId>
@@ -145,11 +159,10 @@
             <version>1.1.10</version>
         </dependency>
 
-        <!--mysql-->
         <dependency>
-            <groupId>mysql</groupId>
-            <artifactId>mysql-connector-java</artifactId>
-            <version>8.0.16</version>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+            <version>18.0</version>
         </dependency>
     </dependencies>
 

+ 45 - 0
springboot-main/src/generated-sources/java/com/alvin/model/QPerson.java

@@ -0,0 +1,45 @@
+package com.alvin.model;
+
+import static com.querydsl.core.types.PathMetadataFactory.*;
+
+import com.querydsl.core.types.dsl.*;
+
+import com.querydsl.core.types.PathMetadata;
+import javax.annotation.Generated;
+import com.querydsl.core.types.Path;
+
+
+/**
+ * QPerson is a Querydsl query type for Person
+ */
+@Generated("com.querydsl.codegen.EntitySerializer")
+public class QPerson extends EntityPathBase<Person> {
+
+    private static final long serialVersionUID = -189434747L;
+
+    public static final QPerson person = new QPerson("person");
+
+    public final NumberPath<Integer> age = createNumber("age", Integer.class);
+
+    public final DateTimePath<java.util.Date> createTime = createDateTime("createTime", java.util.Date.class);
+
+    public final StringPath email = createString("email");
+
+    public final NumberPath<Long> id = createNumber("id", Long.class);
+
+    public final StringPath name = createString("name");
+
+    public QPerson(String variable) {
+        super(Person.class, forVariable(variable));
+    }
+
+    public QPerson(Path<? extends Person> path) {
+        super(path.getType(), path.getMetadata());
+    }
+
+    public QPerson(PathMetadata metadata) {
+        super(Person.class, metadata);
+    }
+
+}
+

+ 0 - 4
springboot-main/src/main/java/com/alvin/Application.java

@@ -1,16 +1,12 @@
 package com.alvin;
 
-import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.CommandLineRunner;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 
 @SpringBootApplication
-@MapperScan("com.alvin.dao.mapper")
 public class Application implements CommandLineRunner {
     public static void main(String[] args) {
-        //日志异步
-        System.setProperty("Log4jContextSelector", "org.apache.logging.log4j.core.async.AsyncLoggerContextSelector");
         SpringApplication.run(Application.class, args);
     }
 

+ 23 - 0
springboot-main/src/main/java/com/alvin/config/QuerydslConfig.java

@@ -0,0 +1,23 @@
+package com.alvin.config;
+
+import com.querydsl.jpa.impl.JPAQueryFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+@Configuration
+public class QuerydslConfig {
+
+    @Autowired
+    @PersistenceContext
+    private EntityManager entityManager;
+
+    @Bean
+    public JPAQueryFactory queryFactory(){
+        return new JPAQueryFactory(entityManager);
+    }
+
+}

+ 3 - 0
springboot-main/src/main/java/com/alvin/controller/AppController.java

@@ -4,6 +4,7 @@ import com.alvin.annotation.ResponseResult;
 import com.alvin.common.entity.PageResult;
 import com.alvin.common.entity.Result;
 import com.alvin.entity.User;
+import com.alvin.repository.PersonRepository;
 import com.alvin.service.AppService;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
@@ -23,6 +24,8 @@ public class AppController {
 
     @Autowired
     private AppService appService;
+    @Autowired
+    private PersonRepository personRepository;
 
     /**
      * 找到一个

+ 0 - 403
springboot-main/src/main/java/com/alvin/dao/entity/Similar.java

@@ -1,403 +0,0 @@
-package com.alvin.dao.entity;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import lombok.Data;
-
-@Data
-public class Similar implements Serializable {
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column similar.id
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    private Long id;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column similar.file_name
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    private String fileName;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column similar.line_num
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    private Integer lineNum;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column similar.txt
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    private String txt;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column similar.similar_txt
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    private String similarTxt;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column similar.commit_time
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    private Date commitTime;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column similar.txt_option
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    private String txtOption;
-
-    /**
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    public static Similar.Builder builder() {
-        return new Similar.Builder();
-    }
-
-    /**
-     * This class was generated by MyBatis Generator.
-     * This class corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    public static class Builder {
-        /**
-         * This field was generated by MyBatis Generator.
-         * This field corresponds to the database table similar
-         *
-         * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-         */
-        private Similar obj;
-
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method corresponds to the database table similar
-         *
-         * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-         */
-        public Builder() {
-            this.obj = new Similar();
-        }
-
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method sets the value of the database column similar.id
-         *
-         * @param id the value for similar.id
-         *
-         * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-         */
-        public Builder id(Long id) {
-            obj.setId(id);
-            return this;
-        }
-
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method sets the value of the database column similar.file_name
-         *
-         * @param fileName the value for similar.file_name
-         *
-         * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-         */
-        public Builder fileName(String fileName) {
-            obj.setFileName(fileName);
-            return this;
-        }
-
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method sets the value of the database column similar.line_num
-         *
-         * @param lineNum the value for similar.line_num
-         *
-         * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-         */
-        public Builder lineNum(Integer lineNum) {
-            obj.setLineNum(lineNum);
-            return this;
-        }
-
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method sets the value of the database column similar.txt
-         *
-         * @param txt the value for similar.txt
-         *
-         * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-         */
-        public Builder txt(String txt) {
-            obj.setTxt(txt);
-            return this;
-        }
-
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method sets the value of the database column similar.txt_option
-         *
-         * @param txtOption the value for similar.txt_option
-         *
-         * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-         */
-        public Builder txtOption(String txtOption) {
-            obj.setTxtOption(txtOption);
-            return this;
-        }
-
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method sets the value of the database column similar.similar_txt
-         *
-         * @param similarTxt the value for similar.similar_txt
-         *
-         * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-         */
-        public Builder similarTxt(String similarTxt) {
-            obj.setSimilarTxt(similarTxt);
-            return this;
-        }
-
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method sets the value of the database column similar.commit_time
-         *
-         * @param commitTime the value for similar.commit_time
-         *
-         * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-         */
-        public Builder commitTime(Date commitTime) {
-            obj.setCommitTime(commitTime);
-            return this;
-        }
-
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method corresponds to the database table similar
-         *
-         * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-         */
-        public Similar build() {
-            return this.obj;
-        }
-    }
-
-    /**
-     * This enum was generated by MyBatis Generator.
-     * This enum corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    public enum Column {
-        id("id", "id", "BIGINT", false),
-        fileName("file_name", "fileName", "VARCHAR", false),
-        lineNum("line_num", "lineNum", "INTEGER", false),
-        txt("txt", "txt", "VARCHAR", false),
-        similarTxt("similar_txt", "similarTxt", "VARCHAR", false),
-        commitTime("commit_time", "commitTime", "TIMESTAMP", false),
-        txtOption("txt_option", "txtOption", "VARCHAR", false);
-
-        /**
-         * This field was generated by MyBatis Generator.
-         * This field corresponds to the database table similar
-         *
-         * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-         */
-        private static final String BEGINNING_DELIMITER = "\"";
-
-        /**
-         * This field was generated by MyBatis Generator.
-         * This field corresponds to the database table similar
-         *
-         * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-         */
-        private static final String ENDING_DELIMITER = "\"";
-
-        /**
-         * This field was generated by MyBatis Generator.
-         * This field corresponds to the database table similar
-         *
-         * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-         */
-        private final String column;
-
-        /**
-         * This field was generated by MyBatis Generator.
-         * This field corresponds to the database table similar
-         *
-         * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-         */
-        private final boolean isColumnNameDelimited;
-
-        /**
-         * This field was generated by MyBatis Generator.
-         * This field corresponds to the database table similar
-         *
-         * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-         */
-        private final String javaProperty;
-
-        /**
-         * This field was generated by MyBatis Generator.
-         * This field corresponds to the database table similar
-         *
-         * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-         */
-        private final String jdbcType;
-
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method corresponds to the database table similar
-         *
-         * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-         */
-        public String value() {
-            return this.column;
-        }
-
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method corresponds to the database table similar
-         *
-         * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-         */
-        public String getValue() {
-            return this.column;
-        }
-
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method corresponds to the database table similar
-         *
-         * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-         */
-        public String getJavaProperty() {
-            return this.javaProperty;
-        }
-
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method corresponds to the database table similar
-         *
-         * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-         */
-        public String getJdbcType() {
-            return this.jdbcType;
-        }
-
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method corresponds to the database table similar
-         *
-         * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-         */
-        Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
-            this.column = column;
-            this.javaProperty = javaProperty;
-            this.jdbcType = jdbcType;
-            this.isColumnNameDelimited = isColumnNameDelimited;
-        }
-
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method corresponds to the database table similar
-         *
-         * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-         */
-        public String desc() {
-            return this.getEscapedColumnName() + " DESC";
-        }
-
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method corresponds to the database table similar
-         *
-         * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-         */
-        public String asc() {
-            return this.getEscapedColumnName() + " ASC";
-        }
-
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method corresponds to the database table similar
-         *
-         * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-         */
-        public static Column[] excludes(Column ... excludes) {
-            ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
-            if (excludes != null && excludes.length > 0) {
-                columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
-            }
-            return columns.toArray(new Column[]{});
-        }
-
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method corresponds to the database table similar
-         *
-         * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-         */
-        public static Column[] all() {
-            return Column.values();
-        }
-
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method corresponds to the database table similar
-         *
-         * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-         */
-        public String getEscapedColumnName() {
-            if (this.isColumnNameDelimited) {
-                return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
-            } else {
-                return this.column;
-            }
-        }
-
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method corresponds to the database table similar
-         *
-         * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-         */
-        public String getAliasedEscapedColumnName() {
-            return this.getEscapedColumnName();
-        }
-    }
-}

+ 0 - 1232
springboot-main/src/main/java/com/alvin/dao/entity/example/SimilarExample.java

@@ -1,1232 +0,0 @@
-package com.alvin.dao.entity.example;
-
-import com.alvin.dao.entity.Similar;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-public class SimilarExample {
-    /**
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    protected String orderByClause;
-
-    /**
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    protected boolean distinct;
-
-    /**
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    protected List<Criteria> oredCriteria;
-
-    /**
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    protected Integer offset;
-
-    /**
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    protected Integer rows;
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    public SimilarExample() {
-        oredCriteria = new ArrayList<Criteria>();
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    public void setOrderByClause(String orderByClause) {
-        this.orderByClause = orderByClause;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    public String getOrderByClause() {
-        return orderByClause;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    public void setDistinct(boolean distinct) {
-        this.distinct = distinct;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    public boolean isDistinct() {
-        return distinct;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    public List<Criteria> getOredCriteria() {
-        return oredCriteria;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    public void or(Criteria criteria) {
-        oredCriteria.add(criteria);
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    public Criteria or() {
-        Criteria criteria = createCriteriaInternal();
-        oredCriteria.add(criteria);
-        return criteria;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    public SimilarExample orderBy(String orderByClause) {
-        this.setOrderByClause(orderByClause);
-        return this;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    public SimilarExample orderBy(String ... orderByClauses) {
-        StringBuffer sb = new StringBuffer();
-        for (int i = 0; i < orderByClauses.length; i++) {
-            sb.append(orderByClauses[i]);
-            if (i < orderByClauses.length - 1) {
-                sb.append(" , ");
-            }
-        }
-        this.setOrderByClause(sb.toString());
-        return this;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    public Criteria createCriteria() {
-        Criteria criteria = createCriteriaInternal();
-        if (oredCriteria.size() == 0) {
-            oredCriteria.add(criteria);
-        }
-        return criteria;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    protected Criteria createCriteriaInternal() {
-        Criteria criteria = new Criteria(this);
-        return criteria;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    public void clear() {
-        oredCriteria.clear();
-        orderByClause = null;
-        distinct = false;
-        rows = null;
-        offset = null;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    public void setOffset(Integer offset) {
-        this.offset = offset;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    public Integer getOffset() {
-        return this.offset;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    public void setRows(Integer rows) {
-        this.rows = rows;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    public Integer getRows() {
-        return this.rows;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    public SimilarExample limit(Integer rows) {
-        this.rows = rows;
-        return this;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    public SimilarExample limit(Integer offset, Integer rows) {
-        this.offset = offset;
-        this.rows = rows;
-        return this;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    public SimilarExample page(Integer page, Integer pageSize) {
-        this.offset = page * pageSize;
-        this.rows = pageSize;
-        return this;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    public static Criteria newAndCreateCriteria() {
-        SimilarExample example = new SimilarExample();
-        return example.createCriteria();
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    public SimilarExample when(boolean condition, IExampleWhen then) {
-        if (condition) {
-            then.example(this);
-        }
-        return this;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    public SimilarExample when(boolean condition, IExampleWhen then, IExampleWhen otherwise) {
-        if (condition) {
-            then.example(this);
-        } else {
-            otherwise.example(this);
-        }
-        return this;
-    }
-
-    /**
-     * This class was generated by MyBatis Generator.
-     * This class corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    protected abstract static class GeneratedCriteria {
-        protected List<Criterion> criteria;
-
-        protected GeneratedCriteria() {
-            super();
-            criteria = new ArrayList<Criterion>();
-        }
-
-        public boolean isValid() {
-            return criteria.size() > 0;
-        }
-
-        public List<Criterion> getAllCriteria() {
-            return criteria;
-        }
-
-        public List<Criterion> getCriteria() {
-            return criteria;
-        }
-
-        protected void addCriterion(String condition) {
-            if (condition == null) {
-                throw new RuntimeException("Value for condition cannot be null");
-            }
-            criteria.add(new Criterion(condition));
-        }
-
-        protected void addCriterion(String condition, Object value, String property) {
-            if (value == null) {
-                throw new RuntimeException("Value for " + property + " cannot be null");
-            }
-            criteria.add(new Criterion(condition, value));
-        }
-
-        protected void addCriterion(String condition, Object value1, Object value2, String property) {
-            if (value1 == null || value2 == null) {
-                throw new RuntimeException("Between values for " + property + " cannot be null");
-            }
-            criteria.add(new Criterion(condition, value1, value2));
-        }
-
-        public Criteria andIdIsNull() {
-            addCriterion("id is null");
-            return (Criteria) this;
-        }
-
-        public Criteria andIdIsNotNull() {
-            addCriterion("id is not null");
-            return (Criteria) this;
-        }
-
-        public Criteria andIdEqualTo(Long value) {
-            addCriterion("id =", value, "id");
-            return (Criteria) this;
-        }
-
-        public Criteria andIdEqualToColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("id = ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andIdNotEqualTo(Long value) {
-            addCriterion("id <>", value, "id");
-            return (Criteria) this;
-        }
-
-        public Criteria andIdNotEqualToColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("id <> ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andIdGreaterThan(Long value) {
-            addCriterion("id >", value, "id");
-            return (Criteria) this;
-        }
-
-        public Criteria andIdGreaterThanColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("id > ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andIdGreaterThanOrEqualTo(Long value) {
-            addCriterion("id >=", value, "id");
-            return (Criteria) this;
-        }
-
-        public Criteria andIdGreaterThanOrEqualToColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("id >= ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andIdLessThan(Long value) {
-            addCriterion("id <", value, "id");
-            return (Criteria) this;
-        }
-
-        public Criteria andIdLessThanColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("id < ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andIdLessThanOrEqualTo(Long value) {
-            addCriterion("id <=", value, "id");
-            return (Criteria) this;
-        }
-
-        public Criteria andIdLessThanOrEqualToColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("id <= ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andIdIn(List<Long> values) {
-            addCriterion("id in", values, "id");
-            return (Criteria) this;
-        }
-
-        public Criteria andIdNotIn(List<Long> values) {
-            addCriterion("id not in", values, "id");
-            return (Criteria) this;
-        }
-
-        public Criteria andIdBetween(Long value1, Long value2) {
-            addCriterion("id between", value1, value2, "id");
-            return (Criteria) this;
-        }
-
-        public Criteria andIdNotBetween(Long value1, Long value2) {
-            addCriterion("id not between", value1, value2, "id");
-            return (Criteria) this;
-        }
-
-        public Criteria andFileNameIsNull() {
-            addCriterion("file_name is null");
-            return (Criteria) this;
-        }
-
-        public Criteria andFileNameIsNotNull() {
-            addCriterion("file_name is not null");
-            return (Criteria) this;
-        }
-
-        public Criteria andFileNameEqualTo(String value) {
-            addCriterion("file_name =", value, "fileName");
-            return (Criteria) this;
-        }
-
-        public Criteria andFileNameEqualToColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("file_name = ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andFileNameNotEqualTo(String value) {
-            addCriterion("file_name <>", value, "fileName");
-            return (Criteria) this;
-        }
-
-        public Criteria andFileNameNotEqualToColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("file_name <> ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andFileNameGreaterThan(String value) {
-            addCriterion("file_name >", value, "fileName");
-            return (Criteria) this;
-        }
-
-        public Criteria andFileNameGreaterThanColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("file_name > ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andFileNameGreaterThanOrEqualTo(String value) {
-            addCriterion("file_name >=", value, "fileName");
-            return (Criteria) this;
-        }
-
-        public Criteria andFileNameGreaterThanOrEqualToColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("file_name >= ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andFileNameLessThan(String value) {
-            addCriterion("file_name <", value, "fileName");
-            return (Criteria) this;
-        }
-
-        public Criteria andFileNameLessThanColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("file_name < ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andFileNameLessThanOrEqualTo(String value) {
-            addCriterion("file_name <=", value, "fileName");
-            return (Criteria) this;
-        }
-
-        public Criteria andFileNameLessThanOrEqualToColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("file_name <= ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andFileNameLike(String value) {
-            addCriterion("file_name like", value, "fileName");
-            return (Criteria) this;
-        }
-
-        public Criteria andFileNameNotLike(String value) {
-            addCriterion("file_name not like", value, "fileName");
-            return (Criteria) this;
-        }
-
-        public Criteria andFileNameIn(List<String> values) {
-            addCriterion("file_name in", values, "fileName");
-            return (Criteria) this;
-        }
-
-        public Criteria andFileNameNotIn(List<String> values) {
-            addCriterion("file_name not in", values, "fileName");
-            return (Criteria) this;
-        }
-
-        public Criteria andFileNameBetween(String value1, String value2) {
-            addCriterion("file_name between", value1, value2, "fileName");
-            return (Criteria) this;
-        }
-
-        public Criteria andFileNameNotBetween(String value1, String value2) {
-            addCriterion("file_name not between", value1, value2, "fileName");
-            return (Criteria) this;
-        }
-
-        public Criteria andLineNumIsNull() {
-            addCriterion("line_num is null");
-            return (Criteria) this;
-        }
-
-        public Criteria andLineNumIsNotNull() {
-            addCriterion("line_num is not null");
-            return (Criteria) this;
-        }
-
-        public Criteria andLineNumEqualTo(Integer value) {
-            addCriterion("line_num =", value, "lineNum");
-            return (Criteria) this;
-        }
-
-        public Criteria andLineNumEqualToColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("line_num = ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andLineNumNotEqualTo(Integer value) {
-            addCriterion("line_num <>", value, "lineNum");
-            return (Criteria) this;
-        }
-
-        public Criteria andLineNumNotEqualToColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("line_num <> ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andLineNumGreaterThan(Integer value) {
-            addCriterion("line_num >", value, "lineNum");
-            return (Criteria) this;
-        }
-
-        public Criteria andLineNumGreaterThanColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("line_num > ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andLineNumGreaterThanOrEqualTo(Integer value) {
-            addCriterion("line_num >=", value, "lineNum");
-            return (Criteria) this;
-        }
-
-        public Criteria andLineNumGreaterThanOrEqualToColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("line_num >= ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andLineNumLessThan(Integer value) {
-            addCriterion("line_num <", value, "lineNum");
-            return (Criteria) this;
-        }
-
-        public Criteria andLineNumLessThanColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("line_num < ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andLineNumLessThanOrEqualTo(Integer value) {
-            addCriterion("line_num <=", value, "lineNum");
-            return (Criteria) this;
-        }
-
-        public Criteria andLineNumLessThanOrEqualToColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("line_num <= ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andLineNumIn(List<Integer> values) {
-            addCriterion("line_num in", values, "lineNum");
-            return (Criteria) this;
-        }
-
-        public Criteria andLineNumNotIn(List<Integer> values) {
-            addCriterion("line_num not in", values, "lineNum");
-            return (Criteria) this;
-        }
-
-        public Criteria andLineNumBetween(Integer value1, Integer value2) {
-            addCriterion("line_num between", value1, value2, "lineNum");
-            return (Criteria) this;
-        }
-
-        public Criteria andLineNumNotBetween(Integer value1, Integer value2) {
-            addCriterion("line_num not between", value1, value2, "lineNum");
-            return (Criteria) this;
-        }
-
-        public Criteria andTxtIsNull() {
-            addCriterion("txt is null");
-            return (Criteria) this;
-        }
-
-        public Criteria andTxtIsNotNull() {
-            addCriterion("txt is not null");
-            return (Criteria) this;
-        }
-
-        public Criteria andTxtEqualTo(String value) {
-            addCriterion("txt =", value, "txt");
-            return (Criteria) this;
-        }
-
-        public Criteria andTxtEqualToColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("txt = ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andTxtNotEqualTo(String value) {
-            addCriterion("txt <>", value, "txt");
-            return (Criteria) this;
-        }
-
-        public Criteria andTxtNotEqualToColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("txt <> ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andTxtGreaterThan(String value) {
-            addCriterion("txt >", value, "txt");
-            return (Criteria) this;
-        }
-
-        public Criteria andTxtGreaterThanColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("txt > ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andTxtGreaterThanOrEqualTo(String value) {
-            addCriterion("txt >=", value, "txt");
-            return (Criteria) this;
-        }
-
-        public Criteria andTxtGreaterThanOrEqualToColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("txt >= ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andTxtLessThan(String value) {
-            addCriterion("txt <", value, "txt");
-            return (Criteria) this;
-        }
-
-        public Criteria andTxtLessThanColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("txt < ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andTxtLessThanOrEqualTo(String value) {
-            addCriterion("txt <=", value, "txt");
-            return (Criteria) this;
-        }
-
-        public Criteria andTxtLessThanOrEqualToColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("txt <= ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andTxtLike(String value) {
-            addCriterion("txt like", value, "txt");
-            return (Criteria) this;
-        }
-
-        public Criteria andTxtNotLike(String value) {
-            addCriterion("txt not like", value, "txt");
-            return (Criteria) this;
-        }
-
-        public Criteria andTxtIn(List<String> values) {
-            addCriterion("txt in", values, "txt");
-            return (Criteria) this;
-        }
-
-        public Criteria andTxtNotIn(List<String> values) {
-            addCriterion("txt not in", values, "txt");
-            return (Criteria) this;
-        }
-
-        public Criteria andTxtBetween(String value1, String value2) {
-            addCriterion("txt between", value1, value2, "txt");
-            return (Criteria) this;
-        }
-
-        public Criteria andTxtNotBetween(String value1, String value2) {
-            addCriterion("txt not between", value1, value2, "txt");
-            return (Criteria) this;
-        }
-
-        public Criteria andSimilarTxtIsNull() {
-            addCriterion("similar_txt is null");
-            return (Criteria) this;
-        }
-
-        public Criteria andSimilarTxtIsNotNull() {
-            addCriterion("similar_txt is not null");
-            return (Criteria) this;
-        }
-
-        public Criteria andSimilarTxtEqualTo(String value) {
-            addCriterion("similar_txt =", value, "similarTxt");
-            return (Criteria) this;
-        }
-
-        public Criteria andSimilarTxtEqualToColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("similar_txt = ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andSimilarTxtNotEqualTo(String value) {
-            addCriterion("similar_txt <>", value, "similarTxt");
-            return (Criteria) this;
-        }
-
-        public Criteria andSimilarTxtNotEqualToColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("similar_txt <> ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andSimilarTxtGreaterThan(String value) {
-            addCriterion("similar_txt >", value, "similarTxt");
-            return (Criteria) this;
-        }
-
-        public Criteria andSimilarTxtGreaterThanColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("similar_txt > ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andSimilarTxtGreaterThanOrEqualTo(String value) {
-            addCriterion("similar_txt >=", value, "similarTxt");
-            return (Criteria) this;
-        }
-
-        public Criteria andSimilarTxtGreaterThanOrEqualToColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("similar_txt >= ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andSimilarTxtLessThan(String value) {
-            addCriterion("similar_txt <", value, "similarTxt");
-            return (Criteria) this;
-        }
-
-        public Criteria andSimilarTxtLessThanColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("similar_txt < ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andSimilarTxtLessThanOrEqualTo(String value) {
-            addCriterion("similar_txt <=", value, "similarTxt");
-            return (Criteria) this;
-        }
-
-        public Criteria andSimilarTxtLessThanOrEqualToColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("similar_txt <= ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andSimilarTxtLike(String value) {
-            addCriterion("similar_txt like", value, "similarTxt");
-            return (Criteria) this;
-        }
-
-        public Criteria andSimilarTxtNotLike(String value) {
-            addCriterion("similar_txt not like", value, "similarTxt");
-            return (Criteria) this;
-        }
-
-        public Criteria andSimilarTxtIn(List<String> values) {
-            addCriterion("similar_txt in", values, "similarTxt");
-            return (Criteria) this;
-        }
-
-        public Criteria andSimilarTxtNotIn(List<String> values) {
-            addCriterion("similar_txt not in", values, "similarTxt");
-            return (Criteria) this;
-        }
-
-        public Criteria andSimilarTxtBetween(String value1, String value2) {
-            addCriterion("similar_txt between", value1, value2, "similarTxt");
-            return (Criteria) this;
-        }
-
-        public Criteria andSimilarTxtNotBetween(String value1, String value2) {
-            addCriterion("similar_txt not between", value1, value2, "similarTxt");
-            return (Criteria) this;
-        }
-
-        public Criteria andCommitTimeIsNull() {
-            addCriterion("commit_time is null");
-            return (Criteria) this;
-        }
-
-        public Criteria andCommitTimeIsNotNull() {
-            addCriterion("commit_time is not null");
-            return (Criteria) this;
-        }
-
-        public Criteria andCommitTimeEqualTo(Date value) {
-            addCriterion("commit_time =", value, "commitTime");
-            return (Criteria) this;
-        }
-
-        public Criteria andCommitTimeEqualToColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("commit_time = ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andCommitTimeNotEqualTo(Date value) {
-            addCriterion("commit_time <>", value, "commitTime");
-            return (Criteria) this;
-        }
-
-        public Criteria andCommitTimeNotEqualToColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("commit_time <> ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andCommitTimeGreaterThan(Date value) {
-            addCriterion("commit_time >", value, "commitTime");
-            return (Criteria) this;
-        }
-
-        public Criteria andCommitTimeGreaterThanColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("commit_time > ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andCommitTimeGreaterThanOrEqualTo(Date value) {
-            addCriterion("commit_time >=", value, "commitTime");
-            return (Criteria) this;
-        }
-
-        public Criteria andCommitTimeGreaterThanOrEqualToColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("commit_time >= ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andCommitTimeLessThan(Date value) {
-            addCriterion("commit_time <", value, "commitTime");
-            return (Criteria) this;
-        }
-
-        public Criteria andCommitTimeLessThanColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("commit_time < ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andCommitTimeLessThanOrEqualTo(Date value) {
-            addCriterion("commit_time <=", value, "commitTime");
-            return (Criteria) this;
-        }
-
-        public Criteria andCommitTimeLessThanOrEqualToColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("commit_time <= ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andCommitTimeIn(List<Date> values) {
-            addCriterion("commit_time in", values, "commitTime");
-            return (Criteria) this;
-        }
-
-        public Criteria andCommitTimeNotIn(List<Date> values) {
-            addCriterion("commit_time not in", values, "commitTime");
-            return (Criteria) this;
-        }
-
-        public Criteria andCommitTimeBetween(Date value1, Date value2) {
-            addCriterion("commit_time between", value1, value2, "commitTime");
-            return (Criteria) this;
-        }
-
-        public Criteria andCommitTimeNotBetween(Date value1, Date value2) {
-            addCriterion("commit_time not between", value1, value2, "commitTime");
-            return (Criteria) this;
-        }
-
-        public Criteria andTxtOptionIsNull() {
-            addCriterion("txt_option is null");
-            return (Criteria) this;
-        }
-
-        public Criteria andTxtOptionIsNotNull() {
-            addCriterion("txt_option is not null");
-            return (Criteria) this;
-        }
-
-        public Criteria andTxtOptionEqualTo(String value) {
-            addCriterion("txt_option =", value, "txtOption");
-            return (Criteria) this;
-        }
-
-        public Criteria andTxtOptionEqualToColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("txt_option = ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andTxtOptionNotEqualTo(String value) {
-            addCriterion("txt_option <>", value, "txtOption");
-            return (Criteria) this;
-        }
-
-        public Criteria andTxtOptionNotEqualToColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("txt_option <> ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andTxtOptionGreaterThan(String value) {
-            addCriterion("txt_option >", value, "txtOption");
-            return (Criteria) this;
-        }
-
-        public Criteria andTxtOptionGreaterThanColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("txt_option > ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andTxtOptionGreaterThanOrEqualTo(String value) {
-            addCriterion("txt_option >=", value, "txtOption");
-            return (Criteria) this;
-        }
-
-        public Criteria andTxtOptionGreaterThanOrEqualToColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("txt_option >= ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andTxtOptionLessThan(String value) {
-            addCriterion("txt_option <", value, "txtOption");
-            return (Criteria) this;
-        }
-
-        public Criteria andTxtOptionLessThanColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("txt_option < ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andTxtOptionLessThanOrEqualTo(String value) {
-            addCriterion("txt_option <=", value, "txtOption");
-            return (Criteria) this;
-        }
-
-        public Criteria andTxtOptionLessThanOrEqualToColumn(Similar.Column column) {
-            addCriterion(new StringBuilder("txt_option <= ").append(column.getEscapedColumnName()).toString());
-            return (Criteria) this;
-        }
-
-        public Criteria andTxtOptionLike(String value) {
-            addCriterion("txt_option like", value, "txtOption");
-            return (Criteria) this;
-        }
-
-        public Criteria andTxtOptionNotLike(String value) {
-            addCriterion("txt_option not like", value, "txtOption");
-            return (Criteria) this;
-        }
-
-        public Criteria andTxtOptionIn(List<String> values) {
-            addCriterion("txt_option in", values, "txtOption");
-            return (Criteria) this;
-        }
-
-        public Criteria andTxtOptionNotIn(List<String> values) {
-            addCriterion("txt_option not in", values, "txtOption");
-            return (Criteria) this;
-        }
-
-        public Criteria andTxtOptionBetween(String value1, String value2) {
-            addCriterion("txt_option between", value1, value2, "txtOption");
-            return (Criteria) this;
-        }
-
-        public Criteria andTxtOptionNotBetween(String value1, String value2) {
-            addCriterion("txt_option not between", value1, value2, "txtOption");
-            return (Criteria) this;
-        }
-    }
-
-    /**
-     * This class was generated by MyBatis Generator.
-     * This class corresponds to the database table similar
-     *
-     * @mbg.generated do_not_delete_during_merge Thu Aug 20 14:29:45 CST 2020
-     */
-    public static class Criteria extends GeneratedCriteria {
-        /**
-         * This field was generated by MyBatis Generator.
-         * This field corresponds to the database table similar
-         *
-         * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-         */
-        private SimilarExample example;
-
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method corresponds to the database table similar
-         *
-         * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-         */
-        protected Criteria(SimilarExample example) {
-            super();
-            this.example = example;
-        }
-
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method corresponds to the database table similar
-         *
-         * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-         */
-        public SimilarExample example() {
-            return this.example;
-        }
-
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method corresponds to the database table similar
-         *
-         * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-         */
-        @Deprecated
-        public Criteria andIf(boolean ifAdd, ICriteriaAdd add) {
-            if (ifAdd) {
-                add.add(this);
-            }
-            return this;
-        }
-
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method corresponds to the database table similar
-         *
-         * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-         */
-        public Criteria when(boolean condition, ICriteriaWhen then) {
-            if (condition) {
-                then.criteria(this);
-            }
-            return this;
-        }
-
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method corresponds to the database table similar
-         *
-         * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-         */
-        public Criteria when(boolean condition, ICriteriaWhen then, ICriteriaWhen otherwise) {
-            if (condition) {
-                then.criteria(this);
-            } else {
-                otherwise.criteria(this);
-            }
-            return this;
-        }
-
-        @Deprecated
-        public interface ICriteriaAdd {
-            /**
-             * This method was generated by MyBatis Generator.
-             * This method corresponds to the database table similar
-             *
-             * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-             */
-            Criteria add(Criteria add);
-        }
-    }
-
-    /**
-     * This class was generated by MyBatis Generator.
-     * This class corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    public static class Criterion {
-        private String condition;
-
-        private Object value;
-
-        private Object secondValue;
-
-        private boolean noValue;
-
-        private boolean singleValue;
-
-        private boolean betweenValue;
-
-        private boolean listValue;
-
-        private String typeHandler;
-
-        public String getCondition() {
-            return condition;
-        }
-
-        public Object getValue() {
-            return value;
-        }
-
-        public Object getSecondValue() {
-            return secondValue;
-        }
-
-        public boolean isNoValue() {
-            return noValue;
-        }
-
-        public boolean isSingleValue() {
-            return singleValue;
-        }
-
-        public boolean isBetweenValue() {
-            return betweenValue;
-        }
-
-        public boolean isListValue() {
-            return listValue;
-        }
-
-        public String getTypeHandler() {
-            return typeHandler;
-        }
-
-        protected Criterion(String condition) {
-            super();
-            this.condition = condition;
-            this.typeHandler = null;
-            this.noValue = true;
-        }
-
-        protected Criterion(String condition, Object value, String typeHandler) {
-            super();
-            this.condition = condition;
-            this.value = value;
-            this.typeHandler = typeHandler;
-            if (value instanceof List<?>) {
-                this.listValue = true;
-            } else {
-                this.singleValue = true;
-            }
-        }
-
-        protected Criterion(String condition, Object value) {
-            this(condition, value, null);
-        }
-
-        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
-            super();
-            this.condition = condition;
-            this.value = value;
-            this.secondValue = secondValue;
-            this.typeHandler = typeHandler;
-            this.betweenValue = true;
-        }
-
-        protected Criterion(String condition, Object value, Object secondValue) {
-            this(condition, value, secondValue, null);
-        }
-    }
-
-    public interface ICriteriaWhen {
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method corresponds to the database table similar
-         *
-         * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-         */
-        void criteria(Criteria criteria);
-    }
-
-    public interface IExampleWhen {
-        /**
-         * This method was generated by MyBatis Generator.
-         * This method corresponds to the database table similar
-         *
-         * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-         */
-        void example(com.alvin.dao.entity.example.SimilarExample example);
-    }
-}

+ 0 - 164
springboot-main/src/main/java/com/alvin/dao/mapper/SimilarMapper.java

@@ -1,164 +0,0 @@
-package com.alvin.dao.mapper;
-
-import com.alvin.dao.entity.Similar;
-import com.alvin.dao.entity.example.SimilarExample;
-import java.util.List;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-import org.springframework.stereotype.Repository;
-
-@Mapper
-@Repository
-public interface SimilarMapper {
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    long countByExample(SimilarExample example);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    int deleteByExample(SimilarExample example);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    int deleteByPrimaryKey(Long id);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    int insert(Similar record);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    int insertSelective(@Param("record") Similar record, @Param("selective") Similar.Column ... selective);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    Similar selectOneByExample(SimilarExample example);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    Similar selectOneByExampleSelective(@Param("example") SimilarExample example, @Param("selective") Similar.Column ... selective);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    List<Similar> selectByExampleSelective(@Param("example") SimilarExample example, @Param("selective") Similar.Column ... selective);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    List<Similar> selectByExample(SimilarExample example);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    Similar selectByPrimaryKeySelective(@Param("id") Long id, @Param("selective") Similar.Column ... selective);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    Similar selectByPrimaryKey(Long id);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    int updateByExampleSelective(@Param("record") Similar record, @Param("example") SimilarExample example, @Param("selective") Similar.Column ... selective);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    int updateByExample(@Param("record") Similar record, @Param("example") SimilarExample example);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    int updateByPrimaryKeySelective(@Param("record") Similar record, @Param("selective") Similar.Column ... selective);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    int updateByPrimaryKey(Similar record);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    int batchInsert(@Param("list") List<Similar> list);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    int batchInsertSelective(@Param("list") List<Similar> list, @Param("selective") Similar.Column ... selective);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    int upsert(Similar record);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table similar
-     *
-     * @mbg.generated Thu Aug 20 14:29:45 CST 2020
-     */
-    int upsertSelective(@Param("record") Similar record, @Param("selective") Similar.Column ... selective);
-}

+ 34 - 0
springboot-main/src/main/java/com/alvin/model/Person.java

@@ -0,0 +1,34 @@
+package com.alvin.model;
+
+import lombok.Data;
+
+import javax.persistence.*;
+import java.util.Date;
+
+@Data
+@Entity(name = "person")
+public class Person {
+    /**
+     * 主键id
+     * 主键自增 @GeneratedValue(strategy = GenerationType.IDENTITY)
+     * 主键不自增 @GeneratedValue
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Long id;
+
+    /**
+     * name
+     */
+    @Column(name = "name", length = 20)
+    private String name;
+
+    @Column(name = "age", nullable = false, length = 2)
+    private int age;
+
+    @Column(nullable = false, unique = true)
+    private String email;
+
+    @Column
+    private Date createTime;
+}

+ 15 - 0
springboot-main/src/main/java/com/alvin/repository/PersonRepository.java

@@ -0,0 +1,15 @@
+package com.alvin.repository;
+
+import com.alvin.model.Person;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.query.Param;
+
+public interface PersonRepository extends JpaRepository<Person, Long> {
+
+    @Query("select u from person u where u.name = :nickName")
+    Page<Person> findByNickName(@Param("nickName") String nickName, Pageable pageable);
+
+}

+ 8 - 17
springboot-main/src/main/resources/application-dev.yml

@@ -5,10 +5,9 @@ spring:
   datasource:
     type: com.alibaba.druid.pool.DruidDataSource
     driver-class-name: com.mysql.cj.jdbc.Driver
-    url: jdbc:mysql://ip-191:3306/biaozhu_medical_kg?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC
-    username: xxx
-    password: xxx
-    #下面为连接池补充设置
+    url: jdbc:mysql://soft.tianyunperfect.cn:3306/test?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC
+    username: root
+    password: tianyunali
     druid:
       initial-size: 5 # 初始化
       max-active: 5 # 最大
@@ -36,16 +35,8 @@ spring:
         allow: # 默认运行所有
         deny: # 默认即可
         reset-enable: true
-
-
-mybatis:
-  type-aliases-package: com.alvin.dao.entity
-  mapper-locations: classpath:mapper/*Mapper.xml
-
-
-# 设置debug模式下打印mysql
-logging:
-  level:
-    com:
-      alvin:
-        mapper: debug
+  jpa:
+    hibernate:
+      ddl-auto: update
+    show-sql: true
+    database-platform: org.hibernate.dialect.MySQL5InnoDBDialect

+ 1 - 0
springboot-main/src/main/resources/log4j2.component.properties

@@ -0,0 +1 @@
+Log4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector

+ 0 - 667
springboot-main/src/main/resources/mapper/SimilarMapper.xml

@@ -1,667 +0,0 @@
-<?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.alvin.dao.mapper.SimilarMapper">
-  <resultMap id="BaseResultMap" type="com.alvin.dao.entity.Similar">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 20 14:29:45 CST 2020.
-    -->
-    <id column="id" jdbcType="BIGINT" property="id" />
-    <result column="file_name" jdbcType="VARCHAR" property="fileName" />
-    <result column="line_num" jdbcType="INTEGER" property="lineNum" />
-    <result column="txt" jdbcType="VARCHAR" property="txt" />
-    <result column="similar_txt" jdbcType="VARCHAR" property="similarTxt" />
-    <result column="commit_time" jdbcType="TIMESTAMP" property="commitTime" />
-    <result column="txt_option" jdbcType="VARCHAR" property="txtOption" />
-  </resultMap>
-  <sql id="Example_Where_Clause">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 20 14:29:45 CST 2020.
-    -->
-    <where>
-      <foreach collection="oredCriteria" item="criteria" separator="or">
-        <if test="criteria.valid">
-          <trim prefix="(" prefixOverrides="and" suffix=")">
-            <foreach collection="criteria.criteria" item="criterion">
-              <choose>
-                <when test="criterion.noValue">
-                  and ${criterion.condition}
-                </when>
-                <when test="criterion.singleValue">
-                  and ${criterion.condition} #{criterion.value}
-                </when>
-                <when test="criterion.betweenValue">
-                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
-                </when>
-                <when test="criterion.listValue">
-                  and ${criterion.condition}
-                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
-                    #{listItem}
-                  </foreach>
-                </when>
-              </choose>
-            </foreach>
-          </trim>
-        </if>
-      </foreach>
-    </where>
-  </sql>
-  <sql id="Update_By_Example_Where_Clause">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 20 14:29:45 CST 2020.
-    -->
-    <where>
-      <foreach collection="example.oredCriteria" item="criteria" separator="or">
-        <if test="criteria.valid">
-          <trim prefix="(" prefixOverrides="and" suffix=")">
-            <foreach collection="criteria.criteria" item="criterion">
-              <choose>
-                <when test="criterion.noValue">
-                  and ${criterion.condition}
-                </when>
-                <when test="criterion.singleValue">
-                  and ${criterion.condition} #{criterion.value}
-                </when>
-                <when test="criterion.betweenValue">
-                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
-                </when>
-                <when test="criterion.listValue">
-                  and ${criterion.condition}
-                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
-                    #{listItem}
-                  </foreach>
-                </when>
-              </choose>
-            </foreach>
-          </trim>
-        </if>
-      </foreach>
-    </where>
-  </sql>
-  <sql id="Base_Column_List">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 20 14:29:45 CST 2020.
-    -->
-    id, file_name, line_num, txt, similar_txt, commit_time, txt_option
-  </sql>
-  <select id="selectByExample" parameterType="com.alvin.dao.entity.example.SimilarExample" resultMap="BaseResultMap">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 20 14:29:45 CST 2020.
-    -->
-    select
-    <if test="distinct">
-      distinct
-    </if>
-    <include refid="Base_Column_List" />
-    from similar
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-    <if test="orderByClause != null">
-      order by ${orderByClause}
-    </if>
-    <if test="rows != null">
-      <if test="offset != null">
-        limit ${offset}, ${rows}
-      </if>
-      <if test="offset == null">
-        limit ${rows}
-      </if>
-    </if>
-  </select>
-  <select id="selectByExampleSelective" parameterType="map" resultMap="BaseResultMap">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 20 14:29:45 CST 2020.
-    -->
-    select
-    <if test="example != null and example.distinct">
-      distinct
-    </if>
-    <choose>
-      <when test="selective != null and selective.length &gt; 0">
-        <foreach collection="selective" item="column" separator=",">
-          ${column.aliasedEscapedColumnName}
-        </foreach>
-      </when>
-      <otherwise>
-        <include refid="Base_Column_List" />
-      </otherwise>
-    </choose>
-    from similar
-    <if test="example != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-    <if test="example != null and example.orderByClause != null">
-      order by ${example.orderByClause}
-    </if>
-    <if test="example != null and example.rows != null">
-      <if test="example.offset != null">
-        limit ${example.offset}, ${example.rows}
-      </if>
-      <if test="example.offset == null">
-        limit ${example.rows}
-      </if>
-    </if>
-  </select>
-  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 20 14:29:45 CST 2020.
-    -->
-    select 
-    <include refid="Base_Column_List" />
-    from similar
-    where id = #{id,jdbcType=BIGINT}
-  </select>
-  <select id="selectByPrimaryKeySelective" parameterType="map" resultMap="BaseResultMap">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 20 14:29:45 CST 2020.
-    -->
-    select
-    <choose>
-      <when test="selective != null and selective.length &gt; 0">
-        <foreach collection="selective" item="column" separator=",">
-          ${column.aliasedEscapedColumnName}
-        </foreach>
-      </when>
-      <otherwise>
-        <include refid="Base_Column_List" />
-      </otherwise>
-    </choose>
-    from similar
-    where id = #{id,jdbcType=BIGINT}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 20 14:29:45 CST 2020.
-    -->
-    delete from similar
-    where id = #{id,jdbcType=BIGINT}
-  </delete>
-  <delete id="deleteByExample" parameterType="com.alvin.dao.entity.example.SimilarExample">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 20 14:29:45 CST 2020.
-    -->
-    delete from similar
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-  </delete>
-  <insert id="insert" parameterType="com.alvin.dao.entity.Similar">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 20 14:29:45 CST 2020.
-    -->
-    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
-      SELECT LAST_INSERT_ID()
-    </selectKey>
-    insert into similar (file_name, line_num, txt, 
-      similar_txt, commit_time, txt_option
-      )
-    values (#{fileName,jdbcType=VARCHAR}, #{lineNum,jdbcType=INTEGER}, #{txt,jdbcType=VARCHAR}, 
-      #{similarTxt,jdbcType=VARCHAR}, #{commitTime,jdbcType=TIMESTAMP}, #{txtOption,jdbcType=VARCHAR}
-      )
-  </insert>
-  <insert id="insertSelective" parameterType="map">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 20 14:29:45 CST 2020.
-    -->
-    <selectKey keyProperty="record.id" order="AFTER" resultType="java.lang.Long">
-      SELECT LAST_INSERT_ID()
-    </selectKey>
-    insert into similar
-    <choose>
-      <when test="selective != null and selective.length &gt; 0">
-        <foreach close=")" collection="selective" item="column" open="(" separator=",">
-          ${column.escapedColumnName}
-        </foreach>
-      </when>
-      <otherwise>
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-          <if test="record.fileName != null">
-            file_name,
-          </if>
-          <if test="record.lineNum != null">
-            line_num,
-          </if>
-          <if test="record.txt != null">
-            txt,
-          </if>
-          <if test="record.similarTxt != null">
-            similar_txt,
-          </if>
-          <if test="record.commitTime != null">
-            commit_time,
-          </if>
-          <if test="record.txtOption != null">
-            txt_option,
-          </if>
-        </trim>
-        <trim prefix="(" suffix=")" suffixOverrides="," />
-      </otherwise>
-    </choose>
-    values
-    <choose>
-      <when test="selective != null and selective.length &gt; 0">
-        <foreach close=")" collection="selective" item="column" open="(" separator=",">
-          #{record.${column.javaProperty},jdbcType=${column.jdbcType}}
-        </foreach>
-      </when>
-      <otherwise>
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-          <if test="record.fileName != null">
-            #{record.fileName,jdbcType=VARCHAR},
-          </if>
-          <if test="record.lineNum != null">
-            #{record.lineNum,jdbcType=INTEGER},
-          </if>
-          <if test="record.txt != null">
-            #{record.txt,jdbcType=VARCHAR},
-          </if>
-          <if test="record.similarTxt != null">
-            #{record.similarTxt,jdbcType=VARCHAR},
-          </if>
-          <if test="record.commitTime != null">
-            #{record.commitTime,jdbcType=TIMESTAMP},
-          </if>
-          <if test="record.txtOption != null">
-            #{record.txtOption,jdbcType=VARCHAR},
-          </if>
-        </trim>
-      </otherwise>
-    </choose>
-  </insert>
-  <select id="countByExample" parameterType="com.alvin.dao.entity.example.SimilarExample" resultType="java.lang.Long">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 20 14:29:45 CST 2020.
-    -->
-    select count(*) from similar
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-  </select>
-  <update id="updateByExampleSelective" parameterType="map">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 20 14:29:45 CST 2020.
-    -->
-    update similar
-    SET
-    <choose>
-      <when test="selective != null and selective.length &gt; 0">
-        <foreach collection="selective" item="column" separator=",">
-          ${column.escapedColumnName} = #{record.${column.javaProperty},jdbcType=${column.jdbcType}}
-        </foreach>
-      </when>
-      <otherwise>
-        <trim suffixOverrides=",">
-          <if test="record.id != null">
-            id = #{record.id,jdbcType=BIGINT},
-          </if>
-          <if test="record.fileName != null">
-            file_name = #{record.fileName,jdbcType=VARCHAR},
-          </if>
-          <if test="record.lineNum != null">
-            line_num = #{record.lineNum,jdbcType=INTEGER},
-          </if>
-          <if test="record.txt != null">
-            txt = #{record.txt,jdbcType=VARCHAR},
-          </if>
-          <if test="record.similarTxt != null">
-            similar_txt = #{record.similarTxt,jdbcType=VARCHAR},
-          </if>
-          <if test="record.commitTime != null">
-            commit_time = #{record.commitTime,jdbcType=TIMESTAMP},
-          </if>
-          <if test="record.txtOption != null">
-            txt_option = #{record.txtOption,jdbcType=VARCHAR},
-          </if>
-        </trim>
-      </otherwise>
-    </choose>
-    <if test="_parameter != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-  </update>
-  <update id="updateByExample" parameterType="map">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 20 14:29:45 CST 2020.
-    -->
-    update similar
-    set id = #{record.id,jdbcType=BIGINT},
-      file_name = #{record.fileName,jdbcType=VARCHAR},
-      line_num = #{record.lineNum,jdbcType=INTEGER},
-      txt = #{record.txt,jdbcType=VARCHAR},
-      similar_txt = #{record.similarTxt,jdbcType=VARCHAR},
-      commit_time = #{record.commitTime,jdbcType=TIMESTAMP},
-      txt_option = #{record.txtOption,jdbcType=VARCHAR}
-    <if test="_parameter != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-  </update>
-  <update id="updateByPrimaryKeySelective" parameterType="map">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 20 14:29:45 CST 2020.
-    -->
-    update similar
-    SET
-    <choose>
-      <when test="selective != null and selective.length &gt; 0">
-        <foreach collection="selective" item="column" separator=",">
-          ${column.escapedColumnName} = #{record.${column.javaProperty},jdbcType=${column.jdbcType}}
-        </foreach>
-      </when>
-      <otherwise>
-        <trim suffixOverrides=",">
-          <if test="record.fileName != null">
-            file_name = #{record.fileName,jdbcType=VARCHAR},
-          </if>
-          <if test="record.lineNum != null">
-            line_num = #{record.lineNum,jdbcType=INTEGER},
-          </if>
-          <if test="record.txt != null">
-            txt = #{record.txt,jdbcType=VARCHAR},
-          </if>
-          <if test="record.similarTxt != null">
-            similar_txt = #{record.similarTxt,jdbcType=VARCHAR},
-          </if>
-          <if test="record.commitTime != null">
-            commit_time = #{record.commitTime,jdbcType=TIMESTAMP},
-          </if>
-          <if test="record.txtOption != null">
-            txt_option = #{record.txtOption,jdbcType=VARCHAR},
-          </if>
-        </trim>
-      </otherwise>
-    </choose>
-    where id = #{record.id,jdbcType=BIGINT}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.alvin.dao.entity.Similar">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 20 14:29:45 CST 2020.
-    -->
-    update similar
-    set file_name = #{fileName,jdbcType=VARCHAR},
-      line_num = #{lineNum,jdbcType=INTEGER},
-      txt = #{txt,jdbcType=VARCHAR},
-      similar_txt = #{similarTxt,jdbcType=VARCHAR},
-      commit_time = #{commitTime,jdbcType=TIMESTAMP},
-      txt_option = #{txtOption,jdbcType=VARCHAR}
-    where id = #{id,jdbcType=BIGINT}
-  </update>
-  <select id="selectOneByExample" parameterType="com.alvin.dao.entity.example.SimilarExample" resultMap="BaseResultMap">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 20 14:29:45 CST 2020.
-    -->
-    select
-    <include refid="Base_Column_List" />
-    from similar
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-    <if test="orderByClause != null">
-      order by ${orderByClause}
-    </if>
-    limit 1
-  </select>
-  <select id="selectOneByExampleSelective" parameterType="map" resultMap="BaseResultMap">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 20 14:29:45 CST 2020.
-    -->
-    select
-    <choose>
-      <when test="selective != null and selective.length &gt; 0">
-        <foreach collection="selective" item="column" separator=",">
-          ${column.aliasedEscapedColumnName}
-        </foreach>
-      </when>
-      <otherwise>
-        <include refid="Base_Column_List" />
-      </otherwise>
-    </choose>
-    from similar
-    <if test="example != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-    <if test="example != null and example.orderByClause != null">
-      order by ${example.orderByClause}
-    </if>
-    limit 1
-  </select>
-  <insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 20 14:29:45 CST 2020.
-    -->
-    insert into similar
-    (file_name, line_num, txt, similar_txt, commit_time, txt_option)
-    values
-    <foreach collection="list" item="item" separator=",">
-      (#{item.fileName,jdbcType=VARCHAR}, #{item.lineNum,jdbcType=INTEGER}, #{item.txt,jdbcType=VARCHAR}, 
-        #{item.similarTxt,jdbcType=VARCHAR}, #{item.commitTime,jdbcType=TIMESTAMP}, #{item.txtOption,jdbcType=VARCHAR}
-        )
-    </foreach>
-  </insert>
-  <insert id="batchInsertSelective" keyColumn="id" keyProperty="list.id" parameterType="map" useGeneratedKeys="true">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 20 14:29:45 CST 2020.
-    -->
-    insert into similar (
-    <foreach collection="selective" item="column" separator=",">
-      ${column.escapedColumnName}
-    </foreach>
-    )
-    values
-    <foreach collection="list" item="item" separator=",">
-      (
-      <foreach collection="selective" item="column" separator=",">
-        <if test="'file_name'.toString() == column.value">
-          #{item.fileName,jdbcType=VARCHAR}
-        </if>
-        <if test="'line_num'.toString() == column.value">
-          #{item.lineNum,jdbcType=INTEGER}
-        </if>
-        <if test="'txt'.toString() == column.value">
-          #{item.txt,jdbcType=VARCHAR}
-        </if>
-        <if test="'similar_txt'.toString() == column.value">
-          #{item.similarTxt,jdbcType=VARCHAR}
-        </if>
-        <if test="'commit_time'.toString() == column.value">
-          #{item.commitTime,jdbcType=TIMESTAMP}
-        </if>
-        <if test="'txt_option'.toString() == column.value">
-          #{item.txtOption,jdbcType=VARCHAR}
-        </if>
-      </foreach>
-      )
-    </foreach>
-  </insert>
-  <insert id="upsertSelective" keyColumn="id" keyProperty="record.id" parameterType="map" useGeneratedKeys="true">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 20 14:29:45 CST 2020.
-    -->
-    insert into similar
-    <choose>
-      <when test="selective != null and selective.length &gt; 0">
-        <foreach close=")" collection="selective" item="column" open="(" separator=",">
-          ${column.escapedColumnName}
-        </foreach>
-      </when>
-      <otherwise>
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-          <if test="record.id != null">
-            id,
-          </if>
-          <if test="record.fileName != null">
-            file_name,
-          </if>
-          <if test="record.lineNum != null">
-            line_num,
-          </if>
-          <if test="record.txt != null">
-            txt,
-          </if>
-          <if test="record.similarTxt != null">
-            similar_txt,
-          </if>
-          <if test="record.commitTime != null">
-            commit_time,
-          </if>
-          <if test="record.txtOption != null">
-            txt_option,
-          </if>
-        </trim>
-        <trim prefix="(" suffix=")" suffixOverrides="," />
-      </otherwise>
-    </choose>
-    values
-    <choose>
-      <when test="selective != null and selective.length &gt; 0">
-        <foreach close=")" collection="selective" item="column" open="(" separator=",">
-          #{record.${column.javaProperty},jdbcType=${column.jdbcType}}
-        </foreach>
-      </when>
-      <otherwise>
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-          <if test="record.id != null">
-            #{record.id,jdbcType=BIGINT},
-          </if>
-          <if test="record.fileName != null">
-            #{record.fileName,jdbcType=VARCHAR},
-          </if>
-          <if test="record.lineNum != null">
-            #{record.lineNum,jdbcType=INTEGER},
-          </if>
-          <if test="record.txt != null">
-            #{record.txt,jdbcType=VARCHAR},
-          </if>
-          <if test="record.similarTxt != null">
-            #{record.similarTxt,jdbcType=VARCHAR},
-          </if>
-          <if test="record.commitTime != null">
-            #{record.commitTime,jdbcType=TIMESTAMP},
-          </if>
-          <if test="record.txtOption != null">
-            #{record.txtOption,jdbcType=VARCHAR},
-          </if>
-        </trim>
-      </otherwise>
-    </choose>
-    on duplicate key update 
-    <choose>
-      <when test="selective != null and selective.length &gt; 0">
-        <foreach collection="selective" item="column" separator=",">
-          ${column.escapedColumnName} = #{record.${column.javaProperty},jdbcType=${column.jdbcType}}
-        </foreach>
-      </when>
-      <otherwise>
-        <trim suffixOverrides=",">
-          <if test="record.id != null">
-            id = #{record.id,jdbcType=BIGINT},
-          </if>
-          <if test="record.fileName != null">
-            file_name = #{record.fileName,jdbcType=VARCHAR},
-          </if>
-          <if test="record.lineNum != null">
-            line_num = #{record.lineNum,jdbcType=INTEGER},
-          </if>
-          <if test="record.txt != null">
-            txt = #{record.txt,jdbcType=VARCHAR},
-          </if>
-          <if test="record.similarTxt != null">
-            similar_txt = #{record.similarTxt,jdbcType=VARCHAR},
-          </if>
-          <if test="record.commitTime != null">
-            commit_time = #{record.commitTime,jdbcType=TIMESTAMP},
-          </if>
-          <if test="record.txtOption != null">
-            txt_option = #{record.txtOption,jdbcType=VARCHAR},
-          </if>
-        </trim>
-      </otherwise>
-    </choose>
-  </insert>
-  <insert id="upsert" keyColumn="id" keyProperty="id" parameterType="com.alvin.dao.entity.Similar" useGeneratedKeys="true">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 20 14:29:45 CST 2020.
-    -->
-    insert into similar
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        id,
-      </if>
-      file_name,
-      line_num,
-      txt,
-      similar_txt,
-      commit_time,
-      txt_option,
-    </trim>
-    values
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        #{id,jdbcType=BIGINT},
-      </if>
-      #{fileName,jdbcType=VARCHAR},
-      #{lineNum,jdbcType=INTEGER},
-      #{txt,jdbcType=VARCHAR},
-      #{similarTxt,jdbcType=VARCHAR},
-      #{commitTime,jdbcType=TIMESTAMP},
-      #{txtOption,jdbcType=VARCHAR},
-    </trim>
-    on duplicate key update 
-    <trim suffixOverrides=",">
-      <if test="id != null">
-        id = #{id,jdbcType=BIGINT},
-      </if>
-      file_name = #{fileName,jdbcType=VARCHAR},
-      line_num = #{lineNum,jdbcType=INTEGER},
-      txt = #{txt,jdbcType=VARCHAR},
-      similar_txt = #{similarTxt,jdbcType=VARCHAR},
-      commit_time = #{commitTime,jdbcType=TIMESTAMP},
-      txt_option = #{txtOption,jdbcType=VARCHAR},
-    </trim>
-  </insert>
-</mapper>

+ 0 - 128
springboot-main/src/main/resources/mybatis-generator.xml

@@ -1,128 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE generatorConfiguration
-        PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
-        "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
-
-<generatorConfiguration>
-
-    <context id="MySql" defaultModelType="flat">
-
-        <!--搜索:need to change-->
-
-        <!-- 查询单条数据插件 -->
-        <plugin type="com.itfsw.mybatis.generator.plugins.SelectOneByExamplePlugin"/>
-
-        <!-- MySQL分页插件 -->
-        <plugin type="com.itfsw.mybatis.generator.plugins.LimitPlugin">
-            <!-- 通过配置startPage影响Example中的page方法开始分页的页码,默认分页从0开始 -->
-            <property name="startPage" value="0"/>
-        </plugin>
-
-        <!-- Example Criteria 增强插件 -->
-        <plugin type="com.itfsw.mybatis.generator.plugins.ExampleEnhancedPlugin">
-            <!-- 是否支持已经过时的andIf方法(推荐使用when代替),默认支持 -->
-            <property name="enableAndIf" value="true"/>
-        </plugin>
-
-        <!-- Example 目标包修改插件 need to change-->
-        <plugin type="com.itfsw.mybatis.generator.plugins.ExampleTargetPlugin">
-            <!-- 修改Example类生成到目标包下 -->
-            <property name="targetPackage" value="com.alvin.dao.entity.example"/>
-        </plugin>
-
-        <!-- 数据Model属性对应Column获取插件 -->
-        <plugin type="com.itfsw.mybatis.generator.plugins.ModelColumnPlugin"/>
-
-        <!-- 数据Model链式构建插件 -->
-        <plugin type="com.itfsw.mybatis.generator.plugins.ModelBuilderPlugin"/>
-
-        <!-- 批量插入插件 -->
-        <plugin type="com.itfsw.mybatis.generator.plugins.BatchInsertPlugin">
-            <!--
-            开启后可以实现官方插件根据属性是否为空决定是否插入该字段功能
-            !需开启allowMultiQueries=true多条sql提交操作,所以不建议使用!插件默认不开启
-            -->
-            <property name="allowMultiQueries" value="false"/>
-        </plugin>
-
-        <!-- 存在即更新插件 -->
-        <plugin type="com.itfsw.mybatis.generator.plugins.UpsertPlugin">
-            <!--
-            支持upsertByExample,upsertByExampleSelective操作
-            !需开启allowMultiQueries=true多条sql提交操作,所以不建议使用!插件默认不开启
-            -->
-            <property name="allowMultiQueries" value="false"/>
-            <!--
-            开启批量功能,支持batchUpsert,batchUpsertWithBLOBs,batchUpserSelective
-            !这几个方法中无法支持IncrementsPlugin的方法!插件默认不开启
-            -->
-            <property name="allowBatchUpsert" value="fasle"/>
-        </plugin>
-
-        <!-- 增量插件 -->
-        <plugin type="com.itfsw.mybatis.generator.plugins.IncrementPlugin"/>
-
-        <!--<table tableName="tb">-->
-        <!--&lt;!&ndash; 配置需要进行增量操作的列名称(英文半角逗号分隔) &ndash;&gt;-->
-        <!--<property name="incrementColumns" value="field1,field2"/>-->
-        <!--</table>-->
-
-        <!-- 查询结果选择性返回插件 -->
-        <plugin type="com.itfsw.mybatis.generator.plugins.SelectSelectivePlugin"/>
-
-        <!-- Selective选择插入更新增强插件 -->
-        <plugin type="com.itfsw.mybatis.generator.plugins.SelectiveEnhancedPlugin"/>
-
-        <!-- Lombok插件 -->
-        <plugin type="com.itfsw.mybatis.generator.plugins.LombokPlugin">
-            <!-- @Data 默认开启,同时插件会对子类自动附加@EqualsAndHashCode(callSuper = true),@ToString(callSuper = true) -->
-            <property name="@Data" value="true"/>
-            <!-- @Builder 必须在 Lombok 版本 >= 1.18.2 的情况下开启,对存在继承关系的类自动替换成@SuperBuilder -->
-            <property name="@Builder" value="false"/>
-            <!-- @NoArgsConstructor 和 @AllArgsConstructor 使用规则和Lombok一致 -->
-            <property name="@AllArgsConstructor" value="false"/>
-            <property name="@NoArgsConstructor" value="false"/>
-            <!-- @Getter、@Setter、@Accessors 等使用规则参见官方文档 -->
-            <property name="@Accessors(chain = true)" value="false"/>
-            <!-- 临时解决IDEA工具对@SuperBuilder的不支持问题,开启后(默认未开启)插件在遇到@SuperBuilder注解时会调用ModelBuilderPlugin来生成相应的builder代码 -->
-            <property name="supportSuperBuilderForIdea" value="false"/>
-        </plugin>
-
-        <plugin type="org.mybatis.generator.plugins.SerializablePlugin"/>
-
-        <!-- Mapper注解插件 -->
-        <plugin type="com.itfsw.mybatis.generator.plugins.MapperAnnotationPlugin">
-            <!-- @Mapper 默认开启 -->
-            <property name="@Mapper" value="true"/>
-            <!-- @Repository 默认关闭,开启后解决IDEA工具@Autowired报错 -->
-            <property name="@Repository" value="true"/>
-        </plugin>
-
-        <!--<plugin type="org.mybatis.generator.plugins.ToStringPlugin" />-->
-
-        <!--数据库连接配置 need to change-->
-        <jdbcConnection
-                driverClass="com.mysql.cj.jdbc.Driver"
-                connectionURL="jdbc:mysql://ip-191:3306/biaozhu_medical_kg?nullCatalogMeansCurrent=true&amp;serverTimezone=UTC"
-                userId="xxx"
-                password="xxx"/>
-
-        <!--指定自动生成的 POJO置于哪个包下 need to change -->
-        <javaModelGenerator targetPackage="com.alvin.dao.entity"
-                            targetProject="src/main/java"/>
-
-        <!--指定自动生成的 mapper.xml置于哪个包下 -->
-        <sqlMapGenerator targetPackage="mapper" targetProject="src/main/resources"/>
-
-        <!--指定自动生成的 DAO接口置于哪个包下 need to change-->
-        <javaClientGenerator targetPackage="com.alvin.dao.mapper"
-                             targetProject="src/main/java" type="XMLMAPPER"/>
-
-        <!--指定数据表名,可以使用_和%通配符,可以配置generatedKey,会返回insert之后的id-->
-        <table tableName="similar">
-            <generatedKey column="id" sqlStatement="MySql" identity="true"/>
-        </table>
-
-    </context>
-
-</generatorConfiguration>

+ 27 - 0
springboot-main/src/test/java/com/alvin/controller/AppControllerTest.java

@@ -1,12 +1,27 @@
 package com.alvin.controller;
 
+import com.alvin.model.Person;
+import com.alvin.model.QPerson;
+import com.alvin.repository.PersonRepository;
+import com.querydsl.core.types.dsl.BooleanExpression;
+import com.querydsl.jpa.impl.JPAQueryFactory;
 import lombok.extern.slf4j.Slf4j;
 import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.PageRequest;
+import org.springframework.data.domain.Sort;
+import org.springframework.data.jpa.domain.Specification;
 import org.springframework.http.MediaType;
 import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
 import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
 
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Predicate;
+import javax.persistence.criteria.Root;
+import java.util.ArrayList;
 import java.util.Date;
+import java.util.List;
 
 @Slf4j
 public class AppControllerTest extends TestBase {
@@ -26,4 +41,16 @@ public class AppControllerTest extends TestBase {
     public void testLog() {
         log.info(new Date().toString());
     }
+
+    @Autowired
+    private PersonRepository personRepository;
+
+    @Autowired
+    private JPAQueryFactory queryFactory;
+
+    @Test
+    public void test() {
+        QPerson query = QPerson.person;
+        //queryFactory.select(query.id,query.age).from(query)
+    }
 }