浏览代码

Merge branch 'huangyuan-user' of lift-manager/lift-server into develop

huangyuan 5 年之前
父节点
当前提交
c1c1a6ef80
共有 19 个文件被更改,包括 347 次插入29 次删除
  1. 4 0
      lift-common/src/main/java/cn.com.ty.lift.common/Constants/ApiConstants.java
  2. 2 0
      lift-system-service/src/main/java/cn/com/ty/lift/system/entity/Menu.java
  3. 11 3
      lift-system-service/src/main/java/cn/com/ty/lift/system/entity/Role.java
  4. 6 4
      lift-system-service/src/main/java/cn/com/ty/lift/system/entity/model/RoleRequest.java
  5. 2 2
      lift-system-service/src/main/java/cn/com/ty/lift/system/mapper/RoleMapper.java
  6. 10 1
      lift-system-service/src/main/java/cn/com/ty/lift/system/mapper/RoleMenuMapper.java
  7. 10 0
      lift-system-service/src/main/java/cn/com/ty/lift/system/mapper/UserRoleMapper.java
  8. 43 0
      lift-system-service/src/main/java/cn/com/ty/lift/system/user/controller/RoleController.java
  9. 20 1
      lift-system-service/src/main/java/cn/com/ty/lift/system/user/service/IRoleMenuService.java
  10. 30 0
      lift-system-service/src/main/java/cn/com/ty/lift/system/user/service/IRoleService.java
  11. 11 0
      lift-system-service/src/main/java/cn/com/ty/lift/system/user/service/IUserRoleService.java
  12. 43 1
      lift-system-service/src/main/java/cn/com/ty/lift/system/user/service/impl/RoleMenuService.java
  13. 69 0
      lift-system-service/src/main/java/cn/com/ty/lift/system/user/service/impl/RoleService.java
  14. 13 0
      lift-system-service/src/main/java/cn/com/ty/lift/system/user/service/impl/UserRoleService.java
  15. 31 0
      lift-system-service/src/main/java/cn/com/ty/lift/system/utils/ProjectUtils.java
  16. 14 3
      lift-system-service/src/main/resources/mapper/MenuMapper.xml
  17. 14 14
      lift-system-service/src/main/resources/mapper/RoleMapper.xml
  18. 6 0
      lift-system-service/src/main/resources/mapper/RoleMenuMapper.xml
  19. 8 0
      lift-system-service/src/main/resources/mapper/UserRoleMapper.xml

+ 4 - 0
lift-common/src/main/java/cn.com.ty.lift.common/Constants/ApiConstants.java

@@ -24,4 +24,8 @@ public class ApiConstants {
      * 当前用户
      */
     public static final String CURRENT_USER = "currentUser";
+
+    public static final int DELETE_YES = 1;//已删除
+
+    public static final int DELETE_NO = 0;//未删除
 }

+ 2 - 0
lift-system-service/src/main/java/cn/com/ty/lift/system/entity/Menu.java

