Parcourir la source

- 修改自定义书籍上传功能,完善书籍初始化的非空字段。
还没有测试

tianyunperfect il y a 3 ans
Parent
commit
177e1957ec

+ 63 - 40
book-dao/src/main/java/com/book/dao/cps/entity/UploadBook.java

@@ -12,7 +12,7 @@ public class UploadBook implements Serializable {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database column upload_book.id
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     private Long id;
 
@@ -21,7 +21,7 @@ public class UploadBook implements Serializable {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database column upload_book.book_id
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     private Long bookId;
 
@@ -30,7 +30,7 @@ public class UploadBook implements Serializable {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database column upload_book.chapter_name
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     private String chapterName;
 
@@ -39,7 +39,7 @@ public class UploadBook implements Serializable {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database column upload_book.create_time
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     private Integer createTime;
 
@@ -48,7 +48,7 @@ public class UploadBook implements Serializable {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database column upload_book.update_time
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     private Integer updateTime;
 
@@ -57,7 +57,7 @@ public class UploadBook implements Serializable {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database column upload_book.words
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     private Integer words;
 
@@ -66,16 +66,25 @@ public class UploadBook implements Serializable {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database column upload_book.read_able
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     private Integer readAble;
 
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column upload_book.chapter_id
+     *
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
+     */
+    private Long chapterId;
+
     /**
      *
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database column upload_book.content
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     private String content;
 
@@ -83,7 +92,7 @@ public class UploadBook implements Serializable {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     private static final long serialVersionUID = 1L;
 
@@ -91,7 +100,7 @@ public class UploadBook implements Serializable {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     public static UploadBook.Builder builder() {
         return new UploadBook.Builder();
@@ -101,14 +110,14 @@ public class UploadBook implements Serializable {
      * This class was generated by MyBatis Generator.
      * This class corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     public static class Builder {
         /**
          * This field was generated by MyBatis Generator.
          * This field corresponds to the database table upload_book
          *
-         * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+         * @mbg.generated Thu Aug 26 23:53:37 CST 2021
          */
         private UploadBook obj;
 
@@ -116,7 +125,7 @@ public class UploadBook implements Serializable {
          * This method was generated by MyBatis Generator.
          * This method corresponds to the database table upload_book
          *
-         * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+         * @mbg.generated Thu Aug 26 23:53:37 CST 2021
          */
         public Builder() {
             this.obj = new UploadBook();
@@ -128,7 +137,7 @@ public class UploadBook implements Serializable {
          *
          * @param id the value for upload_book.id
          *
-         * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+         * @mbg.generated Thu Aug 26 23:53:37 CST 2021
          */
         public Builder id(Long id) {
             obj.setId(id);
@@ -141,7 +150,7 @@ public class UploadBook implements Serializable {
          *
          * @param bookId the value for upload_book.book_id
          *
-         * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+         * @mbg.generated Thu Aug 26 23:53:37 CST 2021
          */
         public Builder bookId(Long bookId) {
             obj.setBookId(bookId);
@@ -154,7 +163,7 @@ public class UploadBook implements Serializable {
          *
          * @param chapterName the value for upload_book.chapter_name
          *
-         * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+         * @mbg.generated Thu Aug 26 23:53:37 CST 2021
          */
         public Builder chapterName(String chapterName) {
             obj.setChapterName(chapterName);
@@ -167,7 +176,7 @@ public class UploadBook implements Serializable {
          *
          * @param createTime the value for upload_book.create_time
          *
-         * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+         * @mbg.generated Thu Aug 26 23:53:37 CST 2021
          */
         public Builder createTime(Integer createTime) {
             obj.setCreateTime(createTime);
@@ -180,7 +189,7 @@ public class UploadBook implements Serializable {
          *
          * @param updateTime the value for upload_book.update_time
          *
-         * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+         * @mbg.generated Thu Aug 26 23:53:37 CST 2021
          */
         public Builder updateTime(Integer updateTime) {
             obj.setUpdateTime(updateTime);
@@ -193,7 +202,7 @@ public class UploadBook implements Serializable {
          *
          * @param words the value for upload_book.words
          *
-         * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+         * @mbg.generated Thu Aug 26 23:53:37 CST 2021
          */
         public Builder words(Integer words) {
             obj.setWords(words);
@@ -206,20 +215,33 @@ public class UploadBook implements Serializable {
          *
          * @param readAble the value for upload_book.read_able
          *
-         * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+         * @mbg.generated Thu Aug 26 23:53:37 CST 2021
          */
         public Builder readAble(Integer readAble) {
             obj.setReadAble(readAble);
             return this;
         }
 
+        /**
+         * This method was generated by MyBatis Generator.
+         * This method sets the value of the database column upload_book.chapter_id
+         *
+         * @param chapterId the value for upload_book.chapter_id
+         *
+         * @mbg.generated Thu Aug 26 23:53:37 CST 2021
+         */
+        public Builder chapterId(Long chapterId) {
+            obj.setChapterId(chapterId);
+            return this;
+        }
+
         /**
          * This method was generated by MyBatis Generator.
          * This method sets the value of the database column upload_book.content
          *
          * @param content the value for upload_book.content
          *
-         * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+         * @mbg.generated Thu Aug 26 23:53:37 CST 2021
          */
         public Builder content(String content) {
             obj.setContent(content);
@@ -230,7 +252,7 @@ public class UploadBook implements Serializable {
          * This method was generated by MyBatis Generator.
          * This method corresponds to the database table upload_book
          *
-         * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+         * @mbg.generated Thu Aug 26 23:53:37 CST 2021
          */
         public UploadBook build() {
             return this.obj;
@@ -241,7 +263,7 @@ public class UploadBook implements Serializable {
      * This enum was generated by MyBatis Generator.
      * This enum corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     public enum Column {
         id("id", "id", "BIGINT", false),
@@ -251,13 +273,14 @@ public class UploadBook implements Serializable {
         updateTime("update_time", "updateTime", "INTEGER", false),
         words("words", "words", "INTEGER", false),
         readAble("read_able", "readAble", "INTEGER", false),
+        chapterId("chapter_id", "chapterId", "BIGINT", false),
         content("content", "content", "LONGVARCHAR", false);
 
         /**
          * This field was generated by MyBatis Generator.
          * This field corresponds to the database table upload_book
          *
-         * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+         * @mbg.generated Thu Aug 26 23:53:37 CST 2021
          */
         private static final String BEGINNING_DELIMITER = "\"";
 
@@ -265,7 +288,7 @@ public class UploadBook implements Serializable {
          * This field was generated by MyBatis Generator.
          * This field corresponds to the database table upload_book
          *
-         * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+         * @mbg.generated Thu Aug 26 23:53:37 CST 2021
          */
         private static final String ENDING_DELIMITER = "\"";
 
@@ -273,7 +296,7 @@ public class UploadBook implements Serializable {
          * This field was generated by MyBatis Generator.
          * This field corresponds to the database table upload_book
          *
-         * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+         * @mbg.generated Thu Aug 26 23:53:37 CST 2021
          */
         private final String column;
 
@@ -281,7 +304,7 @@ public class UploadBook implements Serializable {
          * This field was generated by MyBatis Generator.
          * This field corresponds to the database table upload_book
          *
-         * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+         * @mbg.generated Thu Aug 26 23:53:37 CST 2021
          */
         private final boolean isColumnNameDelimited;
 
@@ -289,7 +312,7 @@ public class UploadBook implements Serializable {
          * This field was generated by MyBatis Generator.
          * This field corresponds to the database table upload_book
          *
-         * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+         * @mbg.generated Thu Aug 26 23:53:37 CST 2021
          */
         private final String javaProperty;
 
@@ -297,7 +320,7 @@ public class UploadBook implements Serializable {
          * This field was generated by MyBatis Generator.
          * This field corresponds to the database table upload_book
          *
-         * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+         * @mbg.generated Thu Aug 26 23:53:37 CST 2021
          */
         private final String jdbcType;
 
@@ -305,7 +328,7 @@ public class UploadBook implements Serializable {
          * This method was generated by MyBatis Generator.
          * This method corresponds to the database table upload_book
          *
-         * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+         * @mbg.generated Thu Aug 26 23:53:37 CST 2021
          */
         public String value() {
             return this.column;
@@ -315,7 +338,7 @@ public class UploadBook implements Serializable {
          * This method was generated by MyBatis Generator.
          * This method corresponds to the database table upload_book
          *
-         * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+         * @mbg.generated Thu Aug 26 23:53:37 CST 2021
          */
         public String getValue() {
             return this.column;
@@ -325,7 +348,7 @@ public class UploadBook implements Serializable {
          * This method was generated by MyBatis Generator.
          * This method corresponds to the database table upload_book
          *
-         * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+         * @mbg.generated Thu Aug 26 23:53:37 CST 2021
          */
         public String getJavaProperty() {
             return this.javaProperty;
@@ -335,7 +358,7 @@ public class UploadBook implements Serializable {
          * This method was generated by MyBatis Generator.
          * This method corresponds to the database table upload_book
          *
-         * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+         * @mbg.generated Thu Aug 26 23:53:37 CST 2021
          */
         public String getJdbcType() {
             return this.jdbcType;
@@ -345,7 +368,7 @@ public class UploadBook implements Serializable {
          * This method was generated by MyBatis Generator.
          * This method corresponds to the database table upload_book
          *
-         * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+         * @mbg.generated Thu Aug 26 23:53:37 CST 2021
          */
         Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
             this.column = column;
@@ -358,7 +381,7 @@ public class UploadBook implements Serializable {
          * This method was generated by MyBatis Generator.
          * This method corresponds to the database table upload_book
          *
-         * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+         * @mbg.generated Thu Aug 26 23:53:37 CST 2021
          */
         public String desc() {
             return this.getEscapedColumnName() + " DESC";
@@ -368,7 +391,7 @@ public class UploadBook implements Serializable {
          * This method was generated by MyBatis Generator.
          * This method corresponds to the database table upload_book
          *
-         * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+         * @mbg.generated Thu Aug 26 23:53:37 CST 2021
          */
         public String asc() {
             return this.getEscapedColumnName() + " ASC";
@@ -378,7 +401,7 @@ public class UploadBook implements Serializable {
          * This method was generated by MyBatis Generator.
          * This method corresponds to the database table upload_book
          *
-         * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+         * @mbg.generated Thu Aug 26 23:53:37 CST 2021
          */
         public static Column[] excludes(Column ... excludes) {
             ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
@@ -392,7 +415,7 @@ public class UploadBook implements Serializable {
          * This method was generated by MyBatis Generator.
          * This method corresponds to the database table upload_book
          *
-         * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+         * @mbg.generated Thu Aug 26 23:53:37 CST 2021
          */
         public static Column[] all() {
             return Column.values();
@@ -402,7 +425,7 @@ public class UploadBook implements Serializable {
          * This method was generated by MyBatis Generator.
          * This method corresponds to the database table upload_book
          *
-         * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+         * @mbg.generated Thu Aug 26 23:53:37 CST 2021
          */
         public String getEscapedColumnName() {
             if (this.isColumnNameDelimited) {
@@ -416,7 +439,7 @@ public class UploadBook implements Serializable {
          * This method was generated by MyBatis Generator.
          * This method corresponds to the database table upload_book
          *
-         * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+         * @mbg.generated Thu Aug 26 23:53:37 CST 2021
          */
         public String getAliasedEscapedColumnName() {
             return this.getEscapedColumnName();

+ 24 - 24
book-dao/src/main/java/com/book/dao/cps/mapper/UploadBookMapper.java

@@ -14,7 +14,7 @@ public interface UploadBookMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     long countByExample(UploadBookExample example);
 
@@ -22,7 +22,7 @@ public interface UploadBookMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     int deleteByExample(UploadBookExample example);
 
@@ -30,7 +30,7 @@ public interface UploadBookMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     int deleteByPrimaryKey(@Param("id") Long id, @Param("bookId") Long bookId);
 
@@ -38,7 +38,7 @@ public interface UploadBookMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     int insert(UploadBook record);
 
@@ -46,7 +46,7 @@ public interface UploadBookMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     int insertSelective(@Param("record") UploadBook record, @Param("selective") UploadBook.Column ... selective);
 
@@ -54,7 +54,7 @@ public interface UploadBookMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     UploadBook selectOneByExample(UploadBookExample example);
 
@@ -62,7 +62,7 @@ public interface UploadBookMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     UploadBook selectOneByExampleSelective(@Param("example") UploadBookExample example, @Param("selective") UploadBook.Column ... selective);
 
@@ -70,7 +70,7 @@ public interface UploadBookMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     UploadBook selectOneByExampleWithBLOBs(UploadBookExample example);
 
@@ -78,7 +78,7 @@ public interface UploadBookMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     List<UploadBook> selectByExampleSelective(@Param("example") UploadBookExample example, @Param("selective") UploadBook.Column ... selective);
 
@@ -86,7 +86,7 @@ public interface UploadBookMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     List<UploadBook> selectByExampleWithBLOBs(UploadBookExample example);
 
@@ -94,7 +94,7 @@ public interface UploadBookMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     List<UploadBook> selectByExample(UploadBookExample example);
 
@@ -102,7 +102,7 @@ public interface UploadBookMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     UploadBook selectByPrimaryKeySelective(@Param("id") Long id, @Param("bookId") Long bookId, @Param("selective") UploadBook.Column ... selective);
 
@@ -110,7 +110,7 @@ public interface UploadBookMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     UploadBook selectByPrimaryKey(@Param("id") Long id, @Param("bookId") Long bookId);
 
@@ -118,7 +118,7 @@ public interface UploadBookMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     int updateByExampleSelective(@Param("record") UploadBook record, @Param("example") UploadBookExample example, @Param("selective") UploadBook.Column ... selective);
 
@@ -126,7 +126,7 @@ public interface UploadBookMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     int updateByExampleWithBLOBs(@Param("record") UploadBook record, @Param("example") UploadBookExample example);
 
@@ -134,7 +134,7 @@ public interface UploadBookMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     int updateByExample(@Param("record") UploadBook record, @Param("example") UploadBookExample example);
 
@@ -142,7 +142,7 @@ public interface UploadBookMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     int updateByPrimaryKeySelective(@Param("record") UploadBook record, @Param("selective") UploadBook.Column ... selective);
 
@@ -150,7 +150,7 @@ public interface UploadBookMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     int updateByPrimaryKeyWithBLOBs(UploadBook record);
 
@@ -158,7 +158,7 @@ public interface UploadBookMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     int updateByPrimaryKey(UploadBook record);
 
@@ -166,7 +166,7 @@ public interface UploadBookMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     int batchInsert(@Param("list") List<UploadBook> list);
 
@@ -174,7 +174,7 @@ public interface UploadBookMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     int batchInsertSelective(@Param("list") List<UploadBook> list, @Param("selective") UploadBook.Column ... selective);
 
@@ -182,7 +182,7 @@ public interface UploadBookMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     int upsert(UploadBook record);
 
@@ -190,7 +190,7 @@ public interface UploadBookMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     int upsertSelective(@Param("record") UploadBook record, @Param("selective") UploadBook.Column ... selective);
 
@@ -198,7 +198,7 @@ public interface UploadBookMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     int upsertWithBLOBs(UploadBook record);
 }

+ 130 - 40
book-dao/src/main/java/com/book/dao/cps/pojo/example/UploadBookExample.java

@@ -9,7 +9,7 @@ public class UploadBookExample {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     protected String orderByClause;
 
@@ -17,7 +17,7 @@ public class UploadBookExample {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     protected boolean distinct;
 
@@ -25,7 +25,7 @@ public class UploadBookExample {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     protected List<Criteria> oredCriteria;
 
@@ -33,7 +33,7 @@ public class UploadBookExample {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     protected Integer offset;
 
@@ -41,7 +41,7 @@ public class UploadBookExample {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     protected Integer rows;
 
@@ -49,7 +49,7 @@ public class UploadBookExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     public UploadBookExample() {
         oredCriteria = new ArrayList<Criteria>();
@@ -59,7 +59,7 @@ public class UploadBookExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     public void setOrderByClause(String orderByClause) {
         this.orderByClause = orderByClause;
@@ -69,7 +69,7 @@ public class UploadBookExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     public String getOrderByClause() {
         return orderByClause;
@@ -79,7 +79,7 @@ public class UploadBookExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     public void setDistinct(boolean distinct) {
         this.distinct = distinct;
@@ -89,7 +89,7 @@ public class UploadBookExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     public boolean isDistinct() {
         return distinct;
@@ -99,7 +99,7 @@ public class UploadBookExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     public List<Criteria> getOredCriteria() {
         return oredCriteria;
@@ -109,7 +109,7 @@ public class UploadBookExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     public void or(Criteria criteria) {
         oredCriteria.add(criteria);
@@ -119,7 +119,7 @@ public class UploadBookExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     public Criteria or() {
         Criteria criteria = createCriteriaInternal();
@@ -131,7 +131,7 @@ public class UploadBookExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     public UploadBookExample orderBy(String orderByClause) {
         this.setOrderByClause(orderByClause);
@@ -142,7 +142,7 @@ public class UploadBookExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     public UploadBookExample orderBy(String ... orderByClauses) {
         StringBuffer sb = new StringBuffer();
@@ -160,7 +160,7 @@ public class UploadBookExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     public Criteria createCriteria() {
         Criteria criteria = createCriteriaInternal();
@@ -174,7 +174,7 @@ public class UploadBookExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     protected Criteria createCriteriaInternal() {
         Criteria criteria = new Criteria(this);
@@ -185,7 +185,7 @@ public class UploadBookExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     public void clear() {
         oredCriteria.clear();
@@ -199,7 +199,7 @@ public class UploadBookExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     public void setOffset(Integer offset) {
         this.offset = offset;
@@ -209,7 +209,7 @@ public class UploadBookExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     public Integer getOffset() {
         return this.offset;
@@ -219,7 +219,7 @@ public class UploadBookExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     public void setRows(Integer rows) {
         this.rows = rows;
@@ -229,7 +229,7 @@ public class UploadBookExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     public Integer getRows() {
         return this.rows;
@@ -239,7 +239,7 @@ public class UploadBookExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     public UploadBookExample limit(Integer rows) {
         this.rows = rows;
@@ -250,7 +250,7 @@ public class UploadBookExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     public UploadBookExample limit(Integer offset, Integer rows) {
         this.offset = offset;
@@ -262,7 +262,7 @@ public class UploadBookExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     public UploadBookExample page(Integer page, Integer pageSize) {
         this.offset = page * pageSize;
@@ -274,7 +274,7 @@ public class UploadBookExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     public static Criteria newAndCreateCriteria() {
         UploadBookExample example = new UploadBookExample();
@@ -285,7 +285,7 @@ public class UploadBookExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     public UploadBookExample when(boolean condition, IExampleWhen then) {
         if (condition) {
@@ -298,7 +298,7 @@ public class UploadBookExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     public UploadBookExample when(boolean condition, IExampleWhen then, IExampleWhen otherwise) {
         if (condition) {
@@ -313,7 +313,7 @@ public class UploadBookExample {
      * This class was generated by MyBatis Generator.
      * This class corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     protected abstract static class GeneratedCriteria {
         protected List<Criterion> criteria;
@@ -995,20 +995,110 @@ public class UploadBookExample {
             addCriterion("read_able not between", value1, value2, "readAble");
             return (Criteria) this;
         }
+
+        public Criteria andChapterIdIsNull() {
+            addCriterion("chapter_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andChapterIdIsNotNull() {
+            addCriterion("chapter_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andChapterIdEqualTo(Long value) {
+            addCriterion("chapter_id =", value, "chapterId");
+            return (Criteria) this;
+        }
+
+        public Criteria andChapterIdEqualToColumn(UploadBook.Column column) {
+            addCriterion(new StringBuilder("chapter_id = ").append(column.getEscapedColumnName()).toString());
+            return (Criteria) this;
+        }
+
+        public Criteria andChapterIdNotEqualTo(Long value) {
+            addCriterion("chapter_id <>", value, "chapterId");
+            return (Criteria) this;
+        }
+
+        public Criteria andChapterIdNotEqualToColumn(UploadBook.Column column) {
+            addCriterion(new StringBuilder("chapter_id <> ").append(column.getEscapedColumnName()).toString());
+            return (Criteria) this;
+        }
+
+        public Criteria andChapterIdGreaterThan(Long value) {
+            addCriterion("chapter_id >", value, "chapterId");
+            return (Criteria) this;
+        }
+
+        public Criteria andChapterIdGreaterThanColumn(UploadBook.Column column) {
+            addCriterion(new StringBuilder("chapter_id > ").append(column.getEscapedColumnName()).toString());
+            return (Criteria) this;
+        }
+
+        public Criteria andChapterIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("chapter_id >=", value, "chapterId");
+            return (Criteria) this;
+        }
+
+        public Criteria andChapterIdGreaterThanOrEqualToColumn(UploadBook.Column column) {
+            addCriterion(new StringBuilder("chapter_id >= ").append(column.getEscapedColumnName()).toString());
+            return (Criteria) this;
+        }
+
+        public Criteria andChapterIdLessThan(Long value) {
+            addCriterion("chapter_id <", value, "chapterId");
+            return (Criteria) this;
+        }
+
+        public Criteria andChapterIdLessThanColumn(UploadBook.Column column) {
+            addCriterion(new StringBuilder("chapter_id < ").append(column.getEscapedColumnName()).toString());
+            return (Criteria) this;
+        }
+
+        public Criteria andChapterIdLessThanOrEqualTo(Long value) {
+            addCriterion("chapter_id <=", value, "chapterId");
+            return (Criteria) this;
+        }
+
+        public Criteria andChapterIdLessThanOrEqualToColumn(UploadBook.Column column) {
+            addCriterion(new StringBuilder("chapter_id <= ").append(column.getEscapedColumnName()).toString());
+            return (Criteria) this;
+        }
+
+        public Criteria andChapterIdIn(List<Long> values) {
+            addCriterion("chapter_id in", values, "chapterId");
+            return (Criteria) this;
+        }
+
+        public Criteria andChapterIdNotIn(List<Long> values) {
+            addCriterion("chapter_id not in", values, "chapterId");
+            return (Criteria) this;
+        }
+
+        public Criteria andChapterIdBetween(Long value1, Long value2) {
+            addCriterion("chapter_id between", value1, value2, "chapterId");
+            return (Criteria) this;
+        }
+
+        public Criteria andChapterIdNotBetween(Long value1, Long value2) {
+            addCriterion("chapter_id not between", value1, value2, "chapterId");
+            return (Criteria) this;
+        }
     }
 
     /**
      * This class was generated by MyBatis Generator.
      * This class corresponds to the database table upload_book
      *
-     * @mbg.generated do_not_delete_during_merge Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated do_not_delete_during_merge Thu Aug 26 23:53:37 CST 2021
      */
     public static class Criteria extends GeneratedCriteria {
         /**
          * This field was generated by MyBatis Generator.
          * This field corresponds to the database table upload_book
          *
-         * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+         * @mbg.generated Thu Aug 26 23:53:37 CST 2021
          */
         private UploadBookExample example;
 
@@ -1016,7 +1106,7 @@ public class UploadBookExample {
          * This method was generated by MyBatis Generator.
          * This method corresponds to the database table upload_book
          *
-         * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+         * @mbg.generated Thu Aug 26 23:53:37 CST 2021
          */
         protected Criteria(UploadBookExample example) {
             super();
@@ -1027,7 +1117,7 @@ public class UploadBookExample {
          * This method was generated by MyBatis Generator.
          * This method corresponds to the database table upload_book
          *
-         * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+         * @mbg.generated Thu Aug 26 23:53:37 CST 2021
          */
         public UploadBookExample example() {
             return this.example;
@@ -1037,7 +1127,7 @@ public class UploadBookExample {
          * This method was generated by MyBatis Generator.
          * This method corresponds to the database table upload_book
          *
-         * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+         * @mbg.generated Thu Aug 26 23:53:37 CST 2021
          */
         @Deprecated
         public Criteria andIf(boolean ifAdd, ICriteriaAdd add) {
@@ -1051,7 +1141,7 @@ public class UploadBookExample {
          * This method was generated by MyBatis Generator.
          * This method corresponds to the database table upload_book
          *
-         * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+         * @mbg.generated Thu Aug 26 23:53:37 CST 2021
          */
         public Criteria when(boolean condition, ICriteriaWhen then) {
             if (condition) {
@@ -1064,7 +1154,7 @@ public class UploadBookExample {
          * This method was generated by MyBatis Generator.
          * This method corresponds to the database table upload_book
          *
-         * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+         * @mbg.generated Thu Aug 26 23:53:37 CST 2021
          */
         public Criteria when(boolean condition, ICriteriaWhen then, ICriteriaWhen otherwise) {
             if (condition) {
@@ -1081,7 +1171,7 @@ public class UploadBookExample {
              * This method was generated by MyBatis Generator.
              * This method corresponds to the database table upload_book
              *
-             * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+             * @mbg.generated Thu Aug 26 23:53:37 CST 2021
              */
             Criteria add(Criteria add);
         }
@@ -1091,7 +1181,7 @@ public class UploadBookExample {
      * This class was generated by MyBatis Generator.
      * This class corresponds to the database table upload_book
      *
-     * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+     * @mbg.generated Thu Aug 26 23:53:37 CST 2021
      */
     public static class Criterion {
         private String condition;
@@ -1184,7 +1274,7 @@ public class UploadBookExample {
          * This method was generated by MyBatis Generator.
          * This method corresponds to the database table upload_book
          *
-         * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+         * @mbg.generated Thu Aug 26 23:53:37 CST 2021
          */
         void criteria(Criteria criteria);
     }
@@ -1194,7 +1284,7 @@ public class UploadBookExample {
          * This method was generated by MyBatis Generator.
          * This method corresponds to the database table upload_book
          *
-         * @mbg.generated Thu Aug 26 21:11:21 CST 2021
+         * @mbg.generated Thu Aug 26 23:53:37 CST 2021
          */
         void example(com.book.dao.cps.pojo.example.UploadBookExample example);
     }

+ 80 - 42
book-dao/src/main/resources/mapper/cps/UploadBookMapper.xml

@@ -5,7 +5,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 26 21:11:21 CST 2021.
+      This element was generated on Thu Aug 26 23:53:37 CST 2021.
     -->
     <id column="id" jdbcType="BIGINT" property="id" />
     <id column="book_id" jdbcType="BIGINT" property="bookId" />
@@ -14,12 +14,13 @@
     <result column="update_time" jdbcType="INTEGER" property="updateTime" />
     <result column="words" jdbcType="INTEGER" property="words" />
     <result column="read_able" jdbcType="INTEGER" property="readAble" />
+    <result column="chapter_id" jdbcType="BIGINT" property="chapterId" />
   </resultMap>
   <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.book.dao.cps.entity.UploadBook">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 26 21:11:21 CST 2021.
+      This element was generated on Thu Aug 26 23:53:37 CST 2021.
     -->
     <result column="content" jdbcType="LONGVARCHAR" property="content" />
   </resultMap>
@@ -27,7 +28,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 26 21:11:21 CST 2021.
+      This element was generated on Thu Aug 26 23:53:37 CST 2021.
     -->
     <where>
       <foreach collection="oredCriteria" item="criteria" separator="or">
@@ -61,7 +62,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 26 21:11:21 CST 2021.
+      This element was generated on Thu Aug 26 23:53:37 CST 2021.
     -->
     <where>
       <foreach collection="example.oredCriteria" item="criteria" separator="or">
@@ -95,15 +96,15 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 26 21:11:21 CST 2021.
+      This element was generated on Thu Aug 26 23:53:37 CST 2021.
     -->
-    id, book_id, chapter_name, create_time, update_time, words, read_able
+    id, book_id, chapter_name, create_time, update_time, words, read_able, chapter_id
   </sql>
   <sql id="Blob_Column_List">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 26 21:11:21 CST 2021.
+      This element was generated on Thu Aug 26 23:53:37 CST 2021.
     -->
     content
   </sql>
@@ -111,7 +112,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 26 21:11:21 CST 2021.
+      This element was generated on Thu Aug 26 23:53:37 CST 2021.
     -->
     select
     <if test="distinct">
@@ -140,7 +141,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 26 21:11:21 CST 2021.
+      This element was generated on Thu Aug 26 23:53:37 CST 2021.
     -->
     select
     <if test="distinct">
@@ -167,7 +168,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 26 21:11:21 CST 2021.
+      This element was generated on Thu Aug 26 23:53:37 CST 2021.
     -->
     select
     <if test="example != null and example.distinct">
@@ -205,7 +206,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 26 21:11:21 CST 2021.
+      This element was generated on Thu Aug 26 23:53:37 CST 2021.
     -->
     select 
     <include refid="Base_Column_List" />
@@ -219,7 +220,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 26 21:11:21 CST 2021.
+      This element was generated on Thu Aug 26 23:53:37 CST 2021.
     -->
     select
     <choose>
@@ -242,7 +243,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 26 21:11:21 CST 2021.
+      This element was generated on Thu Aug 26 23:53:37 CST 2021.
     -->
     delete from upload_book
     where id = #{id,jdbcType=BIGINT}
@@ -252,7 +253,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 26 21:11:21 CST 2021.
+      This element was generated on Thu Aug 26 23:53:37 CST 2021.
     -->
     delete from upload_book
     <if test="_parameter != null">
@@ -263,20 +264,22 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 26 21:11:21 CST 2021.
+      This element was generated on Thu Aug 26 23:53:37 CST 2021.
     -->
     insert into upload_book (id, book_id, chapter_name, 
       create_time, update_time, words, 
-      read_able, content)
+      read_able, chapter_id, content
+      )
     values (#{id,jdbcType=BIGINT}, #{bookId,jdbcType=BIGINT}, #{chapterName,jdbcType=VARCHAR}, 
       #{createTime,jdbcType=INTEGER}, #{updateTime,jdbcType=INTEGER}, #{words,jdbcType=INTEGER}, 
-      #{readAble,jdbcType=INTEGER}, #{content,jdbcType=LONGVARCHAR})
+      #{readAble,jdbcType=INTEGER}, #{chapterId,jdbcType=BIGINT}, #{content,jdbcType=LONGVARCHAR}
+      )
   </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 26 21:11:21 CST 2021.
+      This element was generated on Thu Aug 26 23:53:37 CST 2021.
     -->
     insert into upload_book
     <choose>
@@ -308,6 +311,9 @@
           <if test="record.readAble != null">
             read_able,
           </if>
+          <if test="record.chapterId != null">
+            chapter_id,
+          </if>
           <if test="record.content != null">
             content,
           </if>
@@ -345,6 +351,9 @@
           <if test="record.readAble != null">
             #{record.readAble,jdbcType=INTEGER},
           </if>
+          <if test="record.chapterId != null">
+            #{record.chapterId,jdbcType=BIGINT},
+          </if>
           <if test="record.content != null">
             #{record.content,jdbcType=LONGVARCHAR},
           </if>
@@ -356,7 +365,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 26 21:11:21 CST 2021.
+      This element was generated on Thu Aug 26 23:53:37 CST 2021.
     -->
     select count(*) from upload_book
     <if test="_parameter != null">
@@ -367,7 +376,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 26 21:11:21 CST 2021.
+      This element was generated on Thu Aug 26 23:53:37 CST 2021.
     -->
     update upload_book
     SET
@@ -400,6 +409,9 @@
           <if test="record.readAble != null">
             read_able = #{record.readAble,jdbcType=INTEGER},
           </if>
+          <if test="record.chapterId != null">
+            chapter_id = #{record.chapterId,jdbcType=BIGINT},
+          </if>
           <if test="record.content != null">
             content = #{record.content,jdbcType=LONGVARCHAR},
           </if>
@@ -414,7 +426,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 26 21:11:21 CST 2021.
+      This element was generated on Thu Aug 26 23:53:37 CST 2021.
     -->
     update upload_book
     set id = #{record.id,jdbcType=BIGINT},
@@ -424,6 +436,7 @@
       update_time = #{record.updateTime,jdbcType=INTEGER},
       words = #{record.words,jdbcType=INTEGER},
       read_able = #{record.readAble,jdbcType=INTEGER},
+      chapter_id = #{record.chapterId,jdbcType=BIGINT},
       content = #{record.content,jdbcType=LONGVARCHAR}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -433,7 +446,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 26 21:11:21 CST 2021.
+      This element was generated on Thu Aug 26 23:53:37 CST 2021.
     -->
     update upload_book
     set id = #{record.id,jdbcType=BIGINT},
@@ -442,7 +455,8 @@
       create_time = #{record.createTime,jdbcType=INTEGER},
       update_time = #{record.updateTime,jdbcType=INTEGER},
       words = #{record.words,jdbcType=INTEGER},
-      read_able = #{record.readAble,jdbcType=INTEGER}
+      read_able = #{record.readAble,jdbcType=INTEGER},
+      chapter_id = #{record.chapterId,jdbcType=BIGINT}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -451,7 +465,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 26 21:11:21 CST 2021.
+      This element was generated on Thu Aug 26 23:53:37 CST 2021.
     -->
     update upload_book
     SET
@@ -478,6 +492,9 @@
           <if test="record.readAble != null">
             read_able = #{record.readAble,jdbcType=INTEGER},
           </if>
+          <if test="record.chapterId != null">
+            chapter_id = #{record.chapterId,jdbcType=BIGINT},
+          </if>
           <if test="record.content != null">
             content = #{record.content,jdbcType=LONGVARCHAR},
           </if>
@@ -491,7 +508,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 26 21:11:21 CST 2021.
+      This element was generated on Thu Aug 26 23:53:37 CST 2021.
     -->
     update upload_book
     set chapter_name = #{chapterName,jdbcType=VARCHAR},
@@ -499,6 +516,7 @@
       update_time = #{updateTime,jdbcType=INTEGER},
       words = #{words,jdbcType=INTEGER},
       read_able = #{readAble,jdbcType=INTEGER},
+      chapter_id = #{chapterId,jdbcType=BIGINT},
       content = #{content,jdbcType=LONGVARCHAR}
     where id = #{id,jdbcType=BIGINT}
       and book_id = #{bookId,jdbcType=BIGINT}
@@ -507,14 +525,15 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 26 21:11:21 CST 2021.
+      This element was generated on Thu Aug 26 23:53:37 CST 2021.
     -->
     update upload_book
     set chapter_name = #{chapterName,jdbcType=VARCHAR},
       create_time = #{createTime,jdbcType=INTEGER},
       update_time = #{updateTime,jdbcType=INTEGER},
       words = #{words,jdbcType=INTEGER},
-      read_able = #{readAble,jdbcType=INTEGER}
+      read_able = #{readAble,jdbcType=INTEGER},
+      chapter_id = #{chapterId,jdbcType=BIGINT}
     where id = #{id,jdbcType=BIGINT}
       and book_id = #{bookId,jdbcType=BIGINT}
   </update>
@@ -522,7 +541,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 26 21:11:21 CST 2021.
+      This element was generated on Thu Aug 26 23:53:37 CST 2021.
     -->
     select
     <include refid="Base_Column_List" />
@@ -539,7 +558,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 26 21:11:21 CST 2021.
+      This element was generated on Thu Aug 26 23:53:37 CST 2021.
     -->
     select
     <include refid="Base_Column_List" />
@@ -558,7 +577,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 26 21:11:21 CST 2021.
+      This element was generated on Thu Aug 26 23:53:37 CST 2021.
     -->
     select
     <choose>
@@ -586,22 +605,24 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 26 21:11:21 CST 2021.
+      This element was generated on Thu Aug 26 23:53:37 CST 2021.
     -->
     insert into upload_book
-    (id, book_id, chapter_name, create_time, update_time, words, read_able, content)
+    (id, book_id, chapter_name, create_time, update_time, words, read_able, chapter_id, 
+      content)
     values
     <foreach collection="list" item="item" separator=",">
       (#{item.id,jdbcType=BIGINT}, #{item.bookId,jdbcType=BIGINT}, #{item.chapterName,jdbcType=VARCHAR}, 
         #{item.createTime,jdbcType=INTEGER}, #{item.updateTime,jdbcType=INTEGER}, #{item.words,jdbcType=INTEGER}, 
-        #{item.readAble,jdbcType=INTEGER}, #{item.content,jdbcType=LONGVARCHAR})
+        #{item.readAble,jdbcType=INTEGER}, #{item.chapterId,jdbcType=BIGINT}, #{item.content,jdbcType=LONGVARCHAR}
+        )
     </foreach>
   </insert>
   <insert id="batchInsertSelective" parameterType="map">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 26 21:11:21 CST 2021.
+      This element was generated on Thu Aug 26 23:53:37 CST 2021.
     -->
     insert into upload_book (
     <foreach collection="selective" item="column" separator=",">
@@ -633,6 +654,9 @@
         <if test="'read_able'.toString() == column.value">
           #{item.readAble,jdbcType=INTEGER}
         </if>
+        <if test="'chapter_id'.toString() == column.value">
+          #{item.chapterId,jdbcType=BIGINT}
+        </if>
         <if test="'content'.toString() == column.value">
           #{item.content,jdbcType=LONGVARCHAR}
         </if>
@@ -644,7 +668,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 26 21:11:21 CST 2021.
+      This element was generated on Thu Aug 26 23:53:37 CST 2021.
     -->
     insert into upload_book
     <choose>
@@ -676,6 +700,9 @@
           <if test="record.readAble != null">
             read_able,
           </if>
+          <if test="record.chapterId != null">
+            chapter_id,
+          </if>
           <if test="record.content != null">
             content,
           </if>
@@ -713,6 +740,9 @@
           <if test="record.readAble != null">
             #{record.readAble,jdbcType=INTEGER},
           </if>
+          <if test="record.chapterId != null">
+            #{record.chapterId,jdbcType=BIGINT},
+          </if>
           <if test="record.content != null">
             #{record.content,jdbcType=LONGVARCHAR},
           </if>
@@ -749,6 +779,9 @@
           <if test="record.readAble != null">
             read_able = #{record.readAble,jdbcType=INTEGER},
           </if>
+          <if test="record.chapterId != null">
+            chapter_id = #{record.chapterId,jdbcType=BIGINT},
+          </if>
           <if test="record.content != null">
             content = #{record.content,jdbcType=LONGVARCHAR},
           </if>
@@ -760,14 +793,15 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 26 21:11:21 CST 2021.
+      This element was generated on Thu Aug 26 23:53:37 CST 2021.
     -->
     insert into upload_book
-    (id, book_id, chapter_name, create_time, update_time, words, read_able)
+    (id, book_id, chapter_name, create_time, update_time, words, read_able, chapter_id
+      )
     values
     (#{id,jdbcType=BIGINT}, #{bookId,jdbcType=BIGINT}, #{chapterName,jdbcType=VARCHAR}, 
       #{createTime,jdbcType=INTEGER}, #{updateTime,jdbcType=INTEGER}, #{words,jdbcType=INTEGER}, 
-      #{readAble,jdbcType=INTEGER})
+      #{readAble,jdbcType=INTEGER}, #{chapterId,jdbcType=BIGINT})
     on duplicate key update 
     id = #{id,jdbcType=BIGINT}, 
     book_id = #{bookId,jdbcType=BIGINT}, 
@@ -775,20 +809,23 @@
     create_time = #{createTime,jdbcType=INTEGER}, 
     update_time = #{updateTime,jdbcType=INTEGER}, 
     words = #{words,jdbcType=INTEGER}, 
-    read_able = #{readAble,jdbcType=INTEGER}
+    read_able = #{readAble,jdbcType=INTEGER}, 
+    chapter_id = #{chapterId,jdbcType=BIGINT}
   </insert>
   <insert id="upsertWithBLOBs" parameterType="com.book.dao.cps.entity.UploadBook">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Aug 26 21:11:21 CST 2021.
+      This element was generated on Thu Aug 26 23:53:37 CST 2021.
     -->
     insert into upload_book
-    (id, book_id, chapter_name, create_time, update_time, words, read_able, content)
+    (id, book_id, chapter_name, create_time, update_time, words, read_able, chapter_id, 
+      content)
     values
     (#{id,jdbcType=BIGINT}, #{bookId,jdbcType=BIGINT}, #{chapterName,jdbcType=VARCHAR}, 
       #{createTime,jdbcType=INTEGER}, #{updateTime,jdbcType=INTEGER}, #{words,jdbcType=INTEGER}, 
-      #{readAble,jdbcType=INTEGER}, #{content,jdbcType=LONGVARCHAR})
+      #{readAble,jdbcType=INTEGER}, #{chapterId,jdbcType=BIGINT}, #{content,jdbcType=LONGVARCHAR}
+      )
     on duplicate key update 
     id = #{id,jdbcType=BIGINT}, 
     book_id = #{bookId,jdbcType=BIGINT}, 
@@ -797,6 +834,7 @@
     update_time = #{updateTime,jdbcType=INTEGER}, 
     words = #{words,jdbcType=INTEGER}, 
     read_able = #{readAble,jdbcType=INTEGER}, 
+    chapter_id = #{chapterId,jdbcType=BIGINT}, 
     content = #{content,jdbcType=LONGVARCHAR}
   </insert>
 </mapper>

+ 42 - 8
book-server/src/main/java/com/book/server/service/impl/BookServiceImpl.java

@@ -585,13 +585,12 @@ public class BookServiceImpl implements BookService {
                 }
             }
         }
-        bookMapper.updateByPrimaryKeySelective(
-                Book.builder()
-                        .id(bookId)
-                        .description(content.toString())
-                        .build(),
-                Book.Column.description
-        );
+
+        int wordCount = 0;
+        Long firstChapterId = 0L;
+        Long lastChapterId = 0L;
+        String firstChapterName = "";
+        String lastChapterName = "";
 
         // 获取默认免费章节数
         int defaultFreeChapterNum = getDefaultFreeChapterNum();
@@ -608,6 +607,7 @@ public class BookServiceImpl implements BookService {
             // 放入数据库
             UploadBook uploadBook = new UploadBook();
             uploadBook.setBookId(bookId);
+            uploadBook.setChapterId(bookId + i);
             uploadBook.setChapterName(contentName);
             uploadBook.setContent(sb.toString());
             uploadBook.setCreateTime(DateUtils.getNow());
@@ -615,11 +615,21 @@ public class BookServiceImpl implements BookService {
             uploadBook.setWords(uploadBook.getContent().length());
             if (i <= defaultFreeChapterNum) {
                 uploadBook.setReadAble(0);
-                i++;
             } else {
                 uploadBook.setReadAble(1);
             }
+            i++;
             books.add(uploadBook);
+            // 附加属性
+            wordCount += uploadBook.getContent().length();
+            if (firstChapterId == 0L) {
+                firstChapterId = uploadBook.getChapterId();
+                firstChapterName = uploadBook.getChapterName();
+            }
+            lastChapterId = uploadBook.getChapterId();
+            lastChapterName = uploadBook.getChapterName();
+
+            //存储
             if (books.size() >= 500) {
                 uploadBookMapper.batchInsert(books);
                 books.clear();
@@ -629,6 +639,30 @@ public class BookServiceImpl implements BookService {
             uploadBookMapper.batchInsert(books);
         }
 
+        bookMapper.insertSelective(
+                Book.builder()
+                        .id(bookId)
+                        .bookCategoryId(1)
+                        .name(file.getName())
+                        .realname(file.getName())
+                        .author("作者")
+                        .image("封面")
+                        .description(content.toString())
+                        .referralNum((byte) 5)
+                        .appPrice(100)
+                        .wordCount(wordCount + "")
+                        .firstChapterId(firstChapterId)
+                        .firstChapterName(firstChapterName)
+                        .lastChapterId(lastChapterId)
+                        .lastChapterName(lastChapterName)
+                        .lastChapterUtime(DateUtils.getNow())
+                        .rank((byte) 0)
+                        .checkRank((byte) 0)
+                        .classifyWhiteList((byte) 0)
+                        .putAdSet((byte) 0)
+                        .build()
+        );
+
     }
 
     @Autowired