mirror of
https://github.com/201206030/novel-plus.git
synced 2025-07-04 00:16:39 +00:00
上传后台管理系统代码
This commit is contained in:
98
novel-admin/src/main/resources/mybatis/system/RoleMapper.xml
Normal file
98
novel-admin/src/main/resources/mybatis/system/RoleMapper.xml
Normal file
@ -0,0 +1,98 @@
|
||||
<?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.system.dao.RoleDao">
|
||||
|
||||
<select id="get" resultType="com.java2nb.system.domain.RoleDO">
|
||||
select
|
||||
`role_id`,`role_name`,`role_sign`,`remark`,`user_id_create`,`gmt_create`,`gmt_modified`
|
||||
from sys_role where role_id = #{value}
|
||||
</select>
|
||||
|
||||
<select id="list" resultType="com.java2nb.system.domain.RoleDO">
|
||||
select
|
||||
`role_id`,`role_name`,`role_sign`,`remark`,`user_id_create`,`gmt_create`,`gmt_modified`
|
||||
from sys_role
|
||||
<where>
|
||||
<if test="roleId != null and roleId != ''"> and role_id = #{roleId} </if>
|
||||
<if test="roleName != null and roleName != ''"> and role_name = #{roleName} </if>
|
||||
<if test="roleSign != null and roleSign != ''"> and role_sign = #{roleSign} </if>
|
||||
<if test="remark != null and remark != ''"> and remark = #{remark} </if>
|
||||
<if test="userIdCreate != null and userIdCreate != ''"> and user_id_create = #{userIdCreate} </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 role_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_role
|
||||
<where>
|
||||
<if test="roleId != null and roleId != ''"> and role_id = #{roleId} </if>
|
||||
<if test="roleName != null and roleName != ''"> and role_name = #{roleName} </if>
|
||||
<if test="roleSign != null and roleSign != ''"> and role_sign = #{roleSign} </if>
|
||||
<if test="remark != null and remark != ''"> and remark = #{remark} </if>
|
||||
<if test="userIdCreate != null and userIdCreate != ''"> and user_id_create = #{userIdCreate} </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.RoleDO"
|
||||
useGeneratedKeys="true" keyProperty="roleId">
|
||||
insert into sys_role
|
||||
(
|
||||
`role_name`,
|
||||
`role_sign`,
|
||||
`remark`,
|
||||
`user_id_create`,
|
||||
`gmt_create`,
|
||||
`gmt_modified`
|
||||
)
|
||||
values
|
||||
(
|
||||
#{roleName},
|
||||
#{roleSign},
|
||||
#{remark},
|
||||
#{userIdCreate},
|
||||
#{gmtCreate},
|
||||
#{gmtModified}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="update" parameterType="com.java2nb.system.domain.RoleDO">
|
||||
update sys_role
|
||||
<set>
|
||||
<if test="roleName != null">`role_name` = #{roleName}, </if>
|
||||
<if test="roleSign != null">`role_sign` = #{roleSign}, </if>
|
||||
<if test="remark != null">`remark` = #{remark}, </if>
|
||||
<if test="userIdCreate != null">`user_id_create` = #{userIdCreate}, </if>
|
||||
<if test="gmtCreate != null">`gmt_create` = #{gmtCreate}, </if>
|
||||
<if test="gmtModified != null">`gmt_modified` = #{gmtModified}</if>
|
||||
</set>
|
||||
where role_id = #{roleId}
|
||||
</update>
|
||||
|
||||
<delete id="remove">
|
||||
delete from sys_role where role_id = #{value}
|
||||
</delete>
|
||||
|
||||
<delete id="batchRemove">
|
||||
delete from sys_role where role_id in
|
||||
<foreach item="roleId" collection="array" open="(" separator=","
|
||||
close=")">
|
||||
#{roleId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
Reference in New Issue
Block a user