作家后台小说列表新增昨日订阅量统计

This commit is contained in:
xiongxiaoyang 2020-11-09 18:18:27 +08:00
parent 04d3aef82b
commit beba6e5154
9 changed files with 205 additions and 168 deletions

View File

@ -126,7 +126,7 @@ novel-plus -- 父工程
![img](https://oscimg.oschina.net/oscnet/up-30766372cc7f56480ff1d7d55198204f6ea.png) ![img](https://oscimg.oschina.net/oscnet/up-30766372cc7f56480ff1d7d55198204f6ea.png)
![img](https://s1.ax1x.com/2020/11/09/B7Xmx1.png) ![img](https://s1.ax1x.com/2020/11/09/BHwefI.png)
![img](https://s1.ax1x.com/2020/11/09/B7X5oF.png) ![img](https://s1.ax1x.com/2020/11/09/B7X5oF.png)

View File

@ -47,6 +47,9 @@ public class Book implements Serializable{
@Generated("org.mybatis.generator.api.MyBatisGenerator") @Generated("org.mybatis.generator.api.MyBatisGenerator")
private Integer commentCount; private Integer commentCount;
@Generated("org.mybatis.generator.api.MyBatisGenerator")
private Integer yesterdayBuy;
@Generated("org.mybatis.generator.api.MyBatisGenerator") @Generated("org.mybatis.generator.api.MyBatisGenerator")
private Long lastIndexId; private Long lastIndexId;
@ -220,6 +223,16 @@ public class Book implements Serializable{
this.commentCount = commentCount; this.commentCount = commentCount;
} }
@Generated("org.mybatis.generator.api.MyBatisGenerator")
public Integer getYesterdayBuy() {
return yesterdayBuy;
}
@Generated("org.mybatis.generator.api.MyBatisGenerator")
public void setYesterdayBuy(Integer yesterdayBuy) {
this.yesterdayBuy = yesterdayBuy;
}
@Generated("org.mybatis.generator.api.MyBatisGenerator") @Generated("org.mybatis.generator.api.MyBatisGenerator")
public Long getLastIndexId() { public Long getLastIndexId() {
return lastIndexId; return lastIndexId;

View File

@ -52,6 +52,9 @@ public final class BookDynamicSqlSupport {
@Generated("org.mybatis.generator.api.MyBatisGenerator") @Generated("org.mybatis.generator.api.MyBatisGenerator")
public static final SqlColumn<Integer> commentCount = book.commentCount; public static final SqlColumn<Integer> commentCount = book.commentCount;
@Generated("org.mybatis.generator.api.MyBatisGenerator")
public static final SqlColumn<Integer> yesterdayBuy = book.yesterdayBuy;
@Generated("org.mybatis.generator.api.MyBatisGenerator") @Generated("org.mybatis.generator.api.MyBatisGenerator")
public static final SqlColumn<Long> lastIndexId = book.lastIndexId; public static final SqlColumn<Long> lastIndexId = book.lastIndexId;
@ -115,6 +118,8 @@ public final class BookDynamicSqlSupport {
public final SqlColumn<Integer> commentCount = column("comment_count", JDBCType.INTEGER); public final SqlColumn<Integer> commentCount = column("comment_count", JDBCType.INTEGER);
public final SqlColumn<Integer> yesterdayBuy = column("yesterday_buy", JDBCType.INTEGER);
public final SqlColumn<Long> lastIndexId = column("last_index_id", JDBCType.BIGINT); public final SqlColumn<Long> lastIndexId = column("last_index_id", JDBCType.BIGINT);
public final SqlColumn<String> lastIndexName = column("last_index_name", JDBCType.VARCHAR); public final SqlColumn<String> lastIndexName = column("last_index_name", JDBCType.VARCHAR);

View File

@ -4,10 +4,12 @@ import static com.java2nb.novel.mapper.BookDynamicSqlSupport.*;
import static org.mybatis.dynamic.sql.SqlBuilder.*; import static org.mybatis.dynamic.sql.SqlBuilder.*;
import com.java2nb.novel.entity.Book; import com.java2nb.novel.entity.Book;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import javax.annotation.Generated; import javax.annotation.Generated;
import org.apache.ibatis.annotations.DeleteProvider; import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.InsertProvider; import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@ -35,62 +37,63 @@ import org.mybatis.dynamic.sql.util.mybatis3.MyBatis3Utils;
@Mapper @Mapper
public interface BookMapper { public interface BookMapper {
@Generated("org.mybatis.generator.api.MyBatisGenerator") @Generated("org.mybatis.generator.api.MyBatisGenerator")
BasicColumn[] selectList = BasicColumn.columnList(id, workDirection, catId, catName, picUrl, bookName, authorId, authorName, bookDesc, score, bookStatus, visitCount, wordCount, commentCount, lastIndexId, lastIndexName, lastIndexUpdateTime, isVip, status, updateTime, createTime, crawlSourceId, crawlBookId, crawlLastTime, crawlIsStop); BasicColumn[] selectList = BasicColumn.columnList(id, workDirection, catId, catName, picUrl, bookName, authorId, authorName, bookDesc, score, bookStatus, visitCount, wordCount, commentCount, yesterdayBuy, lastIndexId, lastIndexName, lastIndexUpdateTime, isVip, status, updateTime, createTime, crawlSourceId, crawlBookId, crawlLastTime, crawlIsStop);
@Generated("org.mybatis.generator.api.MyBatisGenerator") @Generated("org.mybatis.generator.api.MyBatisGenerator")
@SelectProvider(type=SqlProviderAdapter.class, method="select") @SelectProvider(type = SqlProviderAdapter.class, method = "select")
long count(SelectStatementProvider selectStatement); long count(SelectStatementProvider selectStatement);
@Generated("org.mybatis.generator.api.MyBatisGenerator") @Generated("org.mybatis.generator.api.MyBatisGenerator")
@DeleteProvider(type=SqlProviderAdapter.class, method="delete") @DeleteProvider(type = SqlProviderAdapter.class, method = "delete")
int delete(DeleteStatementProvider deleteStatement); int delete(DeleteStatementProvider deleteStatement);
@Generated("org.mybatis.generator.api.MyBatisGenerator") @Generated("org.mybatis.generator.api.MyBatisGenerator")
@InsertProvider(type=SqlProviderAdapter.class, method="insert") @InsertProvider(type = SqlProviderAdapter.class, method = "insert")
int insert(InsertStatementProvider<Book> insertStatement); int insert(InsertStatementProvider<Book> insertStatement);
@Generated("org.mybatis.generator.api.MyBatisGenerator") @Generated("org.mybatis.generator.api.MyBatisGenerator")
@InsertProvider(type=SqlProviderAdapter.class, method="insertMultiple") @InsertProvider(type = SqlProviderAdapter.class, method = "insertMultiple")
int insertMultiple(MultiRowInsertStatementProvider<Book> multipleInsertStatement); int insertMultiple(MultiRowInsertStatementProvider<Book> multipleInsertStatement);
@Generated("org.mybatis.generator.api.MyBatisGenerator") @Generated("org.mybatis.generator.api.MyBatisGenerator")
@SelectProvider(type=SqlProviderAdapter.class, method="select") @SelectProvider(type = SqlProviderAdapter.class, method = "select")
@ResultMap("BookResult") @ResultMap("BookResult")
Optional<Book> selectOne(SelectStatementProvider selectStatement); Optional<Book> selectOne(SelectStatementProvider selectStatement);
@Generated("org.mybatis.generator.api.MyBatisGenerator") @Generated("org.mybatis.generator.api.MyBatisGenerator")
@SelectProvider(type=SqlProviderAdapter.class, method="select") @SelectProvider(type = SqlProviderAdapter.class, method = "select")
@Results(id="BookResult", value = { @Results(id = "BookResult", value = {
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column = "id", property = "id", jdbcType = JdbcType.BIGINT, id = true),
@Result(column="work_direction", property="workDirection", jdbcType=JdbcType.TINYINT), @Result(column = "work_direction", property = "workDirection", jdbcType = JdbcType.TINYINT),
@Result(column="cat_id", property="catId", jdbcType=JdbcType.INTEGER), @Result(column = "cat_id", property = "catId", jdbcType = JdbcType.INTEGER),
@Result(column="cat_name", property="catName", jdbcType=JdbcType.VARCHAR), @Result(column = "cat_name", property = "catName", jdbcType = JdbcType.VARCHAR),
@Result(column="pic_url", property="picUrl", jdbcType=JdbcType.VARCHAR), @Result(column = "pic_url", property = "picUrl", jdbcType = JdbcType.VARCHAR),
@Result(column="book_name", property="bookName", jdbcType=JdbcType.VARCHAR), @Result(column = "book_name", property = "bookName", jdbcType = JdbcType.VARCHAR),
@Result(column="author_id", property="authorId", jdbcType=JdbcType.BIGINT), @Result(column = "author_id", property = "authorId", jdbcType = JdbcType.BIGINT),
@Result(column="author_name", property="authorName", jdbcType=JdbcType.VARCHAR), @Result(column = "author_name", property = "authorName", jdbcType = JdbcType.VARCHAR),
@Result(column="book_desc", property="bookDesc", jdbcType=JdbcType.VARCHAR), @Result(column = "book_desc", property = "bookDesc", jdbcType = JdbcType.VARCHAR),
@Result(column="score", property="score", jdbcType=JdbcType.REAL), @Result(column = "score", property = "score", jdbcType = JdbcType.REAL),
@Result(column="book_status", property="bookStatus", jdbcType=JdbcType.TINYINT), @Result(column = "book_status", property = "bookStatus", jdbcType = JdbcType.TINYINT),
@Result(column="visit_count", property="visitCount", jdbcType=JdbcType.BIGINT), @Result(column = "visit_count", property = "visitCount", jdbcType = JdbcType.BIGINT),
@Result(column="word_count", property="wordCount", jdbcType=JdbcType.INTEGER), @Result(column = "word_count", property = "wordCount", jdbcType = JdbcType.INTEGER),
@Result(column="comment_count", property="commentCount", jdbcType=JdbcType.INTEGER), @Result(column = "comment_count", property = "commentCount", jdbcType = JdbcType.INTEGER),
@Result(column="last_index_id", property="lastIndexId", jdbcType=JdbcType.BIGINT), @Result(column="yesterday_buy", property="yesterdayBuy", jdbcType=JdbcType.INTEGER),
@Result(column="last_index_name", property="lastIndexName", jdbcType=JdbcType.VARCHAR), @Result(column = "last_index_id", property = "lastIndexId", jdbcType = JdbcType.BIGINT),
@Result(column="last_index_update_time", property="lastIndexUpdateTime", jdbcType=JdbcType.TIMESTAMP), @Result(column = "last_index_name", property = "lastIndexName", jdbcType = JdbcType.VARCHAR),
@Result(column="is_vip", property="isVip", jdbcType=JdbcType.TINYINT), @Result(column = "last_index_update_time", property = "lastIndexUpdateTime", jdbcType = JdbcType.TIMESTAMP),
@Result(column="status", property="status", jdbcType=JdbcType.TINYINT), @Result(column = "is_vip", property = "isVip", jdbcType = JdbcType.TINYINT),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), @Result(column = "status", property = "status", jdbcType = JdbcType.TINYINT),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), @Result(column = "update_time", property = "updateTime", jdbcType = JdbcType.TIMESTAMP),
@Result(column="crawl_source_id", property="crawlSourceId", jdbcType=JdbcType.INTEGER), @Result(column = "create_time", property = "createTime", jdbcType = JdbcType.TIMESTAMP),
@Result(column="crawl_book_id", property="crawlBookId", jdbcType=JdbcType.VARCHAR), @Result(column = "crawl_source_id", property = "crawlSourceId", jdbcType = JdbcType.INTEGER),
@Result(column="crawl_last_time", property="crawlLastTime", jdbcType=JdbcType.TIMESTAMP), @Result(column = "crawl_book_id", property = "crawlBookId", jdbcType = JdbcType.VARCHAR),
@Result(column="crawl_is_stop", property="crawlIsStop", jdbcType=JdbcType.TINYINT) @Result(column = "crawl_last_time", property = "crawlLastTime", jdbcType = JdbcType.TIMESTAMP),
@Result(column = "crawl_is_stop", property = "crawlIsStop", jdbcType = JdbcType.TINYINT)
}) })
List<Book> selectMany(SelectStatementProvider selectStatement); List<Book> selectMany(SelectStatementProvider selectStatement);
@Generated("org.mybatis.generator.api.MyBatisGenerator") @Generated("org.mybatis.generator.api.MyBatisGenerator")
@UpdateProvider(type=SqlProviderAdapter.class, method="update") @UpdateProvider(type = SqlProviderAdapter.class, method = "update")
int update(UpdateStatementProvider updateStatement); int update(UpdateStatementProvider updateStatement);
@Generated("org.mybatis.generator.api.MyBatisGenerator") @Generated("org.mybatis.generator.api.MyBatisGenerator")
@ -106,100 +109,103 @@ public interface BookMapper {
@Generated("org.mybatis.generator.api.MyBatisGenerator") @Generated("org.mybatis.generator.api.MyBatisGenerator")
default int deleteByPrimaryKey(Long id_) { default int deleteByPrimaryKey(Long id_) {
return delete(c -> return delete(c ->
c.where(id, isEqualTo(id_)) c.where(id, isEqualTo(id_))
); );
} }
@Generated("org.mybatis.generator.api.MyBatisGenerator") @Generated("org.mybatis.generator.api.MyBatisGenerator")
default int insert(Book record) { default int insert(Book record) {
return MyBatis3Utils.insert(this::insert, record, book, c -> return MyBatis3Utils.insert(this::insert, record, book, c ->
c.map(id).toProperty("id") c.map(id).toProperty("id")
.map(workDirection).toProperty("workDirection") .map(workDirection).toProperty("workDirection")
.map(catId).toProperty("catId") .map(catId).toProperty("catId")
.map(catName).toProperty("catName") .map(catName).toProperty("catName")
.map(picUrl).toProperty("picUrl") .map(picUrl).toProperty("picUrl")
.map(bookName).toProperty("bookName") .map(bookName).toProperty("bookName")
.map(authorId).toProperty("authorId") .map(authorId).toProperty("authorId")
.map(authorName).toProperty("authorName") .map(authorName).toProperty("authorName")
.map(bookDesc).toProperty("bookDesc") .map(bookDesc).toProperty("bookDesc")
.map(score).toProperty("score") .map(score).toProperty("score")
.map(bookStatus).toProperty("bookStatus") .map(bookStatus).toProperty("bookStatus")
.map(visitCount).toProperty("visitCount") .map(visitCount).toProperty("visitCount")
.map(wordCount).toProperty("wordCount") .map(wordCount).toProperty("wordCount")
.map(commentCount).toProperty("commentCount") .map(commentCount).toProperty("commentCount")
.map(lastIndexId).toProperty("lastIndexId") .map(yesterdayBuy).toProperty("yesterdayBuy")
.map(lastIndexName).toProperty("lastIndexName") .map(lastIndexId).toProperty("lastIndexId")
.map(lastIndexUpdateTime).toProperty("lastIndexUpdateTime") .map(lastIndexName).toProperty("lastIndexName")
.map(isVip).toProperty("isVip") .map(lastIndexUpdateTime).toProperty("lastIndexUpdateTime")
.map(status).toProperty("status") .map(isVip).toProperty("isVip")
.map(updateTime).toProperty("updateTime") .map(status).toProperty("status")
.map(createTime).toProperty("createTime") .map(updateTime).toProperty("updateTime")
.map(crawlSourceId).toProperty("crawlSourceId") .map(createTime).toProperty("createTime")
.map(crawlBookId).toProperty("crawlBookId") .map(crawlSourceId).toProperty("crawlSourceId")
.map(crawlLastTime).toProperty("crawlLastTime") .map(crawlBookId).toProperty("crawlBookId")
.map(crawlIsStop).toProperty("crawlIsStop") .map(crawlLastTime).toProperty("crawlLastTime")
.map(crawlIsStop).toProperty("crawlIsStop")
); );
} }
@Generated("org.mybatis.generator.api.MyBatisGenerator") @Generated("org.mybatis.generator.api.MyBatisGenerator")
default int insertMultiple(Collection<Book> records) { default int insertMultiple(Collection<Book> records) {
return MyBatis3Utils.insertMultiple(this::insertMultiple, records, book, c -> return MyBatis3Utils.insertMultiple(this::insertMultiple, records, book, c ->
c.map(id).toProperty("id") c.map(id).toProperty("id")
.map(workDirection).toProperty("workDirection") .map(workDirection).toProperty("workDirection")
.map(catId).toProperty("catId") .map(catId).toProperty("catId")
.map(catName).toProperty("catName") .map(catName).toProperty("catName")
.map(picUrl).toProperty("picUrl") .map(picUrl).toProperty("picUrl")
.map(bookName).toProperty("bookName") .map(bookName).toProperty("bookName")
.map(authorId).toProperty("authorId") .map(authorId).toProperty("authorId")
.map(authorName).toProperty("authorName") .map(authorName).toProperty("authorName")
.map(bookDesc).toProperty("bookDesc") .map(bookDesc).toProperty("bookDesc")
.map(score).toProperty("score") .map(score).toProperty("score")
.map(bookStatus).toProperty("bookStatus") .map(bookStatus).toProperty("bookStatus")
.map(visitCount).toProperty("visitCount") .map(visitCount).toProperty("visitCount")
.map(wordCount).toProperty("wordCount") .map(wordCount).toProperty("wordCount")
.map(commentCount).toProperty("commentCount") .map(commentCount).toProperty("commentCount")
.map(lastIndexId).toProperty("lastIndexId") .map(yesterdayBuy).toProperty("yesterdayBuy")
.map(lastIndexName).toProperty("lastIndexName") .map(lastIndexId).toProperty("lastIndexId")
.map(lastIndexUpdateTime).toProperty("lastIndexUpdateTime") .map(lastIndexName).toProperty("lastIndexName")
.map(isVip).toProperty("isVip") .map(lastIndexUpdateTime).toProperty("lastIndexUpdateTime")
.map(status).toProperty("status") .map(isVip).toProperty("isVip")
.map(updateTime).toProperty("updateTime") .map(status).toProperty("status")
.map(createTime).toProperty("createTime") .map(updateTime).toProperty("updateTime")
.map(crawlSourceId).toProperty("crawlSourceId") .map(createTime).toProperty("createTime")
.map(crawlBookId).toProperty("crawlBookId") .map(crawlSourceId).toProperty("crawlSourceId")
.map(crawlLastTime).toProperty("crawlLastTime") .map(crawlBookId).toProperty("crawlBookId")
.map(crawlIsStop).toProperty("crawlIsStop") .map(crawlLastTime).toProperty("crawlLastTime")
.map(crawlIsStop).toProperty("crawlIsStop")
); );
} }
@Generated("org.mybatis.generator.api.MyBatisGenerator") @Generated("org.mybatis.generator.api.MyBatisGenerator")
default int insertSelective(Book record) { default int insertSelective(Book record) {
return MyBatis3Utils.insert(this::insert, record, book, c -> return MyBatis3Utils.insert(this::insert, record, book, c ->
c.map(id).toPropertyWhenPresent("id", record::getId) c.map(id).toPropertyWhenPresent("id", record::getId)
.map(workDirection).toPropertyWhenPresent("workDirection", record::getWorkDirection) .map(workDirection).toPropertyWhenPresent("workDirection", record::getWorkDirection)
.map(catId).toPropertyWhenPresent("catId", record::getCatId) .map(catId).toPropertyWhenPresent("catId", record::getCatId)
.map(catName).toPropertyWhenPresent("catName", record::getCatName) .map(catName).toPropertyWhenPresent("catName", record::getCatName)
.map(picUrl).toPropertyWhenPresent("picUrl", record::getPicUrl) .map(picUrl).toPropertyWhenPresent("picUrl", record::getPicUrl)
.map(bookName).toPropertyWhenPresent("bookName", record::getBookName) .map(bookName).toPropertyWhenPresent("bookName", record::getBookName)
.map(authorId).toPropertyWhenPresent("authorId", record::getAuthorId) .map(authorId).toPropertyWhenPresent("authorId", record::getAuthorId)
.map(authorName).toPropertyWhenPresent("authorName", record::getAuthorName) .map(authorName).toPropertyWhenPresent("authorName", record::getAuthorName)
.map(bookDesc).toPropertyWhenPresent("bookDesc", record::getBookDesc) .map(bookDesc).toPropertyWhenPresent("bookDesc", record::getBookDesc)
.map(score).toPropertyWhenPresent("score", record::getScore) .map(score).toPropertyWhenPresent("score", record::getScore)
.map(bookStatus).toPropertyWhenPresent("bookStatus", record::getBookStatus) .map(bookStatus).toPropertyWhenPresent("bookStatus", record::getBookStatus)
.map(visitCount).toPropertyWhenPresent("visitCount", record::getVisitCount) .map(visitCount).toPropertyWhenPresent("visitCount", record::getVisitCount)
.map(wordCount).toPropertyWhenPresent("wordCount", record::getWordCount) .map(wordCount).toPropertyWhenPresent("wordCount", record::getWordCount)
.map(commentCount).toPropertyWhenPresent("commentCount", record::getCommentCount) .map(commentCount).toPropertyWhenPresent("commentCount", record::getCommentCount)
.map(lastIndexId).toPropertyWhenPresent("lastIndexId", record::getLastIndexId) .map(yesterdayBuy).toPropertyWhenPresent("yesterdayBuy", record::getYesterdayBuy)
.map(lastIndexName).toPropertyWhenPresent("lastIndexName", record::getLastIndexName) .map(lastIndexId).toPropertyWhenPresent("lastIndexId", record::getLastIndexId)
.map(lastIndexUpdateTime).toPropertyWhenPresent("lastIndexUpdateTime", record::getLastIndexUpdateTime) .map(lastIndexName).toPropertyWhenPresent("lastIndexName", record::getLastIndexName)
.map(isVip).toPropertyWhenPresent("isVip", record::getIsVip) .map(lastIndexUpdateTime).toPropertyWhenPresent("lastIndexUpdateTime", record::getLastIndexUpdateTime)
.map(status).toPropertyWhenPresent("status", record::getStatus) .map(isVip).toPropertyWhenPresent("isVip", record::getIsVip)
.map(updateTime).toPropertyWhenPresent("updateTime", record::getUpdateTime) .map(status).toPropertyWhenPresent("status", record::getStatus)
.map(createTime).toPropertyWhenPresent("createTime", record::getCreateTime) .map(updateTime).toPropertyWhenPresent("updateTime", record::getUpdateTime)
.map(crawlSourceId).toPropertyWhenPresent("crawlSourceId", record::getCrawlSourceId) .map(createTime).toPropertyWhenPresent("createTime", record::getCreateTime)
.map(crawlBookId).toPropertyWhenPresent("crawlBookId", record::getCrawlBookId) .map(crawlSourceId).toPropertyWhenPresent("crawlSourceId", record::getCrawlSourceId)
.map(crawlLastTime).toPropertyWhenPresent("crawlLastTime", record::getCrawlLastTime) .map(crawlBookId).toPropertyWhenPresent("crawlBookId", record::getCrawlBookId)
.map(crawlIsStop).toPropertyWhenPresent("crawlIsStop", record::getCrawlIsStop) .map(crawlLastTime).toPropertyWhenPresent("crawlLastTime", record::getCrawlLastTime)
.map(crawlIsStop).toPropertyWhenPresent("crawlIsStop", record::getCrawlIsStop)
); );
} }
@ -221,7 +227,7 @@ public interface BookMapper {
@Generated("org.mybatis.generator.api.MyBatisGenerator") @Generated("org.mybatis.generator.api.MyBatisGenerator")
default Optional<Book> selectByPrimaryKey(Long id_) { default Optional<Book> selectByPrimaryKey(Long id_) {
return selectOne(c -> return selectOne(c ->
c.where(id, isEqualTo(id_)) c.where(id, isEqualTo(id_))
); );
} }
@ -246,6 +252,7 @@ public interface BookMapper {
.set(visitCount).equalTo(record::getVisitCount) .set(visitCount).equalTo(record::getVisitCount)
.set(wordCount).equalTo(record::getWordCount) .set(wordCount).equalTo(record::getWordCount)
.set(commentCount).equalTo(record::getCommentCount) .set(commentCount).equalTo(record::getCommentCount)
.set(yesterdayBuy).equalTo(record::getYesterdayBuy)
.set(lastIndexId).equalTo(record::getLastIndexId) .set(lastIndexId).equalTo(record::getLastIndexId)
.set(lastIndexName).equalTo(record::getLastIndexName) .set(lastIndexName).equalTo(record::getLastIndexName)
.set(lastIndexUpdateTime).equalTo(record::getLastIndexUpdateTime) .set(lastIndexUpdateTime).equalTo(record::getLastIndexUpdateTime)
@ -275,6 +282,7 @@ public interface BookMapper {
.set(visitCount).equalToWhenPresent(record::getVisitCount) .set(visitCount).equalToWhenPresent(record::getVisitCount)
.set(wordCount).equalToWhenPresent(record::getWordCount) .set(wordCount).equalToWhenPresent(record::getWordCount)
.set(commentCount).equalToWhenPresent(record::getCommentCount) .set(commentCount).equalToWhenPresent(record::getCommentCount)
.set(yesterdayBuy).equalToWhenPresent(record::getYesterdayBuy)
.set(lastIndexId).equalToWhenPresent(record::getLastIndexId) .set(lastIndexId).equalToWhenPresent(record::getLastIndexId)
.set(lastIndexName).equalToWhenPresent(record::getLastIndexName) .set(lastIndexName).equalToWhenPresent(record::getLastIndexName)
.set(lastIndexUpdateTime).equalToWhenPresent(record::getLastIndexUpdateTime) .set(lastIndexUpdateTime).equalToWhenPresent(record::getLastIndexUpdateTime)
@ -291,62 +299,64 @@ public interface BookMapper {
@Generated("org.mybatis.generator.api.MyBatisGenerator") @Generated("org.mybatis.generator.api.MyBatisGenerator")
default int updateByPrimaryKey(Book record) { default int updateByPrimaryKey(Book record) {
return update(c -> return update(c ->
c.set(workDirection).equalTo(record::getWorkDirection) c.set(workDirection).equalTo(record::getWorkDirection)
.set(catId).equalTo(record::getCatId) .set(catId).equalTo(record::getCatId)
.set(catName).equalTo(record::getCatName) .set(catName).equalTo(record::getCatName)
.set(picUrl).equalTo(record::getPicUrl) .set(picUrl).equalTo(record::getPicUrl)
.set(bookName).equalTo(record::getBookName) .set(bookName).equalTo(record::getBookName)
.set(authorId).equalTo(record::getAuthorId) .set(authorId).equalTo(record::getAuthorId)
.set(authorName).equalTo(record::getAuthorName) .set(authorName).equalTo(record::getAuthorName)
.set(bookDesc).equalTo(record::getBookDesc) .set(bookDesc).equalTo(record::getBookDesc)
.set(score).equalTo(record::getScore) .set(score).equalTo(record::getScore)
.set(bookStatus).equalTo(record::getBookStatus) .set(bookStatus).equalTo(record::getBookStatus)
.set(visitCount).equalTo(record::getVisitCount) .set(visitCount).equalTo(record::getVisitCount)
.set(wordCount).equalTo(record::getWordCount) .set(wordCount).equalTo(record::getWordCount)
.set(commentCount).equalTo(record::getCommentCount) .set(commentCount).equalTo(record::getCommentCount)
.set(lastIndexId).equalTo(record::getLastIndexId) .set(yesterdayBuy).equalTo(record::getYesterdayBuy)
.set(lastIndexName).equalTo(record::getLastIndexName) .set(lastIndexId).equalTo(record::getLastIndexId)
.set(lastIndexUpdateTime).equalTo(record::getLastIndexUpdateTime) .set(lastIndexName).equalTo(record::getLastIndexName)
.set(isVip).equalTo(record::getIsVip) .set(lastIndexUpdateTime).equalTo(record::getLastIndexUpdateTime)
.set(status).equalTo(record::getStatus) .set(isVip).equalTo(record::getIsVip)
.set(updateTime).equalTo(record::getUpdateTime) .set(status).equalTo(record::getStatus)
.set(createTime).equalTo(record::getCreateTime) .set(updateTime).equalTo(record::getUpdateTime)
.set(crawlSourceId).equalTo(record::getCrawlSourceId) .set(createTime).equalTo(record::getCreateTime)
.set(crawlBookId).equalTo(record::getCrawlBookId) .set(crawlSourceId).equalTo(record::getCrawlSourceId)
.set(crawlLastTime).equalTo(record::getCrawlLastTime) .set(crawlBookId).equalTo(record::getCrawlBookId)
.set(crawlIsStop).equalTo(record::getCrawlIsStop) .set(crawlLastTime).equalTo(record::getCrawlLastTime)
.where(id, isEqualTo(record::getId)) .set(crawlIsStop).equalTo(record::getCrawlIsStop)
.where(id, isEqualTo(record::getId))
); );
} }
@Generated("org.mybatis.generator.api.MyBatisGenerator") @Generated("org.mybatis.generator.api.MyBatisGenerator")
default int updateByPrimaryKeySelective(Book record) { default int updateByPrimaryKeySelective(Book record) {
return update(c -> return update(c ->
c.set(workDirection).equalToWhenPresent(record::getWorkDirection) c.set(workDirection).equalToWhenPresent(record::getWorkDirection)
.set(catId).equalToWhenPresent(record::getCatId) .set(catId).equalToWhenPresent(record::getCatId)
.set(catName).equalToWhenPresent(record::getCatName) .set(catName).equalToWhenPresent(record::getCatName)
.set(picUrl).equalToWhenPresent(record::getPicUrl) .set(picUrl).equalToWhenPresent(record::getPicUrl)
.set(bookName).equalToWhenPresent(record::getBookName) .set(bookName).equalToWhenPresent(record::getBookName)
.set(authorId).equalToWhenPresent(record::getAuthorId) .set(authorId).equalToWhenPresent(record::getAuthorId)
.set(authorName).equalToWhenPresent(record::getAuthorName) .set(authorName).equalToWhenPresent(record::getAuthorName)
.set(bookDesc).equalToWhenPresent(record::getBookDesc) .set(bookDesc).equalToWhenPresent(record::getBookDesc)
.set(score).equalToWhenPresent(record::getScore) .set(score).equalToWhenPresent(record::getScore)
.set(bookStatus).equalToWhenPresent(record::getBookStatus) .set(bookStatus).equalToWhenPresent(record::getBookStatus)
.set(visitCount).equalToWhenPresent(record::getVisitCount) .set(visitCount).equalToWhenPresent(record::getVisitCount)
.set(wordCount).equalToWhenPresent(record::getWordCount) .set(wordCount).equalToWhenPresent(record::getWordCount)
.set(commentCount).equalToWhenPresent(record::getCommentCount) .set(commentCount).equalToWhenPresent(record::getCommentCount)
.set(lastIndexId).equalToWhenPresent(record::getLastIndexId) .set(yesterdayBuy).equalToWhenPresent(record::getYesterdayBuy)
.set(lastIndexName).equalToWhenPresent(record::getLastIndexName) .set(lastIndexId).equalToWhenPresent(record::getLastIndexId)
.set(lastIndexUpdateTime).equalToWhenPresent(record::getLastIndexUpdateTime) .set(lastIndexName).equalToWhenPresent(record::getLastIndexName)
.set(isVip).equalToWhenPresent(record::getIsVip) .set(lastIndexUpdateTime).equalToWhenPresent(record::getLastIndexUpdateTime)
.set(status).equalToWhenPresent(record::getStatus) .set(isVip).equalToWhenPresent(record::getIsVip)
.set(updateTime).equalToWhenPresent(record::getUpdateTime) .set(status).equalToWhenPresent(record::getStatus)
.set(createTime).equalToWhenPresent(record::getCreateTime) .set(updateTime).equalToWhenPresent(record::getUpdateTime)
.set(crawlSourceId).equalToWhenPresent(record::getCrawlSourceId) .set(createTime).equalToWhenPresent(record::getCreateTime)
.set(crawlBookId).equalToWhenPresent(record::getCrawlBookId) .set(crawlSourceId).equalToWhenPresent(record::getCrawlSourceId)
.set(crawlLastTime).equalToWhenPresent(record::getCrawlLastTime) .set(crawlBookId).equalToWhenPresent(record::getCrawlBookId)
.set(crawlIsStop).equalToWhenPresent(record::getCrawlIsStop) .set(crawlLastTime).equalToWhenPresent(record::getCrawlLastTime)
.where(id, isEqualTo(record::getId)) .set(crawlIsStop).equalToWhenPresent(record::getCrawlIsStop)
.where(id, isEqualTo(record::getId))
); );
} }
} }

View File

@ -44,7 +44,7 @@
</javaClientGenerator> </javaClientGenerator>
<!--生成全部表tableName设为%--> <!--生成全部表tableName设为%-->
<table tableName="author_income_detail"/> <table tableName="book"/>
<!-- 指定数据库表 --> <!-- 指定数据库表 -->
<!--<table schema="jly" tableName="job_position" domainObjectName="JobPositionTest"/>--> <!--<table schema="jly" tableName="job_position" domainObjectName="JobPositionTest"/>-->

View File

@ -488,7 +488,7 @@ public class BookServiceImpl implements BookService {
PageHelper.startPage(page, pageSize); PageHelper.startPage(page, pageSize);
SelectStatementProvider selectStatement = select(id, bookName, visitCount, lastIndexName, status) SelectStatementProvider selectStatement = select(id, bookName, visitCount, yesterdayBuy,lastIndexName, status)
.from(book) .from(book)
.where(authorId, isEqualTo(authorService.queryAuthor(userId).getId())) .where(authorId, isEqualTo(authorService.queryAuthor(userId).getId()))
.orderBy(BookDynamicSqlSupport.createTime.descending()) .orderBy(BookDynamicSqlSupport.createTime.descending())

View File

@ -54,6 +54,9 @@
<th class="goread"> <th class="goread">
点击量 点击量
</th> </th>
<th class="goread">
昨日订阅量
</th>
<th class="name"> <th class="name">
最新章节 最新章节
</th> </th>
@ -118,7 +121,7 @@
<script src="/javascript/user.js" type="text/javascript"></script> <script src="/javascript/user.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript"> <script language="javascript" type="text/javascript">
search(1, 10); search(1, 5);
function search(curr, limit) { function search(curr, limit) {
@ -142,6 +145,8 @@
" "+book.bookName+"</td>\n" + " "+book.bookName+"</td>\n" +
" <td class=\"goread\" valsc=\"291|2037554|1\">" " <td class=\"goread\" valsc=\"291|2037554|1\">"
+book.visitCount+"</td>\n" + +book.visitCount+"</td>\n" +
" <td class=\"goread\" valsc=\"291|2037554|1\">"
+book.yesterdayBuy+"</td>\n" +
" <td class=\"name\">\n" + " <td class=\"name\">\n" +
" "+book.lastIndexName+"\n" + " "+book.lastIndexName+"\n" +
" </td>\n" + " </td>\n" +
@ -149,7 +154,7 @@
" </td>\n" + " </td>\n" +
" <td class=\"goread\" id='opt"+book.id+"'>" + " <td class=\"goread\" id='opt"+book.id+"'>" +
"<a href='javascript:updateBookStatus(\""+book.id+"\","+book.status+")'>"+(book.status==0?'上架':'下架')+" </a>" + "<a href='javascript:updateBookStatus(\""+book.id+"\","+book.status+")'>"+(book.status==0?'上架':'下架')+" </a><br/>" +
"<a href='/author/content_add.html?bookStatus="+book.status+"&bookId="+book.id+"'>发布章节 </a>" + "<a href='/author/content_add.html?bookStatus="+book.status+"&bookId="+book.id+"'>发布章节 </a>" +
"</td> </tr>"); "</td> </tr>");
} }

1
sql/20201109.sql Normal file
View File

@ -0,0 +1 @@
alter table book add column `yesterday_buy` int(11) DEFAULT '0' COMMENT '昨日订阅数' after comment_count;

View File

@ -1865,3 +1865,6 @@ CREATE TABLE `author_income` (
`create_time` datetime DEFAULT NULL, `create_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='稿费收入统计表'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='稿费收入统计表';
alter table book add column `yesterday_buy` int(11) DEFAULT '0' COMMENT '昨日订阅数' after comment_count;