public interface NovelOverviewMapper {
    int countByExample(NovelOverviewExample example);

    int deleteByExample(NovelOverviewExample example);

    int deleteByPrimaryKey(Long id);

    int insert(NovelOverview record);

    int insertSelective(NovelOverview record);

    List<NovelOverview> selectByExample(NovelOverviewExample example);

    NovelOverview selectByPrimaryKey(Long id);

    int updateByExampleSelective(@Param("record") NovelOverview record, @Param("example") NovelOverviewExample example);

    int updateByExample(@Param("record") NovelOverview record, @Param("example") NovelOverviewExample example);

    int updateByPrimaryKeySelective(NovelOverview record);

    int updateByPrimaryKey(NovelOverview record);
} public interface ReaderBookshelfMapper {
    int countByExample(ReaderBookshelfExample example);

    int deleteByExample(ReaderBookshelfExample example);

    int deleteByPrimaryKey(Long id);

    int insert(ReaderBookshelf record);

    int insertSelective(ReaderBookshelf record);

    List<ReaderBookshelf> selectByExample(ReaderBookshelfExample example);

    ReaderBookshelf selectByPrimaryKey(Long id);

    int updateByExampleSelective(@Param("record") ReaderBookshelf record, @Param("example") ReaderBookshelfExample example);

    int updateByExample(@Param("record") ReaderBookshelf record, @Param("example") ReaderBookshelfExample example);

    int updateByPrimaryKeySelective(ReaderBookshelf record);

    int updateByPrimaryKey(ReaderBookshelf record);
} public class NovelOverview {
    private Long id;

    private String bookname;

    private String author;

    private String imgUrl;

    private String novelDescribe;

    private String category;

    private Short crawledChapter;

    private String crawledChapterName;

    private String novelStatus;

    private BigDecimal novelScore;

    private String publishSource;

    private Boolean preferGender;

    private Date updateTime;

    private Date createTime;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getBookname() {
        return bookname;
    }

    public void setBookname(String bookname) {
        this.bookname = bookname == null ? null : bookname.trim();
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author == null ? null : author.trim();
    }

    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl == null ? null : imgUrl.trim();
    }

    public String getNovelDescribe() {
        return novelDescribe;
    }

    public void setNovelDescribe(String novelDescribe) {
        this.novelDescribe = novelDescribe == null ? null : novelDescribe.trim();
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category == null ? null : category.trim();
    }

    public Short getCrawledChapter() {
        return crawledChapter;
    }

    public void setCrawledChapter(Short crawledChapter) {
        this.crawledChapter = crawledChapter;
    }

    public String getCrawledChapterName() {
        return crawledChapterName;
    }

    public void setCrawledChapterName(String crawledChapterName) {
        this.crawledChapterName = crawledChapterName == null ? null : crawledChapterName.trim();
    }

    public String getNovelStatus() {
        return novelStatus;
    }

    public void setNovelStatus(String novelStatus) {
        this.novelStatus = novelStatus == null ? null : novelStatus.trim();
    }

    public BigDecimal getNovelScore() {
        return novelScore;
    }

    public void setNovelScore(BigDecimal novelScore) {
        this.novelScore = novelScore;
    }

    public String getPublishSource() {
        return publishSource;
    }

    public void setPublishSource(String publishSource) {
        this.publishSource = publishSource == null ? null : publishSource.trim();
    }

    public Boolean getPreferGender() {
        return preferGender;
    }

    public void setPreferGender(Boolean preferGender) {
        this.preferGender = preferGender;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
} public class NovelOverviewExample {
    protected String orderByClause;

    protected boolean distinct;

    protected List<Criteria> oredCriteria;

    public NovelOverviewExample() {
        oredCriteria = new ArrayList<Criteria>();
    }

    public void setOrderByClause(String orderByClause) {
        this.orderByClause = orderByClause;
    }

    public String getOrderByClause() {
        return orderByClause;
    }

    public void setDistinct(boolean distinct) {
        this.distinct = distinct;
    }

    public boolean isDistinct() {
        return distinct;
    }

    public List<Criteria> getOredCriteria() {
        return oredCriteria;
    }

    public void or(Criteria criteria) {
        oredCriteria.add(criteria);
    }

    public Criteria or() {
        Criteria criteria = createCriteriaInternal();
        oredCriteria.add(criteria);
        return criteria;
    }

    public Criteria createCriteria() {
        Criteria criteria = createCriteriaInternal();
        if (oredCriteria.size() == 0) {
            oredCriteria.add(criteria);
        }
        return criteria;
    }

    protected Criteria createCriteriaInternal() {
        Criteria criteria = new Criteria();
        return criteria;
    }

    public void clear() {
        oredCriteria.clear();
        orderByClause = null;
        distinct = false;
    }

    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<Criterion>();
        }

        public boolean isValid() {
            return criteria.size() > 0;
        }

        public List<Criterion> getAllCriteria() {
            return criteria;
        }

        public List<Criterion> getCriteria() {
            return criteria;
        }

        protected void addCriterion(String condition) {
            if (condition == null) {
                throw new RuntimeException("Value for condition cannot be null");
            }
            criteria.add(new Criterion(condition));
        }

        protected void addCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value));
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value1, value2));
        }

        public Criteria andIdIsNull() {
            addCriterion("id is null");
            return (Criteria) this;
        }

        public Criteria andIdIsNotNull() {
            addCriterion("id is not null");
            return (Criteria) this;
        }

        public Criteria andIdEqualTo(Long value) {
            addCriterion("id =", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotEqualTo(Long value) {
            addCriterion("id <>", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdGreaterThan(Long value) {
            addCriterion("id >", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdGreaterThanOrEqualTo(Long value) {
            addCriterion("id >=", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdLessThan(Long value) {
            addCriterion("id <", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdLessThanOrEqualTo(Long value) {
            addCriterion("id <=", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdIn(List<Long> values) {
            addCriterion("id in", values, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotIn(List<Long> values) {
            addCriterion("id not in", values, "id");
            return (Criteria) this;
        }

        public Criteria andIdBetween(Long value1, Long value2) {
            addCriterion("id between", value1, value2, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotBetween(Long value1, Long value2) {
            addCriterion("id not between", value1, value2, "id");
            return (Criteria) this;
        }

        public Criteria andBooknameIsNull() {
            addCriterion("bookname is null");
            return (Criteria) this;
        }

        public Criteria andBooknameIsNotNull() {
            addCriterion("bookname is not null");
            return (Criteria) this;
        }

        public Criteria andBooknameEqualTo(String value) {
            addCriterion("bookname =", value, "bookname");
            return (Criteria) this;
        }

        public Criteria andBooknameNotEqualTo(String value) {
            addCriterion("bookname <>", value, "bookname");
            return (Criteria) this;
        }

        public Criteria andBooknameGreaterThan(String value) {
            addCriterion("bookname >", value, "bookname");
            return (Criteria) this;
        }

        public Criteria andBooknameGreaterThanOrEqualTo(String value) {
            addCriterion("bookname >=", value, "bookname");
            return (Criteria) this;
        }

        public Criteria andBooknameLessThan(String value) {
            addCriterion("bookname <", value, "bookname");
            return (Criteria) this;
        }

        public Criteria andBooknameLessThanOrEqualTo(String value) {
            addCriterion("bookname <=", value, "bookname");
            return (Criteria) this;
        }

        public Criteria andBooknameLike(String value) {
            addCriterion("bookname like", value, "bookname");
            return (Criteria) this;
        }
        
        public Criteria andBooknameBlurryLike(String value) {
        	String blurryValue = "%" + value + "%";
            addCriterion("bookname like", blurryValue, "bookname");
            return (Criteria) this;
        }

        public Criteria andBooknameNotLike(String value) {
            addCriterion("bookname not like", value, "bookname");
            return (Criteria) this;
        }

        public Criteria andBooknameIn(List<String> values) {
            addCriterion("bookname in", values, "bookname");
            return (Criteria) this;
        }

        public Criteria andBooknameNotIn(List<String> values) {
            addCriterion("bookname not in", values, "bookname");
            return (Criteria) this;
        }

        public Criteria andBooknameBetween(String value1, String value2) {
            addCriterion("bookname between", value1, value2, "bookname");
            return (Criteria) this;
        }

        public Criteria andBooknameNotBetween(String value1, String value2) {
            addCriterion("bookname not between", value1, value2, "bookname");
            return (Criteria) this;
        }

        public Criteria andAuthorIsNull() {
            addCriterion("author is null");
            return (Criteria) this;
        }

        public Criteria andAuthorIsNotNull() {
            addCriterion("author is not null");
            return (Criteria) this;
        }

        public Criteria andAuthorEqualTo(String value) {
            addCriterion("author =", value, "author");
            return (Criteria) this;
        }

        public Criteria andAuthorNotEqualTo(String value) {
            addCriterion("author <>", value, "author");
            return (Criteria) this;
        }

        public Criteria andAuthorGreaterThan(String value) {
            addCriterion("author >", value, "author");
            return (Criteria) this;
        }

        public Criteria andAuthorGreaterThanOrEqualTo(String value) {
            addCriterion("author >=", value, "author");
            return (Criteria) this;
        }

        public Criteria andAuthorLessThan(String value) {
            addCriterion("author <", value, "author");
            return (Criteria) this;
        }

        public Criteria andAuthorLessThanOrEqualTo(String value) {
            addCriterion("author <=", value, "author");
            return (Criteria) this;
        }

        public Criteria andAuthorLike(String value) {
            addCriterion("author like", value, "author");
            return (Criteria) this;
        }

        public Criteria andAuthorNotLike(String value) {
            addCriterion("author not like", value, "author");
            return (Criteria) this;
        }

        public Criteria andAuthorIn(List<String> values) {
            addCriterion("author in", values, "author");
            return (Criteria) this;
        }

        public Criteria andAuthorNotIn(List<String> values) {
            addCriterion("author not in", values, "author");
            return (Criteria) this;
        }

        public Criteria andAuthorBetween(String value1, String value2) {
            addCriterion("author between", value1, value2, "author");
            return (Criteria) this;
        }

        public Criteria andAuthorNotBetween(String value1, String value2) {
            addCriterion("author not between", value1, value2, "author");
            return (Criteria) this;
        }

        public Criteria andImgUrlIsNull() {
            addCriterion("img_url is null");
            return (Criteria) this;
        }

        public Criteria andImgUrlIsNotNull() {
            addCriterion("img_url is not null");
            return (Criteria) this;
        }

        public Criteria andImgUrlEqualTo(String value) {
            addCriterion("img_url =", value, "imgUrl");
            return (Criteria) this;
        }

        public Criteria andImgUrlNotEqualTo(String value) {
            addCriterion("img_url <>", value, "imgUrl");
            return (Criteria) this;
        }

        public Criteria andImgUrlGreaterThan(String value) {
            addCriterion("img_url >", value, "imgUrl");
            return (Criteria) this;
        }

        public Criteria andImgUrlGreaterThanOrEqualTo(String value) {
            addCriterion("img_url >=", value, "imgUrl");
            return (Criteria) this;
        }

        public Criteria andImgUrlLessThan(String value) {
            addCriterion("img_url <", value, "imgUrl");
            return (Criteria) this;
        }

        public Criteria andImgUrlLessThanOrEqualTo(String value) {
            addCriterion("img_url <=", value, "imgUrl");
            return (Criteria) this;
        }

        public Criteria andImgUrlLike(String value) {
            addCriterion("img_url like", value, "imgUrl");
            return (Criteria) this;
        }

        public Criteria andImgUrlNotLike(String value) {
            addCriterion("img_url not like", value, "imgUrl");
            return (Criteria) this;
        }

        public Criteria andImgUrlIn(List<String> values) {
            addCriterion("img_url in", values, "imgUrl");
            return (Criteria) this;
        }

        public Criteria andImgUrlNotIn(List<String> values) {
            addCriterion("img_url not in", values, "imgUrl");
            return (Criteria) this;
        }

        public Criteria andImgUrlBetween(String value1, String value2) {
            addCriterion("img_url between", value1, value2, "imgUrl");
            return (Criteria) this;
        }

        public Criteria andImgUrlNotBetween(String value1, String value2) {
            addCriterion("img_url not between", value1, value2, "imgUrl");
            return (Criteria) this;
        }

        public Criteria andNovelDescribeIsNull() {
            addCriterion("novel_describe is null");
            return (Criteria) this;
        }

        public Criteria andNovelDescribeIsNotNull() {
            addCriterion("novel_describe is not null");
            return (Criteria) this;
        }

        public Criteria andNovelDescribeEqualTo(String value) {
            addCriterion("novel_describe =", value, "novelDescribe");
            return (Criteria) this;
        }

        public Criteria andNovelDescribeNotEqualTo(String value) {
            addCriterion("novel_describe <>", value, "novelDescribe");
            return (Criteria) this;
        }

        public Criteria andNovelDescribeGreaterThan(String value) {
            addCriterion("novel_describe >", value, "novelDescribe");
            return (Criteria) this;
        }

        public Criteria andNovelDescribeGreaterThanOrEqualTo(String value) {
            addCriterion("novel_describe >=", value, "novelDescribe");
            return (Criteria) this;
        }

        public Criteria andNovelDescribeLessThan(String value) {
            addCriterion("novel_describe <", value, "novelDescribe");
            return (Criteria) this;
        }

        public Criteria andNovelDescribeLessThanOrEqualTo(String value) {
            addCriterion("novel_describe <=", value, "novelDescribe");
            return (Criteria) this;
        }

        public Criteria andNovelDescribeLike(String value) {
            addCriterion("novel_describe like", value, "novelDescribe");
            return (Criteria) this;
        }

        public Criteria andNovelDescribeNotLike(String value) {
            addCriterion("novel_describe not like", value, "novelDescribe");
            return (Criteria) this;
        }

        public Criteria andNovelDescribeIn(List<String> values) {
            addCriterion("novel_describe in", values, "novelDescribe");
            return (Criteria) this;
        }

        public Criteria andNovelDescribeNotIn(List<String> values) {
            addCriterion("novel_describe not in", values, "novelDescribe");
            return (Criteria) this;
        }

        public Criteria andNovelDescribeBetween(String value1, String value2) {
            addCriterion("novel_describe between", value1, value2, "novelDescribe");
            return (Criteria) this;
        }

        public Criteria andNovelDescribeNotBetween(String value1, String value2) {
            addCriterion("novel_describe not between", value1, value2, "novelDescribe");
            return (Criteria) this;
        }

        public Criteria andCategoryIsNull() {
            addCriterion("category is null");
            return (Criteria) this;
        }

        public Criteria andCategoryIsNotNull() {
            addCriterion("category is not null");
            return (Criteria) this;
        }

        public Criteria andCategoryEqualTo(String value) {
            addCriterion("category =", value, "category");
            return (Criteria) this;
        }

        public Criteria andCategoryNotEqualTo(String value) {
            addCriterion("category <>", value, "category");
            return (Criteria) this;
        }

        public Criteria andCategoryGreaterThan(String value) {
            addCriterion("category >", value, "category");
            return (Criteria) this;
        }

        public Criteria andCategoryGreaterThanOrEqualTo(String value) {
            addCriterion("category >=", value, "category");
            return (Criteria) this;
        }

        public Criteria andCategoryLessThan(String value) {
            addCriterion("category <", value, "category");
            return (Criteria) this;
        }

        public Criteria andCategoryLessThanOrEqualTo(String value) {
            addCriterion("category <=", value, "category");
            return (Criteria) this;
        }

        public Criteria andCategoryLike(String value) {
            addCriterion("category like", value, "category");
            return (Criteria) this;
        }

        public Criteria andCategoryNotLike(String value) {
            addCriterion("category not like", value, "category");
            return (Criteria) this;
        }

        public Criteria andCategoryIn(List<String> values) {
            addCriterion("category in", values, "category");
            return (Criteria) this;
        }

        public Criteria andCategoryNotIn(List<String> values) {
            addCriterion("category not in", values, "category");
            return (Criteria) this;
        }

        public Criteria andCategoryBetween(String value1, String value2) {
            addCriterion("category between", value1, value2, "category");
            return (Criteria) this;
        }

        public Criteria andCategoryNotBetween(String value1, String value2) {
            addCriterion("category not between", value1, value2, "category");
            return (Criteria) this;
        }

        public Criteria andCrawledChapterIsNull() {
            addCriterion("crawled_chapter is null");
            return (Criteria) this;
        }

        public Criteria andCrawledChapterIsNotNull() {
            addCriterion("crawled_chapter is not null");
            return (Criteria) this;
        }

        public Criteria andCrawledChapterEqualTo(Short value) {
            addCriterion("crawled_chapter =", value, "crawledChapter");
            return (Criteria) this;
        }

        public Criteria andCrawledChapterNotEqualTo(Short value) {
            addCriterion("crawled_chapter <>", value, "crawledChapter");
            return (Criteria) this;
        }

        public Criteria andCrawledChapterGreaterThan(Short value) {
            addCriterion("crawled_chapter >", value, "crawledChapter");
            return (Criteria) this;
        }

        public Criteria andCrawledChapterGreaterThanOrEqualTo(Short value) {
            addCriterion("crawled_chapter >=", value, "crawledChapter");
            return (Criteria) this;
        }

        public Criteria andCrawledChapterLessThan(Short value) {
            addCriterion("crawled_chapter <", value, "crawledChapter");
            return (Criteria) this;
        }

        public Criteria andCrawledChapterLessThanOrEqualTo(Short value) {
            addCriterion("crawled_chapter <=", value, "crawledChapter");
            return (Criteria) this;
        }

        public Criteria andCrawledChapterIn(List<Short> values) {
            addCriterion("crawled_chapter in", values, "crawledChapter");
            return (Criteria) this;
        }

        public Criteria andCrawledChapterNotIn(List<Short> values) {
            addCriterion("crawled_chapter not in", values, "crawledChapter");
            return (Criteria) this;
        }

        public Criteria andCrawledChapterBetween(Short value1, Short value2) {
            addCriterion("crawled_chapter between", value1, value2, "crawledChapter");
            return (Criteria) this;
        }

        public Criteria andCrawledChapterNotBetween(Short value1, Short value2) {
            addCriterion("crawled_chapter not between", value1, value2, "crawledChapter");
            return (Criteria) this;
        }

        public Criteria andCrawledChapterNameIsNull() {
            addCriterion("crawled_chapter_name is null");
            return (Criteria) this;
        }

        public Criteria andCrawledChapterNameIsNotNull() {
            addCriterion("crawled_chapter_name is not null");
            return (Criteria) this;
        }

        public Criteria andCrawledChapterNameEqualTo(String value) {
            addCriterion("crawled_chapter_name =", value, "crawledChapterName");
            return (Criteria) this;
        }

        public Criteria andCrawledChapterNameNotEqualTo(String value) {
            addCriterion("crawled_chapter_name <>", value, "crawledChapterName");
            return (Criteria) this;
        }

        public Criteria andCrawledChapterNameGreaterThan(String value) {
            addCriterion("crawled_chapter_name >", value, "crawledChapterName");
            return (Criteria) this;
        }

        public Criteria andCrawledChapterNameGreaterThanOrEqualTo(String value) {
            addCriterion("crawled_chapter_name >=", value, "crawledChapterName");
            return (Criteria) this;
        }

        public Criteria andCrawledChapterNameLessThan(String value) {
            addCriterion("crawled_chapter_name <", value, "crawledChapterName");
            return (Criteria) this;
        }

        public Criteria andCrawledChapterNameLessThanOrEqualTo(String value) {
            addCriterion("crawled_chapter_name <=", value, "crawledChapterName");
            return (Criteria) this;
        }

        public Criteria andCrawledChapterNameLike(String value) {
            addCriterion("crawled_chapter_name like", value, "crawledChapterName");
            return (Criteria) this;
        }

        public Criteria andCrawledChapterNameNotLike(String value) {
            addCriterion("crawled_chapter_name not like", value, "crawledChapterName");
            return (Criteria) this;
        }

        public Criteria andCrawledChapterNameIn(List<String> values) {
            addCriterion("crawled_chapter_name in", values, "crawledChapterName");
            return (Criteria) this;
        }

        public Criteria andCrawledChapterNameNotIn(List<String> values) {
            addCriterion("crawled_chapter_name not in", values, "crawledChapterName");
            return (Criteria) this;
        }

        public Criteria andCrawledChapterNameBetween(String value1, String value2) {
            addCriterion("crawled_chapter_name between", value1, value2, "crawledChapterName");
            return (Criteria) this;
        }

        public Criteria andCrawledChapterNameNotBetween(String value1, String value2) {
            addCriterion("crawled_chapter_name not between", value1, value2, "crawledChapterName");
            return (Criteria) this;
        }

        public Criteria andNovelStatusIsNull() {
            addCriterion("novel_status is null");
            return (Criteria) this;
        }

        public Criteria andNovelStatusIsNotNull() {
            addCriterion("novel_status is not null");
            return (Criteria) this;
        }

        public Criteria andNovelStatusEqualTo(String value) {
            addCriterion("novel_status =", value, "novelStatus");
            return (Criteria) this;
        }

        public Criteria andNovelStatusNotEqualTo(String value) {
            addCriterion("novel_status <>", value, "novelStatus");
            return (Criteria) this;
        }

        public Criteria andNovelStatusGreaterThan(String value) {
            addCriterion("novel_status >", value, "novelStatus");
            return (Criteria) this;
        }

        public Criteria andNovelStatusGreaterThanOrEqualTo(String value) {
            addCriterion("novel_status >=", value, "novelStatus");
            return (Criteria) this;
        }

        public Criteria andNovelStatusLessThan(String value) {
            addCriterion("novel_status <", value, "novelStatus");
            return (Criteria) this;
        }

        public Criteria andNovelStatusLessThanOrEqualTo(String value) {
            addCriterion("novel_status <=", value, "novelStatus");
            return (Criteria) this;
        }

        public Criteria andNovelStatusLike(String value) {
            addCriterion("novel_status like", value, "novelStatus");
            return (Criteria) this;
        }

        public Criteria andNovelStatusNotLike(String value) {
            addCriterion("novel_status not like", value, "novelStatus");
            return (Criteria) this;
        }

        public Criteria andNovelStatusIn(List<String> values) {
            addCriterion("novel_status in", values, "novelStatus");
            return (Criteria) this;
        }

        public Criteria andNovelStatusNotIn(List<String> values) {
            addCriterion("novel_status not in", values, "novelStatus");
            return (Criteria) this;
        }

        public Criteria andNovelStatusBetween(String value1, String value2) {
            addCriterion("novel_status between", value1, value2, "novelStatus");
            return (Criteria) this;
        }

        public Criteria andNovelStatusNotBetween(String value1, String value2) {
            addCriterion("novel_status not between", value1, value2, "novelStatus");
            return (Criteria) this;
        }

        public Criteria andNovelScoreIsNull() {
            addCriterion("novel_score is null");
            return (Criteria) this;
        }

        public Criteria andNovelScoreIsNotNull() {
            addCriterion("novel_score is not null");
            return (Criteria) this;
        }

        public Criteria andNovelScoreEqualTo(BigDecimal value) {
            addCriterion("novel_score =", value, "novelScore");
            return (Criteria) this;
        }

        public Criteria andNovelScoreNotEqualTo(BigDecimal value) {
            addCriterion("novel_score <>", value, "novelScore");
            return (Criteria) this;
        }

        public Criteria andNovelScoreGreaterThan(BigDecimal value) {
            addCriterion("novel_score >", value, "novelScore");
            return (Criteria) this;
        }

        public Criteria andNovelScoreGreaterThanOrEqualTo(BigDecimal value) {
            addCriterion("novel_score >=", value, "novelScore");
            return (Criteria) this;
        }

        public Criteria andNovelScoreLessThan(BigDecimal value) {
            addCriterion("novel_score <", value, "novelScore");
            return (Criteria) this;
        }

        public Criteria andNovelScoreLessThanOrEqualTo(BigDecimal value) {
            addCriterion("novel_score <=", value, "novelScore");
            return (Criteria) this;
        }

        public Criteria andNovelScoreIn(List<BigDecimal> values) {
            addCriterion("novel_score in", values, "novelScore");
            return (Criteria) this;
        }

        public Criteria andNovelScoreNotIn(List<BigDecimal> values) {
            addCriterion("novel_score not in", values, "novelScore");
            return (Criteria) this;
        }

        public Criteria andNovelScoreBetween(BigDecimal value1, BigDecimal value2) {
            addCriterion("novel_score between", value1, value2, "novelScore");
            return (Criteria) this;
        }

        public Criteria andNovelScoreNotBetween(BigDecimal value1, BigDecimal value2) {
            addCriterion("novel_score not between", value1, value2, "novelScore");
            return (Criteria) this;
        }

        public Criteria andPublishSourceIsNull() {
            addCriterion("publish_source is null");
            return (Criteria) this;
        }

        public Criteria andPublishSourceIsNotNull() {
            addCriterion("publish_source is not null");
            return (Criteria) this;
        }

        public Criteria andPublishSourceEqualTo(String value) {
            addCriterion("publish_source =", value, "publishSource");
            return (Criteria) this;
        }

        public Criteria andPublishSourceNotEqualTo(String value) {
            addCriterion("publish_source <>", value, "publishSource");
            return (Criteria) this;
        }

        public Criteria andPublishSourceGreaterThan(String value) {
            addCriterion("publish_source >", value, "publishSource");
            return (Criteria) this;
        }

        public Criteria andPublishSourceGreaterThanOrEqualTo(String value) {
            addCriterion("publish_source >=", value, "publishSource");
            return (Criteria) this;
        }

        public Criteria andPublishSourceLessThan(String value) {
            addCriterion("publish_source <", value, "publishSource");
            return (Criteria) this;
        }

        public Criteria andPublishSourceLessThanOrEqualTo(String value) {
            addCriterion("publish_source <=", value, "publishSource");
            return (Criteria) this;
        }

        public Criteria andPublishSourceLike(String value) {
            addCriterion("publish_source like", value, "publishSource");
            return (Criteria) this;
        }

        public Criteria andPublishSourceNotLike(String value) {
            addCriterion("publish_source not like", value, "publishSource");
            return (Criteria) this;
        }

        public Criteria andPublishSourceIn(List<String> values) {
            addCriterion("publish_source in", values, "publishSource");
            return (Criteria) this;
        }

        public Criteria andPublishSourceNotIn(List<String> values) {
            addCriterion("publish_source not in", values, "publishSource");
            return (Criteria) this;
        }

        public Criteria andPublishSourceBetween(String value1, String value2) {
            addCriterion("publish_source between", value1, value2, "publishSource");
            return (Criteria) this;
        }

        public Criteria andPublishSourceNotBetween(String value1, String value2) {
            addCriterion("publish_source not between", value1, value2, "publishSource");
            return (Criteria) this;
        }

        public Criteria andPreferGenderIsNull() {
            addCriterion("prefer_gender is null");
            return (Criteria) this;
        }

        public Criteria andPreferGenderIsNotNull() {
            addCriterion("prefer_gender is not null");
            return (Criteria) this;
        }

        public Criteria andPreferGenderEqualTo(Boolean value) {
            addCriterion("prefer_gender =", value, "preferGender");
            return (Criteria) this;
        }

        public Criteria andPreferGenderNotEqualTo(Boolean value) {
            addCriterion("prefer_gender <>", value, "preferGender");
            return (Criteria) this;
        }

        public Criteria andPreferGenderGreaterThan(Boolean value) {
            addCriterion("prefer_gender >", value, "preferGender");
            return (Criteria) this;
        }

        public Criteria andPreferGenderGreaterThanOrEqualTo(Boolean value) {
            addCriterion("prefer_gender >=", value, "preferGender");
            return (Criteria) this;
        }

        public Criteria andPreferGenderLessThan(Boolean value) {
            addCriterion("prefer_gender <", value, "preferGender");
            return (Criteria) this;
        }

        public Criteria andPreferGenderLessThanOrEqualTo(Boolean value) {
            addCriterion("prefer_gender <=", value, "preferGender");
            return (Criteria) this;
        }

        public Criteria andPreferGenderIn(List<Boolean> values) {
            addCriterion("prefer_gender in", values, "preferGender");
            return (Criteria) this;
        }

        public Criteria andPreferGenderNotIn(List<Boolean> values) {
            addCriterion("prefer_gender not in", values, "preferGender");
            return (Criteria) this;
        }

        public Criteria andPreferGenderBetween(Boolean value1, Boolean value2) {
            addCriterion("prefer_gender between", value1, value2, "preferGender");
            return (Criteria) this;
        }

        public Criteria andPreferGenderNotBetween(Boolean value1, Boolean value2) {
            addCriterion("prefer_gender not between", value1, value2, "preferGender");
            return (Criteria) this;
        }

        public Criteria andUpdateTimeIsNull() {
            addCriterion("update_time is null");
            return (Criteria) this;
        }

        public Criteria andUpdateTimeIsNotNull() {
            addCriterion("update_time is not null");
            return (Criteria) this;
        }

        public Criteria andUpdateTimeEqualTo(Date value) {
            addCriterion("update_time =", value, "updateTime");
            return (Criteria) this;
        }

        public Criteria andUpdateTimeNotEqualTo(Date value) {
            addCriterion("update_time <>", value, "updateTime");
            return (Criteria) this;
        }

        public Criteria andUpdateTimeGreaterThan(Date value) {
            addCriterion("update_time >", value, "updateTime");
            return (Criteria) this;
        }

        public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
            addCriterion("update_time >=", value, "updateTime");
            return (Criteria) this;
        }

        public Criteria andUpdateTimeLessThan(Date value) {
            addCriterion("update_time <", value, "updateTime");
            return (Criteria) this;
        }

        public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
            addCriterion("update_time <=", value, "updateTime");
            return (Criteria) this;
        }

        public Criteria andUpdateTimeIn(List<Date> values) {
            addCriterion("update_time in", values, "updateTime");
            return (Criteria) this;
        }

        public Criteria andUpdateTimeNotIn(List<Date> values) {
            addCriterion("update_time not in", values, "updateTime");
            return (Criteria) this;
        }

        public Criteria andUpdateTimeBetween(Date value1, Date value2) {
            addCriterion("update_time between", value1, value2, "updateTime");
            return (Criteria) this;
        }

        public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
            addCriterion("update_time not between", value1, value2, "updateTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeIsNull() {
            addCriterion("create_time is null");
            return (Criteria) this;
        }

        public Criteria andCreateTimeIsNotNull() {
            addCriterion("create_time is not null");
            return (Criteria) this;
        }

        public Criteria andCreateTimeEqualTo(Date value) {
            addCriterion("create_time =", value, "createTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeNotEqualTo(Date value) {
            addCriterion("create_time <>", value, "createTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeGreaterThan(Date value) {
            addCriterion("create_time >", value, "createTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
            addCriterion("create_time >=", value, "createTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeLessThan(Date value) {
            addCriterion("create_time <", value, "createTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
            addCriterion("create_time <=", value, "createTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeIn(List<Date> values) {
            addCriterion("create_time in", values, "createTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeNotIn(List<Date> values) {
            addCriterion("create_time not in", values, "createTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeBetween(Date value1, Date value2) {
            addCriterion("create_time between", value1, value2, "createTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
            addCriterion("create_time not between", value1, value2, "createTime");
            return (Criteria) this;
        }
    }

    public static class Criteria extends GeneratedCriteria {

        protected Criteria() {
            super();
        }
    }

    public static class Criterion {
        private String condition;

        private Object value;

        private Object secondValue;

        private boolean noValue;

        private boolean singleValue;

        private boolean betweenValue;

        private boolean listValue;

        private String typeHandler;

        public String getCondition() {
            return condition;
        }

        public Object getValue() {
            return value;
        }

        public Object getSecondValue() {
            return secondValue;
        }

        public boolean isNoValue() {
            return noValue;
        }

        public boolean isSingleValue() {
            return singleValue;
        }

        public boolean isBetweenValue() {
            return betweenValue;
        }

        public boolean isListValue() {
            return listValue;
        }

        public String getTypeHandler() {
            return typeHandler;
        }

        protected Criterion(String condition) {
            super();
            this.condition = condition;
            this.typeHandler = null;
            this.noValue = true;
        }

        protected Criterion(String condition, Object value, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.typeHandler = typeHandler;
            if (value instanceof List<?>) {
                this.listValue = true;
            } else {
                this.singleValue = true;
            }
        }

        protected Criterion(String condition, Object value) {
            this(condition, value, null);
        }

        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.secondValue = secondValue;
            this.typeHandler = typeHandler;
            this.betweenValue = true;
        }

        protected Criterion(String condition, Object value, Object secondValue) {
            this(condition, value, secondValue, null);
        }
    }
} public class ReaderBookshelf {
    private Long id;

    private Long userId;

    private Long novelId;

    private String novelName;

    private String imgUrl;

    private BigDecimal readerProgress;

    private Date updateTime;

    private Date createTime;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getNovelId() {
        return novelId;
    }

    public void setNovelId(Long novelId) {
        this.novelId = novelId;
    }

    public String getNovelName() {
        return novelName;
    }

    public void setNovelName(String novelName) {
        this.novelName = novelName == null ? null : novelName.trim();
    }

    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl == null ? null : imgUrl.trim();
    }

    public BigDecimal getReaderProgress() {
        return readerProgress;
    }

    public void setReaderProgress(BigDecimal readerProgress) {
        this.readerProgress = readerProgress;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
} public class ReaderBookshelfExample {
    protected String orderByClause;

    protected boolean distinct;

    protected List<Criteria> oredCriteria;

    public ReaderBookshelfExample() {
        oredCriteria = new ArrayList<Criteria>();
    }

    public void setOrderByClause(String orderByClause) {
        this.orderByClause = orderByClause;
    }

    public String getOrderByClause() {
        return orderByClause;
    }

    public void setDistinct(boolean distinct) {
        this.distinct = distinct;
    }

    public boolean isDistinct() {
        return distinct;
    }

    public List<Criteria> getOredCriteria() {
        return oredCriteria;
    }

    public void or(Criteria criteria) {
        oredCriteria.add(criteria);
    }

    public Criteria or() {
        Criteria criteria = createCriteriaInternal();
        oredCriteria.add(criteria);
        return criteria;
    }

    public Criteria createCriteria() {
        Criteria criteria = createCriteriaInternal();
        if (oredCriteria.size() == 0) {
            oredCriteria.add(criteria);
        }
        return criteria;
    }

    protected Criteria createCriteriaInternal() {
        Criteria criteria = new Criteria();
        return criteria;
    }

    public void clear() {
        oredCriteria.clear();
        orderByClause = null;
        distinct = false;
    }

    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<Criterion>();
        }

        public boolean isValid() {
            return criteria.size() > 0;
        }

        public List<Criterion> getAllCriteria() {
            return criteria;
        }

        public List<Criterion> getCriteria() {
            return criteria;
        }

        protected void addCriterion(String condition) {
            if (condition == null) {
                throw new RuntimeException("Value for condition cannot be null");
            }
            criteria.add(new Criterion(condition));
        }

        protected void addCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value));
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value1, value2));
        }

        public Criteria andIdIsNull() {
            addCriterion("id is null");
            return (Criteria) this;
        }

        public Criteria andIdIsNotNull() {
            addCriterion("id is not null");
            return (Criteria) this;
        }

        public Criteria andIdEqualTo(Long value) {
            addCriterion("id =", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotEqualTo(Long value) {
            addCriterion("id <>", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdGreaterThan(Long value) {
            addCriterion("id >", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdGreaterThanOrEqualTo(Long value) {
            addCriterion("id >=", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdLessThan(Long value) {
            addCriterion("id <", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdLessThanOrEqualTo(Long value) {
            addCriterion("id <=", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdIn(List<Long> values) {
            addCriterion("id in", values, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotIn(List<Long> values) {
            addCriterion("id not in", values, "id");
            return (Criteria) this;
        }

        public Criteria andIdBetween(Long value1, Long value2) {
            addCriterion("id between", value1, value2, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotBetween(Long value1, Long value2) {
            addCriterion("id not between", value1, value2, "id");
            return (Criteria) this;
        }

        public Criteria andUserIdIsNull() {
            addCriterion("user_id is null");
            return (Criteria) this;
        }

        public Criteria andUserIdIsNotNull() {
            addCriterion("user_id is not null");
            return (Criteria) this;
        }

        public Criteria andUserIdEqualTo(Long value) {
            addCriterion("user_id =", value, "userId");
            return (Criteria) this;
        }

        public Criteria andUserIdNotEqualTo(Long value) {
            addCriterion("user_id <>", value, "userId");
            return (Criteria) this;
        }

        public Criteria andUserIdGreaterThan(Long value) {
            addCriterion("user_id >", value, "userId");
            return (Criteria) this;
        }

        public Criteria andUserIdGreaterThanOrEqualTo(Long value) {
            addCriterion("user_id >=", value, "userId");
            return (Criteria) this;
        }

        public Criteria andUserIdLessThan(Long value) {
            addCriterion("user_id <", value, "userId");
            return (Criteria) this;
        }

        public Criteria andUserIdLessThanOrEqualTo(Long value) {
            addCriterion("user_id <=", value, "userId");
            return (Criteria) this;
        }

        public Criteria andUserIdIn(List<Long> values) {
            addCriterion("user_id in", values, "userId");
            return (Criteria) this;
        }

        public Criteria andUserIdNotIn(List<Long> values) {
            addCriterion("user_id not in", values, "userId");
            return (Criteria) this;
        }

        public Criteria andUserIdBetween(Long value1, Long value2) {
            addCriterion("user_id between", value1, value2, "userId");
            return (Criteria) this;
        }

        public Criteria andUserIdNotBetween(Long value1, Long value2) {
            addCriterion("user_id not between", value1, value2, "userId");
            return (Criteria) this;
        }

        public Criteria andNovelIdIsNull() {
            addCriterion("novel_id is null");
            return (Criteria) this;
        }

        public Criteria andNovelIdIsNotNull() {
            addCriterion("novel_id is not null");
            return (Criteria) this;
        }

        public Criteria andNovelIdEqualTo(Long value) {
            addCriterion("novel_id =", value, "novelId");
            return (Criteria) this;
        }

        public Criteria andNovelIdNotEqualTo(Long value) {
            addCriterion("novel_id <>", value, "novelId");
            return (Criteria) this;
        }

        public Criteria andNovelIdGreaterThan(Long value) {
            addCriterion("novel_id >", value, "novelId");
            return (Criteria) this;
        }

        public Criteria andNovelIdGreaterThanOrEqualTo(Long value) {
            addCriterion("novel_id >=", value, "novelId");
            return (Criteria) this;
        }

        public Criteria andNovelIdLessThan(Long value) {
            addCriterion("novel_id <", value, "novelId");
            return (Criteria) this;
        }

        public Criteria andNovelIdLessThanOrEqualTo(Long value) {
            addCriterion("novel_id <=", value, "novelId");
            return (Criteria) this;
        }

        public Criteria andNovelIdIn(List<Long> values) {
            addCriterion("novel_id in", values, "novelId");
            return (Criteria) this;
        }

        public Criteria andNovelIdNotIn(List<Long> values) {
            addCriterion("novel_id not in", values, "novelId");
            return (Criteria) this;
        }

        public Criteria andNovelIdBetween(Long value1, Long value2) {
            addCriterion("novel_id between", value1, value2, "novelId");
            return (Criteria) this;
        }

        public Criteria andNovelIdNotBetween(Long value1, Long value2) {
            addCriterion("novel_id not between", value1, value2, "novelId");
            return (Criteria) this;
        }

        public Criteria andNovelNameIsNull() {
            addCriterion("novel_name is null");
            return (Criteria) this;
        }

        public Criteria andNovelNameIsNotNull() {
            addCriterion("novel_name is not null");
            return (Criteria) this;
        }

        public Criteria andNovelNameEqualTo(String value) {
            addCriterion("novel_name =", value, "novelName");
            return (Criteria) this;
        }

        public Criteria andNovelNameNotEqualTo(String value) {
            addCriterion("novel_name <>", value, "novelName");
            return (Criteria) this;
        }

        public Criteria andNovelNameGreaterThan(String value) {
            addCriterion("novel_name >", value, "novelName");
            return (Criteria) this;
        }

        public Criteria andNovelNameGreaterThanOrEqualTo(String value) {
            addCriterion("novel_name >=", value, "novelName");
            return (Criteria) this;
        }

        public Criteria andNovelNameLessThan(String value) {
            addCriterion("novel_name <", value, "novelName");
            return (Criteria) this;
        }

        public Criteria andNovelNameLessThanOrEqualTo(String value) {
            addCriterion("novel_name <=", value, "novelName");
            return (Criteria) this;
        }

        public Criteria andNovelNameLike(String value) {
            addCriterion("novel_name like", value, "novelName");
            return (Criteria) this;
        }

        public Criteria andNovelNameNotLike(String value) {
            addCriterion("novel_name not like", value, "novelName");
            return (Criteria) this;
        }

        public Criteria andNovelNameIn(List<String> values) {
            addCriterion("novel_name in", values, "novelName");
            return (Criteria) this;
        }

        public Criteria andNovelNameNotIn(List<String> values) {
            addCriterion("novel_name not in", values, "novelName");
            return (Criteria) this;
        }

        public Criteria andNovelNameBetween(String value1, String value2) {
            addCriterion("novel_name between", value1, value2, "novelName");
            return (Criteria) this;
        }

        public Criteria andNovelNameNotBetween(String value1, String value2) {
            addCriterion("novel_name not between", value1, value2, "novelName");
            return (Criteria) this;
        }

        public Criteria andImgUrlIsNull() {
            addCriterion("img_url is null");
            return (Criteria) this;
        }

        public Criteria andImgUrlIsNotNull() {
            addCriterion("img_url is not null");
            return (Criteria) this;
        }

        public Criteria andImgUrlEqualTo(String value) {
            addCriterion("img_url =", value, "imgUrl");
            return (Criteria) this;
        }

        public Criteria andImgUrlNotEqualTo(String value) {
            addCriterion("img_url <>", value, "imgUrl");
            return (Criteria) this;
        }

        public Criteria andImgUrlGreaterThan(String value) {
            addCriterion("img_url >", value, "imgUrl");
            return (Criteria) this;
        }

        public Criteria andImgUrlGreaterThanOrEqualTo(String value) {
            addCriterion("img_url >=", value, "imgUrl");
            return (Criteria) this;
        }

        public Criteria andImgUrlLessThan(String value) {
            addCriterion("img_url <", value, "imgUrl");
            return (Criteria) this;
        }

        public Criteria andImgUrlLessThanOrEqualTo(String value) {
            addCriterion("img_url <=", value, "imgUrl");
            return (Criteria) this;
        }

        public Criteria andImgUrlLike(String value) {
            addCriterion("img_url like", value, "imgUrl");
            return (Criteria) this;
        }

        public Criteria andImgUrlNotLike(String value) {
            addCriterion("img_url not like", value, "imgUrl");
            return (Criteria) this;
        }

        public Criteria andImgUrlIn(List<String> values) {
            addCriterion("img_url in", values, "imgUrl");
            return (Criteria) this;
        }

        public Criteria andImgUrlNotIn(List<String> values) {
            addCriterion("img_url not in", values, "imgUrl");
            return (Criteria) this;
        }

        public Criteria andImgUrlBetween(String value1, String value2) {
            addCriterion("img_url between", value1, value2, "imgUrl");
            return (Criteria) this;
        }

        public Criteria andImgUrlNotBetween(String value1, String value2) {
            addCriterion("img_url not between", value1, value2, "imgUrl");
            return (Criteria) this;
        }

        public Criteria andReaderProgressIsNull() {
            addCriterion("reader_progress is null");
            return (Criteria) this;
        }

        public Criteria andReaderProgressIsNotNull() {
            addCriterion("reader_progress is not null");
            return (Criteria) this;
        }

        public Criteria andReaderProgressEqualTo(BigDecimal value) {
            addCriterion("reader_progress =", value, "readerProgress");
            return (Criteria) this;
        }

        public Criteria andReaderProgressNotEqualTo(BigDecimal value) {
            addCriterion("reader_progress <>", value, "readerProgress");
            return (Criteria) this;
        }

        public Criteria andReaderProgressGreaterThan(BigDecimal value) {
            addCriterion("reader_progress >", value, "readerProgress");
            return (Criteria) this;
        }

        public Criteria andReaderProgressGreaterThanOrEqualTo(BigDecimal value) {
            addCriterion("reader_progress >=", value, "readerProgress");
            return (Criteria) this;
        }

        public Criteria andReaderProgressLessThan(BigDecimal value) {
            addCriterion("reader_progress <", value, "readerProgress");
            return (Criteria) this;
        }

        public Criteria andReaderProgressLessThanOrEqualTo(BigDecimal value) {
            addCriterion("reader_progress <=", value, "readerProgress");
            return (Criteria) this;
        }

        public Criteria andReaderProgressIn(List<BigDecimal> values) {
            addCriterion("reader_progress in", values, "readerProgress");
            return (Criteria) this;
        }

        public Criteria andReaderProgressNotIn(List<BigDecimal> values) {
            addCriterion("reader_progress not in", values, "readerProgress");
            return (Criteria) this;
        }

        public Criteria andReaderProgressBetween(BigDecimal value1, BigDecimal value2) {
            addCriterion("reader_progress between", value1, value2, "readerProgress");
            return (Criteria) this;
        }

        public Criteria andReaderProgressNotBetween(BigDecimal value1, BigDecimal value2) {
            addCriterion("reader_progress not between", value1, value2, "readerProgress");
            return (Criteria) this;
        }

        public Criteria andUpdateTimeIsNull() {
            addCriterion("update_time is null");
            return (Criteria) this;
        }

        public Criteria andUpdateTimeIsNotNull() {
            addCriterion("update_time is not null");
            return (Criteria) this;
        }

        public Criteria andUpdateTimeEqualTo(Date value) {
            addCriterion("update_time =", value, "updateTime");
            return (Criteria) this;
        }

        public Criteria andUpdateTimeNotEqualTo(Date value) {
            addCriterion("update_time <>", value, "updateTime");
            return (Criteria) this;
        }

        public Criteria andUpdateTimeGreaterThan(Date value) {
            addCriterion("update_time >", value, "updateTime");
            return (Criteria) this;
        }

        public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
            addCriterion("update_time >=", value, "updateTime");
            return (Criteria) this;
        }

        public Criteria andUpdateTimeLessThan(Date value) {
            addCriterion("update_time <", value, "updateTime");
            return (Criteria) this;
        }

        public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
            addCriterion("update_time <=", value, "updateTime");
            return (Criteria) this;
        }

        public Criteria andUpdateTimeIn(List<Date> values) {
            addCriterion("update_time in", values, "updateTime");
            return (Criteria) this;
        }

        public Criteria andUpdateTimeNotIn(List<Date> values) {
            addCriterion("update_time not in", values, "updateTime");
            return (Criteria) this;
        }

        public Criteria andUpdateTimeBetween(Date value1, Date value2) {
            addCriterion("update_time between", value1, value2, "updateTime");
            return (Criteria) this;
        }

        public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
            addCriterion("update_time not between", value1, value2, "updateTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeIsNull() {
            addCriterion("create_time is null");
            return (Criteria) this;
        }

        public Criteria andCreateTimeIsNotNull() {
            addCriterion("create_time is not null");
            return (Criteria) this;
        }

        public Criteria andCreateTimeEqualTo(Date value) {
            addCriterion("create_time =", value, "createTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeNotEqualTo(Date value) {
            addCriterion("create_time <>", value, "createTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeGreaterThan(Date value) {
            addCriterion("create_time >", value, "createTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
            addCriterion("create_time >=", value, "createTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeLessThan(Date value) {
            addCriterion("create_time <", value, "createTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
            addCriterion("create_time <=", value, "createTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeIn(List<Date> values) {
            addCriterion("create_time in", values, "createTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeNotIn(List<Date> values) {
            addCriterion("create_time not in", values, "createTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeBetween(Date value1, Date value2) {
            addCriterion("create_time between", value1, value2, "createTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
            addCriterion("create_time not between", value1, value2, "createTime");
            return (Criteria) this;
        }
    }

    public static class Criteria extends GeneratedCriteria {

        protected Criteria() {
            super();
        }
    }

    public static class Criterion {
        private String condition;

        private Object value;

        private Object secondValue;

        private boolean noValue;

        private boolean singleValue;

        private boolean betweenValue;

        private boolean listValue;

        private String typeHandler;

        public String getCondition() {
            return condition;
        }

        public Object getValue() {
            return value;
        }

        public Object getSecondValue() {
            return secondValue;
        }

        public boolean isNoValue() {
            return noValue;
        }

        public boolean isSingleValue() {
            return singleValue;
        }

        public boolean isBetweenValue() {
            return betweenValue;
        }

        public boolean isListValue() {
            return listValue;
        }

        public String getTypeHandler() {
            return typeHandler;
        }

        protected Criterion(String condition) {
            super();
            this.condition = condition;
            this.typeHandler = null;
            this.noValue = true;
        }

        protected Criterion(String condition, Object value, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.typeHandler = typeHandler;
            if (value instanceof List<?>) {
                this.listValue = true;
            } else {
                this.singleValue = true;
            }
        }

        protected Criterion(String condition, Object value) {
            this(condition, value, null);
        }

        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.secondValue = secondValue;
            this.typeHandler = typeHandler;
            this.betweenValue = true;
        }

        protected Criterion(String condition, Object value, Object secondValue) {
            this(condition, value, secondValue, null);
        }
    }
} public static class Criteria extends GeneratedCriteria {

    protected Criteria() {
        super();
    }
} public enum ResCode {

	UNKONW_ERROR(-1,"服务器繁忙，请稍后再试"),
	
	NOVEL_ALREADY_EXIST_ERROR(20500,"小说在书架中已存在"),
	
	NOVEL_NOT_EXIST_ERROR(20501,"小说不存在"),
	
	INVALID_REQUEST_PARAM_ERROR(20503,"无效的请求参数"),

	INVALID_FILE_ERROR(20504,"请上传线索文件！"),
	
	INVALID_ASSIGN_SHOP_ERROR(20505,"请选择分配门店"),
	
	INVALID_FOLLOW_MSG_NULL_ERROR(20506,"请填写跟进记录!"),
	
	;
	
	public int errno;
	public String errmsg;
	
	private ResCode(int errno,String errmsg){
		this.errno = errno;
		this.errmsg = errmsg;
	}
	
} @Component
public class NewNovelCrawler
{	
	private static Logger logger = LoggerFactory.getLogger(NewNovelCrawler.class);
	
  	private static final String CRAWLE_Filedir = "crawler.filedir";
	public static String crawleFiledir = Configs.getString(CRAWLE_Filedir);
	
	//public static String sourceUrl = "http://www.biquge.la/book/2/";
	
	@Autowired
	private CrawlerTaskMapper crawlerTaskMapper;
	
	@Autowired
	private NovelOverviewMapper novelOverviewMapper;
	
	@Autowired
	private NovelDirectoryMapper novelDirectoryMapper;
	
	@Autowired
	private BqgNovelExtract bqgNovelExtract;
	
	/**
	 * 抓取新的小说，初始化抓取任务表和小说概览表， 写入两个表用事务来管理 v1.0
	 * v2.0 修改点为：  返回小说id， 已完结的照样抓取，  已存在抓取任务表的返回小说id  2016/09/23
	 * @throws IOException 
	 */
	@Transactional()
	public Long CrawleNewNovel(Long userId,String sourceUrl) throws IOException
	{
		String sHtml = HttpClientUtils.getContent(sourceUrl);
		if (sHtml == null) {
			logger.error("user {} trigger {} error, not continue crawl",userId,sourceUrl);
			return -1L;
		}
		
		String charset =  RexxarPageUtils.getCharSetByBody(sHtml);
		String cleanHtml = RexxarPageUtils.changeCharset(sHtml, "ISO-8859-1", charset);
		
		Document novelHtml = Jsoup.parse(cleanHtml);
		
		//小说已完结不主动抓取
//		try {
//			if (bqgNovelExtract.isNovelEnd(novelHtml)) {
//				logger.info("novel [{}] is end, do not take the initiative to crawl", bqgNovelExtract.getName(novelHtml));
//				return;
//			}
//		} catch (ParseException e) {
//			e.printStackTrace();
//		}
				
		//小说在抓取任务中存在同名，不重复抓取
		CrawlerTaskExample cTaskExample = new CrawlerTaskExample();
		Criteria criteria = cTaskExample.createCriteria();
		criteria.andBooknameEqualTo(bqgNovelExtract.getName(novelHtml));
		ArrayList<CrawlerTask> crawlerTask = (ArrayList<CrawlerTask>) crawlerTaskMapper.selectByExample(cTaskExample);
		if (crawlerTask.size() > 0) {
			logger.info("novel [{}] already in rexxar task, do not repeat crawl", bqgNovelExtract.getName(novelHtml));
			return crawlerTask.get(0).getId();
		}
		
		Long novelId = RexxarNovelUtils.generatorNovelId();
		//创建抓取任务
		initCrawlerTask(novelHtml,novelId,sourceUrl);
		//创建小说概览
		initNovelOverview(novelHtml, novelId);
		//创建小说目录存储
		initNovelDirectory(novelHtml,novelId);
		//创建小说章节内容存储， 直接文件存储  （如果web系统，可以考虑存储为html页面后直接访问）
		initDownloadContentDir(novelId);
		
		logger.info("user {} trigger new novel {} crawler task",userId, novelId);
		
		return novelId;
	}
	
	private void initCrawlerTask(Document novelHtml,Long novelId,String sourceUrl) throws UnsupportedEncodingException
	{
		CrawlerTask ct = new CrawlerTask();
		
		String latestChapterName = bqgNovelExtract.getLatestChapterName(novelHtml);
		String bookname = bqgNovelExtract.getName(novelHtml);
		Short latestChapter = bqgNovelExtract.getDirectoryCount(novelHtml);
		Date date = new Date();
		Timestamp timeStamp = new Timestamp(date.getTime());
		
		ct.setId(novelId);
		ct.setBookname(bookname);
		ct.setSource("biquge");
		ct.setSourceUrl(sourceUrl);
		ct.setBackSource("");
		ct.setLatestChapter(latestChapter);
		ct.setLatestChapterName(latestChapterName);
		ct.setCrawledChapter((short) 0);
		ct.setCrawledChapterName("");  
		ct.setCrawledPercent(BigDecimal.valueOf(0.0000));     
		ct.setCrawledStatus(true);
		ct.setUpdateTime(timeStamp);
		ct.setCreateTime(timeStamp);
		
		crawlerTaskMapper.insert(ct);
		
		logger.info("novel [{}] initCrawlerTask success", bookname);
	}
	
	private void initNovelOverview(Document novelHtml,Long novelId)
	{
		NovelOverview novelOverview = new NovelOverview();
		
		String bookname = bqgNovelExtract.getName(novelHtml);
		String author = bqgNovelExtract.getAuthor(novelHtml);
		String imgurl = bqgNovelExtract.getImgUrl(novelHtml);
		String describe = bqgNovelExtract.getDescribe(novelHtml);
		String category = bqgNovelExtract.getCagetory(novelHtml);
		String status = bqgNovelExtract.getStatus(novelHtml);
		
		Date date = new Date();
		Timestamp timeStamp = new Timestamp(date.getTime());
		
		
		novelOverview.setId(novelId);
		novelOverview.setBookname(bookname);
		novelOverview.setAuthor(author);
		novelOverview.setImgUrl(imgurl);
		novelOverview.setNovelDescribe(describe);
		novelOverview.setCategory(category);
		novelOverview.setCrawledChapter((short) 0);
		novelOverview.setCrawledChapterName("");
		novelOverview.setNovelStatus(status);
		novelOverview.setNovelScore(BigDecimal.valueOf(9.9));
		novelOverview.setPublishSource("");
		novelOverview.setPreferGender(true);
		novelOverview.setUpdateTime(timeStamp);
		novelOverview.setCreateTime(timeStamp);		
		
		novelOverviewMapper.insert(novelOverview);  
		
		logger.info("novel [{}] initNovelOverview success", bookname);
	}
	
	public void initNovelDirectory(Document novelHtml,Long novelId)
	{
		NovelDirectoryWithBLOBs novelDirectory = new NovelDirectoryWithBLOBs();
		
		String bookname = bqgNovelExtract.getName(novelHtml);
		
		Date date = new Date();
		Timestamp timeStamp = new Timestamp(date.getTime());
		
		novelDirectory.setId(novelId);
		novelDirectory.setBookname(bookname);
		novelDirectory.setCreateTime(timeStamp);
		novelDirectory.setUpdateTime(timeStamp);
		novelDirectory.setCrawledChapterNumber((short) 0);
		
		novelDirectoryMapper.insert(novelDirectory);
		
		logger.info("novel [{}] initNovelDirectory success", bookname);
	}
	
	public static void initDownloadContentDir(Long novelId) throws IOException
	{
		String newNovelDirPath = crawleFiledir + File.separatorChar + novelId.toString(); 
		File newNovelDir = new File(newNovelDirPath);
		Boolean result = newNovelDir.mkdirs();
		logger.info("init novel store dir: {} {}", newNovelDirPath, result);
	}
	
	public static void main( String[] args ) 
    {  			
		try {
			initDownloadContentDir(2625414856641831L);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
/*		BqgNovelExtract bqgExtractor = new BqgNovelExtract();
		bqgExtractor.getName(novelHtml);
		bqgExtractor.getAuthor(novelHtml);
		bqgExtractor.getDescribe(novelHtml);
		bqgExtractor.getImgUrl(novelHtml);
		bqgExtractor.getCagetory(novelHtml);
		bqgExtractor.getLatestChapterName(novelHtml);
		bqgExtractor.getStatus(novelHtml);*/
    }
} public class HttpApiServiceException extends RuntimeException {

    private static final long serialVersionUID = -7995149703674561834L;

    private int errno;

    private String errmsg;

    public int getErrno() {
        return this.errno;
    }

    public String getErrmsg() {
        return this.errmsg;
    }

    public HttpApiServiceException(int errno, String errmsg) {
        super(errmsg);
        this.errno = errno;
        this.errmsg = errmsg;
    }

    public HttpApiServiceException(int errno, String errmsg, Throwable cause) {
        super(errmsg,cause);
        this.errno = errno;
        this.errmsg = errmsg;
    }
} public class BqgNovelOnlineSearch implements NovelOnlineSearch {
	
	private static final Logger logger = LoggerFactory.getLogger(BqgNovelOnlineSearch.class);
	
	public static String bqgSearchUrl = "http://zhannei.baidu.com/cse/search?s=7138806708853866527&q=";
	
	@Override
	public HashMap<String, String> searchNovel(String bookname) throws UnsupportedEncodingException {
		String searchUrl = bqgSearchUrl + bookname;
		String sHtml = HttpClientUtils.getContent(searchUrl);
		if (sHtml == null) {
			logger.error("search {} error",searchUrl);
			return null;
		}
		
		String charset =  RexxarPageUtils.getCharSetByBody(sHtml);		
		String cleanHtml = RexxarPageUtils.changeCharset(sHtml, "ISO-8859-1", charset);
		
		Document searchHtml = Jsoup.parse(cleanHtml); 
		Elements eles = searchHtml.select(".result-item .result-item-title a");
		
		int resultLength = eles.size();
		if (resultLength == 0) {
			return null;
		}
		
		HashMap<String, String> searchResults = new HashMap<>();
		
		for (int i = 0; i < resultLength; i++) {
			searchResults.put(eles.get(i).attr("title"), eles.get(i).attr("href"));
		}
		
		return searchResults;
	}
	
	public static void main(String[] args) {
		BqgNovelOnlineSearch bqgNovelOnlineSearch = new BqgNovelOnlineSearch();
		try {
			logger.info(bqgNovelOnlineSearch.searchNovel("蛊真人").toString() );
		} catch (UnsupportedEncodingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}

}
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import com.rexxar.dao.NovelOverviewMapper;
import com.rexxar.dao.ReaderBookshelfMapper;
import com.rexxar.dao.model.NovelOverview;
import com.rexxar.dao.model.NovelOverviewExample;
import com.rexxar.dao.model.ReaderBookshelf;
import com.rexxar.dao.model.ReaderBookshelfExample;
import com.rexxar.dao.model.ReaderBookshelfExample.Criteria;
import com.rexxar.reader.web.component.ResCode;
import com.rexxar.reader.web.crawler.NewNovelCrawler;
import com.rexxar.reader.web.exception.HttpApiServiceException;
import com.rexxar.reader.web.onlinesearch.BqgNovelOnlineSearch;
package com.rexxar.reader.web.service;





@Component
public class BookshelfService {
	
	private static final Logger logger = LoggerFactory.getLogger(BookshelfService.class);

	@Autowired
	private ReaderBookshelfMapper readerBookshelfMapper;
	
	@Autowired
	private NovelOverviewMapper novelOverviewMapper;