This commit is contained in:
xiongxiaoyang 2020-04-21 18:04:43 +08:00
parent e77af7d6ca
commit 075df46572
4 changed files with 904 additions and 0 deletions

View File

@ -0,0 +1,30 @@
package xyz.zinglizingli.books.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import xyz.zinglizingli.books.po.BookParseLog;
import xyz.zinglizingli.books.po.BookParseLogExample;
public interface BookParseLogMapper {
int countByExample(BookParseLogExample example);
int deleteByExample(BookParseLogExample example);
int deleteByPrimaryKey(Long id);
int insert(BookParseLog record);
int insertSelective(BookParseLog record);
List<BookParseLog> selectByExample(BookParseLogExample example);
BookParseLog selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") BookParseLog record, @Param("example") BookParseLogExample example);
int updateByExample(@Param("record") BookParseLog record, @Param("example") BookParseLogExample example);
int updateByPrimaryKeySelective(BookParseLog record);
int updateByPrimaryKey(BookParseLog record);
}

View File

@ -0,0 +1,65 @@
package xyz.zinglizingli.books.po;
import java.util.Date;
public class BookParseLog {
private Long id;
private String bookUrl;
private String bookName;
private Float score;
private Date createTime;
private Byte priority;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getBookUrl() {
return bookUrl;
}
public void setBookUrl(String bookUrl) {
this.bookUrl = bookUrl == null ? null : bookUrl.trim();
}
public String getBookName() {
return bookName;
}
public void setBookName(String bookName) {
this.bookName = bookName == null ? null : bookName.trim();
}
public Float getScore() {
return score;
}
public void setScore(Float score) {
this.score = score;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Byte getPriority() {
return priority;
}
public void setPriority(Byte priority) {
this.priority = priority;
}
}

View File

@ -0,0 +1,581 @@
package xyz.zinglizingli.books.po;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class BookParseLogExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public BookParseLogExample() {
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 andBookUrlIsNull() {
addCriterion("book_url is null");
return (Criteria) this;
}
public Criteria andBookUrlIsNotNull() {
addCriterion("book_url is not null");
return (Criteria) this;
}
public Criteria andBookUrlEqualTo(String value) {
addCriterion("book_url =", value, "bookUrl");
return (Criteria) this;
}
public Criteria andBookUrlNotEqualTo(String value) {
addCriterion("book_url <>", value, "bookUrl");
return (Criteria) this;
}
public Criteria andBookUrlGreaterThan(String value) {
addCriterion("book_url >", value, "bookUrl");
return (Criteria) this;
}
public Criteria andBookUrlGreaterThanOrEqualTo(String value) {
addCriterion("book_url >=", value, "bookUrl");
return (Criteria) this;
}
public Criteria andBookUrlLessThan(String value) {
addCriterion("book_url <", value, "bookUrl");
return (Criteria) this;
}
public Criteria andBookUrlLessThanOrEqualTo(String value) {
addCriterion("book_url <=", value, "bookUrl");
return (Criteria) this;
}
public Criteria andBookUrlLike(String value) {
addCriterion("book_url like", value, "bookUrl");
return (Criteria) this;
}
public Criteria andBookUrlNotLike(String value) {
addCriterion("book_url not like", value, "bookUrl");
return (Criteria) this;
}
public Criteria andBookUrlIn(List<String> values) {
addCriterion("book_url in", values, "bookUrl");
return (Criteria) this;
}
public Criteria andBookUrlNotIn(List<String> values) {
addCriterion("book_url not in", values, "bookUrl");
return (Criteria) this;
}
public Criteria andBookUrlBetween(String value1, String value2) {
addCriterion("book_url between", value1, value2, "bookUrl");
return (Criteria) this;
}
public Criteria andBookUrlNotBetween(String value1, String value2) {
addCriterion("book_url not between", value1, value2, "bookUrl");
return (Criteria) this;
}
public Criteria andBookNameIsNull() {
addCriterion("book_name is null");
return (Criteria) this;
}
public Criteria andBookNameIsNotNull() {
addCriterion("book_name is not null");
return (Criteria) this;
}
public Criteria andBookNameEqualTo(String value) {
addCriterion("book_name =", value, "bookName");
return (Criteria) this;
}
public Criteria andBookNameNotEqualTo(String value) {
addCriterion("book_name <>", value, "bookName");
return (Criteria) this;
}
public Criteria andBookNameGreaterThan(String value) {
addCriterion("book_name >", value, "bookName");
return (Criteria) this;
}
public Criteria andBookNameGreaterThanOrEqualTo(String value) {
addCriterion("book_name >=", value, "bookName");
return (Criteria) this;
}
public Criteria andBookNameLessThan(String value) {
addCriterion("book_name <", value, "bookName");
return (Criteria) this;
}
public Criteria andBookNameLessThanOrEqualTo(String value) {
addCriterion("book_name <=", value, "bookName");
return (Criteria) this;
}
public Criteria andBookNameLike(String value) {
addCriterion("book_name like", value, "bookName");
return (Criteria) this;
}
public Criteria andBookNameNotLike(String value) {
addCriterion("book_name not like", value, "bookName");
return (Criteria) this;
}
public Criteria andBookNameIn(List<String> values) {
addCriterion("book_name in", values, "bookName");
return (Criteria) this;
}
public Criteria andBookNameNotIn(List<String> values) {
addCriterion("book_name not in", values, "bookName");
return (Criteria) this;
}
public Criteria andBookNameBetween(String value1, String value2) {
addCriterion("book_name between", value1, value2, "bookName");
return (Criteria) this;
}
public Criteria andBookNameNotBetween(String value1, String value2) {
addCriterion("book_name not between", value1, value2, "bookName");
return (Criteria) this;
}
public Criteria andScoreIsNull() {
addCriterion("score is null");
return (Criteria) this;
}
public Criteria andScoreIsNotNull() {
addCriterion("score is not null");
return (Criteria) this;
}
public Criteria andScoreEqualTo(Float value) {
addCriterion("score =", value, "score");
return (Criteria) this;
}
public Criteria andScoreNotEqualTo(Float value) {
addCriterion("score <>", value, "score");
return (Criteria) this;
}
public Criteria andScoreGreaterThan(Float value) {
addCriterion("score >", value, "score");
return (Criteria) this;
}
public Criteria andScoreGreaterThanOrEqualTo(Float value) {
addCriterion("score >=", value, "score");
return (Criteria) this;
}
public Criteria andScoreLessThan(Float value) {
addCriterion("score <", value, "score");
return (Criteria) this;
}
public Criteria andScoreLessThanOrEqualTo(Float value) {
addCriterion("score <=", value, "score");
return (Criteria) this;
}
public Criteria andScoreIn(List<Float> values) {
addCriterion("score in", values, "score");
return (Criteria) this;
}
public Criteria andScoreNotIn(List<Float> values) {
addCriterion("score not in", values, "score");
return (Criteria) this;
}
public Criteria andScoreBetween(Float value1, Float value2) {
addCriterion("score between", value1, value2, "score");
return (Criteria) this;
}
public Criteria andScoreNotBetween(Float value1, Float value2) {
addCriterion("score not between", value1, value2, "score");
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 Criteria andPriorityIsNull() {
addCriterion("priority is null");
return (Criteria) this;
}
public Criteria andPriorityIsNotNull() {
addCriterion("priority is not null");
return (Criteria) this;
}
public Criteria andPriorityEqualTo(Byte value) {
addCriterion("priority =", value, "priority");
return (Criteria) this;
}
public Criteria andPriorityNotEqualTo(Byte value) {
addCriterion("priority <>", value, "priority");
return (Criteria) this;
}
public Criteria andPriorityGreaterThan(Byte value) {
addCriterion("priority >", value, "priority");
return (Criteria) this;
}
public Criteria andPriorityGreaterThanOrEqualTo(Byte value) {
addCriterion("priority >=", value, "priority");
return (Criteria) this;
}
public Criteria andPriorityLessThan(Byte value) {
addCriterion("priority <", value, "priority");
return (Criteria) this;
}
public Criteria andPriorityLessThanOrEqualTo(Byte value) {
addCriterion("priority <=", value, "priority");
return (Criteria) this;
}
public Criteria andPriorityIn(List<Byte> values) {
addCriterion("priority in", values, "priority");
return (Criteria) this;
}
public Criteria andPriorityNotIn(List<Byte> values) {
addCriterion("priority not in", values, "priority");
return (Criteria) this;
}
public Criteria andPriorityBetween(Byte value1, Byte value2) {
addCriterion("priority between", value1, value2, "priority");
return (Criteria) this;
}
public Criteria andPriorityNotBetween(Byte value1, Byte value2) {
addCriterion("priority not between", value1, value2, "priority");
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);
}
}
}

