增加序列号

This commit is contained in:
jinqiming 2020-11-27 18:06:49 +08:00
parent fc9ea59be4
commit 76113333fa
3 changed files with 27 additions and 3 deletions

View File

@ -50,10 +50,14 @@
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:role:export"> <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:role:export">
<i class="fa fa-download"></i> 导出 <i class="fa fa-download"></i> 导出
</a> </a>
<a class="btn btn-info" id="expandAllBtn">
<i class="fa fa-exchange"></i> 展开/折叠
</a>
</div> </div>
<div class="col-sm-12 select-table table-striped"> <div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table> <table id="bootstrap-table"></table>
<table id="bootstrap-tree-table"></table>
</div> </div>
</div> </div>
</div> </div>
@ -66,6 +70,9 @@
$(function() { $(function() {
var options = { var options = {
code: "roleId",
parentCode: "parentId",
uniqueId: "roleId",
url: prefix + "/list", url: prefix + "/list",
createUrl: prefix + "/add", createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}", updateUrl: prefix + "/edit/{id}",
@ -123,7 +130,7 @@
} }
}] }]
}; };
$.table.init(options); $.treeTable.init(options);
}); });
/* 角色管理-分配数据权限 */ /* 角色管理-分配数据权限 */

View File

@ -19,6 +19,8 @@ public class SysRole extends BaseEntity
/** 角色ID */ /** 角色ID */
@Excel(name = "角色序号", cellType = ColumnType.NUMERIC) @Excel(name = "角色序号", cellType = ColumnType.NUMERIC)
private Long roleId; private Long roleId;
@Excel(name = "父角色", cellType = ColumnType.NUMERIC)
private Long parentId;
/** 角色名称 */ /** 角色名称 */
@Excel(name = "角色名称") @Excel(name = "角色名称")
@ -177,6 +179,14 @@ public class SysRole extends BaseEntity
this.deptIds = deptIds; this.deptIds = deptIds;
} }
public Long getParentId() {
return parentId;
}
public void setParentId(Long parentId) {
this.parentId = parentId;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

View File

@ -17,11 +17,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="remark" column="remark" /> <result property="remark" column="remark" />
<result property="parentId" column="parent_id" />
</resultMap> </resultMap>
<sql id="selectRoleContactVo"> <sql id="selectRoleContactVo">
select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope,
r.status, r.del_flag, r.create_time, r.remark r.status, r.del_flag, r.create_time, r.remark,r.parent_id
from sys_role r from sys_role r
left join sys_user_role ur on ur.role_id = r.role_id left join sys_user_role ur on ur.role_id = r.role_id
left join sys_user u on u.user_id = ur.user_id left join sys_user u on u.user_id = ur.user_id
@ -29,7 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql> </sql>
<sql id="selectRoleVo"> <sql id="selectRoleVo">
select r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status, r.del_flag, r.create_time, r.remark select r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status, r.del_flag, r.create_time, r.remark,r.parent_id
from sys_role r from sys_role r
</sql> </sql>
@ -42,6 +43,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null and status != ''"> <if test="status != null and status != ''">
AND r.status = #{status} AND r.status = #{status}
</if> </if>
<if test="parentId != null and parentId != 0">
AND r.parent_id = #{parentId}
</if>
<if test="roleKey != null and roleKey != ''"> <if test="roleKey != null and roleKey != ''">
AND r.role_key like concat('%', #{roleKey}, '%') AND r.role_key like concat('%', #{roleKey}, '%')
</if> </if>
@ -99,6 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null and status != ''">status = #{status},</if> <if test="status != null and status != ''">status = #{status},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
update_time = sysdate() update_time = sysdate()
</set> </set>
where role_id = #{roleId} where role_id = #{roleId}
@ -107,6 +112,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId"> <insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId">
insert into sys_role( insert into sys_role(
<if test="roleId != null and roleId != 0">role_id,</if> <if test="roleId != null and roleId != 0">role_id,</if>
<if test="parentId != null and parentId != 0">parent_id,</if>
<if test="roleName != null and roleName != ''">role_name,</if> <if test="roleName != null and roleName != ''">role_name,</if>
<if test="roleKey != null and roleKey != ''">role_key,</if> <if test="roleKey != null and roleKey != ''">role_key,</if>
<if test="roleSort != null and roleSort != ''">role_sort,</if> <if test="roleSort != null and roleSort != ''">role_sort,</if>
@ -117,6 +123,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
create_time create_time
)values( )values(
<if test="roleId != null and roleId != 0">#{roleId},</if> <if test="roleId != null and roleId != 0">#{roleId},</if>
<if test="parentId != null and parentId != 0">#{parentId},</if>
<if test="roleName != null and roleName != ''">#{roleName},</if> <if test="roleName != null and roleName != ''">#{roleName},</if>
<if test="roleKey != null and roleKey != ''">#{roleKey},</if> <if test="roleKey != null and roleKey != ''">#{roleKey},</if>
<if test="roleSort != null and roleSort != ''">#{roleSort},</if> <if test="roleSort != null and roleSort != ''">#{roleSort},</if>