feat(新增): 返回所有权限取消递归
This commit is contained in:
parent
dc772bd747
commit
34d4971595
|
@ -2,11 +2,14 @@ package cn.bunny.dao.dto.system.dept;
|
|||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
|
@ -17,9 +20,9 @@ public class DeptAddDto {
|
|||
@Schema(name = "parentId", title = "父级id")
|
||||
private String parentId;
|
||||
|
||||
@Schema(name = "managerId", title = "管理者id")
|
||||
@NotBlank(message = "管理者id不能为空")
|
||||
private String managerId;
|
||||
@Schema(name = "managerId", title = "管理者")
|
||||
@NotNull(message = "管理者不能为空")
|
||||
private List<String> manager;
|
||||
|
||||
@Schema(name = "deptName", title = "部门名称")
|
||||
@NotBlank(message = "部门名称不能为空")
|
||||
|
|
|
@ -8,6 +8,8 @@ import lombok.Builder;
|
|||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
|
@ -22,9 +24,9 @@ public class DeptUpdateDto {
|
|||
@Schema(name = "parentId", title = "父级id")
|
||||
private String parentId;
|
||||
|
||||
@Schema(name = "managerId", title = "管理者id")
|
||||
@NotBlank(message = "管理者id不能为空")
|
||||
private String managerId;
|
||||
@Schema(name = "managerId", title = "管理者")
|
||||
@NotNull(message = "管理者不能为空")
|
||||
private List<String> manager;
|
||||
|
||||
@Schema(name = "deptName", title = "部门名称")
|
||||
@NotBlank(message = "部门名称不能为空")
|
||||
|
|
|
@ -25,8 +25,8 @@ public class Dept extends BaseEntity {
|
|||
@Schema(name = "parentId", title = "父级id")
|
||||
private String parentId;
|
||||
|
||||
@Schema(name = "managerId", title = "管理者id")
|
||||
private String managerId;
|
||||
@Schema(name = "manager", title = "管理者")
|
||||
private String manager;
|
||||
|
||||
@Schema(name = "deptName", title = "部门名称")
|
||||
private String deptName;
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
package cn.bunny.dao.entity.system;
|
||||
|
||||
import cn.bunny.dao.entity.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@Accessors(chain = true)
|
||||
@TableName("sys_router_power")
|
||||
@Schema(name = "RouterPower对象", title = "路由和权限关系表", description = "路由和权限关系表")
|
||||
public class RouterPower extends BaseEntity {
|
||||
|
||||
@Schema(name = "routerId", title = "路由ID")
|
||||
private Long routerId;
|
||||
|
||||
@Schema(name = "powerId", title = "角色ID")
|
||||
private Long powerId;
|
||||
|
||||
}
|
|
@ -4,6 +4,8 @@ import cn.bunny.dao.vo.BaseVo;
|
|||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
|
@ -15,8 +17,8 @@ public class DeptVo extends BaseVo {
|
|||
@Schema(name = "parentId", title = "父级id")
|
||||
private String parentId;
|
||||
|
||||
@Schema(name = "managerId", title = "管理者id")
|
||||
private String managerId;
|
||||
@Schema(name = "manager", title = "管理者")
|
||||
private List<String> manager;
|
||||
|
||||
@Schema(name = "deptName", title = "部门名称")
|
||||
private String deptName;
|
||||
|
|
|
@ -49,6 +49,13 @@ public class DeptController {
|
|||
return Mono.just(Result.success(pageResult));
|
||||
}
|
||||
|
||||
@Operation(summary = "获取所有部门", description = "获取所有部门")
|
||||
@GetMapping("getAllDeptList")
|
||||
public Mono<Result<List<DeptVo>>> getAllDeptList() {
|
||||
List<DeptVo> voList = deptService.getAllDeptList();
|
||||
return Mono.just(Result.success(voList));
|
||||
}
|
||||
|
||||
@Operation(summary = "添加部门", description = "添加部门")
|
||||
@PostMapping("addDept")
|
||||
public Mono<Result<String>> addDept(@Valid @RequestBody DeptAddDto dto) {
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
package cn.bunny.services.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 路由和权限关系表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author Bunny
|
||||
* @since 2024-09-26
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/routerPower")
|
||||
public class RouterPowerController {
|
||||
|
||||
}
|
|
@ -42,11 +42,18 @@ public class UserController {
|
|||
return Mono.just(Result.success(pageResult));
|
||||
}
|
||||
|
||||
@Operation(summary = "添加用户信息", description = "添加用户信息")
|
||||
@PostMapping("addAdminUser")
|
||||
public Mono<Result<String>> addAdminUser(@Valid @RequestBody AdminUserAddDto dto) {
|
||||
userService.addAdminUser(dto);
|
||||
return Mono.just(Result.success(ResultCodeEnum.ADD_SUCCESS));
|
||||
@Operation(summary = "获取用户信息", description = "获取用户信息")
|
||||
@GetMapping("getUserinfoById")
|
||||
public Mono<Result<UserVo>> getUserinfoById(Long id) {
|
||||
UserVo vo = userService.getUserinfoById(id);
|
||||
return Mono.just(Result.success(vo));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询用户", description = "查询用户")
|
||||
@GetMapping("queryUser")
|
||||
public Mono<Result<List<AdminUserVo>>> queryUser(String keyword) {
|
||||
List<AdminUserVo> voList = userService.queryUser(keyword);
|
||||
return Mono.just(Result.success(voList));
|
||||
}
|
||||
|
||||
@Operation(summary = "更新用户信息", description = "更新用户信息")
|
||||
|
@ -56,28 +63,6 @@ public class UserController {
|
|||
return Mono.just(Result.success(ResultCodeEnum.UPDATE_SUCCESS));
|
||||
}
|
||||
|
||||
@Operation(summary = "删除用户信息", description = "删除用户信息")
|
||||
@DeleteMapping("deleteAdminUser")
|
||||
public Mono<Result<String>> deleteAdminUser(@RequestBody List<Long> ids) {
|
||||
userService.deleteAdminUser(ids);
|
||||
return Mono.just(Result.success(ResultCodeEnum.DELETE_SUCCESS));
|
||||
}
|
||||
|
||||
@Operation(summary = "管理员修改管理员用户密码", description = "管理员修改管理员用户密码")
|
||||
@PutMapping("updateUserPasswordByAdmin")
|
||||
public Result<String> updateUserPasswordByAdmin(@Valid @RequestBody UserUpdateWithPasswordDto dto) {
|
||||
userService.updateUserPasswordByAdmin(dto);
|
||||
return Result.success(ResultCodeEnum.UPDATE_SUCCESS);
|
||||
}
|
||||
|
||||
@Operation(summary = "管理员上传用户头像", description = "管理员上传用户头像")
|
||||
@PutMapping("uploadAvatarByAdmin")
|
||||
public Result<String> uploadAvatarByAdmin(@Valid UserUpdateWithAvatarDto dto) {
|
||||
userService.uploadAvatarByAdmin(dto);
|
||||
return Result.success(ResultCodeEnum.UPDATE_SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "登录发送邮件验证码", description = "登录发送邮件验证码")
|
||||
@PostMapping("noAuth/sendLoginEmail")
|
||||
public Result<String> sendLoginEmail(String email) {
|
||||
|
@ -92,11 +77,11 @@ public class UserController {
|
|||
return Result.success(vo);
|
||||
}
|
||||
|
||||
@Operation(summary = "强制退出", description = "强制退出")
|
||||
@PutMapping("forcedOffline")
|
||||
public Result<String> forcedOffline(@RequestBody Long id) {
|
||||
userService.forcedOffline(id);
|
||||
return Result.success();
|
||||
@Operation(summary = "添加用户信息", description = "添加用户信息")
|
||||
@PostMapping("addAdminUser")
|
||||
public Mono<Result<String>> addAdminUser(@Valid @RequestBody AdminUserAddDto dto) {
|
||||
userService.addAdminUser(dto);
|
||||
return Mono.just(Result.success(ResultCodeEnum.ADD_SUCCESS));
|
||||
}
|
||||
|
||||
@Operation(summary = "退出登录", description = "退出登录")
|
||||
|
@ -106,10 +91,32 @@ public class UserController {
|
|||
return Result.success(ResultCodeEnum.LOGOUT_SUCCESS);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取用户信息", description = "获取用户信息")
|
||||
@GetMapping("getUserinfoById")
|
||||
public Mono<Result<UserVo>> getUserinfoById(Long id) {
|
||||
UserVo vo = userService.getUserinfoById(id);
|
||||
return Mono.just(Result.success(vo));
|
||||
|
||||
@Operation(summary = "管理员修改管理员用户密码", description = "管理员修改管理员用户密码")
|
||||
@PutMapping("updateUserPasswordByAdmin")
|
||||
public Result<String> updateUserPasswordByAdmin(@Valid @RequestBody UserUpdateWithPasswordDto dto) {
|
||||
userService.updateUserPasswordByAdmin(dto);
|
||||
return Result.success(ResultCodeEnum.UPDATE_SUCCESS);
|
||||
}
|
||||
|
||||
@Operation(summary = "管理员上传用户头像", description = "管理员上传用户头像")
|
||||
@PutMapping("uploadAvatarByAdmin")
|
||||
public Result<String> uploadAvatarByAdmin(@Valid UserUpdateWithAvatarDto dto) {
|
||||
userService.uploadAvatarByAdmin(dto);
|
||||
return Result.success(ResultCodeEnum.UPDATE_SUCCESS);
|
||||
}
|
||||
|
||||
@Operation(summary = "强制退出", description = "强制退出")
|
||||
@PutMapping("forcedOffline")
|
||||
public Result<String> forcedOffline(@RequestBody Long id) {
|
||||
userService.forcedOffline(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@Operation(summary = "删除用户信息", description = "删除用户信息")
|
||||
@DeleteMapping("deleteAdminUser")
|
||||
public Mono<Result<String>> deleteAdminUser(@RequestBody List<Long> ids) {
|
||||
userService.deleteAdminUser(ids);
|
||||
return Mono.just(Result.success(ResultCodeEnum.DELETE_SUCCESS));
|
||||
}
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package cn.bunny.services.mapper;
|
||||
|
||||
import cn.bunny.dao.entity.system.RouterPower;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 路由和权限关系表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author Bunny
|
||||
* @since 2024-09-26
|
||||
*/
|
||||
@Mapper
|
||||
public interface RouterPowerMapper extends BaseMapper<RouterPower> {
|
||||
|
||||
}
|
|
@ -36,4 +36,12 @@ public interface UserMapper extends BaseMapper<AdminUser> {
|
|||
* @param ids 删除 id 列表
|
||||
*/
|
||||
void deleteBatchIdsWithPhysics(List<Long> ids);
|
||||
|
||||
/**
|
||||
* * 查询用户
|
||||
*
|
||||
* @param keyword 查询关键字
|
||||
* @return 用户信息列表
|
||||
*/
|
||||
List<AdminUser> queryUser(String keyword);
|
||||
}
|
||||
|
|
|
@ -49,4 +49,11 @@ public interface DeptService extends IService<Dept> {
|
|||
* @param ids 删除id列表
|
||||
*/
|
||||
void deleteDept(List<Long> ids);
|
||||
|
||||
/**
|
||||
* * 获取所有部门
|
||||
*
|
||||
* @return 所有部门列表
|
||||
*/
|
||||
List<DeptVo> getAllDeptList();
|
||||
}
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
package cn.bunny.services.service;
|
||||
|
||||
import cn.bunny.dao.entity.system.RouterPower;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 路由和权限关系表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author Bunny
|
||||
* @since 2024-09-26
|
||||
*/
|
||||
public interface RouterPowerService extends IService<RouterPower> {
|
||||
|
||||
}
|
|
@ -100,4 +100,12 @@ public interface UserService extends IService<AdminUser> {
|
|||
* @param id 用户id
|
||||
*/
|
||||
void forcedOffline(Long id);
|
||||
|
||||
/**
|
||||
* * 查询用户
|
||||
*
|
||||
* @param keyword 查询用户信息关键字
|
||||
* @return 用户信息列表
|
||||
*/
|
||||
List<AdminUserVo> queryUser(String keyword);
|
||||
}
|
||||
|
|
|
@ -18,7 +18,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
@ -47,10 +49,14 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements De
|
|||
// 分页查询菜单图标
|
||||
IPage<Dept> page = baseMapper.selectListByPage(pageParams, dto);
|
||||
|
||||
List<DeptVo> voList = page.getRecords().stream().map(Dept -> {
|
||||
DeptVo DeptVo = new DeptVo();
|
||||
BeanUtils.copyProperties(Dept, DeptVo);
|
||||
return DeptVo;
|
||||
List<DeptVo> voList = page.getRecords().stream().map(dept -> {
|
||||
// 将数据库中管理员取出
|
||||
List<String> mangerList = Arrays.stream(dept.getManager().split(",")).map(String::trim).toList();
|
||||
|
||||
DeptVo deptVo = new DeptVo();
|
||||
BeanUtils.copyProperties(dept, deptVo);
|
||||
deptVo.setManager(mangerList);
|
||||
return deptVo;
|
||||
}).toList();
|
||||
|
||||
return PageResult.<DeptVo>builder()
|
||||
|
@ -68,9 +74,13 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements De
|
|||
*/
|
||||
@Override
|
||||
public void addDept(@Valid DeptAddDto dto) {
|
||||
String mangerList = dto.getManager().stream().map(String::trim).collect(Collectors.joining(","));
|
||||
|
||||
// 保存数据
|
||||
Dept dept = new Dept();
|
||||
BeanUtils.copyProperties(dto, dept);
|
||||
dept.setManager(mangerList);
|
||||
|
||||
save(dept);
|
||||
}
|
||||
|
||||
|
@ -81,9 +91,13 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements De
|
|||
*/
|
||||
@Override
|
||||
public void updateDept(@Valid DeptUpdateDto dto) {
|
||||
String mangerList = dto.getManager().stream().map(String::trim).collect(Collectors.joining(","));
|
||||
|
||||
// 更新内容
|
||||
Dept dept = new Dept();
|
||||
BeanUtils.copyProperties(dto, dept);
|
||||
dept.setManager(mangerList);
|
||||
|
||||
updateById(dept);
|
||||
}
|
||||
|
||||
|
@ -99,4 +113,18 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements De
|
|||
// 删除用户部门关联
|
||||
userDeptMapper.deleteBatchIdsByDeptIdWithPhysics(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* * 获取所有部门
|
||||
*
|
||||
* @return 所有部门列表
|
||||
*/
|
||||
@Override
|
||||
public List<DeptVo> getAllDeptList() {
|
||||
return list().stream().map(dept -> {
|
||||
DeptVo deptVo = new DeptVo();
|
||||
BeanUtils.copyProperties(dept, deptVo);
|
||||
return deptVo;
|
||||
}).toList();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,6 @@ import cn.bunny.dao.dto.system.rolePower.PowerUpdateDto;
|
|||
import cn.bunny.dao.entity.system.Power;
|
||||
import cn.bunny.dao.pojo.result.PageResult;
|
||||
import cn.bunny.dao.vo.system.rolePower.PowerVo;
|
||||
import cn.bunny.services.factory.PowerFactory;
|
||||
import cn.bunny.services.mapper.PowerMapper;
|
||||
import cn.bunny.services.mapper.RolePowerMapper;
|
||||
import cn.bunny.services.service.PowerService;
|
||||
|
@ -18,7 +17,6 @@ import org.springframework.beans.BeanUtils;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -32,9 +30,6 @@ import java.util.List;
|
|||
@Service
|
||||
public class PowerServiceImpl extends ServiceImpl<PowerMapper, Power> implements PowerService {
|
||||
|
||||
@Autowired
|
||||
private PowerFactory powerFactory;
|
||||
|
||||
@Autowired
|
||||
private RolePowerMapper rolePowerMapper;
|
||||
|
||||
|
@ -112,21 +107,10 @@ public class PowerServiceImpl extends ServiceImpl<PowerMapper, Power> implements
|
|||
@Override
|
||||
public List<PowerVo> getAllPowers() {
|
||||
List<Power> powerList = list();
|
||||
ArrayList<PowerVo> powerVos = new ArrayList<>();
|
||||
|
||||
// 构建返回波对象
|
||||
List<PowerVo> powerVoList = powerList.stream().map(power -> {
|
||||
return powerList.stream().map(power -> {
|
||||
PowerVo powerVo = new PowerVo();
|
||||
BeanUtils.copyProperties(power, powerVo);
|
||||
return powerVo;
|
||||
}).toList();
|
||||
|
||||
powerVoList.stream()
|
||||
.filter(power -> power.getParentId() == 0)
|
||||
.forEach(powerVo -> {
|
||||
powerVo.setChildren(powerFactory.handlePowerVoChildren(powerVo.getId(), powerVoList));
|
||||
powerVos.add(powerVo);
|
||||
});
|
||||
return powerVos;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
package cn.bunny.services.service.impl;
|
||||
|
||||
import cn.bunny.dao.entity.system.RouterPower;
|
||||
import cn.bunny.services.mapper.RouterPowerMapper;
|
||||
import cn.bunny.services.service.RouterPowerService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 路由和权限关系表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author Bunny
|
||||
* @since 2024-09-26
|
||||
*/
|
||||
@Service
|
||||
public class RouterPowerServiceImpl extends ServiceImpl<RouterPowerMapper, RouterPower> implements RouterPowerService {
|
||||
|
||||
}
|
|
@ -42,6 +42,7 @@ import org.springframework.util.DigestUtils;
|
|||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
|
@ -225,6 +226,24 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, AdminUser> implemen
|
|||
redisTemplate.delete(adminLoginInfoPrefix);
|
||||
}
|
||||
|
||||
/**
|
||||
* * 查询用户
|
||||
*
|
||||
* @param keyword 查询用户信息关键字
|
||||
* @return 用户信息列表
|
||||
*/
|
||||
@Override
|
||||
public List<AdminUserVo> queryUser(String keyword) {
|
||||
if (!StringUtils.hasText(keyword)) return new ArrayList<>();
|
||||
|
||||
List<AdminUser> list = baseMapper.queryUser(keyword);
|
||||
return list.stream().map(adminUser -> {
|
||||
AdminUserVo adminUserVo = new AdminUserVo();
|
||||
BeanUtils.copyProperties(adminUser, adminUserVo);
|
||||
return adminUserVo;
|
||||
}).toList();
|
||||
}
|
||||
|
||||
/**
|
||||
* * 用户信息 服务实现类
|
||||
*
|
||||
|
|
|
@ -11,14 +11,14 @@
|
|||
<id column="update_user" property="updateUser"/>
|
||||
<id column="is_deleted" property="isDeleted"/>
|
||||
<id column="parent_id" property="parentId"/>
|
||||
<id column="manager_id" property="managerId"/>
|
||||
<id column="manager" property="manager"/>
|
||||
<id column="dept_name" property="deptName"/>
|
||||
<id column="summary" property="summary"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, create_time, update_time, create_user, update_user, is_deleted, parent_id, manager_id, dept_name, summary
|
||||
id, create_time, update_time, create_user, update_user, is_deleted, parent_id, manager, dept_name, summary
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询部门内容 -->
|
||||
|
@ -30,9 +30,6 @@
|
|||
<if test="dto.parentId != null and dto.parentId != ''">
|
||||
parent_id like CONCAT('%',#{dto.parentId},'%')
|
||||
</if>
|
||||
<if test="dto.managerId != null and dto.managerId != ''">
|
||||
manager_id like CONCAT('%',#{dto.managerId},'%')
|
||||
</if>
|
||||
<if test="dto.deptName != null and dto.deptName != ''">
|
||||
dept_name like CONCAT('%',#{dto.deptName},'%')
|
||||
</if>
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.bunny.services.mapper.RouterPowerMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="cn.bunny.dao.entity.system.RouterPower">
|
||||
<id column="id" property="id"/>
|
||||
<result column="router_id" property="routerId"/>
|
||||
<result column="power_id" property="powerId"/>
|
||||
<result column="create_user" property="createUser"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="update_user" property="updateUser"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="is_deleted" property="isDeleted"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, router_id, power_id, create_user, update_time, update_user, create_time, is_deleted
|
||||
</sql>
|
||||
|
||||
</mapper>
|
|
@ -58,6 +58,20 @@
|
|||
</where>
|
||||
</select>
|
||||
|
||||
<!-- 查询用户 -->
|
||||
<select id="queryUser" resultType="cn.bunny.dao.entity.system.AdminUser">
|
||||
select *
|
||||
from sys_user
|
||||
<where>
|
||||
<if test="keyword != null and keyword != ''">
|
||||
username like CONCAT('%', #{keyword}, '%')
|
||||
or nick_name like CONCAT('%', #{keyword}, '%')
|
||||
or email like CONCAT('%', #{keyword}, '%')
|
||||
or phone like CONCAT('%', #{keyword}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!-- 物理删除用户信息 -->
|
||||
<delete id="deleteBatchIdsWithPhysics">
|
||||
delete
|
||||
|
|
Loading…
Reference in New Issue