| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dg.core.ResultData; |
| | | import com.dg.core.annotation.Authorization; |
| | | import com.dg.core.annotation.CurrentUser; |
| | | import com.dg.core.db.gen.entity.RoleManagementEntity; |
| | | import com.dg.core.db.gen.entity.SysUser; |
| | | import com.dg.core.service.IRoleManagementService; |
| | | import com.dg.core.util.TableDataInfo; |
| | | import io.swagger.annotations.Api; |
| | |
| | | @ApiOperation("新增角色") |
| | | @PostMapping("/add") |
| | | @Authorization |
| | | public ResultData insertConfig(@RequestBody RoleManagementEntity entity) |
| | | public ResultData insertConfig(@RequestBody RoleManagementEntity entity, @CurrentUser SysUser sysUser) |
| | | { |
| | | // entity.setCreateUserId(sysUser.getUserId()+""); |
| | | entity.setCreateUserId(sysUser.getUserId()+""); |
| | | return toAjax(iRoleManagementService.insertConfig(entity)); |
| | | } |
| | | |
| | |
| | | @Authorization |
| | | public TableDataInfo selectConfigList(@RequestParam(value = "pageNum",required = false) Integer pageNum, |
| | | @RequestParam(value = "pageSize",required = false) Integer pageSize, |
| | | @RequestParam(value = "userName",required = false) String userName) |
| | | @RequestParam(value = "keyword",required = false) String keyword) |
| | | { |
| | | Assert.notNull(pageNum, "pageNum can not be empty"); |
| | | Assert.notNull(pageSize, "pageSize can not be empty"); |
| | | Page<SysUser> pageParam = new Page<>(pageNum,pageSize); |
| | | List<SysUser> list = IUserService.selectConfigList(pageParam,pageSize,"3",userName); |
| | | List<SysUser> list = IUserService.selectConfigList(pageParam,pageSize,"3",keyword); |
| | | |
| | | int num=IUserService.selectNum("3",userName); |
| | | int num=IUserService.selectNum("3",keyword); |
| | | return getDataTable(list,num); |
| | | } |
| | | |
| | |
| | | package com.dg.core.db.gen.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | |
| | | @ApiModelProperty("权限") |
| | | private String permission; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("创建者名称") |
| | | private String createName; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | create_time, |
| | | update_time, |
| | | create_user_id, |
| | | (select user_name from automessage_sys_user where create_user_id=automessage_sys_user.user_id) as createName, |
| | | update_user_id |
| | | FROM |
| | | automessage_role_management |
| | |
| | | <if test="userName != null and userName != ''"> |
| | | AND user_name like concat('%', #{userName}, '%') or |
| | | (department_id in (SELECT id FROM automessage_organization_chart |
| | | WHERE organization_name like concat('%', #{userName}, '%'))) |
| | | |
| | | WHERE organization_name like concat('%', #{userName}, '%'))) or |
| | | phonenumber like concat('%', #{userName}, '%') |
| | | </if> |
| | | <if test="userType != null and userType != ''"> |
| | | AND user_type=#{userType} |
| | |
| | | <if test="userName != null and userName != ''"> |
| | | AND user_name like concat('%', #{userName}, '%') or |
| | | (department_id in (SELECT id FROM automessage_organization_chart |
| | | WHERE organization_name like concat('%', #{userName}, '%'))) |
| | | |
| | | WHERE organization_name like concat('%', #{userName}, '%'))) or |
| | | phonenumber like concat('%', #{userName}, '%') |
| | | </if> |
| | | <if test="userType != null and userType != ''"> |
| | | AND user_type=#{userType} |