给用户列表增加角色的显示

This commit is contained in:
季圣华
2020-09-06 13:10:10 +08:00
parent 957583e54e
commit 37255a260c
3 changed files with 26 additions and 5 deletions

View File

@@ -66,7 +66,7 @@
</td>
</tr>
<tr>
<td>部门</td>
<td>机构</td>
<td style="padding:5px">
<input name="orgAbr" id="orgAbr" class="easyui-textbox" readonly style="width: 120px;"/>
<a href="javascript:void(0)" class="l-btn l-btn-plain" group="" id="lookForSelectOrganization">
@@ -188,7 +188,6 @@
return str;
}
},
{title: '登录名称', field: 'loginName', width: 80, align: "center"},
{
title: '用户类型', field: 'userType', width: 80, formatter: function (value, rec, index) {
var str = '';
@@ -202,9 +201,11 @@
return str;
}
},
{title: '登录名称', field: 'loginName', width: 80, align: "center"},
{title: '用户姓名', field: 'username', width: 80, align: "center"},
{title: '角色', field: 'roleName', width: 80, align: "center"},
{title: '职位', field: 'position', width: 115, align: "center"},
{title: '部门', field: 'orgAbr', width: 115, align: "center"},
{title: '机构', field: 'orgAbr', width: 115, align: "center"},
{title: '电子邮箱', field: 'email', width: 150, align: "center"},
{title: '电话号码', field: 'phonenum', width: 150, align: "center"},
{title: '用户排序', field: 'userBlngOrgaDsplSeq', width: 80, align: "center"},
@@ -567,7 +568,7 @@
}
});
//分配部门
//分配仓库
$('#btnSetDepart').click(function () {
var currentRow = $("#tableData").datagrid("getSelected");
if (currentRow == null) {

View File

@@ -16,6 +16,8 @@ public class UserEx extends User{
//机构用户关联关系id
private Long orgaUserRelId;
private String roleName;
public String getOrgAbr() {
return orgAbr;
}
@@ -47,4 +49,12 @@ public class UserEx extends User{
public void setOrgaUserRelId(Long orgaUserRelId) {
this.orgaUserRelId = orgaUserRelId;
}
public String getRoleName() {
return roleName;
}
public void setRoleName(String roleName) {
this.roleName = roleName;
}
}

View File

@@ -6,12 +6,19 @@
<result column="org_abr" jdbcType="VARCHAR" property="orgAbr" />
<result column="user_blng_orga_dspl_seq" jdbcType="VARCHAR" property="userBlngOrgaDsplSeq" />
<result column="orgaUserRelId" jdbcType="BIGINT" property="orgaUserRelId" />
<result column="roleName" jdbcType="VARCHAR" property="roleName" />
</resultMap>
<select id="selectByConditionUser" parameterType="com.jsh.erp.datasource.entities.UserExample" resultMap="ResultMapEx">
select user.id, user.username, user.login_name, user.position, user.email, user.phonenum,
user.description, user.remark,user.isystem,org.id as orgaId,user.tenant_id,org.org_abr,rel.user_blng_orga_dspl_seq,
rel.id as orgaUserRelId
rel.id as orgaUserRelId, tb.roleName
FROM jsh_user user
left join
(
select ub.*,r.name roleName from jsh_user_business ub
inner join jsh_role r on ub.value=concat("[",r.id,"]") and ifnull(r.delete_flag,'0') !='1'
where ub.type='UserRole'
) tb on tb.key_id=user.id
left join jsh_orga_user_rel rel on user.id=rel.user_id and ifnull(rel.delete_flag,'0') !='1'
left join jsh_organization org on rel.orga_id=org.id and ifnull(org.org_stcd,'0') !='5'
where 1=1
@@ -30,10 +37,13 @@
<select id="countsByUser" resultType="java.lang.Long">
select count(user.id)
FROM jsh_user user
left join jsh_user_business ub on user.id=ub.key_id
left join jsh_role r on ub.value=concat("[",r.id,"]") and ifnull(r.delete_flag,'0') !='1'
left join jsh_orga_user_rel rel on user.id=rel.user_id and ifnull(rel.delete_flag,'0') !='1'
left join jsh_organization org on rel.orga_id=org.id and ifnull(org.org_stcd,'0') !='5'
where 1=1
and ifnull(user.status,'0') not in('1','2')
and ub.type='UserRole'
<if test="userName != null">
and user.username like '%${userName}%'
</if>