From 6fd183c2ae191caefff8c67c1f75107cb43d7000 Mon Sep 17 00:00:00 2001
From: xiongxiaoyang <773861846@qq.com>
Date: Thu, 24 Dec 2020 01:22:19 +0800
Subject: [PATCH] =?UTF-8?q?=E7=88=AC=E8=99=AB=E4=BB=A3=E7=A0=81=E4=BC=98?=
 =?UTF-8?q?=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../src/main/java/com/java2nb/novel/core/crawl/CrawlParser.java | 2 +-
 novel-crawl/src/main/resources/mybatis/mapping/BookMapper.xml   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/novel-crawl/src/main/java/com/java2nb/novel/core/crawl/CrawlParser.java b/novel-crawl/src/main/java/com/java2nb/novel/core/crawl/CrawlParser.java
index 21d66cf..505fd6b 100644
--- a/novel-crawl/src/main/java/com/java2nb/novel/core/crawl/CrawlParser.java
+++ b/novel-crawl/src/main/java/com/java2nb/novel/core/crawl/CrawlParser.java
@@ -171,7 +171,7 @@ public class CrawlParser {
             int indexNum = 0;
 
             //总字数
-            Integer totalWordCount = 0;
+            Integer totalWordCount = book.getWordCount() == null ? 0 : book.getWordCount();
 
             while (isFindIndex) {
 
diff --git a/novel-crawl/src/main/resources/mybatis/mapping/BookMapper.xml b/novel-crawl/src/main/resources/mybatis/mapping/BookMapper.xml
index ea9f378..b42d951 100644
--- a/novel-crawl/src/main/resources/mybatis/mapping/BookMapper.xml
+++ b/novel-crawl/src/main/resources/mybatis/mapping/BookMapper.xml
@@ -5,7 +5,7 @@
 
     <select id="queryNeedUpdateBook" resultType="com.java2nb.novel.entity.Book">
 
-        select id,crawl_source_id,crawl_book_id,crawl_last_time,pic_url
+        select id,crawl_source_id,crawl_book_id,crawl_last_time,pic_url,word_count
         from book where last_index_update_time > #{startDate} and crawl_source_id is not null
         order by crawl_last_time
         limit ${limit}