@@ -16,6 +16,8 @@ public class Menu {
 
 	private String code;
 
+	private String url;
+
 	private String type;
 
 	private String description;

+ 11 - 3
lift-system-service/src/main/java/cn/com/ty/lift/system/entity/Role.java

@@ -1,5 +1,7 @@
 package cn.com.ty.lift.system.entity;
 
+import cn.com.ty.lift.system.entity.model.RoleRequest;
+import cn.com.ty.lift.system.utils.PojoUtils;
 import lombok.Data;
 
 import java.util.Date;
@@ -26,11 +28,17 @@ public class Role {
 
 	private Date deleteTime;
 
-	private Date createUserId;
+	private Long createUserId;
 
-	private Date updateUserId;
+	private Long updateUserId;
 
-	private Date deleteUserId;
+	private Long deleteUserId;
 
 	private Integer deleteFlag;
+
+	public Role(){}
+
+	public Role(RoleRequest roleRequest){
+		PojoUtils.pojoCopy(this, roleRequest);
+	}
 }

+ 6 - 4
lift-system-service/src/main/java/cn/com/ty/lift/system/entity/model/RoleRequest.java

@@ -11,7 +11,7 @@ import java.util.Date;
  */
 @Data
 public class RoleRequest {
-    private Integer id;//角色id
+    private Long id;//角色id
 
     private String name;
 
@@ -21,17 +21,19 @@ public class RoleRequest {
 
     private Long companyId;
 
+    private String menuIds;//菜单id,通过","连接的菜单id字符串
+
     private Date createTime;
 
     private Date updateTime;
 
     private Date deleteTime;
 
-    private Date createUserId;
+    private Long createUserId;
 
-    private Date updateUserId;
+    private Long updateUserId;
 
-    private Date deleteUserId;
+    private Long deleteUserId;
 
     private Integer deleteFlag;
 }

+ 2 - 2
lift-system-service/src/main/java/cn/com/ty/lift/system/mapper/RoleMapper.java

@@ -11,13 +11,13 @@ import cn.com.xwy.boot.web.dto.RestResponse;
  */
 @MyBatisMapper
 public interface RoleMapper {
-	int deleteByPrimaryKey(Integer id);
+	int deleteByPrimaryKey(Long id);
 
 	int insert(Role record);
 
 	int insertSelective(Role record);
 
-	Role selectByPrimaryKey(Integer id);
+	Role selectByPrimaryKey(Long id);
 
 	int updateByPrimaryKeySelective(Role record);
 

+ 10 - 1
lift-system-service/src/main/java/cn/com/ty/lift/system/mapper/RoleMenuMapper.java

@@ -2,13 +2,14 @@ package cn.com.ty.lift.system.mapper;
 
 import cn.com.ty.lift.system.entity.RoleMenu;
 import cn.com.xwy.boot.mybatis.MyBatisMapper;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**
  * MyBatis Mapper 接口 - 表:role_menu
  * @since 2019-12-01 15:46:21
  */
 @MyBatisMapper
-public interface RoleMenuMapper {
+public interface RoleMenuMapper extends BaseMapper<RoleMenu> {
 	int deleteByPrimaryKey(Integer id);
 
 	int insert(RoleMenu record);
@@ -20,4 +21,12 @@ public interface RoleMenuMapper {
 	int updateByPrimaryKeySelective(RoleMenu record);
 
 	int updateByPrimaryKey(RoleMenu record);
+
+	/**
+	 * @description 通过角色id删除角色菜单关联关系
+	 * @date 2019/11/27 10:03 AM
+	 * @param
+	 * @return
+	 */
+    int deleteByRoleId(Long roleId);
 }

+ 10 - 0
lift-system-service/src/main/java/cn/com/ty/lift/system/mapper/UserRoleMapper.java

@@ -3,6 +3,8 @@ package cn.com.ty.lift.system.mapper;
 import cn.com.ty.lift.system.entity.UserRole;
 import cn.com.xwy.boot.mybatis.MyBatisMapper;
 
+import java.util.List;
+
 /**
  * MyBatis Mapper 接口 - 表:user_role
  * @since 2019-12-01 15:46:21
@@ -20,4 +22,12 @@ public interface UserRoleMapper {
 	int updateByPrimaryKeySelective(UserRole record);
 
 	int updateByPrimaryKey(UserRole record);
+
+	/**
+	 * @description 通过角色获取用户角色关联信息
+	 * @date 2019/11/27 10:03 AM
+	 * @param roleId
+	 * @return
+	 */
+    List<UserRole> getByRoleId(Long roleId);
 }

+ 43 - 0
lift-system-service/src/main/java/cn/com/ty/lift/system/user/controller/RoleController.java

@@ -1,12 +1,17 @@
 package cn.com.ty.lift.system.user.controller;
 
+import cn.com.ty.lift.common.Constants.ApiConstants;
+import cn.com.ty.lift.system.entity.UserAccount;
 import cn.com.ty.lift.system.entity.model.RoleRequest;
 import cn.com.ty.lift.system.user.service.IRoleService;
 import cn.com.xwy.boot.web.dto.RestResponse;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.servlet.http.HttpServletRequest;
+
 /**
  * @author huangyuan
  * @date 2019-12-01
@@ -30,4 +35,42 @@ public class RoleController {
         return roleService.list(roleRequest);
     }
 
+    /**
+     * @description 添加角色
+     * @date 2019/11/27 10:03 AM
+     * @param request http请求对象
+     * @param roleRequest 角色请求对象
+     * @return
+     */
+    @PostMapping("/addRole")
+    public RestResponse addRole(HttpServletRequest request, RoleRequest roleRequest){
+        //设置创建者信息
+        UserAccount userAccount = (UserAccount) request.getSession().getAttribute(ApiConstants.CURRENT_USER);
+        roleRequest.setCreateUserId(userAccount.getUserId());
+        return roleService.addRole(roleRequest);
+    }
+
+    /**
+     * @description 添加角色
+     * @date 2019/11/27 10:03 AM
+     * @param request http请求对象
+     * @param roleRequest 角色请求对象
+     * @return
+     */
+    @PostMapping("/updateRole")
+    public RestResponse updateRole(HttpServletRequest request, RoleRequest roleRequest){
+        //设置更新者信息
+        UserAccount userAccount = (UserAccount) request.getSession().getAttribute(ApiConstants.CURRENT_USER);
+        roleRequest.setUpdateUserId(userAccount.getUserId());
+        return roleService.updateRole(roleRequest);
+    }
+
+    @PostMapping("/deleteRole")
+    public RestResponse deleteRole(HttpServletRequest request, RoleRequest roleRequest){
+        //设置删除者信息
+        UserAccount userAccount = (UserAccount) request.getSession().getAttribute(ApiConstants.CURRENT_USER);
+        roleRequest.setDeleteUserId(userAccount.getUserId());
+        return roleService.deleteRole(roleRequest);
+    }
+
 }

+ 20 - 1
lift-system-service/src/main/java/cn/com/ty/lift/system/user/service/IRoleMenuService.java

@@ -1,9 +1,28 @@
 package cn.com.ty.lift.system.user.service;
 
+import cn.com.ty.lift.system.entity.RoleMenu;
+import com.baomidou.mybatisplus.extension.service.IService;
+
 /**
  * @author huangyuan
  * @date 2019-12-01
  * @description 角色菜单接口
  */
-public interface IRoleMenuService {
+public interface IRoleMenuService extends IService<RoleMenu> {
+    /**
+     * @description 批量关联菜单
+     * @date 2019/11/27 10:03 AM
+     * @param roleId 角色id
+     * @param menuIds 菜单id,通过","连接
+     * @return boolean是否成功,false失败,true成功
+     */
+    boolean saveRoleMenu(Long roleId, String menuIds);
+
+    /**
+     * @description 删除角色菜单关联信息
+     * @date 2019/11/27 10:03 AM
+     * @param roleId 角色id
+     * @return boolean是否成功,false失败,true成功
+     */
+    boolean deleteRoleMenu(Long roleId);
 }

+ 30 - 0
lift-system-service/src/main/java/cn/com/ty/lift/system/user/service/IRoleService.java

@@ -9,5 +9,35 @@ import cn.com.xwy.boot.web.dto.RestResponse;
  * @description 角色接口
  */
 public interface IRoleService {
+    /**
+     * @description
+     * @date 2019/11/27 10:03 AM
+     * @param roleRequest 角色请求对象
+     * @return
+     */
     RestResponse list(RoleRequest roleRequest);
+
+    /**
+     * @description 添加角色
+     * @date 2019/11/27 10:03 AM
+     * @param roleRequest 角色请求对象
+     * @return
+     */
+    RestResponse addRole(RoleRequest roleRequest);
+
+    /**
+     * @description 更新角色
+     * @date 2019/11/27 10:03 AM
+     * @param roleRequest 角色请求对象
+     * @return
+     */
+    RestResponse updateRole(RoleRequest roleRequest);
+
+    /**
+     * @description 删除角色信息
+     * @date 2019/11/27 10:03 AM
+     * @param roleRequest 角色请求对象
+     * @return
+     */
+    RestResponse deleteRole(RoleRequest roleRequest);
 }

+ 11 - 0
lift-system-service/src/main/java/cn/com/ty/lift/system/user/service/IUserRoleService.java

@@ -1,9 +1,20 @@
 package cn.com.ty.lift.system.user.service;
 
+import cn.com.ty.lift.system.entity.UserRole;
+
+import java.util.List;
+
 /**
  * @author huangyuan
  * @date 2019-12-01
  * @description 用户角色接口
  */
 public interface IUserRoleService {
+    /**
+     * @description 通过角色信息获取用户角色关联信息
+     * @date 2019/11/27 10:03 AM
+     * @param roleId
+     * @return
+     */
+    List<UserRole> getByRoleId(Long roleId);
 }

+ 43 - 1
lift-system-service/src/main/java/cn/com/ty/lift/system/user/service/impl/RoleMenuService.java

@@ -1,6 +1,16 @@
 package cn.com.ty.lift.system.user.service.impl;
 
+import cn.com.ty.lift.system.entity.RoleMenu;
+import cn.com.ty.lift.system.mapper.RoleMenuMapper;
+import cn.com.ty.lift.system.user.service.IRoleMenuService;
+import cn.com.ty.lift.system.utils.ProjectUtils;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * @author huangyuan
@@ -8,5 +18,37 @@ import org.springframework.stereotype.Service;
  * @description 角色菜单实现类
  */
 @Service
-public class RoleMenuService {
+public class RoleMenuService extends ServiceImpl<RoleMenuMapper, RoleMenu> implements IRoleMenuService {
+
+    @Autowired
+    private RoleMenuMapper roleMenuMapper;
+
+    @Override
+    @Transactional
+    public boolean saveRoleMenu(Long roleId, String menuIds) {
+        List<RoleMenu> needSaveRoleMenuList = new ArrayList<>();
+        List<Long> menuIdList = ProjectUtils.getLongIdFromIds(menuIds);
+        if (menuIdList.size() > 0) {
+            for (Long menuId : menuIdList) {
+                RoleMenu roleMenu = new RoleMenu();
+                roleMenu.setRoleId(roleId);
+                roleMenu.setMenuId(menuId);
+                needSaveRoleMenuList.add(roleMenu);
+            }
+        }
+        if (needSaveRoleMenuList.size() > 0) {
+            return this.saveBatch(needSaveRoleMenuList);
+        }
+        return false;
+    }
+
+    @Override
+    @Transactional
+    public boolean deleteRoleMenu(Long roleId) {
+        int deleteCount = roleMenuMapper.deleteByRoleId(roleId);
+        if (deleteCount == 0) {
+            return false;
+        }
+        return true;
+    }
 }

+ 69 - 0
lift-system-service/src/main/java/cn/com/ty/lift/system/user/service/impl/RoleService.java

@@ -1,11 +1,20 @@
 package cn.com.ty.lift.system.user.service.impl;
 
+import cn.com.ty.lift.common.Constants.ApiConstants;
+import cn.com.ty.lift.system.entity.Role;
+import cn.com.ty.lift.system.entity.UserRole;
 import cn.com.ty.lift.system.entity.model.RoleRequest;
 import cn.com.ty.lift.system.mapper.RoleMapper;
+import cn.com.ty.lift.system.user.service.IRoleMenuService;
 import cn.com.ty.lift.system.user.service.IRoleService;
+import cn.com.ty.lift.system.user.service.IUserRoleService;
 import cn.com.xwy.boot.web.dto.RestResponse;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Date;
+import java.util.List;
 
 /**
  * @author huangyuan
@@ -18,8 +27,68 @@ public class RoleService implements IRoleService {
     @Autowired
     private RoleMapper roleMapper;
 
+    @Autowired
+    private IRoleMenuService roleMenuService;
+
+    @Autowired
+    private IUserRoleService userRoleService;
+
     @Override
     public RestResponse list(RoleRequest roleRequest) {
         return roleMapper.getByRoleRequest(roleRequest);
     }
+
+    @Override
+    @Transactional
+    public RestResponse addRole(RoleRequest roleRequest) {
+        Role role = new Role(roleRequest);
+        role.setCreateTime(new Date());
+        //保存角色信息
+        int insertCount = roleMapper.insert(role);
+        //保存角色菜单关联关系
+        boolean saveBatchFlag = roleMenuService.saveRoleMenu(role.getId(), roleRequest.getMenuIds());
+        if (insertCount == 0 || !saveBatchFlag) {
+            return RestResponse.error(ApiConstants.RESULT_ERROR, "保存角色信息失败");
+        }
+        return RestResponse.ok(role, ApiConstants.RESULT_SUCCESS, "保存角色信息成功");
+    }
+
+    @Override
+    @Transactional
+    public RestResponse updateRole(RoleRequest roleRequest) {
+        Role role = new Role(roleRequest);
+        role.setUpdateTime(new Date());
+        //更新角色信息
+        int updateCount = roleMapper.updateByPrimaryKey(role);
+        //删除角色原来关联的菜单信息
+        boolean deleteFlag = roleMenuService.deleteRoleMenu(role.getId());
+        //保存角色关联的新的菜单信息
+        boolean saveBatchFlag = roleMenuService.saveRoleMenu(role.getId(), roleRequest.getMenuIds());
+        if (updateCount == 0 || !deleteFlag || !saveBatchFlag) {
+            return RestResponse.error(ApiConstants.RESULT_ERROR, "更新角色信息失败");
+        }
+        return RestResponse.ok(role, ApiConstants.RESULT_SUCCESS, "更新角色信息成功");
+    }
+
+    @Override
+    @Transactional
+    public RestResponse deleteRole(RoleRequest roleRequest) {
+        Long roleId = roleRequest.getId();
+        //判断角色有没有分配给用户
+        List<UserRole> userRoleList = userRoleService.getByRoleId(roleId);
+        if(userRoleList != null && userRoleList.size() > 0){
+            return RestResponse.error(ApiConstants.RESULT_ERROR, "角色已关联用户,无法删除");
+        }
+        Role role = roleMapper.selectByPrimaryKey(roleId);
+        role.setDeleteUserId(roleRequest.getDeleteUserId());
+        role.setDeleteTime(new Date());
+        role.setDeleteFlag(ApiConstants.DELETE_YES);
+        int updateCount = roleMapper.updateByPrimaryKey(role);
+        //删除角色菜单关联信息
+        boolean deleteFlag = roleMenuService.deleteRoleMenu(roleId);
+        if (updateCount == 0 || !deleteFlag) {
+            return RestResponse.error(ApiConstants.RESULT_ERROR, "删除失败");
+        }
+        return RestResponse.ok(null, ApiConstants.RESULT_SUCCESS, "删除成功");
+    }
 }

+ 13 - 0
lift-system-service/src/main/java/cn/com/ty/lift/system/user/service/impl/UserRoleService.java

@@ -1,8 +1,13 @@
 package cn.com.ty.lift.system.user.service.impl;
 
+import cn.com.ty.lift.system.entity.UserRole;
+import cn.com.ty.lift.system.mapper.UserRoleMapper;
 import cn.com.ty.lift.system.user.service.IUserRoleService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /**
  * @author huangyuan
  * @date 2019-12-01
@@ -10,4 +15,12 @@ import org.springframework.stereotype.Service;
  */
 @Service
 public class UserRoleService implements IUserRoleService {
+
+    @Autowired
+    private UserRoleMapper userRoleMapper;
+
+    @Override
+    public List<UserRole> getByRoleId(Long roleId) {
+        return userRoleMapper.getByRoleId(roleId);
+    }
 }

+ 31 - 0
lift-system-service/src/main/java/cn/com/ty/lift/system/utils/ProjectUtils.java

@@ -0,0 +1,31 @@
+package cn.com.ty.lift.system.utils;
+
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author huangyuan
+ * @date 2019-12-02
+ * @description 项目工具类
+ */
+public class ProjectUtils {
+
+    /**
+     * @description 通过id字符串,获取long型id列表
+     * @date 2019/11/27 10:03 AM
+     * @param
+     * @return
+     */
+    public static List<Long> getLongIdFromIds(String ids){
+        List<Long> longIdList = new ArrayList<>();
+        if(StringUtils.isNotBlank(ids)){
+            String [] idArray = ids.split(",");
+            for(String id:idArray){
+                longIdList.add(Long.parseLong(id));
+            }
+        }
+        return longIdList;
+    }
+}

+ 14 - 3
lift-system-service/src/main/resources/mapper/MenuMapper.xml

@@ -6,12 +6,13 @@
 		<result column="parent_id" property="parentId" jdbcType="BIGINT" />
 		<result column="name" property="name" jdbcType="VARCHAR" />
 		<result column="code" property="code" jdbcType="VARCHAR" />
+		<result column="url" property="url" jdbcType="VARCHAR" />
 		<result column="type" property="type" jdbcType="VARCHAR" />
 		<result column="description" property="description" jdbcType="VARCHAR" />
 	</resultMap>
 
 	<sql id="Base_Column_List" >
-		id, parent_id, name, code, type, description
+		id, parent_id, name, code, url, type, description
 	</sql>
 
 	<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
@@ -28,10 +29,10 @@
 
 	<insert id="insert" parameterType="cn.com.ty.lift.system.entity.Menu" >
 		insert into menu (id, parent_id, name, 
-			code, type, description
+			code, url, type, description
 			)
 		values (#{id,jdbcType=BIGINT}, #{parentId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, 
-			#{code,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}
+			#{code,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}
 			)
 	</insert>
 
@@ -50,6 +51,9 @@
 			<if test="code != null" >
 				code,
 			</if>
+			<if test="url != null" >
+				url,
+			</if>
 			<if test="type != null" >
 				type,
 			</if>
@@ -70,6 +74,9 @@
 			<if test="code != null" >
 				#{code,jdbcType=VARCHAR},
 			</if>
+			<if test="url != null" >
+				#{url,jdbcType=VARCHAR},
+			</if>
 			<if test="type != null" >
 				#{type,jdbcType=VARCHAR},
 			</if>
@@ -91,6 +98,9 @@
 			<if test="code != null" >
 				code = #{code,jdbcType=VARCHAR},
 			</if>
+			<if test="url != null" >
+				url = #{url,jdbcType=VARCHAR},
+			</if>
 			<if test="type != null" >
 				type = #{type,jdbcType=VARCHAR},
 			</if>
@@ -106,6 +116,7 @@
 		set parent_id = #{parentId,jdbcType=BIGINT},
 			name = #{name,jdbcType=VARCHAR},
 			code = #{code,jdbcType=VARCHAR},
+			url = #{url,jdbcType=VARCHAR},
 			type = #{type,jdbcType=VARCHAR},
 			description = #{description,jdbcType=VARCHAR}
 		where id = #{id,jdbcType=BIGINT}

+ 14 - 14
lift-system-service/src/main/resources/mapper/RoleMapper.xml

@@ -10,9 +10,9 @@
 		<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
 		<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
 		<result column="delete_time" property="deleteTime" jdbcType="TIMESTAMP" />
-		<result column="create_user_id" property="createUserId" jdbcType="TIMESTAMP" />
-		<result column="update_user_id" property="updateUserId" jdbcType="TIMESTAMP" />
-		<result column="delete_user_id" property="deleteUserId" jdbcType="TIMESTAMP" />
+		<result column="create_user_id" property="createUserId" jdbcType="BIGINT" />
+		<result column="update_user_id" property="updateUserId" jdbcType="BIGINT" />
+		<result column="delete_user_id" property="deleteUserId" jdbcType="BIGINT" />
 		<result column="delete_flag" property="deleteFlag" jdbcType="INTEGER" />
 	</resultMap>
 
@@ -41,8 +41,8 @@
 			)
 		values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, 
 			#{description,jdbcType=VARCHAR}, #{companyId,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, 
-			#{updateTime,jdbcType=TIMESTAMP}, #{deleteTime,jdbcType=TIMESTAMP}, #{createUserId,jdbcType=TIMESTAMP}, 
-			#{updateUserId,jdbcType=TIMESTAMP}, #{deleteUserId,jdbcType=TIMESTAMP}, #{deleteFlag,jdbcType=INTEGER}
+			#{updateTime,jdbcType=TIMESTAMP}, #{deleteTime,jdbcType=TIMESTAMP}, #{createUserId,jdbcType=BIGINT},
+			#{updateUserId,jdbcType=BIGINT}, #{deleteUserId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=INTEGER}
 			)
 	</insert>
 
@@ -112,13 +112,13 @@
 				#{deleteTime,jdbcType=TIMESTAMP},
 			</if>
 			<if test="createUserId != null" >
-				#{createUserId,jdbcType=TIMESTAMP},
+				#{createUserId,jdbcType=BIGINT},
 			</if>
 			<if test="updateUserId != null" >
-				#{updateUserId,jdbcType=TIMESTAMP},
+				#{updateUserId,jdbcType=BIGINT},
 			</if>
 			<if test="deleteUserId != null" >
-				#{deleteUserId,jdbcType=TIMESTAMP},
+				#{deleteUserId,jdbcType=BIGINT},
 			</if>
 			<if test="deleteFlag != null" >
 				#{deleteFlag,jdbcType=INTEGER},
@@ -151,13 +151,13 @@
 				delete_time = #{deleteTime,jdbcType=TIMESTAMP},
 			</if>
 			<if test="createUserId != null" >
-				create_user_id = #{createUserId,jdbcType=TIMESTAMP},
+				create_user_id = #{createUserId,jdbcType=BIGINT},
 			</if>
 			<if test="updateUserId != null" >
-				update_user_id = #{updateUserId,jdbcType=TIMESTAMP},
+				update_user_id = #{updateUserId,jdbcType=BIGINT},
 			</if>
 			<if test="deleteUserId != null" >
-				delete_user_id = #{deleteUserId,jdbcType=TIMESTAMP},
+				delete_user_id = #{deleteUserId,jdbcType=BIGINT},
 			</if>
 			<if test="deleteFlag != null" >
 				delete_flag = #{deleteFlag,jdbcType=INTEGER},
@@ -175,9 +175,9 @@
 			create_time = #{createTime,jdbcType=TIMESTAMP},
 			update_time = #{updateTime,jdbcType=TIMESTAMP},
 			delete_time = #{deleteTime,jdbcType=TIMESTAMP},
-			create_user_id = #{createUserId,jdbcType=TIMESTAMP},
-			update_user_id = #{updateUserId,jdbcType=TIMESTAMP},
-			delete_user_id = #{deleteUserId,jdbcType=TIMESTAMP},
+			create_user_id = #{createUserId,jdbcType=BIGINT},
+			update_user_id = #{updateUserId,jdbcType=BIGINT},
+			delete_user_id = #{deleteUserId,jdbcType=BIGINT},
 			delete_flag = #{deleteFlag,jdbcType=INTEGER}
 		where id = #{id,jdbcType=BIGINT}
 	</update>

+ 6 - 0
lift-system-service/src/main/resources/mapper/RoleMenuMapper.xml

@@ -98,4 +98,10 @@
 		where id = #{id,jdbcType=BIGINT}
 	</update>
 
+	<!--通过角色id 删除角色关联的菜单信息 -->
+	<delete id="deleteByRoleId" parameterType="java.lang.Long" >
+		delete from role_menu
+		where role_id = #{roleId,jdbcType=BIGINT}
+	</delete>
+
 </mapper>

+ 8 - 0
lift-system-service/src/main/resources/mapper/UserRoleMapper.xml

@@ -76,4 +76,12 @@
 		where id = #{id,jdbcType=BIGINT}
 	</update>
 
+	<!-- 通过角色id获取角色用户关联信息 -->
+	<select id="getByRoleId" parameterType="java.lang.Long" resultType="java.util.ArrayList">
+		select
+		<include refid="Base_Column_List"></include>
+		from user_role
+		where role_id = #{roleId,jdbcType=BIGINT}
+	</select>
+
 </mapper>