提交 dcb5dd09 编写于 作者: yubinCloud's avatar yubinCloud

11-3 根据电子书快照表生成相应的持久层代码

上级 b108de0a
package io.github.yubincloud.fairywiki.domain;
import java.util.Date;
public class EbookSnapshot {
private Long id;
private Long ebookId;
private Date date;
private Integer viewCount;
private Integer voteCount;
private Integer viewIncrease;
private Integer voteIncrease;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getEbookId() {
return ebookId;
}
public void setEbookId(Long ebookId) {
this.ebookId = ebookId;
}
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
public Integer getViewCount() {
return viewCount;
}
public void setViewCount(Integer viewCount) {
this.viewCount = viewCount;
}
public Integer getVoteCount() {
return voteCount;
}
public void setVoteCount(Integer voteCount) {
this.voteCount = voteCount;
}
public Integer getViewIncrease() {
return viewIncrease;
}
public void setViewIncrease(Integer viewIncrease) {
this.viewIncrease = viewIncrease;
}
public Integer getVoteIncrease() {
return voteIncrease;
}
public void setVoteIncrease(Integer voteIncrease) {
this.voteIncrease = voteIncrease;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", ebookId=").append(ebookId);
sb.append(", date=").append(date);
sb.append(", viewCount=").append(viewCount);
sb.append(", voteCount=").append(voteCount);
sb.append(", viewIncrease=").append(viewIncrease);
sb.append(", voteIncrease=").append(voteIncrease);
sb.append("]");
return sb.toString();
}
}
\ No newline at end of file
package io.github.yubincloud.fairywiki.domain;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
public class EbookSnapshotExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public EbookSnapshotExample() {
oredCriteria = new ArrayList<>();
}
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<>();
}
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));
}
protected void addCriterionForJDBCDate(String condition, Date value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
addCriterion(condition, new java.sql.Date(value.getTime()), property);
}
protected void addCriterionForJDBCDate(String condition, List<Date> values, String property) {
if (values == null || values.size() == 0) {
throw new RuntimeException("Value list for " + property + " cannot be null or empty");
}
List<java.sql.Date> dateList = new ArrayList<>();
Iterator<Date> iter = values.iterator();
while (iter.hasNext()) {
dateList.add(new java.sql.Date(iter.next().getTime()));
}
addCriterion(condition, dateList, property);
}
protected void addCriterionForJDBCDate(String condition, Date value1, Date value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
addCriterion(condition, new java.sql.Date(value1.getTime()), new java.sql.Date(value2.getTime()), property);
}
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 andEbookIdIsNull() {
addCriterion("ebook_id is null");
return (Criteria) this;
}
public Criteria andEbookIdIsNotNull() {
addCriterion("ebook_id is not null");
return (Criteria) this;
}
public Criteria andEbookIdEqualTo(Long value) {
addCriterion("ebook_id =", value, "ebookId");
return (Criteria) this;
}
public Criteria andEbookIdNotEqualTo(Long value) {
addCriterion("ebook_id <>", value, "ebookId");
return (Criteria) this;
}
public Criteria andEbookIdGreaterThan(Long value) {
addCriterion("ebook_id >", value, "ebookId");
return (Criteria) this;
}
public Criteria andEbookIdGreaterThanOrEqualTo(Long value) {
addCriterion("ebook_id >=", value, "ebookId");
return (Criteria) this;
}
public Criteria andEbookIdLessThan(Long value) {
addCriterion("ebook_id <", value, "ebookId");
return (Criteria) this;
}
public Criteria andEbookIdLessThanOrEqualTo(Long value) {
addCriterion("ebook_id <=", value, "ebookId");
return (Criteria) this;
}
public Criteria andEbookIdIn(List<Long> values) {
addCriterion("ebook_id in", values, "ebookId");
return (Criteria) this;
}
public Criteria andEbookIdNotIn(List<Long> values) {
addCriterion("ebook_id not in", values, "ebookId");
return (Criteria) this;
}
public Criteria andEbookIdBetween(Long value1, Long value2) {
addCriterion("ebook_id between", value1, value2, "ebookId");
return (Criteria) this;
}
public Criteria andEbookIdNotBetween(Long value1, Long value2) {
addCriterion("ebook_id not between", value1, value2, "ebookId");
return (Criteria) this;
}
public Criteria andDateIsNull() {
addCriterion("`date` is null");
return (Criteria) this;
}
public Criteria andDateIsNotNull() {
addCriterion("`date` is not null");
return (Criteria) this;
}
public Criteria andDateEqualTo(Date value) {
addCriterionForJDBCDate("`date` =", value, "date");
return (Criteria) this;
}
public Criteria andDateNotEqualTo(Date value) {
addCriterionForJDBCDate("`date` <>", value, "date");
return (Criteria) this;
}
public Criteria andDateGreaterThan(Date value) {
addCriterionForJDBCDate("`date` >", value, "date");
return (Criteria) this;
}
public Criteria andDateGreaterThanOrEqualTo(Date value) {
addCriterionForJDBCDate("`date` >=", value, "date");
return (Criteria) this;
}
public Criteria andDateLessThan(Date value) {
addCriterionForJDBCDate("`date` <", value, "date");
return (Criteria) this;
}
public Criteria andDateLessThanOrEqualTo(Date value) {
addCriterionForJDBCDate("`date` <=", value, "date");
return (Criteria) this;
}
public Criteria andDateIn(List<Date> values) {
addCriterionForJDBCDate("`date` in", values, "date");
return (Criteria) this;
}
public Criteria andDateNotIn(List<Date> values) {
addCriterionForJDBCDate("`date` not in", values, "date");
return (Criteria) this;
}
public Criteria andDateBetween(Date value1, Date value2) {
addCriterionForJDBCDate("`date` between", value1, value2, "date");
return (Criteria) this;
}
public Criteria andDateNotBetween(Date value1, Date value2) {
addCriterionForJDBCDate("`date` not between", value1, value2, "date");
return (Criteria) this;
}
public Criteria andViewCountIsNull() {
addCriterion("view_count is null");
return (Criteria) this;
}
public Criteria andViewCountIsNotNull() {
addCriterion("view_count is not null");
return (Criteria) this;
}
public Criteria andViewCountEqualTo(Integer value) {
addCriterion("view_count =", value, "viewCount");
return (Criteria) this;
}
public Criteria andViewCountNotEqualTo(Integer value) {
addCriterion("view_count <>", value, "viewCount");
return (Criteria) this;
}
public Criteria andViewCountGreaterThan(Integer value) {
addCriterion("view_count >", value, "viewCount");
return (Criteria) this;
}
public Criteria andViewCountGreaterThanOrEqualTo(Integer value) {
addCriterion("view_count >=", value, "viewCount");
return (Criteria) this;
}
public Criteria andViewCountLessThan(Integer value) {
addCriterion("view_count <", value, "viewCount");
return (Criteria) this;
}
public Criteria andViewCountLessThanOrEqualTo(Integer value) {
addCriterion("view_count <=", value, "viewCount");
return (Criteria) this;
}
public Criteria andViewCountIn(List<Integer> values) {
addCriterion("view_count in", values, "viewCount");
return (Criteria) this;
}
public Criteria andViewCountNotIn(List<Integer> values) {
addCriterion("view_count not in", values, "viewCount");
return (Criteria) this;
}
public Criteria andViewCountBetween(Integer value1, Integer value2) {
addCriterion("view_count between", value1, value2, "viewCount");
return (Criteria) this;
}
public Criteria andViewCountNotBetween(Integer value1, Integer value2) {
addCriterion("view_count not between", value1, value2, "viewCount");
return (Criteria) this;
}
public Criteria andVoteCountIsNull() {
addCriterion("vote_count is null");
return (Criteria) this;
}
public Criteria andVoteCountIsNotNull() {
addCriterion("vote_count is not null");
return (Criteria) this;
}
public Criteria andVoteCountEqualTo(Integer value) {
addCriterion("vote_count =", value, "voteCount");
return (Criteria) this;
}
public Criteria andVoteCountNotEqualTo(Integer value) {
addCriterion("vote_count <>", value, "voteCount");
return (Criteria) this;
}
public Criteria andVoteCountGreaterThan(Integer value) {
addCriterion("vote_count >", value, "voteCount");
return (Criteria) this;
}
public Criteria andVoteCountGreaterThanOrEqualTo(Integer value) {
addCriterion("vote_count >=", value, "voteCount");
return (Criteria) this;
}
public Criteria andVoteCountLessThan(Integer value) {
addCriterion("vote_count <", value, "voteCount");
return (Criteria) this;
}
public Criteria andVoteCountLessThanOrEqualTo(Integer value) {
addCriterion("vote_count <=", value, "voteCount");
return (Criteria) this;
}
public Criteria andVoteCountIn(List<Integer> values) {
addCriterion("vote_count in", values, "voteCount");
return (Criteria) this;
}
public Criteria andVoteCountNotIn(List<Integer> values) {
addCriterion("vote_count not in", values, "voteCount");
return (Criteria) this;
}
public Criteria andVoteCountBetween(Integer value1, Integer value2) {
addCriterion("vote_count between", value1, value2, "voteCount");
return (Criteria) this;
}
public Criteria andVoteCountNotBetween(Integer value1, Integer value2) {
addCriterion("vote_count not between", value1, value2, "voteCount");
return (Criteria) this;
}
public Criteria andViewIncreaseIsNull() {
addCriterion("view_increase is null");
return (Criteria) this;
}
public Criteria andViewIncreaseIsNotNull() {
addCriterion("view_increase is not null");
return (Criteria) this;
}
public Criteria andViewIncreaseEqualTo(Integer value) {
addCriterion("view_increase =", value, "viewIncrease");
return (Criteria) this;
}
public Criteria andViewIncreaseNotEqualTo(Integer value) {
addCriterion("view_increase <>", value, "viewIncrease");
return (Criteria) this;
}
public Criteria andViewIncreaseGreaterThan(Integer value) {
addCriterion("view_increase >", value, "viewIncrease");
return (Criteria) this;
}
public Criteria andViewIncreaseGreaterThanOrEqualTo(Integer value) {
addCriterion("view_increase >=", value, "viewIncrease");
return (Criteria) this;
}
public Criteria andViewIncreaseLessThan(Integer value) {
addCriterion("view_increase <", value, "viewIncrease");
return (Criteria) this;
}
public Criteria andViewIncreaseLessThanOrEqualTo(Integer value) {
addCriterion("view_increase <=", value, "viewIncrease");
return (Criteria) this;
}
public Criteria andViewIncreaseIn(List<Integer> values) {
addCriterion("view_increase in", values, "viewIncrease");
return (Criteria) this;
}
public Criteria andViewIncreaseNotIn(List<Integer> values) {
addCriterion("view_increase not in", values, "viewIncrease");
return (Criteria) this;
}
public Criteria andViewIncreaseBetween(Integer value1, Integer value2) {
addCriterion("view_increase between", value1, value2, "viewIncrease");
return (Criteria) this;
}
public Criteria andViewIncreaseNotBetween(Integer value1, Integer value2) {
addCriterion("view_increase not between", value1, value2, "viewIncrease");
return (Criteria) this;
}
public Criteria andVoteIncreaseIsNull() {
addCriterion("vote_increase is null");
return (Criteria) this;
}
public Criteria andVoteIncreaseIsNotNull() {
addCriterion("vote_increase is not null");
return (Criteria) this;
}
public Criteria andVoteIncreaseEqualTo(Integer value) {
addCriterion("vote_increase =", value, "voteIncrease");
return (Criteria) this;
}
public Criteria andVoteIncreaseNotEqualTo(Integer value) {
addCriterion("vote_increase <>", value, "voteIncrease");
return (Criteria) this;
}
public Criteria andVoteIncreaseGreaterThan(Integer value) {
addCriterion("vote_increase >", value, "voteIncrease");
return (Criteria) this;
}
public Criteria andVoteIncreaseGreaterThanOrEqualTo(Integer value) {
addCriterion("vote_increase >=", value, "voteIncrease");
return (Criteria) this;
}
public Criteria andVoteIncreaseLessThan(Integer value) {
addCriterion("vote_increase <", value, "voteIncrease");
return (Criteria) this;
}
public Criteria andVoteIncreaseLessThanOrEqualTo(Integer value) {
addCriterion("vote_increase <=", value, "voteIncrease");
return (Criteria) this;
}
public Criteria andVoteIncreaseIn(List<Integer> values) {
addCriterion("vote_increase in", values, "voteIncrease");
return (Criteria) this;
}
public Criteria andVoteIncreaseNotIn(List<Integer> values) {
addCriterion("vote_increase not in", values, "voteIncrease");
return (Criteria) this;
}
public Criteria andVoteIncreaseBetween(Integer value1, Integer value2) {
addCriterion("vote_increase between", value1, value2, "voteIncrease");
return (Criteria) this;
}
public Criteria andVoteIncreaseNotBetween(Integer value1, Integer value2) {
addCriterion("vote_increase not between", value1, value2, "voteIncrease");
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);
}
}
}
\ No newline at end of file
package io.github.yubincloud.fairywiki.mapper;
import io.github.yubincloud.fairywiki.domain.EbookSnapshot;
import io.github.yubincloud.fairywiki.domain.EbookSnapshotExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface EbookSnapshotMapper {
long countByExample(EbookSnapshotExample example);
int deleteByExample(EbookSnapshotExample example);
int deleteByPrimaryKey(Long id);
int insert(EbookSnapshot record);
int insertSelective(EbookSnapshot record);
List<EbookSnapshot> selectByExample(EbookSnapshotExample example);
EbookSnapshot selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") EbookSnapshot record, @Param("example") EbookSnapshotExample example);
int updateByExample(@Param("record") EbookSnapshot record, @Param("example") EbookSnapshotExample example);
int updateByPrimaryKeySelective(EbookSnapshot record);
int updateByPrimaryKey(EbookSnapshot record);
}
\ No newline at end of file
package io.github.yubincloud.fairywiki.service;
import io.github.yubincloud.fairywiki.mapper.EbookSnapshotMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
public class EbookSnapshotService {
@Resource
private EbookSnapshotMapper ebookSnapshotMapper;
}
...@@ -43,6 +43,6 @@ ...@@ -43,6 +43,6 @@
targetPackage="io.github.yubincloud.fairywiki.mapper" targetPackage="io.github.yubincloud.fairywiki.mapper"
type="XMLMAPPER"/> type="XMLMAPPER"/>
<table tableName="user" domainObjectName="User"/> <table tableName="ebook_snapshot"/>
</context> </context>
</generatorConfiguration> </generatorConfiguration>
<?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="io.github.yubincloud.fairywiki.mapper.EbookSnapshotMapper">
<resultMap id="BaseResultMap" type="io.github.yubincloud.fairywiki.domain.EbookSnapshot">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="ebook_id" jdbcType="BIGINT" property="ebookId" />
<result column="date" jdbcType="DATE" property="date" />
<result column="view_count" jdbcType="INTEGER" property="viewCount" />
<result column="vote_count" jdbcType="INTEGER" property="voteCount" />
<result column="view_increase" jdbcType="INTEGER" property="viewIncrease" />
<result column="vote_increase" jdbcType="INTEGER" property="voteIncrease" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<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 close=")" collection="criterion.value" item="listItem" open="(" 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="(" prefixOverrides="and" suffix=")">
<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 close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, ebook_id, `date`, view_count, vote_count, view_increase, vote_increase
</sql>
<select id="selectByExample" parameterType="io.github.yubincloud.fairywiki.domain.EbookSnapshotExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from ebook_snapshot
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ebook_snapshot
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from ebook_snapshot
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="io.github.yubincloud.fairywiki.domain.EbookSnapshotExample">
delete from ebook_snapshot
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="io.github.yubincloud.fairywiki.domain.EbookSnapshot">
insert into ebook_snapshot (id, ebook_id, `date`,
view_count, vote_count, view_increase,
vote_increase)
values (#{id,jdbcType=BIGINT}, #{ebookId,jdbcType=BIGINT}, #{date,jdbcType=DATE},
#{viewCount,jdbcType=INTEGER}, #{voteCount,jdbcType=INTEGER}, #{viewIncrease,jdbcType=INTEGER},
#{voteIncrease,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="io.github.yubincloud.fairywiki.domain.EbookSnapshot">
insert into ebook_snapshot
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="ebookId != null">
ebook_id,
</if>
<if test="date != null">
`date`,
</if>
<if test="viewCount != null">
view_count,
</if>
<if test="voteCount != null">
vote_count,
</if>
<if test="viewIncrease != null">
view_increase,
</if>
<if test="voteIncrease != null">
vote_increase,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="ebookId != null">
#{ebookId,jdbcType=BIGINT},
</if>
<if test="date != null">
#{date,jdbcType=DATE},
</if>
<if test="viewCount != null">
#{viewCount,jdbcType=INTEGER},
</if>
<if test="voteCount != null">
#{voteCount,jdbcType=INTEGER},
</if>
<if test="viewIncrease != null">
#{viewIncrease,jdbcType=INTEGER},
</if>
<if test="voteIncrease != null">
#{voteIncrease,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.github.yubincloud.fairywiki.domain.EbookSnapshotExample" resultType="java.lang.Long">
select count(*) from ebook_snapshot
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update ebook_snapshot
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.ebookId != null">
ebook_id = #{record.ebookId,jdbcType=BIGINT},
</if>
<if test="record.date != null">
`date` = #{record.date,jdbcType=DATE},
</if>
<if test="record.viewCount != null">
view_count = #{record.viewCount,jdbcType=INTEGER},
</if>
<if test="record.voteCount != null">
vote_count = #{record.voteCount,jdbcType=INTEGER},
</if>
<if test="record.viewIncrease != null">
view_increase = #{record.viewIncrease,jdbcType=INTEGER},
</if>
<if test="record.voteIncrease != null">
vote_increase = #{record.voteIncrease,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update ebook_snapshot
set id = #{record.id,jdbcType=BIGINT},
ebook_id = #{record.ebookId,jdbcType=BIGINT},
`date` = #{record.date,jdbcType=DATE},
view_count = #{record.viewCount,jdbcType=INTEGER},
vote_count = #{record.voteCount,jdbcType=INTEGER},
view_increase = #{record.viewIncrease,jdbcType=INTEGER},
vote_increase = #{record.voteIncrease,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="io.github.yubincloud.fairywiki.domain.EbookSnapshot">
update ebook_snapshot
<set>
<if test="ebookId != null">
ebook_id = #{ebookId,jdbcType=BIGINT},
</if>
<if test="date != null">
`date` = #{date,jdbcType=DATE},
</if>
<if test="viewCount != null">
view_count = #{viewCount,jdbcType=INTEGER},
</if>
<if test="voteCount != null">
vote_count = #{voteCount,jdbcType=INTEGER},
</if>
<if test="viewIncrease != null">
view_increase = #{viewIncrease,jdbcType=INTEGER},
</if>
<if test="voteIncrease != null">
vote_increase = #{voteIncrease,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="io.github.yubincloud.fairywiki.domain.EbookSnapshot">
update ebook_snapshot
set ebook_id = #{ebookId,jdbcType=BIGINT},
`date` = #{date,jdbcType=DATE},
view_count = #{viewCount,jdbcType=INTEGER},
vote_count = #{voteCount,jdbcType=INTEGER},
view_increase = #{viewIncrease,jdbcType=INTEGER},
vote_increase = #{voteIncrease,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册