feat: 后台小说删除

This commit is contained in:
xiongxiaoyang
2023-04-14 21:09:37 +08:00
parent 9f23f817b1
commit 687eb61846
44 changed files with 3523 additions and 782 deletions

View File

@ -51,4 +51,43 @@ spring:
# 连接池最大连接数使用负值表示没有限制
max-active: 100
# 连接池最大阻塞等待时间使用负值表示没有限制
max-wait: -1
max-wait: -1
####使用shardingJdbc时
####所有的jdbcType都不能是LONGVARCHAR,否则会导致java.io.NotSerializableException: java.io.StringReader错误
##### 应该替换所有的 LONGVARCHAR 类型为VARCHAR
sharding:
jdbc:
datasource:
names: ds0 #,ds1
ds0:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
jdbc-url: jdbc:mysql://localhost:3306/novel_plus?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
username: root
password: test123456
# ds1:
# type: com.alibaba.druid.pool.DruidDataSource
# driver-class-name: com.mysql.jdbc.Driver
# url: jdbc:mysql://localhost:3306/novel_plus2
# username: root
# password: test123456
config:
sharding:
props:
sql.show: true
tables:
book_content: #book_content表
key-generator-column-name: id #主键
actual-data-nodes: ds${0}.book_content${0..9} #数据节点
# database-strategy: #分库策略
# inline:
# sharding-column: book_id
# algorithm-expression: ds${book_id % 10}
table-strategy: #分表策略
inline:
shardingColumn: index_id
algorithm-expression: book_content${index_id % 10}

View File

@ -51,4 +51,42 @@ spring:
# 连接池最大连接数使用负值表示没有限制
max-active: 100
# 连接池最大阻塞等待时间使用负值表示没有限制
max-wait: -1
max-wait: -1
####使用shardingJdbc时
####所有的jdbcType都不能是LONGVARCHAR,否则会导致java.io.NotSerializableException: java.io.StringReader错误
##### 应该替换所有的 LONGVARCHAR 类型为VARCHAR
sharding:
jdbc:
datasource:
names: ds0 #,ds1
ds0:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
jdbc-url: jdbc:mysql://localhost:3306/novel_plus?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
username: root
password: test123456
# ds1:
# type: com.alibaba.druid.pool.DruidDataSource
# driver-class-name: com.mysql.jdbc.Driver
# url: jdbc:mysql://localhost:3306/novel_plus2
# username: root
# password: test123456
config:
sharding:
props:
sql.show: true
tables:
book_content: #book_content表
key-generator-column-name: id #主键
actual-data-nodes: ds${0}.book_content${0..9} #数据节点
# database-strategy: #分库策略
# inline:
# sharding-column: book_id
# algorithm-expression: ds${book_id % 10}
table-strategy: #分表策略
inline:
shardingColumn: index_id
algorithm-expression: book_content${index_id % 10}

View File

@ -17,13 +17,17 @@ spring:
date-format: yyyy-MM-dd HH:mm:ss
profiles:
active: dev
#上传文件的最大值10M
servlet:
multipart:
max-file-size: 30Mb
max-request-size: 30Mb
max-file-size: 10485760
devtools:
restart:
enabled: true
main:
allow-bean-definition-overriding: true
mybatis:
configuration:

View File