View File

@ -0,0 +1,228 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="xyz.zinglizingli.books.mapper.BookParseLogMapper" >
<resultMap id="BaseResultMap" type="xyz.zinglizingli.books.po.BookParseLog" >
<id column="id" property="id" jdbcType="BIGINT" />
<result column="book_url" property="bookUrl" jdbcType="VARCHAR" />
<result column="book_name" property="bookName" jdbcType="VARCHAR" />
<result column="score" property="score" jdbcType="REAL" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="priority" property="priority" jdbcType="TINYINT" />
</resultMap>
<sql id="Example_Where_Clause" >
<where >
<foreach collection="oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<foreach collection="criteria.criteria" item="criterion" >
<choose >
<when test="criterion.noValue" >
and ${criterion.condition}
</when>
<when test="criterion.singleValue" >
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue" >
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue" >
and ${criterion.condition}
<foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause" >
<where >
<foreach collection="example.oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<foreach collection="criteria.criteria" item="criterion" >
<choose >
<when test="criterion.noValue" >
and ${criterion.condition}
</when>
<when test="criterion.singleValue" >
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue" >
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue" >
and ${criterion.condition}
<foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List" >
id, book_url, book_name, score, create_time, priority
</sql>
<select id="selectByExample" resultMap="BaseResultMap" parameterType="xyz.zinglizingli.books.po.BookParseLogExample" >
select
<if test="distinct" >
distinct
</if>
<include refid="Base_Column_List" />
from book_parse_log
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null" >
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
select
<include refid="Base_Column_List" />
from book_parse_log
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
delete from book_parse_log
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="xyz.zinglizingli.books.po.BookParseLogExample" >
delete from book_parse_log
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="xyz.zinglizingli.books.po.BookParseLog" >
insert into book_parse_log (id, book_url, book_name,
score, create_time, priority
)
values (#{id,jdbcType=BIGINT}, #{bookUrl,jdbcType=VARCHAR}, #{bookName,jdbcType=VARCHAR},
#{score,jdbcType=REAL}, #{createTime,jdbcType=TIMESTAMP}, #{priority,jdbcType=TINYINT}
)
</insert>
<insert id="insertSelective" parameterType="xyz.zinglizingli.books.po.BookParseLog" >
insert into book_parse_log
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="bookUrl != null" >
book_url,
</if>
<if test="bookName != null" >
book_name,
</if>
<if test="score != null" >
score,
</if>
<if test="createTime != null" >
create_time,
</if>
<if test="priority != null" >
priority,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=BIGINT},
</if>
<if test="bookUrl != null" >
#{bookUrl,jdbcType=VARCHAR},
</if>
<if test="bookName != null" >
#{bookName,jdbcType=VARCHAR},
</if>
<if test="score != null" >
#{score,jdbcType=REAL},
</if>
<if test="createTime != null" >
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="priority != null" >
#{priority,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="xyz.zinglizingli.books.po.BookParseLogExample" resultType="java.lang.Integer" >
select count(*) from book_parse_log
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map" >
update book_parse_log
<set >
<if test="record.id != null" >
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.bookUrl != null" >
book_url = #{record.bookUrl,jdbcType=VARCHAR},
</if>
<if test="record.bookName != null" >
book_name = #{record.bookName,jdbcType=VARCHAR},
</if>
<if test="record.score != null" >
score = #{record.score,jdbcType=REAL},
</if>
<if test="record.createTime != null" >
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.priority != null" >
priority = #{record.priority,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map" >
update book_parse_log
set id = #{record.id,jdbcType=BIGINT},
book_url = #{record.bookUrl,jdbcType=VARCHAR},
book_name = #{record.bookName,jdbcType=VARCHAR},
score = #{record.score,jdbcType=REAL},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
priority = #{record.priority,jdbcType=TINYINT}
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="xyz.zinglizingli.books.po.BookParseLog" >
update book_parse_log
<set >
<if test="bookUrl != null" >
book_url = #{bookUrl,jdbcType=VARCHAR},
</if>
<if test="bookName != null" >
book_name = #{bookName,jdbcType=VARCHAR},
</if>
<if test="score != null" >
score = #{score,jdbcType=REAL},
</if>
<if test="createTime != null" >
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="priority != null" >
priority = #{priority,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="xyz.zinglizingli.books.po.BookParseLog" >
update book_parse_log
set book_url = #{bookUrl,jdbcType=VARCHAR},
book_name = #{bookName,jdbcType=VARCHAR},
score = #{score,jdbcType=REAL},
create_time = #{createTime,jdbcType=TIMESTAMP},
priority = #{priority,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>