修改用户管理--增加租户显示和搜索
This commit is contained in:
parent
1d2df8d0f7
commit
b4c58047eb
@ -50,6 +50,11 @@ public class SysUser extends BaseEntity
|
||||
*/
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 租户名称
|
||||
*/
|
||||
private String tenantName;
|
||||
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
@ -410,6 +415,10 @@ public class SysUser extends BaseEntity
|
||||
this.menuIds = menuIds;
|
||||
}
|
||||
|
||||
public String getTenantName() {
|
||||
return tenantName+":"+getTenantId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
@ -437,6 +446,7 @@ public class SysUser extends BaseEntity
|
||||
.append("remark", getRemark())
|
||||
.append("dept", getDept())
|
||||
.append("tenantId", getTenantId())
|
||||
.append("tenantName", getTenantName())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@ -20,6 +20,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -238,6 +239,7 @@ public class SysUserServiceImpl implements ISysUserService
|
||||
public int insertUser(SysUser user)
|
||||
{
|
||||
// 新增用户信息
|
||||
user.setCreateTime(new Date());
|
||||
int rows = userMapper.insertUser(user);
|
||||
// 新增用户岗位关联
|
||||
sysUserPostRoleService.insertUserPost(user);
|
||||
|
||||
@ -28,6 +28,7 @@
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="remark" property="remark"/>
|
||||
<result column="tenant_id" property="tenantId"/>
|
||||
<result column="tenant_name" property="tenantName"/>
|
||||
<result column="operator_id" property="operatorId"/>
|
||||
<association column="dept_id" property="dept" javaType="com.xhpc.system.api.domain.SysDept" resultMap="deptResult"/>
|
||||
<collection property="roles" javaType="java.util.List" resultMap="RoleResult"/>
|
||||
@ -93,9 +94,11 @@
|
||||
<select id="selectUserList" parameterType="com.xhpc.system.api.domain.SysUser" resultMap="SysUserResult">
|
||||
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.password, u.sex,
|
||||
u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader,
|
||||
u.tenant_id from
|
||||
u.tenant_id,ten.tenant_name tenant_name
|
||||
from
|
||||
sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left JOIN xhpc_tenant ten on ten.tenant_id = u.tenant_id
|
||||
where u.del_flag = '0'
|
||||
<if test="userName != null and userName != ''">
|
||||
AND u.user_name like concat('%', #{userName}, '%')
|
||||
@ -103,6 +106,9 @@
|
||||
<if test="status != null and status != ''">
|
||||
AND u.status = #{status}
|
||||
</if>
|
||||
<if test="tenantId != null and tenantId != ''">
|
||||
AND u.tenant_id = #{tenantId}
|
||||
</if>
|
||||
<if test="phonenumber != null and phonenumber != ''">
|
||||
AND u.phonenumber like concat('%', #{phonenumber}, '%')
|
||||
</if>
|
||||
@ -237,6 +243,7 @@
|
||||
<if test="loginDate != null">login_date = #{loginDate},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="tenantId != null and ''!=tenantId">tenant_id = #{tenantId},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where user_id = #{userId}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user