Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yubinCloud
fairy-wiki
提交
dcb5dd09
F
fairy-wiki
项目概览
yubinCloud
/
fairy-wiki
通知
4
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
fairy-wiki
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
dcb5dd09
编写于
4月 30, 2021
作者:
yubinCloud
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
11-3 根据电子书快照表生成相应的持久层代码
上级
b108de0a
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
1026 addition
and
1 deletion
+1026
-1
src/main/java/io/github/yubincloud/fairywiki/domain/EbookSnapshot.java
.../io/github/yubincloud/fairywiki/domain/EbookSnapshot.java
+92
-0
src/main/java/io/github/yubincloud/fairywiki/domain/EbookSnapshotExample.java
...hub/yubincloud/fairywiki/domain/EbookSnapshotExample.java
+647
-0
src/main/java/io/github/yubincloud/fairywiki/mapper/EbookSnapshotMapper.java
...thub/yubincloud/fairywiki/mapper/EbookSnapshotMapper.java
+30
-0
src/main/java/io/github/yubincloud/fairywiki/service/EbookSnapshotService.java
...ub/yubincloud/fairywiki/service/EbookSnapshotService.java
+13
-0
src/main/resources/generator/generator-config.xml
src/main/resources/generator/generator-config.xml
+1
-1
src/main/resources/mapper/EbookSnapshotMapper.xml
src/main/resources/mapper/EbookSnapshotMapper.xml
+243
-0
未找到文件。
src/main/java/io/github/yubincloud/fairywiki/domain/EbookSnapshot.java
0 → 100644
浏览文件 @
dcb5dd09
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
src/main/java/io/github/yubincloud/fairywiki/domain/EbookSnapshotExample.java
0 → 100644
浏览文件 @
dcb5dd09
此差异已折叠。
点击以展开。
src/main/java/io/github/yubincloud/fairywiki/mapper/EbookSnapshotMapper.java
0 → 100644
浏览文件 @
dcb5dd09
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
src/main/java/io/github/yubincloud/fairywiki/service/EbookSnapshotService.java
0 → 100644
浏览文件 @
dcb5dd09
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
;
}
src/main/resources/generator/generator-config.xml
浏览文件 @
dcb5dd09
...
...
@@ -43,6 +43,6 @@
targetPackage=
"io.github.yubincloud.fairywiki.mapper"
type=
"XMLMAPPER"
/>
<table
tableName=
"
user"
domainObjectName=
"User
"
/>
<table
tableName=
"
ebook_snapshot
"
/>
</context>
</generatorConfiguration>
src/main/resources/mapper/EbookSnapshotMapper.xml
0 → 100644
浏览文件 @
dcb5dd09
<?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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录