@ -3,130 +3,140 @@
<mapper namespace="com.java2nb.common.dao.DictDao">
<select id="get" resultType="com.java2nb.common.domain.DictDO">
select
`id`,`name`,`value`,`type`,`description`,`sort`,`parent_id`,`create_by`,`create_date`,`update_by`,`update_date`,`remarks`,`del_flag`
from sys_dict where id = #{value}
</select>
<select id="get" resultType="com.java2nb.common.domain.DictDO">
select `id`,
`name`,
`value`,
`type`,
`description`,
`sort`,
`parent_id`,
`create_by`,
`create_date`,
`update_by`,
`update_date`,
`remarks`,
`del_flag`
from sys_dict
where id = #{value}
</select>
<select id="list" resultType="com.java2nb.common.domain.DictDO">
select
`id`,`name`,`value`,`type`,`description`,`sort`,`parent_id`,`create_by`,`create_date`,`update_by`,`update_date`,`remarks`,`del_flag`
from sys_dict
<where>
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="name != null and name != ''"> and name = #{name} </if>
<if test="value != null and value != ''"> and value = #{value} </if>
<if test="type != null and type != ''"> and type = #{type} </if>
<if test="description != null and description != ''"> and description = #{description} </if>
<if test="sort != null and sort != ''"> and sort = #{sort} </if>
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId} </if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy} </if>
<if test="createDate != null and createDate != ''"> and create_date = #{createDate} </if>
<if test="updateBy != null and updateBy != ''"> and update_by = #{updateBy} </if>
<if test="updateDate != null and updateDate != ''"> and update_date = #{updateDate} </if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks} </if>
<if test="delFlag != null and delFlag != ''"> and del_flag = #{delFlag} </if>
</where>
<choose>
<when test="sort != null and sort.trim() != ''">
order by ${sort} ${order}
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="list" resultType="com.java2nb.common.domain.DictDO">
select
`id`,`name`,`value`,`type`,`description`,`sort`,`parent_id`,`create_by`,`create_date`,`update_by`,`update_date`,`remarks`,`del_flag`
from sys_dict
<where>
<if test="id != null and id != ''">and id = #{id}</if>
<if test="name != null and name != ''">and name = #{name}</if>
<if test="value != null and value != ''">and value = #{value}</if>
<if test="type != null and type != ''">and type = #{type}</if>
<if test="description != null and description != ''">and description = #{description}</if>
<if test="sort != null and sort != ''">and sort = #{sort}</if>
<if test="parentId != null and parentId != ''">and parent_id = #{parentId}</if>
<if test="createBy != null and createBy != ''">and create_by = #{createBy}</if>
<if test="createDate != null and createDate != ''">and create_date = #{createDate}</if>
<if test="updateBy != null and updateBy != ''">and update_by = #{updateBy}</if>
<if test="updateDate != null and updateDate != ''">and update_date = #{updateDate}</if>
<if test="remarks != null and remarks != ''">and remarks = #{remarks}</if>
<if test="delFlag != null and delFlag != ''">and del_flag = #{delFlag}</if>
</where>
<choose>
<when test="sort != null and sort.trim() != ''">
order by ${sort} ${order}
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="count" resultType="int">
select count(*) from sys_dict
<where>
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="name != null and name != ''"> and name = #{name} </if>
<if test="value != null and value != ''"> and value = #{value} </if>
<if test="type != null and type != ''"> and type = #{type} </if>
<if test="description != null and description != ''"> and description = #{description} </if>
<if test="sort != null and sort != ''"> and sort = #{sort} </if>
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId} </if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy} </if>
<if test="createDate != null and createDate != ''"> and create_date = #{createDate} </if>
<if test="updateBy != null and updateBy != ''"> and update_by = #{updateBy} </if>
<if test="updateDate != null and updateDate != ''"> and update_date = #{updateDate} </if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks} </if>
<if test="delFlag != null and delFlag != ''"> and del_flag = #{delFlag} </if>
</where>
</select>
<select id="count" resultType="int">
select count(*) from sys_dict
<where>
<if test="id != null and id != ''">and id = #{id}</if>
<if test="name != null and name != ''">and name = #{name}</if>
<if test="value != null and value != ''">and value = #{value}</if>
<if test="type != null and type != ''">and type = #{type}</if>
<if test="description != null and description != ''">and description = #{description}</if>
<if test="sort != null and sort != ''">and sort = #{sort}</if>
<if test="parentId != null and parentId != ''">and parent_id = #{parentId}</if>
<if test="createBy != null and createBy != ''">and create_by = #{createBy}</if>
<if test="createDate != null and createDate != ''">and create_date = #{createDate}</if>
<if test="updateBy != null and updateBy != ''">and update_by = #{updateBy}</if>
<if test="updateDate != null and updateDate != ''">and update_date = #{updateDate}</if>
<if test="remarks != null and remarks != ''">and remarks = #{remarks}</if>
<if test="delFlag != null and delFlag != ''">and del_flag = #{delFlag}</if>
</where>
</select>
<insert id="save" parameterType="com.java2nb.common.domain.DictDO"
useGeneratedKeys="true" keyProperty="id">
insert into sys_dict
(
`name`,
`value`,
`type`,
`description`,
`sort`,
`parent_id`,
`create_by`,
`create_date`,
`update_by`,
`update_date`,
`remarks`,
`del_flag`
)
values
(
#{name},
#{value},
#{type},
#{description},
#{sort},
#{parentId},
#{createBy},
#{createDate},
#{updateBy},
#{updateDate},
#{remarks},
#{delFlag}
)
</insert>
<insert id="save" parameterType="com.java2nb.common.domain.DictDO"
useGeneratedKeys="true" keyProperty="id">
insert into sys_dict
(`name`,
`value`,
`type`,
`description`,
`sort`,
`parent_id`,
`create_by`,
`create_date`,
`update_by`,
`update_date`,
`remarks`,
`del_flag`)
values (#{name},
#{value},
#{type},
#{description},
#{sort},
#{parentId},
#{createBy},
#{createDate},
#{updateBy},
#{updateDate},
#{remarks},
#{delFlag})
</insert>
<update id="update" parameterType="com.java2nb.common.domain.DictDO">
update sys_dict
<set>
<if test="name != null">`name` = #{name}, </if>
<if test="value != null">`value` = #{value}, </if>
<if test="type != null">`type` = #{type}, </if>
<if test="description != null">`description` = #{description}, </if>
<if test="sort != null">`sort` = #{sort}, </if>
<if test="parentId != null">`parent_id` = #{parentId}, </if>
<if test="createBy != null">`create_by` = #{createBy}, </if>
<if test="createDate != null">`create_date` = #{createDate}, </if>
<if test="updateBy != null">`update_by` = #{updateBy}, </if>
<if test="updateDate != null">`update_date` = #{updateDate}, </if>
<if test="remarks != null">`remarks` = #{remarks}, </if>
<if test="delFlag != null">`del_flag` = #{delFlag}</if>
</set>
where id = #{id}
</update>
<update id="update" parameterType="com.java2nb.common.domain.DictDO">
update sys_dict
<set>
<if test="name != null">`name` = #{name},</if>
<if test="value != null">`value` = #{value},</if>
<if test="type != null">`type` = #{type},</if>
<if test="description != null">`description` = #{description},</if>
<if test="sort != null">`sort` = #{sort},</if>
<if test="parentId != null">`parent_id` = #{parentId},</if>
<if test="createBy != null">`create_by` = #{createBy},</if>
<if test="createDate != null">`create_date` = #{createDate},</if>
<if test="updateBy != null">`update_by` = #{updateBy},</if>
<if test="updateDate != null">`update_date` = #{updateDate},</if>
<if test="remarks != null">`remarks` = #{remarks},</if>
<if test="delFlag != null">`del_flag` = #{delFlag}</if>
</set>
where id = #{id}
</update>
<delete id="remove">
delete from sys_dict where id = #{value}
</delete>
<delete id="remove">
delete
from sys_dict
where id = #{value}
</delete>
<delete id="batchRemove">
delete from sys_dict where id in
<foreach item="id" collection="array" open="(" separator=","
close=")">
#{id}
</foreach>
</delete>
<delete id="batchRemove">
delete from sys_dict where id in
<foreach item="id" collection="array" open="(" separator=","
close=")">
#{id}
</foreach>
</delete>
<select id="listType" resultType="com.java2nb.common.domain.DictDO">
select distinct `type` , description from sys_dict
</select>
<select id="listType" resultType="com.java2nb.common.domain.DictDO">
select `type`, description
from sys_dict
</select>
</mapper>

View File

@ -0,0 +1,94 @@
<?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="com.java2nb.novel.dao.BookContentDao">
<select id="get" resultType="com.java2nb.novel.domain.BookContentDO">
select `id`, `index_id`, `content`
from book_content
where id = #{value}
</select>
<select id="list" resultType="com.java2nb.novel.domain.BookContentDO">
select `id`,`index_id`,`content` from book_content
<where>
<if test="id != null and id != ''">and id = #{id}</if>
<if test="indexId != null and indexId != ''">and index_id = #{indexId}</if>
<if test="content != null and content != ''">and content = #{content}</if>
</where>
<choose>
<when test="sort != null and sort.trim() != ''">
order by ${sort} ${order}
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="count" resultType="int">
select count(*) from book_content
<where>
<if test="id != null and id != ''">and id = #{id}</if>
<if test="indexId != null and indexId != ''">and index_id = #{indexId}</if>
<if test="content != null and content != ''">and content = #{content}</if>
</where>
</select>
<insert id="save" parameterType="com.java2nb.novel.domain.BookContentDO">
insert into book_content
(`id`,
`index_id`,
`content`)
values (#{id},
#{indexId},
#{content})
</insert>
<insert id="saveSelective" parameterType="com.java2nb.novel.domain.BookContentDO">
insert into book_content
(
<if test="id != null">`id`,</if>
<if test="indexId != null">`index_id`,</if>
<if test="content != null">`content`</if>
)
values
(
<if test="id != null">#{id},</if>
<if test="indexId != null">#{indexId},</if>
<if test="content != null">#{content}</if>
)
</insert>
<update id="update" parameterType="com.java2nb.novel.domain.BookContentDO">
update book_content
<set>
<if test="indexId != null">`index_id` = #{indexId},</if>
<if test="content != null">`content` = #{content}</if>
</set>
where id = #{id}
</update>
<delete id="remove">
delete
from book_content
where id = #{value}
</delete>
<delete id="batchRemove">
delete from book_content where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="removeByIndexIds">
delete from book_content where index_id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,153 @@
<?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="com.java2nb.novel.dao.BookIndexDao">
<select id="get" resultType="com.java2nb.novel.domain.BookIndexDO">
select `id`,
`book_id`,
`index_num`,
`index_name`,
`word_count`,
`is_vip`,
`book_price`,
`storage_type`,
`create_time`,
`update_time`
from book_index
where id = #{value}
</select>
<select id="list" resultType="com.java2nb.novel.domain.BookIndexDO">
select
`id`,`book_id`,`index_num`,`index_name`,`word_count`,`is_vip`,`book_price`,`storage_type`,`create_time`,`update_time`
from book_index
<where>
<if test="id != null and id != ''">and id = #{id}</if>
<if test="bookId != null and bookId != ''">and book_id = #{bookId}</if>
<if test="indexNum != null and indexNum != ''">and index_num = #{indexNum}</if>
<if test="indexName != null and indexName != ''">and index_name = #{indexName}</if>
<if test="wordCount != null and wordCount != ''">and word_count = #{wordCount}</if>
<if test="isVip != null and isVip != ''">and is_vip = #{isVip}</if>
<if test="bookPrice != null and bookPrice != ''">and book_price = #{bookPrice}</if>
<if test="storageType != null and storageType != ''">and storage_type = #{storageType}</if>
<if test="createTime != null and createTime != ''">and create_time = #{createTime}</if>
<if test="updateTime != null and updateTime != ''">and update_time = #{updateTime}</if>
</where>
<choose>
<when test="sort != null and sort.trim() != ''">
order by ${sort} ${order}
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="count" resultType="int">
select count(*) from book_index
<where>
<if test="id != null and id != ''">and id = #{id}</if>
<if test="bookId != null and bookId != ''">and book_id = #{bookId}</if>
<if test="indexNum != null and indexNum != ''">and index_num = #{indexNum}</if>
<if test="indexName != null and indexName != ''">and index_name = #{indexName}</if>
<if test="wordCount != null and wordCount != ''">and word_count = #{wordCount}</if>
<if test="isVip != null and isVip != ''">and is_vip = #{isVip}</if>
<if test="bookPrice != null and bookPrice != ''">and book_price = #{bookPrice}</if>
<if test="storageType != null and storageType != ''">and storage_type = #{storageType}</if>
<if test="createTime != null and createTime != ''">and create_time = #{createTime}</if>
<if test="updateTime != null and updateTime != ''">and update_time = #{updateTime}</if>
</where>
</select>
<select id="getIdsByBookId" resultType="java.lang.Long">
select id
from book_index
where book_id = #{bookId}
</select>
<insert id="save" parameterType="com.java2nb.novel.domain.BookIndexDO">
insert into book_index
(`id`,
`book_id`,
`index_num`,
`index_name`,
`word_count`,
`is_vip`,
`book_price`,
`storage_type`,
`create_time`,
`update_time`)
values (#{id},
#{bookId},
#{indexNum},
#{indexName},
#{wordCount},
#{isVip},
#{bookPrice},
#{storageType},
#{createTime},
#{updateTime})
</insert>
<insert id="saveSelective" parameterType="com.java2nb.novel.domain.BookIndexDO">
insert into book_index
(
<if test="id != null">`id`,</if>
<if test="bookId != null">`book_id`,</if>
<if test="indexNum != null">`index_num`,</if>
<if test="indexName != null">`index_name`,</if>
<if test="wordCount != null">`word_count`,</if>
<if test="isVip != null">`is_vip`,</if>
<if test="bookPrice != null">`book_price`,</if>
<if test="storageType != null">`storage_type`,</if>
<if test="createTime != null">`create_time`,</if>
<if test="updateTime != null">`update_time`</if>
)
values
(
<if test="id != null">#{id},</if>
<if test="bookId != null">#{bookId},</if>
<if test="indexNum != null">#{indexNum},</if>
<if test="indexName != null">#{indexName},</if>
<if test="wordCount != null">#{wordCount},</if>
<if test="isVip != null">#{isVip},</if>
<if test="bookPrice != null">#{bookPrice},</if>
<if test="storageType != null">#{storageType},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime}</if>
)
</insert>
<update id="update" parameterType="com.java2nb.novel.domain.BookIndexDO">
update book_index
<set>
<if test="bookId != null">`book_id` = #{bookId},</if>
<if test="indexNum != null">`index_num` = #{indexNum},</if>
<if test="indexName != null">`index_name` = #{indexName},</if>
<if test="wordCount != null">`word_count` = #{wordCount},</if>
<if test="isVip != null">`is_vip` = #{isVip},</if>
<if test="bookPrice != null">`book_price` = #{bookPrice},</if>
<if test="storageType != null">`storage_type` = #{storageType},</if>
<if test="createTime != null">`create_time` = #{createTime},</if>
<if test="updateTime != null">`update_time` = #{updateTime}</if>
</set>
where id = #{id}
</update>
<delete id="remove">
delete
from book_index
where id = #{value}
</delete>
<delete id="batchRemove">
delete from book_index where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -3,149 +3,161 @@
<mapper namespace="com.java2nb.system.dao.DataPermDao">
<select id="get" resultType="com.java2nb.system.domain.DataPermDO">
select `id`,`name`,`table_name`,`module_name`,`crl_attr_name`,`crl_column_name`,`perm_code`,`order_num`,`gmt_create`,`gmt_modified` from sys_data_perm where id = #{value}
</select>
<select id="get" resultType="com.java2nb.system.domain.DataPermDO">
select `id`,
`name`,
`table_name`,
`module_name`,
`crl_attr_name`,
`crl_column_name`,
`perm_code`,
`order_num`,
`gmt_create`,
`gmt_modified`
from sys_data_perm
where id = #{value}
</select>
<select id="list" resultType="com.java2nb.system.domain.DataPermDO">
select `id`,`name`,`table_name`,`module_name`,`crl_attr_name`,`crl_column_name`,`perm_code`,`order_num`,`gmt_create`,`gmt_modified` from sys_data_perm
<where>
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="name != null and name != ''"> and name = #{name} </if>
<if test="tableName != null and tableName != ''"> and table_name = #{tableName} </if>
<if test="moduleName != null and moduleName != ''"> and module_name = #{moduleName} </if>
<if test="crlAttrName != null and crlAttrName != ''"> and crl_attr_name = #{crlAttrName} </if>
<if test="crlColumnName != null and crlColumnName != ''"> and crl_column_name = #{crlColumnName} </if>
<if test="permCode != null and permCode != ''"> and perm_code = #{permCode} </if>
<if test="orderNum != null and orderNum != ''"> and order_num = #{orderNum} </if>
<if test="gmtCreate != null and gmtCreate != ''"> and gmt_create = #{gmtCreate} </if>
<if test="gmtModified != null and gmtModified != ''"> and gmt_modified = #{gmtModified} </if>
</where>
<select id="list" resultType="com.java2nb.system.domain.DataPermDO">
select
`id`,`name`,`table_name`,`module_name`,`crl_attr_name`,`crl_column_name`,`perm_code`,`order_num`,`gmt_create`,`gmt_modified`
from sys_data_perm
<where>
<if test="id != null and id != ''">and id = #{id}</if>
<if test="name != null and name != ''">and name = #{name}</if>
<if test="tableName != null and tableName != ''">and table_name = #{tableName}</if>
<if test="moduleName != null and moduleName != ''">and module_name = #{moduleName}</if>
<if test="crlAttrName != null and crlAttrName != ''">and crl_attr_name = #{crlAttrName}</if>
<if test="crlColumnName != null and crlColumnName != ''">and crl_column_name = #{crlColumnName}</if>
<if test="permCode != null and permCode != ''">and perm_code = #{permCode}</if>
<if test="orderNum != null and orderNum != ''">and order_num = #{orderNum}</if>
<if test="gmtCreate != null and gmtCreate != ''">and gmt_create = #{gmtCreate}</if>
<if test="gmtModified != null and gmtModified != ''">and gmt_modified = #{gmtModified}</if>
</where>
<choose>
<when test="sort != null and sort.trim() != ''">
order by ${sort} ${order}
</when>
<otherwise>
<otherwise>
order by id desc
</otherwise>
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="count" resultType="int">
select count(*) from sys_data_perm
<where>
<if test="id != null and id != ''"> and id = #{id} </if>
<if test="name != null and name != ''"> and name = #{name} </if>
<if test="tableName != null and tableName != ''"> and table_name = #{tableName} </if>
<if test="moduleName != null and moduleName != ''"> and module_name = #{moduleName} </if>
<if test="crlAttrName != null and crlAttrName != ''"> and crl_attr_name = #{crlAttrName} </if>
<if test="crlColumnName != null and crlColumnName != ''"> and crl_column_name = #{crlColumnName} </if>
<if test="permCode != null and permCode != ''"> and perm_code = #{permCode} </if>
<if test="orderNum != null and orderNum != ''"> and order_num = #{orderNum} </if>
<if test="gmtCreate != null and gmtCreate != ''"> and gmt_create = #{gmtCreate} </if>
<if test="gmtModified != null and gmtModified != ''"> and gmt_modified = #{gmtModified} </if>
</where>
</select>
<insert id="save" parameterType="com.java2nb.system.domain.DataPermDO" useGeneratedKeys="true" keyProperty="id">
insert into sys_data_perm
(
`name`,
`table_name`,
`module_name`,
`crl_attr_name`,
`crl_column_name`,
`perm_code`,
`order_num`,
`gmt_create`,
`gmt_modified`
)
values
(
#{name},
#{tableName},
#{moduleName},
#{crlAttrName},
#{crlColumnName},
#{permCode},
#{orderNum},
#{gmtCreate},
#{gmtModified}
)
</insert>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<insert id="saveSelective" parameterType="com.java2nb.system.domain.DataPermDO" useGeneratedKeys="true" keyProperty="id">
insert into sys_data_perm
(
<if test="id != null"> `id`, </if>
<if test="name != null"> `name`, </if>
<if test="tableName != null"> `table_name`, </if>
<if test="moduleName != null"> `module_name`, </if>
<if test="crlAttrName != null"> `crl_attr_name`, </if>
<if test="crlColumnName != null"> `crl_column_name`, </if>
<if test="permCode != null"> `perm_code`, </if>
<if test="orderNum != null"> `order_num`, </if>
<if test="gmtCreate != null"> `gmt_create`, </if>
<if test="gmtModified != null"> `gmt_modified` </if>
)
values
(
<if test="id != null"> #{id}, </if>
<if test="name != null"> #{name}, </if>
<if test="tableName != null"> #{tableName}, </if>
<if test="moduleName != null"> #{moduleName}, </if>
<if test="crlAttrName != null"> #{crlAttrName}, </if>
<if test="crlColumnName != null"> #{crlColumnName}, </if>
<if test="permCode != null"> #{permCode}, </if>
<if test="orderNum != null"> #{orderNum}, </if>
<if test="gmtCreate != null"> #{gmtCreate}, </if>
<if test="gmtModified != null"> #{gmtModified} </if>
)
</insert>
<update id="update" parameterType="com.java2nb.system.domain.DataPermDO">
update sys_data_perm
<set>
<if test="name != null">`name` = #{name}, </if>
<if test="tableName != null">`table_name` = #{tableName}, </if>
<if test="moduleName != null">`module_name` = #{moduleName}, </if>
<if test="crlAttrName != null">`crl_attr_name` = #{crlAttrName}, </if>
<if test="crlColumnName != null">`crl_column_name` = #{crlColumnName}, </if>
<if test="permCode != null">`perm_code` = #{permCode}, </if>
<if test="orderNum != null">`order_num` = #{orderNum}, </if>
<if test="gmtCreate != null">`gmt_create` = #{gmtCreate}, </if>
<if test="gmtModified != null">`gmt_modified` = #{gmtModified}</if>
</set>
where id = #{id}
</update>
<delete id="remove">
delete from sys_data_perm where id = #{value}
</delete>
<delete id="batchRemove">
delete from sys_data_perm where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="count" resultType="int">
select count(*) from sys_data_perm
<where>
<if test="id != null and id != ''">and id = #{id}</if>
<if test="name != null and name != ''">and name = #{name}</if>
<if test="tableName != null and tableName != ''">and table_name = #{tableName}</if>
<if test="moduleName != null and moduleName != ''">and module_name = #{moduleName}</if>
<if test="crlAttrName != null and crlAttrName != ''">and crl_attr_name = #{crlAttrName}</if>
<if test="crlColumnName != null and crlColumnName != ''">and crl_column_name = #{crlColumnName}</if>
<if test="permCode != null and permCode != ''">and perm_code = #{permCode}</if>
<if test="orderNum != null and orderNum != ''">and order_num = #{orderNum}</if>
<if test="gmtCreate != null and gmtCreate != ''">and gmt_create = #{gmtCreate}</if>
<if test="gmtModified != null and gmtModified != ''">and gmt_modified = #{gmtModified}</if>
</where>
</select>
<insert id="save" parameterType="com.java2nb.system.domain.DataPermDO" useGeneratedKeys="true" keyProperty="id">
insert into sys_data_perm
(`name`,
`table_name`,
`module_name`,
`crl_attr_name`,
`crl_column_name`,
`perm_code`,
`order_num`,
`gmt_create`,
`gmt_modified`)
values (#{name},
#{tableName},
#{moduleName},
#{crlAttrName},
#{crlColumnName},
#{permCode},
#{orderNum},
#{gmtCreate},
#{gmtModified})
</insert>
<insert id="saveSelective" parameterType="com.java2nb.system.domain.DataPermDO" useGeneratedKeys="true"
keyProperty="id">
insert into sys_data_perm
(
<if test="id != null">`id`,</if>
<if test="name != null">`name`,</if>
<if test="tableName != null">`table_name`,</if>
<if test="moduleName != null">`module_name`,</if>
<if test="crlAttrName != null">`crl_attr_name`,</if>
<if test="crlColumnName != null">`crl_column_name`,</if>
<if test="permCode != null">`perm_code`,</if>
<if test="orderNum != null">`order_num`,</if>
<if test="gmtCreate != null">`gmt_create`,</if>
<if test="gmtModified != null">`gmt_modified`</if>
)
values
(
<if test="id != null">#{id},</if>
<if test="name != null">#{name},</if>
<if test="tableName != null">#{tableName},</if>
<if test="moduleName != null">#{moduleName},</if>
<if test="crlAttrName != null">#{crlAttrName},</if>
<if test="crlColumnName != null">#{crlColumnName},</if>
<if test="permCode != null">#{permCode},</if>
<if test="orderNum != null">#{orderNum},</if>
<if test="gmtCreate != null">#{gmtCreate},</if>
<if test="gmtModified != null">#{gmtModified}</if>
)
</insert>
<update id="update" parameterType="com.java2nb.system.domain.DataPermDO">
update sys_data_perm
<set>
<if test="name != null">`name` = #{name},</if>
<if test="tableName != null">`table_name` = #{tableName},</if>
<if test="moduleName != null">`module_name` = #{moduleName},</if>
<if test="crlAttrName != null">`crl_attr_name` = #{crlAttrName},</if>
<if test="crlColumnName != null">`crl_column_name` = #{crlColumnName},</if>
<if test="permCode != null">`perm_code` = #{permCode},</if>
<if test="orderNum != null">`order_num` = #{orderNum},</if>
<if test="gmtCreate != null">`gmt_create` = #{gmtCreate},</if>
<if test="gmtModified != null">`gmt_modified` = #{gmtModified}</if>
</set>
where id = #{id}
</update>
<delete id="remove">
delete
from sys_data_perm
where id = #{value}
</delete>
<delete id="batchRemove">
delete from sys_data_perm where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="listModuleName" resultType="com.java2nb.system.domain.DataPermDO">
select distinct `module_name` from sys_data_perm ;
<select id="listModuleName" resultType="com.java2nb.system.domain.DataPermDO">
select `module_name`
from sys_data_perm;
</select>
</select>
<select id="selectDataPermsByUserId" parameterType="long" resultType="com.java2nb.system.domain.DataPermDO">
<select id="selectDataPermsByUserId" parameterType="long" resultType="com.java2nb.system.domain.DataPermDO">
select distinct t1.`table_name`,t1.`module_name`,t1.`crl_attr_name`,t1.`crl_column_name`,t1.`perm_code`
from sys_data_perm t1
inner join sys_role_data_perm t2 on t1.id = t2.perm_id
inner join sys_user_role t3 on t2.role_id = t3.role_id
and t3.user_id = #{userId}
</select>
select t1.`table_name`, t1.`module_name`, t1.`crl_attr_name`, t1.`crl_column_name`, t1.`perm_code`
from sys_data_perm t1
inner join sys_role_data_perm t2 on t1.id = t2.perm_id
inner join sys_user_role t3 on t2.role_id = t3.role_id
and t3.user_id = #{userId}
</select>
</mapper>

View File

@ -3,96 +3,102 @@
<mapper namespace="com.java2nb.system.dao.DeptDao">
<select id="get" resultType="com.java2nb.system.domain.DeptDO">
select
`dept_id`,`parent_id`,`name`,`order_num`,`del_flag` from sys_dept
where dept_id = #{value}
</select>
<select id="get" resultType="com.java2nb.system.domain.DeptDO">
select `dept_id`,
`parent_id`,
`name`,
`order_num`,
`del_flag`
from sys_dept
where dept_id = #{value}
</select>
<select id="list" resultType="com.java2nb.system.domain.DeptDO">
select `dept_id`,`parent_id`,`name`,`order_num`,`del_flag` from
sys_dept
<where>
<if test="deptId != null and deptId != ''"> and dept_id = #{deptId} </if>
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId} </if>
<if test="name != null and name != ''"> and name = #{name} </if>
<if test="orderNum != null and orderNum != ''"> and order_num = #{orderNum} </if>
<if test="delFlag != null and delFlag != ''"> and del_flag = #{delFlag} </if>
</where>
<choose>
<when test="sort != null and sort.trim() != ''">
order by ${sort} ${order}
</when>
<otherwise>
order by dept_id desc
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="list" resultType="com.java2nb.system.domain.DeptDO">
select `dept_id`,`parent_id`,`name`,`order_num`,`del_flag` from
sys_dept
<where>
<if test="deptId != null and deptId != ''">and dept_id = #{deptId}</if>
<if test="parentId != null and parentId != ''">and parent_id = #{parentId}</if>
<if test="name != null and name != ''">and name = #{name}</if>
<if test="orderNum != null and orderNum != ''">and order_num = #{orderNum}</if>
<if test="delFlag != null and delFlag != ''">and del_flag = #{delFlag}</if>
</where>
<choose>
<when test="sort != null and sort.trim() != ''">
order by ${sort} ${order}
</when>
<otherwise>
order by dept_id desc
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="count" resultType="int">
select count(*) from sys_dept
<where>
<if test="deptId != null and deptId != ''"> and dept_id = #{deptId} </if>
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId} </if>
<if test="name != null and name != ''"> and name = #{name} </if>
<if test="orderNum != null and orderNum != ''"> and order_num = #{orderNum} </if>
<if test="delFlag != null and delFlag != ''"> and del_flag = #{delFlag} </if>
</where>
</select>
<select id="count" resultType="int">
select count(*) from sys_dept
<where>
<if test="deptId != null and deptId != ''">and dept_id = #{deptId}</if>
<if test="parentId != null and parentId != ''">and parent_id = #{parentId}</if>
<if test="name != null and name != ''">and name = #{name}</if>
<if test="orderNum != null and orderNum != ''">and order_num = #{orderNum}</if>
<if test="delFlag != null and delFlag != ''">and del_flag = #{delFlag}</if>
</where>
</select>
<insert id="save" parameterType="com.java2nb.system.domain.DeptDO"
useGeneratedKeys="true" keyProperty="deptId">
insert into sys_dept
(
`parent_id`,
`name`,
`order_num`,
`del_flag`
)
values
(
#{parentId},
#{name},
#{orderNum},
#{delFlag}
)
</insert>
<insert id="save" parameterType="com.java2nb.system.domain.DeptDO"
useGeneratedKeys="true" keyProperty="deptId">
insert into sys_dept
(`parent_id`,
`name`,
`order_num`,
`del_flag`)
values (#{parentId},
#{name},
#{orderNum},
#{delFlag})
</insert>
<update id="update" parameterType="com.java2nb.system.domain.DeptDO">
update sys_dept
<set>
<if test="parentId != null">`parent_id` = #{parentId}, </if>
<if test="name != null">`name` = #{name}, </if>
<if test="orderNum != null">`order_num` = #{orderNum}, </if>
<if test="delFlag != null">`del_flag` = #{delFlag}</if>
</set>
where dept_id = #{deptId}
</update>
<update id="update" parameterType="com.java2nb.system.domain.DeptDO">
update sys_dept
<set>
<if test="parentId != null">`parent_id` = #{parentId},</if>
<if test="name != null">`name` = #{name},</if>
<if test="orderNum != null">`order_num` = #{orderNum},</if>
<if test="delFlag != null">`del_flag` = #{delFlag}</if>
</set>
where dept_id = #{deptId}
</update>
<delete id="remove">
delete from sys_dept where dept_id = #{value}
</delete>
<delete id="remove">
delete
from sys_dept
where dept_id = #{value}
</delete>
<delete id="batchRemove">
delete from sys_dept where dept_id in
<foreach item="deptId" collection="array" open="(" separator=","
close=")">
#{deptId}
</foreach>
</delete>
<select id="listParentDept" resultType="long">
select DISTINCT parent_id from sys_dept
</select>
<delete id="batchRemove">
delete from sys_dept where dept_id in
<foreach item="deptId" collection="array" open="(" separator=","
close=")">
#{deptId}
</foreach>
</delete>
<select id="listParentDept" resultType="long">
select parent_id
from sys_dept
</select>
<select id="getDeptUserNumber" resultType="int">
select count(*) from sys_user where dept_id = #{value}
</select>
select count(*)
from sys_user
where dept_id = #{value}
</select>
<select id="getDeptIdsByParentId" parameterType="long" resultType="String">
select group_concat(dept_id) from sys_dept where parent_id = #{deptId}
</select>
<select id="getDeptIdsByParentId" parameterType="long" resultType="String">
select group_concat(dept_id)
from sys_dept
where parent_id = #{deptId}
</select>
</mapper>

View File

@ -3,134 +3,148 @@
<mapper namespace="com.java2nb.system.dao.MenuDao">
<select id="get" resultType="com.java2nb.system.domain.MenuDO">
select
`menu_id`,`parent_id`,`name`,`url`,`perms`,`type`,`icon`,`order_num`,`gmt_create`,`gmt_modified`
from sys_menu where menu_id = #{value}
</select>
<select id="get" resultType="com.java2nb.system.domain.MenuDO">
select `menu_id`,
`parent_id`,
`name`,
`url`,
`perms`,
`type`,
`icon`,
`order_num`,
`gmt_create`,
`gmt_modified`
from sys_menu
where menu_id = #{value}
</select>
<select id="list" resultType="com.java2nb.system.domain.MenuDO">
select
`menu_id`,`parent_id`,`name`,`url`,`perms`,`type`,`icon`,`order_num`,`gmt_create`,`gmt_modified`
from sys_menu
<where>
<if test="menuId != null and menuId != ''"> and menu_id = #{menuId} </if>
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId} </if>
<if test="name != null and name != ''"> and name = #{name} </if>
<if test="url != null and url != ''"> and url = #{url} </if>
<if test="perms != null and perms != ''"> and perms = #{perms} </if>
<if test="type != null and type != ''"> and type = #{type} </if>
<if test="icon != null and icon != ''"> and icon = #{icon} </if>
<if test="orderNum != null and orderNum != ''"> and order_num = #{orderNum} </if>
<if test="gmtCreate != null and gmtCreate != ''"> and gmt_create = #{gmtCreate} </if>
<if test="gmtModified != null and gmtModified != ''"> and gmt_modified = #{gmtModified} </if>
</where>
<choose>
<when test="sort != null and sort.trim() != ''">
order by ${sort} ${order}
</when>
<otherwise>
order by menu_id desc
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="list" resultType="com.java2nb.system.domain.MenuDO">
select
`menu_id`,`parent_id`,`name`,`url`,`perms`,`type`,`icon`,`order_num`,`gmt_create`,`gmt_modified`
from sys_menu
<where>
<if test="menuId != null and menuId != ''">and menu_id = #{menuId}</if>
<if test="parentId != null and parentId != ''">and parent_id = #{parentId}</if>
<if test="name != null and name != ''">and name = #{name}</if>
<if test="url != null and url != ''">and url = #{url}</if>
<if test="perms != null and perms != ''">and perms = #{perms}</if>
<if test="type != null and type != ''">and type = #{type}</if>
<if test="icon != null and icon != ''">and icon = #{icon}</if>
<if test="orderNum != null and orderNum != ''">and order_num = #{orderNum}</if>
<if test="gmtCreate != null and gmtCreate != ''">and gmt_create = #{gmtCreate}</if>
<if test="gmtModified != null and gmtModified != ''">and gmt_modified = #{gmtModified}</if>
</where>
<choose>
<when test="sort != null and sort.trim() != ''">
order by ${sort} ${order}
</when>
<otherwise>
order by menu_id desc
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="count" resultType="int">
select count(*) from sys_menu
<where>
<if test="menuId != null and menuId != ''"> and menu_id = #{menuId} </if>
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId} </if>
<if test="name != null and name != ''"> and name = #{name} </if>
<if test="url != null and url != ''"> and url = #{url} </if>
<if test="perms != null and perms != ''"> and perms = #{perms} </if>
<if test="type != null and type != ''"> and type = #{type} </if>
<if test="icon != null and icon != ''"> and icon = #{icon} </if>
<if test="orderNum != null and orderNum != ''"> and order_num = #{orderNum} </if>
<if test="gmtCreate != null and gmtCreate != ''"> and gmt_create = #{gmtCreate} </if>
<if test="gmtModified != null and gmtModified != ''"> and gmt_modified = #{gmtModified} </if>
</where>
</select>
<select id="count" resultType="int">
select count(*) from sys_menu
<where>
<if test="menuId != null and menuId != ''">and menu_id = #{menuId}</if>
<if test="parentId != null and parentId != ''">and parent_id = #{parentId}</if>
<if test="name != null and name != ''">and name = #{name}</if>
<if test="url != null and url != ''">and url = #{url}</if>
<if test="perms != null and perms != ''">and perms = #{perms}</if>
<if test="type != null and type != ''">and type = #{type}</if>
<if test="icon != null and icon != ''">and icon = #{icon}</if>
<if test="orderNum != null and orderNum != ''">and order_num = #{orderNum}</if>
<if test="gmtCreate != null and gmtCreate != ''">and gmt_create = #{gmtCreate}</if>
<if test="gmtModified != null and gmtModified != ''">and gmt_modified = #{gmtModified}</if>
</where>
</select>
<insert id="save" parameterType="com.java2nb.system.domain.MenuDO"
useGeneratedKeys="true" keyProperty="menuId">
insert into sys_menu
(
`parent_id`,
`name`,
`url`,
`perms`,
`type`,
`icon`,
`order_num`,
`gmt_create`,
`gmt_modified`
)
values
(
#{parentId},
#{name},
#{url},
#{perms},
#{type},
#{icon},
#{orderNum},
#{gmtCreate},
#{gmtModified}
)
</insert>
<insert id="save" parameterType="com.java2nb.system.domain.MenuDO"
useGeneratedKeys="true" keyProperty="menuId">
insert into sys_menu
(`parent_id`,
`name`,
`url`,
`perms`,
`type`,
`icon`,
`order_num`,
`gmt_create`,
`gmt_modified`)
values (#{parentId},
#{name},
#{url},
#{perms},
#{type},
#{icon},
#{orderNum},
#{gmtCreate},
#{gmtModified})
</insert>
<update id="update" parameterType="com.java2nb.system.domain.MenuDO">
update sys_menu
<set>
<if test="parentId != null">`parent_id` = #{parentId}, </if>
<if test="name != null">`name` = #{name}, </if>
<if test="url != null">`url` = #{url}, </if>
<if test="perms != null">`perms` = #{perms}, </if>
<if test="type != null">`type` = #{type}, </if>
<if test="icon != null">`icon` = #{icon}, </if>
<if test="orderNum != null">`order_num` = #{orderNum}, </if>
<if test="gmtCreate != null">`gmt_create` = #{gmtCreate}, </if>
<if test="gmtModified != null">`gmt_modified` = #{gmtModified}</if>
</set>
where menu_id = #{menuId}
</update>
<update id="update" parameterType="com.java2nb.system.domain.MenuDO">
update sys_menu
<set>
<if test="parentId != null">`parent_id` = #{parentId},</if>
<if test="name != null">`name` = #{name},</if>
<if test="url != null">`url` = #{url},</if>
<if test="perms != null">`perms` = #{perms},</if>
<if test="type != null">`type` = #{type},</if>
<if test="icon != null">`icon` = #{icon},</if>
<if test="orderNum != null">`order_num` = #{orderNum},</if>
<if test="gmtCreate != null">`gmt_create` = #{gmtCreate},</if>
<if test="gmtModified != null">`gmt_modified` = #{gmtModified}</if>
</set>
where menu_id = #{menuId}
</update>
<delete id="remove">
delete from sys_menu where menu_id = #{value}
</delete>
<delete id="remove">
delete
from sys_menu
where menu_id = #{value}
</delete>
<delete id="batchRemove">
delete from sys_menu where menu_id in
<foreach item="menuId" collection="array" open="(" separator=","
close=")">
#{menuId}
</foreach>
</delete>
<delete id="batchRemove">
delete from sys_menu where menu_id in
<foreach item="menuId" collection="array" open="(" separator=","
close=")">
#{menuId}
</foreach>
</delete>
<select id="listMenuByUserId" resultType="com.java2nb.system.domain.MenuDO">
select distinct
m.menu_id , parent_id, name, url,
perms,`type`,icon,order_num,gmt_create, gmt_modified
from sys_menu m
left
join sys_role_menu rm on m.menu_id = rm.menu_id left join
sys_user_role ur
on rm.role_id =ur.role_id where ur.user_id = #{id}
and
m.type in(0,1)
order by
m.order_num
</select>
<select id="listMenuByUserId" resultType="com.java2nb.system.domain.MenuDO">
select m.menu_id,
parent_id,
name,
url,
perms,
`type`,
icon,
order_num,
gmt_create,
gmt_modified
from sys_menu m
left join sys_role_menu rm on m.menu_id = rm.menu_id
left join
sys_user_role ur
on rm.role_id = ur.role_id
where ur.user_id = #{id}
and m.type in (0, 1)
order by m.order_num
</select>
<select id="listUserPerms" resultType="string">
select distinct m.perms
from sys_menu m left join
sys_role_menu rm on m.menu_id = rm.menu_id
left join sys_user_role ur
on rm.role_id = ur.role_id where ur.user_id
= #{id}
</select>
<select id="listUserPerms" resultType="string">
select m.perms
from sys_menu m
left join
sys_role_menu rm on m.menu_id = rm.menu_id
left join sys_user_role ur
on rm.role_id = ur.role_id
where ur.user_id
= #{id}
</select>
</mapper>

View File

@ -4,8 +4,28 @@
<mapper namespace="com.java2nb.system.dao.SysUserDao">
<select id="get" resultType="com.java2nb.system.domain.UserDO">
select `user_id`,`username`,`name`,`password`,`dept_id`,`email`,`mobile`,`status`,`user_id_create`,`gmt_create`,`gmt_modified`,`sex`,`birth`,`pic_id`,`live_address`,`hobby`,`province`,`city`,`district` from sys_user where user_id = #{value}
</select>
select `user_id`,
`username`,
`name`,
`password`,
`dept_id`,
`email`,
`mobile`,
`status`,
`user_id_create`,
`gmt_create`,
`gmt_modified`,
`sex`,
`birth`,
`pic_id`,
`live_address`,
`hobby`,
`province`,
`city`,
`district`
from sys_user
where user_id = #{value}
</select>
<select id="list" resultType="com.java2nb.system.domain.UserDO">
select
@ -51,7 +71,8 @@
</select>
<select id="listByPerm" resultType="com.java2nb.system.domain.UserDO">
select `user_id`,`username`,`name`,`password`,`dept_id`,`email`,`mobile`,`status`,`user_id_create`,`gmt_create`,`gmt_modified`,`sex`,`birth`,`pic_id`,`live_address`,`hobby`,`province`,`city`,`district`
select
`user_id`,`username`,`name`,`password`,`dept_id`,`email`,`mobile`,`status`,`user_id_create`,`gmt_create`,`gmt_modified`,`sex`,`birth`,`pic_id`,`live_address`,`hobby`,`province`,`city`,`district`
from (
select
`user_id`,`username`,`name`,`password`,`dept_id`,`email`,`mobile`,`status`,`user_id_create`,`gmt_create`,`gmt_modified`,`sex`,`birth`,`pic_id`,`live_address`,`hobby`,`province`,`city`,`district`
@ -97,7 +118,8 @@
</select>
<select id="countByPerm" resultType="int">
select count(*) from (
select `user_id`,`username`,`name`,`password`,`dept_id`,`email`,`mobile`,`status`,`user_id_create`,`gmt_create`,`gmt_modified`,`sex`,`birth`,`pic_id`,`live_address`,`hobby`,`province`,`city`,`district`
select
`user_id`,`username`,`name`,`password`,`dept_id`,`email`,`mobile`,`status`,`user_id_create`,`gmt_create`,`gmt_modified`,`sex`,`birth`,`pic_id`,`live_address`,`hobby`,`province`,`city`,`district`
from sys_user
<where>
<if test="userId != null and userId != ''">and user_id = #{userId}</if>
@ -149,49 +171,44 @@
</select>
<insert id="save" parameterType="com.java2nb.system.domain.UserDO" useGeneratedKeys="true" keyProperty="userId">
insert into sys_user
(
`username`,
`name`,
`password`,
`dept_id`,
`email`,
`mobile`,
`status`,
`user_id_create`,
`gmt_create`,
`gmt_modified`,
`sex`,
`birth`,
`pic_id`,
`live_address`,
`hobby`,
`province`,
`city`,
`district`
)
values
(
#{username},
#{name},
#{password},
#{deptId},
#{email},
#{mobile},
#{status},
#{userIdCreate},
#{gmtCreate},
#{gmtModified},
#{sex},
#{birth},
#{picId},
#{liveAddress},
#{hobby},
#{province},
#{city},
#{district}
)
</insert>
insert into sys_user
(`username`,
`name`,
`password`,
`dept_id`,
`email`,
`mobile`,
`status`,
`user_id_create`,
`gmt_create`,
`gmt_modified`,
`sex`,
`birth`,
`pic_id`,
`live_address`,
`hobby`,
`province`,
`city`,
`district`)
values (#{username},
#{name},
#{password},
#{deptId},
#{email},
#{mobile},
#{status},
#{userIdCreate},
#{gmtCreate},
#{gmtModified},
#{sex},
#{birth},
#{picId},
#{liveAddress},
#{hobby},
#{province},
#{city},
#{district})
</insert>
<update id="update" parameterType="com.java2nb.system.domain.UserDO">
update sys_user
@ -219,8 +236,10 @@
</update>
<delete id="remove">
delete from sys_user where user_id = #{value}
</delete>
delete
from sys_user
where user_id = #{value}
</delete>
<delete id="batchRemove">
delete from sys_user where user_id in
@ -230,7 +249,8 @@
</delete>
<select id="listAllDept" resultType="long">
select DISTINCT dept_id from sys_user
</select>
select dept_id
from sys_user
</select>
</mapper>

View File

@ -134,6 +134,18 @@ function load() {
{
field: 'createTime',
title: '入库时间'
},
{
title: '操作',
field: 'id',
align: 'center',
formatter: function (value, row, index) {
var r = '<a class="btn btn-warning btn-sm ' + s_remove_h + '" href="#" title="删除" mce_href="#" onclick="remove(\''
+ row.id
+ '\')"><i class="fa fa-remove"></i></a> ';
return r;
}
}
]

View File

@ -0,0 +1,107 @@
var E = window.wangEditor;
$("[id^='contentEditor']").each(function (index, ele) {
var relName = $(ele).attr("id").substring(13);
var editor = new E('#contentEditor' + relName);
// 自定义菜单配置
editor.customConfig.menus = [
'head', // 标题
'bold', // 粗体
'fontSize', // 字号
'fontName', // 字体
'italic', // 斜体
'underline', // 下划线
'strikeThrough', // 删除线
'foreColor', // 文字颜色
//'backColor', // 背景颜色
//'link', // 插入链接
'list', // 列表
'justify', // 对齐方式
'quote', // 引用
'emoticon', // 表情
'image', // 插入图片
//'table', // 表格
//'video', // 插入视频
//'code', // 插入代码
'undo', // 撤销
'redo' // 重复
];
editor.customConfig.onchange = function (html) {
// html 即变化之后的内容
$("#" + relName).val(html);
}
editor.customConfig.uploadImgShowBase64 = true;
editor.create();
})
$("[id^='picImage']").each(function (index, ele) {
var relName = $(ele).attr("id").substring(8);
layui.use('upload', function () {
var upload = layui.upload;
//执行实例
var uploadInst = upload.render({
elem: '#picImage' + relName, //绑定元素
url: '/common/sysFile/upload', //上传接口
size: 1000,
accept: 'file',
done: function (r) {
$("#picImage" + relName).attr("src", r.fileName);
$("#" + relName).val(r.fileName);
},
error: function (r) {
layer.msg(r.msg);
}
});
});
});
$().ready(function () {
validateRule();
});
$.validator.setDefaults({
submitHandler: function () {
save();
}
});
function save() {
$.ajax({
cache: true,
type: "POST",
url: "/novel/bookContent/save",
data: $('#signupForm').serialize(),// 你的formid
async: false,
error: function (request) {
parent.layer.alert("Connection error");
},
success: function (data) {
if (data.code == 0) {
parent.layer.msg("操作成功");
parent.reLoad();
var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
parent.layer.close(index);
} else {
parent.layer.alert(data.msg)
}
}
});
}
function validateRule() {
var icon = "<i class='fa fa-times-circle'></i> ";
$("#signupForm").validate({
ignore: "",
rules: {
},
messages: {
}
})
}

View File

@ -0,0 +1,189 @@
var prefix = "/novel/bookContent"
$(function () {
load();
});
function load() {
$('#exampleTable')
.bootstrapTable(
{
method: 'get', // 服务器数据的请求方式 get or post
url: prefix + "/list", // 服务器数据的加载地址
// showRefresh : true,
// showToggle : true,
// showColumns : true,
iconSize: 'outline',
toolbar: '#exampleToolbar',
striped: true, // 设置为true会有隔行变色效果
dataType: "json", // 服务器返回的数据类型
pagination: true, // 设置为true会在底部显示分页条
// queryParamsType : "limit",
// //设置为limit则会发送符合RESTFull格式的参数
singleSelect: false, // 设置为true将禁止多选
// contentType : "application/x-www-form-urlencoded",
// //发送到服务器的数据编码类型
pageSize: 10, // 如果设置了分页,每页数据条数
pageNumber: 1, // 如果设置了分布,首页页码
//search : true, // 是否显示搜索框
showColumns: false, // 是否显示内容下拉框(选择显示的列)
sidePagination: "server", // 设置在哪里进行分页,可选值为"client" 或者 "server"
queryParams: function (params) {
//说明传入后台的参数包括offset开始索引limit步长sort排序列orderdesc或者,以及所有列的键值对
var queryParams = getFormJson("searchForm");
queryParams.limit = params.limit;
queryParams.offset = params.offset;
return queryParams;
},
// //请求服务器数据时,你可以通过重写参数的方式添加一些额外的参数,例如 toolbar 中的参数 如果
// queryParamsType = 'limit' ,返回参数必须包含
// limit, offset, search, sort, order 否则, 需要包含:
// pageSize, pageNumber, searchText, sortName,
// sortOrder.
// 返回false将会终止请求
responseHandler: function (rs) {
if (rs.code == 0) {
return rs.data;
} else {
parent.layer.alert(rs.msg)
return {total: 0, rows: []};
}
},
columns: [
{
checkbox: true
},
{
title: '序号',
formatter: function () {
return arguments[2] + 1;
}
},
{
field: 'id',
title: '主键'
},
{
field: 'indexId',
title: '目录ID'
},
{
field: 'content',
title: '小说章节内容'
},
{
title: '操作',
field: 'id',
align: 'center',
formatter: function (value, row, index) {
var d = '<a class="btn btn-primary btn-sm ' + s_detail_h + '" href="#" mce_href="#" title="详情" onclick="detail(\''
+ row.id
+ '\')"><i class="fa fa-file"></i></a> ';
var e = '<a class="btn btn-primary btn-sm ' + s_edit_h + '" href="#" mce_href="#" title="编辑" onclick="edit(\''
+ row.id
+ '\')"><i class="fa fa-edit"></i></a> ';
var r = '<a class="btn btn-warning btn-sm ' + s_remove_h + '" href="#" title="删除" mce_href="#" onclick="remove(\''
+ row.id
+ '\')"><i class="fa fa-remove"></i></a> ';
return d + e + r;
}
}]
});
}
function reLoad() {
$('#exampleTable').bootstrapTable('refresh');
}
function add() {
layer.open({
type: 2,
title: '增加',
maxmin: true,
shadeClose: false, // 点击遮罩关闭层
area: ['800px', '520px'],
content: prefix + '/add' // iframe的url
});
}
function detail(id) {
layer.open({
type: 2,
title: '详情',
maxmin: true,
shadeClose: false, // 点击遮罩关闭层
area: ['800px', '520px'],
content: prefix + '/detail/' + id // iframe的url
});
}
function edit(id) {
layer.open({
type: 2,
title: '编辑',
maxmin: true,
shadeClose: false, // 点击遮罩关闭层
area: ['800px', '520px'],
content: prefix + '/edit/' + id // iframe的url
});
}
function remove(id) {
layer.confirm('确定要删除选中的记录?', {
btn: ['确定', '取消']
}, function () {
$.ajax({
url: prefix + "/remove",
type: "post",
data: {
'id': id
},
success: function (r) {
if (r.code == 0) {
layer.msg(r.msg);
reLoad();
} else {
layer.msg(r.msg);
}
}
});
})
}
function resetPwd(id) {
}
function batchRemove() {
var rows = $('#exampleTable').bootstrapTable('getSelections'); // 返回所有选择的行,当没有选择的记录时,返回一个空数组
if (rows.length == 0) {
layer.msg("请选择要删除的数据");
return;
}
layer.confirm("确认要删除选中的'" + rows.length + "'条数据吗?", {
btn: ['确定', '取消']
// 按钮
}, function () {
var ids = new Array();
// 遍历所有选择的行数据取每条数据对应的ID
$.each(rows, function (i, row) {
ids[i] = row['id'];
});
$.ajax({
type: 'POST',
data: {
"ids": ids
},
url: prefix + '/batchRemove',
success: function (r) {
if (r.code == 0) {
layer.msg(r.msg);
reLoad();
} else {
layer.msg(r.msg);
}
}
});
}, function () {
});
}

View File

@ -0,0 +1,103 @@
var E = window.wangEditor;
$("[id^='contentEditor']").each(function (index, ele) {
var relName = $(ele).attr("id").substring(13);
var editor = new E('#contentEditor' + relName);
// 自定义菜单配置
editor.customConfig.menus = [
'head', // 标题
'bold', // 粗体
'fontSize', // 字号
'fontName', // 字体
'italic', // 斜体
'underline', // 下划线
'strikeThrough', // 删除线
'foreColor', // 文字颜色
//'backColor', // 背景颜色
//'link', // 插入链接
'list', // 列表
'justify', // 对齐方式
'quote', // 引用
'emoticon', // 表情
'image', // 插入图片
//'table', // 表格
//'video', // 插入视频
//'code', // 插入代码
'undo', // 撤销
'redo' // 重复
];
editor.customConfig.onchange = function (html) {
// html 即变化之后的内容
$("#" + relName).val(html);
}
editor.customConfig.uploadImgShowBase64 = true;
editor.create();
editor.txt.html($("#" + relName).val());
})
$("[id^='picImage']").each(function (index, ele) {
var relName = $(ele).attr("id").substring(8);
layui.use('upload', function () {
var upload = layui.upload;
//执行实例
var uploadInst = upload.render({
elem: '#picImage' + relName, //绑定元素
url: '/common/sysFile/upload', //上传接口
size: 1000,
accept: 'file',
done: function (r) {
$("#picImage" + relName).attr("src", r.fileName);
$("#" + relName).val(r.fileName);
},
error: function (r) {
layer.msg(r.msg);
}
});
});
});
$().ready(function () {
validateRule();
});
$.validator.setDefaults({
submitHandler: function () {
update();
}
});
function update() {
$.ajax({
cache: true,
type: "POST",
url: "/novel/bookContent/update",
data: $('#signupForm').serialize(),// 你的formid
async: false,
error: function (request) {
parent.layer.alert("Connection error");
},
success: function (data) {
if (data.code == 0) {
parent.layer.msg("操作成功");
parent.reLoad();
var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
parent.layer.close(index);
} else {
parent.layer.alert(data.msg)
}
}
});
}
function validateRule() {
var icon = "<i class='fa fa-times-circle'></i> ";
$("#signupForm").validate({
ignore: "",
rules: {
},
messages: {
}
})
}

View File

@ -0,0 +1,107 @@
var E = window.wangEditor;
$("[id^='contentEditor']").each(function (index, ele) {
var relName = $(ele).attr("id").substring(13);
var editor = new E('#contentEditor' + relName);
// 自定义菜单配置
editor.customConfig.menus = [
'head', // 标题
'bold', // 粗体
'fontSize', // 字号
'fontName', // 字体
'italic', // 斜体
'underline', // 下划线
'strikeThrough', // 删除线
'foreColor', // 文字颜色
//'backColor', // 背景颜色
//'link', // 插入链接
'list', // 列表
'justify', // 对齐方式
'quote', // 引用
'emoticon', // 表情
'image', // 插入图片
//'table', // 表格
//'video', // 插入视频
//'code', // 插入代码
'undo', // 撤销
'redo' // 重复
];
editor.customConfig.onchange = function (html) {
// html 即变化之后的内容
$("#" + relName).val(html);
}
editor.customConfig.uploadImgShowBase64 = true;
editor.create();
})
$("[id^='picImage']").each(function (index, ele) {
var relName = $(ele).attr("id").substring(8);
layui.use('upload', function () {
var upload = layui.upload;
//执行实例
var uploadInst = upload.render({
elem: '#picImage' + relName, //绑定元素
url: '/common/sysFile/upload', //上传接口
size: 1000,
accept: 'file',
done: function (r) {
$("#picImage" + relName).attr("src", r.fileName);
$("#" + relName).val(r.fileName);
},
error: function (r) {
layer.msg(r.msg);
}
});
});
});
$().ready(function () {
validateRule();
});
$.validator.setDefaults({
submitHandler: function () {
save();
}
});
function save() {
$.ajax({
cache: true,
type: "POST",
url: "/novel/bookIndex/save",
data: $('#signupForm').serialize(),// 你的formid
async: false,
error: function (request) {
parent.layer.alert("Connection error");
},
success: function (data) {
if (data.code == 0) {
parent.layer.msg("操作成功");
parent.reLoad();
var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
parent.layer.close(index);
} else {
parent.layer.alert(data.msg)
}
}
});
}
function validateRule() {
var icon = "<i class='fa fa-times-circle'></i> ";
$("#signupForm").validate({
ignore: "",
rules: {
},
messages: {
}
})
}

View File

@ -0,0 +1,231 @@
var prefix = "/novel/bookIndex"
$(function () {
load();
});
function load() {
$('#exampleTable')
.bootstrapTable(
{
method: 'get', // 服务器数据的请求方式 get or post
url: prefix + "/list", // 服务器数据的加载地址
// showRefresh : true,
// showToggle : true,
// showColumns : true,
iconSize: 'outline',
toolbar: '#exampleToolbar',
striped: true, // 设置为true会有隔行变色效果
dataType: "json", // 服务器返回的数据类型
pagination: true, // 设置为true会在底部显示分页条
// queryParamsType : "limit",
// //设置为limit则会发送符合RESTFull格式的参数
singleSelect: false, // 设置为true将禁止多选
// contentType : "application/x-www-form-urlencoded",
// //发送到服务器的数据编码类型
pageSize: 10, // 如果设置了分页,每页数据条数
pageNumber: 1, // 如果设置了分布,首页页码
//search : true, // 是否显示搜索框
showColumns: false, // 是否显示内容下拉框(选择显示的列)
sidePagination: "server", // 设置在哪里进行分页,可选值为"client" 或者 "server"
queryParams: function (params) {
//说明传入后台的参数包括offset开始索引limit步长sort排序列orderdesc或者,以及所有列的键值对
var queryParams = getFormJson("searchForm");
queryParams.limit = params.limit;
queryParams.offset = params.offset;
return queryParams;
},
// //请求服务器数据时,你可以通过重写参数的方式添加一些额外的参数,例如 toolbar 中的参数 如果
// queryParamsType = 'limit' ,返回参数必须包含
// limit, offset, search, sort, order 否则, 需要包含:
// pageSize, pageNumber, searchText, sortName,
// sortOrder.
// 返回false将会终止请求
responseHandler: function (rs) {
if (rs.code == 0) {
return rs.data;
} else {
parent.layer.alert(rs.msg)
return {total: 0, rows: []};
}
},
columns: [
{
checkbox: true
},
{
title: '序号',
formatter: function () {
return arguments[2] + 1;
}
},
{
field: 'id',
title: '主键'
},
{
field: 'bookId',
title: '小说ID'
},
{
field: 'indexNum',
title: '目录号'
},
{
field: 'indexName',
title: '目录名'
},
{
field: 'wordCount',
title: '字数'
},
{
field: 'isVip',
title: '是否收费1收费0免费'
},
{
field: 'bookPrice',
title: '章节费用屋币'
},
{
field: 'storageType',
title: '存储方式'
},
{
field: 'createTime',
title: ''
},
{
field: 'updateTime',
title: ''
},
{
title: '操作',
field: 'id',
align: 'center',
formatter: function (value, row, index) {
var d = '<a class="btn btn-primary btn-sm ' + s_detail_h + '" href="#" mce_href="#" title="详情" onclick="detail(\''
+ row.id
+ '\')"><i class="fa fa-file"></i></a> ';
var e = '<a class="btn btn-primary btn-sm ' + s_edit_h + '" href="#" mce_href="#" title="编辑" onclick="edit(\''
+ row.id
+ '\')"><i class="fa fa-edit"></i></a> ';
var r = '<a class="btn btn-warning btn-sm ' + s_remove_h + '" href="#" title="删除" mce_href="#" onclick="remove(\''
+ row.id
+ '\')"><i class="fa fa-remove"></i></a> ';
return d + e + r;
}
}]
});
}
function reLoad() {
$('#exampleTable').bootstrapTable('refresh');
}
function add() {
layer.open({
type: 2,
title: '增加',
maxmin: true,
shadeClose: false, // 点击遮罩关闭层
area: ['800px', '520px'],
content: prefix + '/add' // iframe的url
});
}
function detail(id) {
layer.open({
type: 2,
title: '详情',
maxmin: true,
shadeClose: false, // 点击遮罩关闭层
area: ['800px', '520px'],
content: prefix + '/detail/' + id // iframe的url
});
}
function edit(id) {
layer.open({
type: 2,
title: '编辑',
maxmin: true,
shadeClose: false, // 点击遮罩关闭层
area: ['800px', '520px'],
content: prefix + '/edit/' + id // iframe的url
});
}
function remove(id) {
layer.confirm('确定要删除选中的记录?', {
btn: ['确定', '取消']
}, function () {
$.ajax({
url: prefix + "/remove",
type: "post",
data: {
'id': id
},
success: function (r) {
if (r.code == 0) {
layer.msg(r.msg);
reLoad();
} else {
layer.msg(r.msg);
}
}
});
})
}
function resetPwd(id) {
}
function batchRemove() {
var rows = $('#exampleTable').bootstrapTable('getSelections'); // 返回所有选择的行,当没有选择的记录时,返回一个空数组
if (rows.length == 0) {
layer.msg("请选择要删除的数据");
return;
}
layer.confirm("确认要删除选中的'" + rows.length + "'条数据吗?", {
btn: ['确定', '取消']
// 按钮
}, function () {
var ids = new Array();
// 遍历所有选择的行数据取每条数据对应的ID
$.each(rows, function (i, row) {
ids[i] = row['id'];
});
$.ajax({
type: 'POST',
data: {
"ids": ids
},
url: prefix + '/batchRemove',
success: function (r) {
if (r.code == 0) {
layer.msg(r.msg);
reLoad();
} else {
layer.msg(r.msg);
}
}
});
}, function () {
});
}

View File

@ -0,0 +1,103 @@
var E = window.wangEditor;
$("[id^='contentEditor']").each(function (index, ele) {
var relName = $(ele).attr("id").substring(13);
var editor = new E('#contentEditor' + relName);
// 自定义菜单配置
editor.customConfig.menus = [
'head', // 标题
'bold', // 粗体
'fontSize', // 字号
'fontName', // 字体
'italic', // 斜体
'underline', // 下划线
'strikeThrough', // 删除线
'foreColor', // 文字颜色
//'backColor', // 背景颜色
//'link', // 插入链接
'list', // 列表
'justify', // 对齐方式
'quote', // 引用
'emoticon', // 表情
'image', // 插入图片
//'table', // 表格
//'video', // 插入视频
//'code', // 插入代码
'undo', // 撤销
'redo' // 重复
];
editor.customConfig.onchange = function (html) {
// html 即变化之后的内容
$("#" + relName).val(html);
}
editor.customConfig.uploadImgShowBase64 = true;
editor.create();
editor.txt.html($("#" + relName).val());
})
$("[id^='picImage']").each(function (index, ele) {
var relName = $(ele).attr("id").substring(8);
layui.use('upload', function () {
var upload = layui.upload;
//执行实例
var uploadInst = upload.render({
elem: '#picImage' + relName, //绑定元素
url: '/common/sysFile/upload', //上传接口
size: 1000,
accept: 'file',
done: function (r) {
$("#picImage" + relName).attr("src", r.fileName);
$("#" + relName).val(r.fileName);
},
error: function (r) {
layer.msg(r.msg);
}
});
});
});
$().ready(function () {
validateRule();
});
$.validator.setDefaults({
submitHandler: function () {
update();
}
});
function update() {
$.ajax({
cache: true,
type: "POST",
url: "/novel/bookIndex/update",
data: $('#signupForm').serialize(),// 你的formid
async: false,
error: function (request) {
parent.layer.alert("Connection error");
},
success: function (data) {
if (data.code == 0) {
parent.layer.msg("操作成功");
parent.reLoad();
var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
parent.layer.close(index);
} else {
parent.layer.alert(data.msg)
}
}
});
}
function validateRule() {
var icon = "<i class='fa fa-times-circle'></i> ";
$("#signupForm").validate({
ignore: "",
rules: {
},
messages: {
}
})
}

View File

@ -0,0 +1,18 @@
-- 菜单SQL
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
VALUES ('1', '小说内容表', 'novel/bookContent', 'novel:bookContent:bookContent', '1', 'fa', '6');
-- 按钮父菜单ID
set @parentId = @@identity;
-- 菜单对应按钮SQL
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
SELECT @parentId, '查看', null, 'novel:bookContent:detail', '2', null, '6';
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
SELECT @parentId, '新增', null, 'novel:bookContent:add', '2', null, '6';
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
SELECT @parentId, '修改', null, 'novel:bookContent:edit', '2', null, '6';
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
SELECT @parentId, '删除', null, 'novel:bookContent:remove', '2', null, '6';
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
SELECT @parentId, '批量删除', null, 'novel:bookContent:batchRemove', '2', null, '6';

View File

@ -0,0 +1,18 @@
-- 菜单SQL
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
VALUES ('1', '小说目录表', 'novel/bookIndex', 'novel:bookIndex:bookIndex', '1', 'fa', '6');
-- 按钮父菜单ID
set @parentId = @@identity;
-- 菜单对应按钮SQL
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
SELECT @parentId, '查看', null, 'novel:bookIndex:detail', '2', null, '6';
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
SELECT @parentId, '新增', null, 'novel:bookIndex:add', '2', null, '6';
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
SELECT @parentId, '修改', null, 'novel:bookIndex:edit', '2', null, '6';
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
SELECT @parentId, '删除', null, 'novel:bookIndex:remove', '2', null, '6';
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
SELECT @parentId, '批量删除', null, 'novel:bookIndex:batchRemove', '2', null, '6';

View File

@ -0,0 +1,46 @@
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
<div class="wrapper wrapper-content ">
<div class="row">
<div class="col-sm-12">
<div class="ibox float-e-margins">
<div class="ibox-content">
<form class="form-horizontal m-t" id="signupForm">
<div class="form-group">
<label class="col-sm-3 control-label">目录ID</label>
<div class="col-sm-8">
<input id="indexId" name="indexId"
class="form-control"
type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">小说章节内容:</label>
<div class="col-sm-8">
<input id="content" name="content"
class="form-control"
type="text">
</div>
</div>
<div class="form-group">
<div class="col-sm-8 col-sm-offset-3">
<button type="submit" class="btn btn-primary">提交</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript" src="/wangEditor/release/wangEditor.js"></script>
<script type="text/javascript" src="/js/appjs/novel/bookContent/add.js">
</script>
</body>
</html>

View File

@ -0,0 +1,66 @@
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
<div class="wrapper wrapper-content ">
<div class="col-sm-12">
<div class="ibox">
<div class="ibox-body">
<div class="fixed-table-toolbar">
<div class="columns pull-left">
<button shiro:hasPermission="novel:bookContent:add" type="button"
class="btn btn-primary" onclick="add()">
<i class="fa fa-plus" aria-hidden="true"></i>添加
</button>
<button shiro:hasPermission="novel:bookContent:batchRemove" type="button"
class="btn btn-danger"
onclick="batchRemove()">
<i class="fa fa-trash" aria-hidden="true"></i>删除
</button>
</div>
<div class="columns pull-right">
<button class="btn btn-success" onclick="reLoad()">查询</button>
</div>
<form id="searchForm">
<div class="columns pull-right col-md-2">
<input id="id" name="id" type="text" class="form-control"
placeholder="主键">
</div>
</form>
</div>
<table id="exampleTable" data-mobile-responsive="true">
</table>
</div>
</div>
</div>
</div>
<!--shiro控制bootstraptable行内按钮看见性 -->
<div>
<script type="text/javascript">
var s_detail_h = 'hidden';
var s_edit_h = 'hidden';
var s_remove_h = 'hidden';
</script>
</div>
<div shiro:hasPermission="test:order:detail">
<script type="text/javascript">
s_detail_h = '';
</script>
</div>
<div shiro:hasPermission="novel:bookContent:edit">
<script type="text/javascript">
s_edit_h = '';
</script>
</div>
<div shiro:hasPermission="novel:bookContent:remove">
<script type="text/javascript">
var s_remove_h = '';
</script>
</div>
<div th:include="include :: footer"></div>
<script type="text/javascript" src="/js/appjs/novel/bookContent/bookContent.js"></script>
</body>
</html>

View File

@ -0,0 +1,42 @@
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
<div class="wrapper wrapper-content ">
<div class="row">
<div class="col-sm-12">
<div class="ibox float-e-margins">
<div class="ibox-content">
<form class="form-horizontal m-t" id="signupForm">
<input id="id" name="id" th:value="${bookContent.id}"
type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">目录ID</label>
<div style="padding-top:8px" class="col-sm-8"
th:text="${bookContent.indexId}">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">小说章节内容:</label>
<div style="padding-top:8px" class="col-sm-8"
th:text="${bookContent.content}">
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<div th:include="include::footer"></div>
</body>
</html>

View File

@ -0,0 +1,48 @@
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
<div class="wrapper wrapper-content ">
<div class="row">
<div class="col-sm-12">
<div class="ibox float-e-margins">
<div class="ibox-content">
<form class="form-horizontal m-t" id="signupForm">
<input id="id" name="id" th:value="${bookContent.id}"
type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">目录ID</label>
<div class="col-sm-8">
<input id="indexId" name="indexId"
th:value="${bookContent.indexId}"
class="form-control"
type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">小说章节内容:</label>
<div class="col-sm-8">
<input id="content" name="content"
th:value="${bookContent.content}"
class="form-control"
type="text">
</div>
</div>
<div class="form-group">
<div class="col-sm-8 col-sm-offset-3">
<button type="submit" class="btn btn-primary">提交</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript" src="/wangEditor/release/wangEditor.js"></script>
<script type="text/javascript" src="/js/appjs/novel/bookContent/edit.js">
</script>
</body>
</html>

View File

@ -0,0 +1,113 @@
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
<div class="wrapper wrapper-content ">
<div class="row">
<div class="col-sm-12">
<div class="ibox float-e-margins">
<div class="ibox-content">
<form class="form-horizontal m-t" id="signupForm">
<div class="form-group">
<label class="col-sm-3 control-label">小说ID</label>
<div class="col-sm-8">
<input id="bookId" name="bookId"
class="form-control"
type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">目录号:</label>
<div class="col-sm-8">
<input id="indexNum" name="indexNum"
class="form-control"
type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">目录名:</label>
<div class="col-sm-8">
<input id="indexName" name="indexName"
class="form-control"
type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">字数:</label>
<div class="col-sm-8">
<input id="wordCount" name="wordCount"
class="form-control"
type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">是否收费1收费0免费</label>
<div class="col-sm-8">
<input id="isVip" name="isVip"
class="form-control"
type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">章节费用(屋币):</label>
<div class="col-sm-8">
<input id="bookPrice" name="bookPrice"
class="form-control"
type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">存储方式:</label>
<div class="col-sm-8">
<input id="storageType" name="storageType"
class="form-control"
type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"></label>
<div class="col-sm-8">
<input type="text" class="laydate-icon layer-date form-control"
id="createTime"
name="createTime"
onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
style="background-color: #fff;" readonly="readonly"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"></label>
<div class="col-sm-8">
<input type="text" class="laydate-icon layer-date form-control"
id="updateTime"
name="updateTime"
onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
style="background-color: #fff;" readonly="readonly"/>
</div>
</div>
<div class="form-group">
<div class="col-sm-8 col-sm-offset-3">
<button type="submit" class="btn btn-primary">提交</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript" src="/wangEditor/release/wangEditor.js"></script>
<script type="text/javascript" src="/js/appjs/novel/bookIndex/add.js">
</script>
</body>
</html>

View File

@ -0,0 +1,66 @@
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
<div class="wrapper wrapper-content ">
<div class="col-sm-12">
<div class="ibox">
<div class="ibox-body">
<div class="fixed-table-toolbar">
<div class="columns pull-left">
<button shiro:hasPermission="novel:bookIndex:add" type="button"
class="btn btn-primary" onclick="add()">
<i class="fa fa-plus" aria-hidden="true"></i>添加
</button>
<button shiro:hasPermission="novel:bookIndex:batchRemove" type="button"
class="btn btn-danger"
onclick="batchRemove()">
<i class="fa fa-trash" aria-hidden="true"></i>删除
</button>
</div>
<div class="columns pull-right">
<button class="btn btn-success" onclick="reLoad()">查询</button>
</div>
<form id="searchForm">
<div class="columns pull-right col-md-2">
<input id="id" name="id" type="text" class="form-control"
placeholder="主键">
</div>
</form>
</div>
<table id="exampleTable" data-mobile-responsive="true">
</table>
</div>
</div>
</div>
</div>
<!--shiro控制bootstraptable行内按钮看见性 -->
<div>
<script type="text/javascript">
var s_detail_h = 'hidden';
var s_edit_h = 'hidden';
var s_remove_h = 'hidden';
</script>
</div>
<div shiro:hasPermission="test:order:detail">
<script type="text/javascript">
s_detail_h = '';
</script>
</div>
<div shiro:hasPermission="novel:bookIndex:edit">
<script type="text/javascript">
s_edit_h = '';
</script>
</div>
<div shiro:hasPermission="novel:bookIndex:remove">
<script type="text/javascript">
var s_remove_h = '';
</script>
</div>
<div th:include="include :: footer"></div>
<script type="text/javascript" src="/js/appjs/novel/bookIndex/bookIndex.js"></script>
</body>
</html>

View File

@ -0,0 +1,110 @@
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
<div class="wrapper wrapper-content ">
<div class="row">
<div class="col-sm-12">
<div class="ibox float-e-margins">
<div class="ibox-content">
<form class="form-horizontal m-t" id="signupForm">
<input id="id" name="id" th:value="${bookIndex.id}"
type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">小说ID</label>
<div style="padding-top:8px" class="col-sm-8"
th:text="${bookIndex.bookId}">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">目录号:</label>
<div style="padding-top:8px" class="col-sm-8"
th:text="${bookIndex.indexNum}">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">目录名:</label>
<div style="padding-top:8px" class="col-sm-8"
th:text="${bookIndex.indexName}">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">字数:</label>
<div style="padding-top:8px" class="col-sm-8"
th:text="${bookIndex.wordCount}">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">是否收费1收费0免费</label>
<div style="padding-top:8px" class="col-sm-8"
th:text="${bookIndex.isVip}">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">章节费用(屋币):</label>
<div style="padding-top:8px" class="col-sm-8"
th:text="${bookIndex.bookPrice}">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">存储方式:</label>
<div style="padding-top:8px" class="col-sm-8"
th:text="${bookIndex.storageType}">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"></label>
<div style="padding-top:8px" class="col-sm-8"
th:text="${bookIndex.createTime}==null?null:${#dates.format(bookIndex.createTime,'yyyy-MM-dd HH:mm:ss')}">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"></label>
<div style="padding-top:8px" class="col-sm-8"
th:text="${bookIndex.updateTime}==null?null:${#dates.format(bookIndex.updateTime,'yyyy-MM-dd HH:mm:ss')}">
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<div th:include="include::footer"></div>
</body>
</html>

View File

@ -0,0 +1,115 @@
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
<div class="wrapper wrapper-content ">
<div class="row">
<div class="col-sm-12">
<div class="ibox float-e-margins">
<div class="ibox-content">
<form class="form-horizontal m-t" id="signupForm">
<input id="id" name="id" th:value="${bookIndex.id}"
type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">小说ID</label>
<div class="col-sm-8">
<input id="bookId" name="bookId"
th:value="${bookIndex.bookId}"
class="form-control"
type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">目录号:</label>
<div class="col-sm-8">
<input id="indexNum" name="indexNum"
th:value="${bookIndex.indexNum}"
class="form-control"
type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">目录名:</label>
<div class="col-sm-8">
<input id="indexName" name="indexName"
th:value="${bookIndex.indexName}"
class="form-control"
type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">字数:</label>
<div class="col-sm-8">
<input id="wordCount" name="wordCount"
th:value="${bookIndex.wordCount}"
class="form-control"
type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">是否收费1收费0免费</label>
<div class="col-sm-8">
<input id="isVip" name="isVip"
th:value="${bookIndex.isVip}"
class="form-control"
type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">章节费用(屋币):</label>
<div class="col-sm-8">
<input id="bookPrice" name="bookPrice"
th:value="${bookIndex.bookPrice}"
class="form-control"
type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">存储方式:</label>
<div class="col-sm-8">
<input id="storageType" name="storageType"
th:value="${bookIndex.storageType}"
class="form-control"
type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"></label>
<div class="col-sm-8">
<input type="text" class="laydate-icon layer-date form-control"
id="createTime"
name="createTime"
th:value="${bookIndex.createTime}==null?null:${#dates.format(bookIndex.createTime,'yyyy-MM-dd HH:mm:ss')}"
onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
style="background-color: #fff;" readonly="readonly"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"></label>
<div class="col-sm-8">
<input type="text" class="laydate-icon layer-date form-control"
id="updateTime"
name="updateTime"
th:value="${bookIndex.updateTime}==null?null:${#dates.format(bookIndex.updateTime,'yyyy-MM-dd HH:mm:ss')}"
onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
style="background-color: #fff;" readonly="readonly"/>
</div>
</div>
<div class="form-group">
<div class="col-sm-8 col-sm-offset-3">
<button type="submit" class="btn btn-primary">提交</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript" src="/wangEditor/release/wangEditor.js"></script>
<script type="text/javascript" src="/js/appjs/novel/bookIndex/edit.js">
</script>
</body>
</html>