Commit f21c1c41 authored by hongguangwu's avatar hongguangwu

1.5.8-用户-角色初提交

parent 06304408
package com.yifu.cloud.plus.v1.yifu.permission.entity;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
/**
* 新权限-角色表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Data
@TableName("sys_role_info")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "新权限-角色表")
public class SysRoleInfo extends BaseEntity {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("主键")
@Schema(description = "主键")
private String fdId;
/**
* 角色名称
*/
@ExcelAttribute(name = "角色名称", isNotEmpty = true, errorInfo = "角色名称不能为空", maxLength = 20)
@NotBlank(message = "角色名称不能为空")
@Length(max = 20, message = "角色名称不能超过20个字符")
@ExcelProperty("角色名称")
@Schema(description = "角色名称")
private String roleName;
/**
* 角色描述
*/
@ExcelAttribute(name = "角色描述", maxLength = 200)
@Length(max = 200, message = "角色描述不能超过200个字符")
@ExcelProperty("角色描述")
@Schema(description = "角色描述")
private String remark;
/**
* 状态:0:正常;1:冻结/停用
*/
@ExcelAttribute(name = "状态:0:正常;1:冻结/停用", isNotEmpty = true, errorInfo = "状态:0:正常;1:冻结/停用不能为空")
@NotBlank(message = "状态:0:正常;1:冻结/停用不能为空")
@ExcelProperty("状态:0:正常;1:冻结/停用")
@Schema(description = "状态:0:正常;1:冻结/停用")
private Integer status;
/**
* 删除状态图:0:正常;1:删除
*/
@ExcelAttribute(name = "删除状态图:0:正常;1:删除", isNotEmpty = true, errorInfo = "删除状态图:0:正常;1:删除不能为空")
@NotBlank(message = "删除状态图:0:正常;1:删除不能为空")
@ExcelProperty("删除状态图:0:正常;1:删除")
@Schema(description = "删除状态图:0:正常;1:删除")
private Integer deleteFlag;
/**
* 数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;)
*/
@ExcelAttribute(name = "数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;)", isNotEmpty = true, errorInfo = "数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;)不能为空", maxLength = 50)
@NotBlank(message = "数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;)不能为空")
@Length(max = 50, message = "数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;)不能超过50个字符")
@ExcelProperty("数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;)")
@Schema(description = "数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;)")
private String dataAuth;
}
package com.yifu.cloud.plus.v1.yifu.permission.entity;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
/**
* 新权限-角色-菜单-关联表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Data
@TableName("sys_role_menu_res")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "新权限-角色-菜单-关联表")
public class SysRoleMenuRes extends BaseEntity {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("主键")
@Schema(description = "主键")
private String fdId;
/**
* 角色ID
*/
@ExcelAttribute(name = "角色ID", isNotEmpty = true, errorInfo = "角色ID不能为空", maxLength = 36)
@NotBlank(message = "角色ID不能为空")
@Length(max = 36, message = "角色ID不能超过36个字符")
@ExcelProperty("角色ID")
@Schema(description = "角色ID")
private String roleId;
/**
* 菜单ID
*/
@ExcelAttribute(name = "菜单ID", isNotEmpty = true, errorInfo = "菜单ID不能为空", maxLength = 36)
@NotBlank(message = "菜单ID不能为空")
@Length(max = 36, message = "菜单ID不能超过36个字符")
@ExcelProperty("菜单ID")
@Schema(description = "菜单ID")
private String menuId;
}
package com.yifu.cloud.plus.v1.yifu.permission.entity;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
/**
* 新权限-账号管理表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Data
@TableName("sys_user_info")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "新权限-账号管理表")
public class SysUserInfo extends BaseEntity {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("主键")
@Schema(description = "主键")
private String fdId;
/**
* ele表-员工姓名
*/
@ExcelAttribute(name = "ele表-员工姓名", maxLength = 200)
@Length(max = 200, message = "ele表-员工姓名不能超过200个字符")
@ExcelProperty("ele表-员工姓名")
@Schema(description = "ele表-员工姓名")
private String fdName;
/**
* per表-登录账号
*/
@ExcelAttribute(name = "per表-登录账号", maxLength = 200)
@Length(max = 200, message = "per表-登录账号不能超过200个字符")
@ExcelProperty("per表-登录账号")
@Schema(description = "per表-登录账号")
private String fdLoginName;
/**
* ele表-所在部门
*/
@ExcelAttribute(name = "ele表-所在部门", maxLength = 450)
@Length(max = 450, message = "ele表-所在部门不能超过450个字符")
@ExcelProperty("ele表-所在部门")
@Schema(description = "ele表-所在部门")
private String fdLdapDn;
/**
* 所在部门
*/
@ExcelAttribute(name = "所在部门", maxLength = 100)
@Length(max = 100, message = "所在部门不能超过100个字符")
@ExcelProperty("所在部门")
@Schema(description = "所在部门")
private String fdDeptName;
/**
* per表-手机号
*/
@ExcelAttribute(name = "per表-手机号", maxLength = 150)
@Length(max = 150, message = "per表-手机号不能超过150个字符")
@ExcelProperty("per表-手机号")
@Schema(description = "per表-手机号")
private String fdMobileNo;
/**
* per表-邮箱
*/
@ExcelAttribute(name = "per表-邮箱", maxLength = 200)
@Length(max = 200, message = "per表-邮箱不能超过200个字符")
@ExcelProperty("per表-邮箱")
@Schema(description = "per表-邮箱")
private String fdEmail;
/**
* 状态:0正常;1冻结
*/
@ExcelAttribute(name = "状态:0正常;1冻结", isNotEmpty = true, errorInfo = "状态:0正常;1冻结不能为空")
@NotBlank(message = "状态:0正常;1冻结不能为空")
@ExcelProperty("状态:0正常;1冻结")
@Schema(description = "状态:0正常;1冻结")
private Integer status;
/**
* 角色名称合集
*/
@ExcelAttribute(name = "角色名称合集", maxLength = 200)
@Length(max = 200, message = "角色名称合集不能超过200个字符")
@ExcelProperty("角色名称合集")
@Schema(description = "角色名称合集")
private String roleNames;
}
package com.yifu.cloud.plus.v1.yifu.permission.entity;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
/**
* 新权限-账号-角色关联表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Data
@TableName("sys_user_role_res")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "新权限-账号-角色关联表")
public class SysUserRoleRes extends BaseEntity {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("主键")
@Schema(description = "主键")
private String fdId;
/**
* 账号ID
*/
@ExcelAttribute(name = "账号ID", isNotEmpty = true, errorInfo = "账号ID不能为空", maxLength = 36)
@NotBlank(message = "账号ID不能为空")
@Length(max = 36, message = "账号ID不能超过36个字符")
@ExcelProperty("账号ID")
@Schema(description = "账号ID")
private String userId;
/**
* 角色ID
*/
@ExcelAttribute(name = "角色ID", isNotEmpty = true, errorInfo = "角色ID不能为空", maxLength = 36)
@NotBlank(message = "角色ID不能为空")
@Length(max = 36, message = "角色ID不能超过36个字符")
@ExcelProperty("角色ID")
@Schema(description = "角色ID")
private String roleId;
}
package com.yifu.cloud.plus.v1.yifu.permission.vo;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysRoleInfo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 新权限-角色表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Data
public class SysRoleInfoSearchVo extends SysRoleInfo {
/**
* 多选导出或删除等操作
*/
@Schema(description = "选中ID,多个逗号分割")
private String ids;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间区间")
private LocalDateTime[] createTimes;
/**
* @Author fxj
* 查询数据起
**/
@Schema(description = "查询limit 开始")
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
@Schema(description = "查询limit 数据条数")
private int limitEnd;
}
package com.yifu.cloud.plus.v1.yifu.permission.vo;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* 新权限-角色表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Data
public class SysRoleInfoVo extends RowIndex implements Serializable {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@NotBlank(message = "主键 不能为空")
@Length(max = 36, message = "主键 不能超过36 个字符")
@ExcelAttribute(name = "主键", isNotEmpty = true, errorInfo = "主键 不能为空", maxLength = 36)
@Schema(description = "主键")
@ExcelProperty("主键")
private String fdId;
/**
* 角色名称
*/
@NotBlank(message = "角色名称 不能为空")
@Length(max = 20, message = "角色名称 不能超过20 个字符")
@ExcelAttribute(name = "角色名称", isNotEmpty = true, errorInfo = "角色名称 不能为空", maxLength = 20)
@Schema(description = "角色名称")
@ExcelProperty("角色名称")
private String roleName;
/**
* 角色描述
*/
@Length(max = 200, message = "角色描述 不能超过200 个字符")
@ExcelAttribute(name = "角色描述", maxLength = 200)
@Schema(description = "角色描述")
@ExcelProperty("角色描述")
private String remark;
/**
* 状态:0:正常;1:冻结/停用
*/
@NotBlank(message = "状态:0:正常;1:冻结/停用 不能为空")
@ExcelAttribute(name = "状态:0:正常;1:冻结/停用", isNotEmpty = true, errorInfo = "状态:0:正常;1:冻结/停用 不能为空")
@Schema(description = "状态:0:正常;1:冻结/停用")
@ExcelProperty("状态:0:正常;1:冻结/停用")
private Integer status;
/**
* 删除状态图:0:正常;1:删除
*/
@NotBlank(message = "删除状态图:0:正常;1:删除 不能为空")
@ExcelAttribute(name = "删除状态图:0:正常;1:删除", isNotEmpty = true, errorInfo = "删除状态图:0:正常;1:删除 不能为空")
@Schema(description = "删除状态图:0:正常;1:删除")
@ExcelProperty("删除状态图:0:正常;1:删除")
private Integer deleteFlag;
/**
* 数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;)
*/
@NotBlank(message = "数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;) 不能为空")
@Length(max = 50, message = "数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;) 不能超过50 个字符")
@ExcelAttribute(name = "数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;)", isNotEmpty = true, errorInfo = "数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;) 不能为空", maxLength = 50)
@Schema(description = "数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;)")
@ExcelProperty("数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;)")
private String dataAuth;
/**
* 创建人id
*/
@Length(max = 36, message = "创建人id 不能超过36 个字符")
@ExcelAttribute(name = "创建人id", maxLength = 36)
@Schema(description = "创建人id")
@ExcelProperty("创建人id")
private String createBy;
/**
* 创建人姓名
*/
@Length(max = 200, message = "创建人姓名 不能超过200 个字符")
@ExcelAttribute(name = "创建人姓名", maxLength = 200)
@Schema(description = "创建人姓名")
@ExcelProperty("创建人姓名")
private String createName;
/**
* 创建时间
*/
@ExcelAttribute(name = "创建时间", isDate = true)
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private LocalDateTime createTime;
/**
* 更新人id
*/
@Length(max = 200, message = "更新人id 不能超过200 个字符")
@ExcelAttribute(name = "更新人id", maxLength = 200)
@Schema(description = "更新人id")
@ExcelProperty("更新人id")
private String updateBy;
/**
* 更新时间
*/
@ExcelAttribute(name = "更新时间", isDate = true)
@Schema(description = "更新时间")
@ExcelProperty("更新时间")
private LocalDateTime updateTime;
}
package com.yifu.cloud.plus.v1.yifu.permission.vo;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysRoleMenuRes;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 新权限-角色-菜单-关联表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Data
public class SysRoleMenuResSearchVo extends SysRoleMenuRes {
/**
* 多选导出或删除等操作
*/
@Schema(description = "选中ID,多个逗号分割")
private String ids;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间区间")
private LocalDateTime[] createTimes;
/**
* @Author fxj
* 查询数据起
**/
@Schema(description = "查询limit 开始")
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
@Schema(description = "查询limit 数据条数")
private int limitEnd;
}
package com.yifu.cloud.plus.v1.yifu.permission.vo;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 新权限-角色-菜单-关联表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Data
public class SysRoleMenuResVo extends RowIndex implements Serializable {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@NotBlank(message = "主键 不能为空")
@Length(max = 36, message = "主键 不能超过36 个字符")
@ExcelAttribute(name = "主键", isNotEmpty = true, errorInfo = "主键 不能为空", maxLength = 36)
@Schema(description = "主键")
@ExcelProperty("主键")
private String fdId;
/**
* 角色ID
*/
@NotBlank(message = "角色ID 不能为空")
@Length(max = 36, message = "角色ID 不能超过36 个字符")
@ExcelAttribute(name = "角色ID", isNotEmpty = true, errorInfo = "角色ID 不能为空", maxLength = 36)
@Schema(description = "角色ID")
@ExcelProperty("角色ID")
private String roleId;
/**
* 菜单ID
*/
@NotBlank(message = "菜单ID 不能为空")
@Length(max = 36, message = "菜单ID 不能超过36 个字符")
@ExcelAttribute(name = "菜单ID", isNotEmpty = true, errorInfo = "菜单ID 不能为空", maxLength = 36)
@Schema(description = "菜单ID")
@ExcelProperty("菜单ID")
private String menuId;
}
package com.yifu.cloud.plus.v1.yifu.permission.vo;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserInfo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 新权限-账号管理表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Data
public class SysUserInfoSearchVo extends SysUserInfo {
/**
* 多选导出或删除等操作
*/
@Schema(description = "选中ID,多个逗号分割")
private String ids;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间区间")
private LocalDateTime[] createTimes;
/**
* @Author fxj
* 查询数据起
**/
@Schema(description = "查询limit 开始")
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
@Schema(description = "查询limit 数据条数")
private int limitEnd;
}
package com.yifu.cloud.plus.v1.yifu.permission.vo;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* 新权限-账号管理表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Data
public class SysUserInfoVo extends RowIndex implements Serializable {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@NotBlank(message = "主键 不能为空")
@Length(max = 36, message = "主键 不能超过36 个字符")
@ExcelAttribute(name = "主键", isNotEmpty = true, errorInfo = "主键 不能为空", maxLength = 36)
@Schema(description = "主键")
@ExcelProperty("主键")
private String fdId;
/**
* ele表-员工姓名
*/
@Length(max = 200, message = "ele表-员工姓名 不能超过200 个字符")
@ExcelAttribute(name = "ele表-员工姓名", maxLength = 200)
@Schema(description = "ele表-员工姓名")
@ExcelProperty("ele表-员工姓名")
private String fdName;
/**
* per表-登录账号
*/
@Length(max = 200, message = "per表-登录账号 不能超过200 个字符")
@ExcelAttribute(name = "per表-登录账号", maxLength = 200)
@Schema(description = "per表-登录账号")
@ExcelProperty("per表-登录账号")
private String fdLoginName;
/**
* ele表-所在部门
*/
@Length(max = 450, message = "ele表-所在部门 不能超过450 个字符")
@ExcelAttribute(name = "ele表-所在部门", maxLength = 450)
@Schema(description = "ele表-所在部门")
@ExcelProperty("ele表-所在部门")
private String fdLdapDn;
/**
* 所在部门
*/
@Length(max = 100, message = "所在部门 不能超过100 个字符")
@ExcelAttribute(name = "所在部门", maxLength = 100)
@Schema(description = "所在部门")
@ExcelProperty("所在部门")
private String fdDeptName;
/**
* per表-手机号
*/
@Length(max = 150, message = "per表-手机号 不能超过150 个字符")
@ExcelAttribute(name = "per表-手机号", maxLength = 150)
@Schema(description = "per表-手机号")
@ExcelProperty("per表-手机号")
private String fdMobileNo;
/**
* per表-邮箱
*/
@Length(max = 200, message = "per表-邮箱 不能超过200 个字符")
@ExcelAttribute(name = "per表-邮箱", maxLength = 200)
@Schema(description = "per表-邮箱")
@ExcelProperty("per表-邮箱")
private String fdEmail;
/**
* 状态:0正常;1冻结
*/
@NotBlank(message = "状态:0正常;1冻结 不能为空")
@ExcelAttribute(name = "状态:0正常;1冻结", isNotEmpty = true, errorInfo = "状态:0正常;1冻结 不能为空")
@Schema(description = "状态:0正常;1冻结")
@ExcelProperty("状态:0正常;1冻结")
private Integer status;
/**
* 角色名称合集
*/
@Length(max = 200, message = "角色名称合集 不能超过200 个字符")
@ExcelAttribute(name = "角色名称合集", maxLength = 200)
@Schema(description = "角色名称合集")
@ExcelProperty("角色名称合集")
private String roleNames;
/**
* 创建人id
*/
@Length(max = 36, message = "创建人id 不能超过36 个字符")
@ExcelAttribute(name = "创建人id", maxLength = 36)
@Schema(description = "创建人id")
@ExcelProperty("创建人id")
private String createBy;
/**
* 创建人姓名
*/
@Length(max = 200, message = "创建人姓名 不能超过200 个字符")
@ExcelAttribute(name = "创建人姓名", maxLength = 200)
@Schema(description = "创建人姓名")
@ExcelProperty("创建人姓名")
private String createName;
/**
* 创建时间
*/
@ExcelAttribute(name = "创建时间", isDate = true)
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private LocalDateTime createTime;
/**
* 更新人id
*/
@Length(max = 200, message = "更新人id 不能超过200 个字符")
@ExcelAttribute(name = "更新人id", maxLength = 200)
@Schema(description = "更新人id")
@ExcelProperty("更新人id")
private String updateBy;
/**
* 更新时间
*/
@ExcelAttribute(name = "更新时间", isDate = true)
@Schema(description = "更新时间")
@ExcelProperty("更新时间")
private LocalDateTime updateTime;
}
package com.yifu.cloud.plus.v1.yifu.permission.vo;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserRoleRes;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 新权限-账号-角色关联表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Data
public class SysUserRoleResSearchVo extends SysUserRoleRes {
/**
* 多选导出或删除等操作
*/
@Schema(description = "选中ID,多个逗号分割")
private String ids;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间区间")
private LocalDateTime[] createTimes;
/**
* @Author fxj
* 查询数据起
**/
@Schema(description = "查询limit 开始")
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
@Schema(description = "查询limit 数据条数")
private int limitEnd;
}
package com.yifu.cloud.plus.v1.yifu.permission.vo;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 新权限-账号-角色关联表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Data
public class SysUserRoleResVo extends RowIndex implements Serializable {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@NotBlank(message = "主键 不能为空")
@Length(max = 36, message = "主键 不能超过36 个字符")
@ExcelAttribute(name = "主键", isNotEmpty = true, errorInfo = "主键 不能为空", maxLength = 36)
@Schema(description = "主键")
@ExcelProperty("主键")
private String fdId;
/**
* 账号ID
*/
@NotBlank(message = "账号ID 不能为空")
@Length(max = 36, message = "账号ID 不能超过36 个字符")
@ExcelAttribute(name = "账号ID", isNotEmpty = true, errorInfo = "账号ID 不能为空", maxLength = 36)
@Schema(description = "账号ID")
@ExcelProperty("账号ID")
private String userId;
/**
* 角色ID
*/
@NotBlank(message = "角色ID 不能为空")
@Length(max = 36, message = "角色ID 不能超过36 个字符")
@ExcelAttribute(name = "角色ID", isNotEmpty = true, errorInfo = "角色ID 不能为空", maxLength = 36)
@Schema(description = "角色ID")
@ExcelProperty("角色ID")
private String roleId;
}
package com.yifu.cloud.plus.v1.permission.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.permission.service.SysRoleInfoService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysRoleInfo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysRoleInfoSearchVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 新权限-角色表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/sysroleinfo")
@Tag(name = "新权限-角色表管理")
public class SysRoleInfoController {
private final SysRoleInfoService sysRoleInfoService;
/**
* 简单分页查询
*
* @param page 分页对象
* @param sysRoleInfo 新权限-角色表
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<SysRoleInfo>> getSysRoleInfoPage(Page<SysRoleInfo> page, SysRoleInfoSearchVo sysRoleInfo) {
return new R<>(sysRoleInfoService.getSysRoleInfoPage(page, sysRoleInfo));
}
/**
* 不分页查询
*
* @param sysRoleInfo 新权限-角色表
* @return
*/
@Operation(summary = "不分页查询", description = "不分页查询")
@PostMapping("/noPage")
//@PreAuthorize("@pms.hasPermission('ekp_sysroleinfo_get')" )
public R<List<SysRoleInfo>> getSysRoleInfoNoPage(@RequestBody SysRoleInfoSearchVo sysRoleInfo) {
return R.ok(sysRoleInfoService.noPageDiy(sysRoleInfo));
}
/**
* 通过id查询新权限-角色表
*
* @param fdId id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('ekp_sysroleinfo_get')")
@GetMapping("/{fdId}")
@PreAuthorize("@pms.hasPermission('ekp_sysroleinfo_get')")
public R<SysRoleInfo> getById(@PathVariable("fdId") String fdId) {
return R.ok(sysRoleInfoService.getById(fdId));
}
/**
* 新增新权限-角色表
*
* @param sysRoleInfo 新权限-角色表
* @return R
*/
@Operation(summary = "新增新权限-角色表", description = "新增新权限-角色表:hasPermission('ekp_sysroleinfo_add')")
@SysLog("新增新权限-角色表")
@PostMapping
@PreAuthorize("@pms.hasPermission('ekp_sysroleinfo_add')")
public R<Boolean> save(@RequestBody SysRoleInfo sysRoleInfo) {
return R.ok(sysRoleInfoService.save(sysRoleInfo));
}
/**
* 修改新权限-角色表
*
* @param sysRoleInfo 新权限-角色表
* @return R
*/
@Operation(summary = "修改新权限-角色表", description = "修改新权限-角色表:hasPermission('ekp_sysroleinfo_edit')")
@SysLog("修改新权限-角色表")
@PutMapping
@PreAuthorize("@pms.hasPermission('ekp_sysroleinfo_edit')")
public R<Boolean> updateById(@RequestBody SysRoleInfo sysRoleInfo) {
return R.ok(sysRoleInfoService.updateById(sysRoleInfo));
}
/**
* 通过id删除新权限-角色表
*
* @param fdId id
* @return R
*/
@Operation(summary = "通过id删除新权限-角色表", description = "通过id删除新权限-角色表:hasPermission('ekp_sysroleinfo_del')")
@SysLog("通过id删除新权限-角色表")
@DeleteMapping("/{fdId}")
@PreAuthorize("@pms.hasPermission('ekp_sysroleinfo_del')")
public R<Boolean> removeById(@PathVariable String fdId) {
return R.ok(sysRoleInfoService.removeById(fdId));
}
/**
* 新权限-角色表 批量导入
*
* @author hgw
* @date 2023-08-29 14:49:40
**/
@SneakyThrows
@Operation(description = "批量新增新权限-角色表 hasPermission('ekp_sysroleinfo-batch-import')")
@SysLog("批量新增新权限-角色表")
@PostMapping("/importListAdd")
@PreAuthorize("@pms.hasPermission('ekp_sysroleinfo-batch-import')")
public R<List<ErrorMessage>> importListAdd(@RequestBody MultipartFile file) {
return sysRoleInfoService.importDiy(file.getInputStream());
}
/**
* 新权限-角色表 批量导出
*
* @author hgw
* @date 2023-08-29 14:49:40
**/
@Operation(description = "导出新权限-角色表 hasPermission('ekp_sysroleinfo-export')")
@PostMapping("/export")
@PreAuthorize("@pms.hasPermission('ekp_sysroleinfo-export')")
public void export(HttpServletResponse response, @RequestBody SysRoleInfoSearchVo searchVo) {
sysRoleInfoService.listExport(response, searchVo);
}
}
package com.yifu.cloud.plus.v1.permission.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.permission.service.SysRoleMenuResService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysRoleMenuRes;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysRoleMenuResSearchVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 新权限-角色-菜单-关联表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/sysrolemenures")
@Tag(name = "新权限-角色-菜单-关联表管理")
public class SysRoleMenuResController {
private final SysRoleMenuResService sysRoleMenuResService;
/**
* 简单分页查询
*
* @param page 分页对象
* @param sysRoleMenuRes 新权限-角色-菜单-关联表
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<SysRoleMenuRes>> getSysRoleMenuResPage(Page<SysRoleMenuRes> page, SysRoleMenuResSearchVo sysRoleMenuRes) {
return new R<>(sysRoleMenuResService.getSysRoleMenuResPage(page, sysRoleMenuRes));
}
/**
* 不分页查询
*
* @param sysRoleMenuRes 新权限-角色-菜单-关联表
* @return
*/
@Operation(summary = "不分页查询", description = "不分页查询")
@PostMapping("/noPage")
public R<List<SysRoleMenuRes>> getSysRoleMenuResNoPage(@RequestBody SysRoleMenuResSearchVo sysRoleMenuRes) {
return R.ok(sysRoleMenuResService.noPageDiy(sysRoleMenuRes));
}
/**
* 通过id查询新权限-角色-菜单-关联表
*
* @param fdId id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('ekp_sysrolemenures_get')")
@GetMapping("/{fdId}")
@PreAuthorize("@pms.hasPermission('ekp_sysrolemenures_get')")
public R<SysRoleMenuRes> getById(@PathVariable("fdId") String fdId) {
return R.ok(sysRoleMenuResService.getById(fdId));
}
}
package com.yifu.cloud.plus.v1.permission.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.permission.service.SysUserInfoService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserInfo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserInfoSearchVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 新权限-账号管理表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/sysuserinfo")
@Tag(name = "新权限-账号管理表管理")
public class SysUserInfoController {
private final SysUserInfoService sysUserInfoService;
/**
* 简单分页查询
*
* @param page 分页对象
* @param sysUserInfo 新权限-账号管理表
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<SysUserInfo>> getSysUserInfoPage(Page<SysUserInfo> page, SysUserInfoSearchVo sysUserInfo) {
return new R<>(sysUserInfoService.getSysUserInfoPage(page, sysUserInfo));
}
/**
* 不分页查询
*
* @param sysUserInfo 新权限-账号管理表
* @return
*/
@Operation(summary = "不分页查询", description = "不分页查询")
@PostMapping("/noPage")
//@PreAuthorize("@pms.hasPermission('ekp_sysuserinfo_get')" )
public R<List<SysUserInfo>> getSysUserInfoNoPage(@RequestBody SysUserInfoSearchVo sysUserInfo) {
return R.ok(sysUserInfoService.noPageDiy(sysUserInfo));
}
/**
* 通过id查询新权限-账号管理表
*
* @param fdId id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('ekp_sysuserinfo_get')")
@GetMapping("/{fdId}")
@PreAuthorize("@pms.hasPermission('ekp_sysuserinfo_get')")
public R<SysUserInfo> getById(@PathVariable("fdId") String fdId) {
return R.ok(sysUserInfoService.getById(fdId));
}
/**
* 新增新权限-账号管理表
*
* @param sysUserInfo 新权限-账号管理表
* @return R
*/
@Operation(summary = "新增新权限-账号管理表", description = "新增新权限-账号管理表:hasPermission('ekp_sysuserinfo_add')")
@SysLog("新增新权限-账号管理表")
@PostMapping
@PreAuthorize("@pms.hasPermission('ekp_sysuserinfo_add')")
public R<Boolean> save(@RequestBody SysUserInfo sysUserInfo) {
return R.ok(sysUserInfoService.save(sysUserInfo));
}
/**
* 修改新权限-账号管理表
*
* @param sysUserInfo 新权限-账号管理表
* @return R
*/
@Operation(summary = "修改新权限-账号管理表", description = "修改新权限-账号管理表:hasPermission('ekp_sysuserinfo_edit')")
@SysLog("修改新权限-账号管理表")
@PutMapping
@PreAuthorize("@pms.hasPermission('ekp_sysuserinfo_edit')")
public R<Boolean> updateById(@RequestBody SysUserInfo sysUserInfo) {
return R.ok(sysUserInfoService.updateById(sysUserInfo));
}
/**
* 通过id删除新权限-账号管理表
*
* @param fdId id
* @return R
*/
@Operation(summary = "通过id删除新权限-账号管理表", description = "通过id删除新权限-账号管理表:hasPermission('ekp_sysuserinfo_del')")
@SysLog("通过id删除新权限-账号管理表")
@DeleteMapping("/{fdId}")
@PreAuthorize("@pms.hasPermission('ekp_sysuserinfo_del')")
public R<Boolean> removeById(@PathVariable String fdId) {
return R.ok(sysUserInfoService.removeById(fdId));
}
/**
* 新权限-账号管理表 批量导出
*
* @author hgw
* @date 2023-08-29 14:49:40
**/
@Operation(description = "导出新权限-账号管理表 hasPermission('ekp_sysuserinfo-export')")
@PostMapping("/export")
@PreAuthorize("@pms.hasPermission('ekp_sysuserinfo-export')")
public void export(HttpServletResponse response, @RequestBody SysUserInfoSearchVo searchVo) {
sysUserInfoService.listExport(response, searchVo);
}
}
package com.yifu.cloud.plus.v1.permission.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.permission.service.SysUserRoleResService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserRoleRes;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserRoleResSearchVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 新权限-账号-角色关联表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/sysuserroleres")
@Tag(name = "新权限-账号-角色关联表管理")
public class SysUserRoleResController {
private final SysUserRoleResService sysUserRoleResService;
/**
* 简单分页查询
*
* @param page 分页对象
* @param sysUserRoleRes 新权限-账号-角色关联表
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<SysUserRoleRes>> getSysUserRoleResPage(Page<SysUserRoleRes> page, SysUserRoleResSearchVo sysUserRoleRes) {
return new R<>(sysUserRoleResService.getSysUserRoleResPage(page, sysUserRoleRes));
}
/**
* 不分页查询
*
* @param sysUserRoleRes 新权限-账号-角色关联表
* @return
*/
@Operation(summary = "不分页查询", description = "不分页查询")
@PostMapping("/noPage")
public R<List<SysUserRoleRes>> getSysUserRoleResNoPage(@RequestBody SysUserRoleResSearchVo sysUserRoleRes) {
return R.ok(sysUserRoleResService.noPageDiy(sysUserRoleRes));
}
/**
* 通过id查询新权限-账号-角色关联表
*
* @param fdId id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('ekp_sysuserroleres_get')")
@GetMapping("/{fdId}")
@PreAuthorize("@pms.hasPermission('ekp_sysuserroleres_get')")
public R<SysUserRoleRes> getById(@PathVariable("fdId") String fdId) {
return R.ok(sysUserRoleResService.getById(fdId));
}
/**
* 新增新权限-账号-角色关联表
*
* @param sysUserRoleRes 新权限-账号-角色关联表
* @return R
*/
@Operation(summary = "新增新权限-账号-角色关联表", description = "新增新权限-账号-角色关联表:hasPermission('ekp_sysuserroleres_add')")
@SysLog("新增新权限-账号-角色关联表")
@PostMapping
@PreAuthorize("@pms.hasPermission('ekp_sysuserroleres_add')")
public R<Boolean> save(@RequestBody SysUserRoleRes sysUserRoleRes) {
return R.ok(sysUserRoleResService.save(sysUserRoleRes));
}
/**
* 修改新权限-账号-角色关联表
*
* @param sysUserRoleRes 新权限-账号-角色关联表
* @return R
*/
@Operation(summary = "修改新权限-账号-角色关联表", description = "修改新权限-账号-角色关联表:hasPermission('ekp_sysuserroleres_edit')")
@SysLog("修改新权限-账号-角色关联表")
@PutMapping
@PreAuthorize("@pms.hasPermission('ekp_sysuserroleres_edit')")
public R<Boolean> updateById(@RequestBody SysUserRoleRes sysUserRoleRes) {
return R.ok(sysUserRoleResService.updateById(sysUserRoleRes));
}
/**
* 通过id删除新权限-账号-角色关联表
*
* @param fdId id
* @return R
*/
@Operation(summary = "通过id删除新权限-账号-角色关联表", description = "通过id删除新权限-账号-角色关联表:hasPermission('ekp_sysuserroleres_del')")
@SysLog("通过id删除新权限-账号-角色关联表")
@DeleteMapping("/{fdId}")
@PreAuthorize("@pms.hasPermission('ekp_sysuserroleres_del')")
public R<Boolean> removeById(@PathVariable String fdId) {
return R.ok(sysUserRoleResService.removeById(fdId));
}
}
package com.yifu.cloud.plus.v1.permission.mapper;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysRoleInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 新权限-角色表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Mapper
public interface SysRoleInfoMapper extends BaseMapper<SysRoleInfo> {
/**
* 新权限-角色表简单分页查询
*
* @param sysRoleInfo 新权限-角色表
* @return
*/
IPage<SysRoleInfo> getSysRoleInfoPage(Page<SysRoleInfo> page, @Param("sysRoleInfo") SysRoleInfo sysRoleInfo);
}
package com.yifu.cloud.plus.v1.permission.mapper;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysRoleMenuRes;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 新权限-角色-菜单-关联表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Mapper
public interface SysRoleMenuResMapper extends BaseMapper<SysRoleMenuRes> {
/**
* 新权限-角色-菜单-关联表简单分页查询
*
* @param sysRoleMenuRes 新权限-角色-菜单-关联表
* @return
*/
IPage<SysRoleMenuRes> getSysRoleMenuResPage(Page<SysRoleMenuRes> page, @Param("sysRoleMenuRes") SysRoleMenuRes sysRoleMenuRes);
}
package com.yifu.cloud.plus.v1.permission.mapper;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 新权限-账号管理表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Mapper
public interface SysUserInfoMapper extends BaseMapper<SysUserInfo> {
/**
* 新权限-账号管理表简单分页查询
*
* @param sysUserInfo 新权限-账号管理表
* @return
*/
IPage<SysUserInfo> getSysUserInfoPage(Page<SysUserInfo> page, @Param("sysUserInfo") SysUserInfo sysUserInfo);
}
package com.yifu.cloud.plus.v1.permission.mapper;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserRoleRes;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 新权限-账号-角色关联表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Mapper
public interface SysUserRoleResMapper extends BaseMapper<SysUserRoleRes> {
/**
* 新权限-账号-角色关联表简单分页查询
*
* @param sysUserRoleRes 新权限-账号-角色关联表
* @return
*/
IPage<SysUserRoleRes> getSysUserRoleResPage(Page<SysUserRoleRes> page, @Param("sysUserRoleRes") SysUserRoleRes sysUserRoleRes);
}
package com.yifu.cloud.plus.v1.permission.service;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysRoleInfo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysRoleInfoSearchVo;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.List;
/**
* 新权限-角色表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
public interface SysRoleInfoService extends IService<SysRoleInfo> {
/**
* 新权限-角色表简单分页查询
*
* @param sysRoleInfo 新权限-角色表
* @return
*/
IPage<SysRoleInfo> getSysRoleInfoPage(Page<SysRoleInfo> page, SysRoleInfoSearchVo sysRoleInfo);
R<List<ErrorMessage>> importDiy(InputStream inputStream);
void listExport(HttpServletResponse response, SysRoleInfoSearchVo searchVo);
List<SysRoleInfo> noPageDiy(SysRoleInfoSearchVo searchVo);
}
package com.yifu.cloud.plus.v1.permission.service;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysRoleMenuRes;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysRoleMenuResSearchVo;
import java.util.List;
/**
* 新权限-角色-菜单-关联表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
public interface SysRoleMenuResService extends IService<SysRoleMenuRes> {
/**
* 新权限-角色-菜单-关联表简单分页查询
*
* @param sysRoleMenuRes 新权限-角色-菜单-关联表
* @return
*/
IPage<SysRoleMenuRes> getSysRoleMenuResPage(Page<SysRoleMenuRes> page, SysRoleMenuResSearchVo sysRoleMenuRes);
List<SysRoleMenuRes> noPageDiy(SysRoleMenuResSearchVo searchVo);
}
package com.yifu.cloud.plus.v1.permission.service;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserInfo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserInfoSearchVo;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.List;
/**
* 新权限-账号管理表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
public interface SysUserInfoService extends IService<SysUserInfo> {
/**
* 新权限-账号管理表简单分页查询
*
* @param sysUserInfo 新权限-账号管理表
* @return
*/
IPage<SysUserInfo> getSysUserInfoPage(Page<SysUserInfo> page, SysUserInfoSearchVo sysUserInfo);
R<List<ErrorMessage>> importDiy(InputStream inputStream);
void listExport(HttpServletResponse response, SysUserInfoSearchVo searchVo);
List<SysUserInfo> noPageDiy(SysUserInfoSearchVo searchVo);
}
package com.yifu.cloud.plus.v1.permission.service;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserRoleRes;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserRoleResSearchVo;
import java.util.List;
/**
* 新权限-账号-角色关联表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
public interface SysUserRoleResService extends IService<SysUserRoleRes> {
/**
* 新权限-账号-角色关联表简单分页查询
*
* @param sysUserRoleRes 新权限-账号-角色关联表
* @return
*/
IPage<SysUserRoleRes> getSysUserRoleResPage(Page<SysUserRoleRes> page, SysUserRoleResSearchVo sysUserRoleRes);
List<SysUserRoleRes> noPageDiy(SysUserRoleResSearchVo searchVo);
}
package com.yifu.cloud.plus.v1.permission.service.impl;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ArrayUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.excel.read.metadata.holder.ReadRowHolder;
import com.alibaba.excel.util.ListUtils;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.permission.mapper.SysRoleInfoMapper;
import com.yifu.cloud.plus.v1.permission.service.SysRoleInfoService;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysRoleInfo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysRoleInfoSearchVo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysRoleInfoVo;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
/**
* 新权限-角色表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Log4j2
@Service
public class SysRoleInfoServiceImpl extends ServiceImpl<SysRoleInfoMapper, SysRoleInfo> implements SysRoleInfoService {
/**
* 新权限-角色表简单分页查询
*
* @param sysRoleInfo 新权限-角色表
* @return
*/
@Override
public IPage<SysRoleInfo> getSysRoleInfoPage(Page<SysRoleInfo> page, SysRoleInfoSearchVo sysRoleInfo) {
return baseMapper.getSysRoleInfoPage(page, sysRoleInfo);
}
/**
* 新权限-角色表批量导出
*
* @param searchVo 新权限-角色表
* @return
*/
@Override
public void listExport(HttpServletResponse response, SysRoleInfoSearchVo searchVo) {
String fileName = "新权限-角色表批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<SysRoleInfo> list = new ArrayList<>();
long count = noPageCountDiy(searchVo);
ServletOutputStream out = null;
try {
out = response.getOutputStream();
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
//EasyExcel.write(out, TEmpBadRecord.class).sheet("不良记录").doWrite(list);
ExcelWriter excelWriter = EasyExcel.write(out, SysRoleInfo.class).build();
int index = 0;
if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; ) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = noPageDiy(searchVo);
if (Common.isNotNull(list)) {
ExcelUtil<SysRoleInfo> util = new ExcelUtil<>(SysRoleInfo.class);
for (SysRoleInfo vo : list) {
util.convertEntity(vo, null, null, null);
}
}
if (Common.isNotNull(list)) {
WriteSheet writeSheet = EasyExcel.writerSheet("新权限-角色表" + index).build();
excelWriter.write(list, writeSheet);
index++;
}
i = i + CommonConstants.EXCEL_EXPORT_LIMIT;
if (Common.isNotNull(list)) {
list.clear();
}
}
} else {
WriteSheet writeSheet = EasyExcel.writerSheet("新权限-角色表" + index).build();
excelWriter.write(list, writeSheet);
}
if (Common.isNotNull(list)) {
list.clear();
}
out.flush();
excelWriter.finish();
} catch (Exception e) {
log.error("执行异常", e);
} finally {
try {
if (null != out) {
out.close();
}
} catch (IOException e) {
log.error("执行异常", e);
}
}
}
@Override
public List<SysRoleInfo> noPageDiy(SysRoleInfoSearchVo searchVo) {
LambdaQueryWrapper<SysRoleInfo> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
if (Common.isNotNull(idList)) {
wrapper.in(SysRoleInfo::getFdId, idList);
}
if (searchVo.getLimitStart() >= 0 && searchVo.getLimitEnd() > 0) {
wrapper.last(" limit " + searchVo.getLimitStart() + "," + searchVo.getLimitEnd());
}
wrapper.orderByDesc(BaseEntity::getCreateTime);
return baseMapper.selectList(wrapper);
}
private Long noPageCountDiy(SysRoleInfoSearchVo searchVo) {
LambdaQueryWrapper<SysRoleInfo> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
if (Common.isNotNull(idList)) {
wrapper.in(SysRoleInfo::getFdId, idList);
}
return baseMapper.selectCount(wrapper);
}
private LambdaQueryWrapper buildQueryWrapper(SysRoleInfoSearchVo entity) {
LambdaQueryWrapper<SysRoleInfo> wrapper = Wrappers.lambdaQuery();
if (ArrayUtil.isNotEmpty(entity.getCreateTimes())) {
wrapper.ge(SysRoleInfo::getCreateTime, entity.getCreateTimes()[0])
.le(SysRoleInfo::getCreateTime,
entity.getCreateTimes()[1]);
}
if (Common.isNotNull(entity.getCreateName())) {
wrapper.eq(SysRoleInfo::getCreateName, entity.getCreateName());
}
return wrapper;
}
@Override
public R<List<ErrorMessage>> importDiy(InputStream inputStream) {
List<ErrorMessage> errorMessageList = new ArrayList<>();
ExcelUtil<SysRoleInfoVo> util1 = new ExcelUtil<>(SysRoleInfoVo.class);
// 写法2:
// 匿名内部类 不用额外写一个DemoDataListener
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
try {
EasyExcel.read(inputStream, SysRoleInfoVo.class, new ReadListener<SysRoleInfoVo>() {
/**
* 单次缓存的数据量
*/
public static final int BATCH_COUNT = CommonConstants.BATCH_COUNT;
/**
*临时存储
*/
private List<SysRoleInfoVo> cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
@Override
public void invoke(SysRoleInfoVo data, AnalysisContext context) {
ReadRowHolder readRowHolder = context.readRowHolder();
Integer rowIndex = readRowHolder.getRowIndex();
data.setRowIndex(rowIndex + 1);
ErrorMessage errorMessage = util1.checkEntity(data, data.getRowIndex());
if (Common.isNotNull(errorMessage)) {
errorMessageList.add(errorMessage);
} else {
cachedDataList.add(data);
}
if (cachedDataList.size() >= BATCH_COUNT) {
saveData();
// 存储完成清理 list
cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
}
}
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
saveData();
}
/**
* 加上存储数据库
*/
private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size());
importSysRoleInfo(cachedDataList, errorMessageList);
log.info("存储数据库成功!");
}
}).sheet().doRead();
} catch (Exception e) {
log.error(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR, e);
return R.failed(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR);
}
return R.ok(errorMessageList);
}
private void importSysRoleInfo(List<SysRoleInfoVo> excelVOList, List<ErrorMessage> errorMessageList) {
// 个性化校验逻辑
ErrorMessage errorMsg;
// 执行数据插入操作 组装
for (int i = 0; i < excelVOList.size(); i++) {
SysRoleInfoVo excel = excelVOList.get(i);
// 数据合法情况 TODO
// 插入
insertExcel(excel);
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), CommonConstants.SAVE_SUCCESS));
}
}
/**
* 插入excel bad record
*/
private void insertExcel(SysRoleInfoVo excel) {
SysRoleInfo insert = new SysRoleInfo();
BeanUtil.copyProperties(excel, insert);
this.save(insert);
}
}
package com.yifu.cloud.plus.v1.permission.service.impl;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import cn.hutool.core.util.ArrayUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.permission.mapper.SysRoleMenuResMapper;
import com.yifu.cloud.plus.v1.permission.service.SysRoleMenuResService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysRoleMenuRes;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysRoleMenuResSearchVo;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 新权限-角色-菜单-关联表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Log4j2
@Service
public class SysRoleMenuResServiceImpl extends ServiceImpl<SysRoleMenuResMapper, SysRoleMenuRes> implements SysRoleMenuResService {
/**
* 新权限-角色-菜单-关联表简单分页查询
*
* @param sysRoleMenuRes 新权限-角色-菜单-关联表
* @return
*/
@Override
public IPage<SysRoleMenuRes> getSysRoleMenuResPage(Page<SysRoleMenuRes> page, SysRoleMenuResSearchVo sysRoleMenuRes) {
return baseMapper.getSysRoleMenuResPage(page, sysRoleMenuRes);
}
@Override
public List<SysRoleMenuRes> noPageDiy(SysRoleMenuResSearchVo searchVo) {
LambdaQueryWrapper<SysRoleMenuRes> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
if (Common.isNotNull(idList)) {
wrapper.in(SysRoleMenuRes::getFdId, idList);
}
if (searchVo.getLimitStart() >= 0 && searchVo.getLimitEnd() > 0) {
wrapper.last(" limit " + searchVo.getLimitStart() + "," + searchVo.getLimitEnd());
}
wrapper.orderByDesc(BaseEntity::getCreateTime);
return baseMapper.selectList(wrapper);
}
private LambdaQueryWrapper buildQueryWrapper(SysRoleMenuResSearchVo entity) {
LambdaQueryWrapper<SysRoleMenuRes> wrapper = Wrappers.lambdaQuery();
if (ArrayUtil.isNotEmpty(entity.getCreateTimes())) {
wrapper.ge(SysRoleMenuRes::getCreateTime, entity.getCreateTimes()[0])
.le(SysRoleMenuRes::getCreateTime,
entity.getCreateTimes()[1]);
}
if (Common.isNotNull(entity.getCreateName())) {
wrapper.eq(SysRoleMenuRes::getCreateName, entity.getCreateName());
}
return wrapper;
}
}
package com.yifu.cloud.plus.v1.permission.service.impl;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ArrayUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.EasyExcelFactory;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.excel.read.metadata.holder.ReadRowHolder;
import com.alibaba.excel.util.ListUtils;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.permission.mapper.SysUserInfoMapper;
import com.yifu.cloud.plus.v1.permission.service.SysUserInfoService;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserInfo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserInfoSearchVo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserInfoVo;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
/**
* 新权限-账号管理表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Log4j2
@Service
public class SysUserInfoServiceImpl extends ServiceImpl<SysUserInfoMapper, SysUserInfo> implements SysUserInfoService {
/**
* 新权限-账号管理表简单分页查询
*
* @param sysUserInfo 新权限-账号管理表
* @return
*/
@Override
public IPage<SysUserInfo> getSysUserInfoPage(Page<SysUserInfo> page, SysUserInfoSearchVo sysUserInfo) {
return baseMapper.getSysUserInfoPage(page, sysUserInfo);
}
/**
* 新权限-账号管理表批量导出
*
* @param searchVo 新权限-账号管理表
* @return
*/
@Override
public void listExport(HttpServletResponse response, SysUserInfoSearchVo searchVo) {
String fileName = "新权限-账号管理表批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<SysUserInfo> list = new ArrayList<>();
long count = noPageCountDiy(searchVo);
ServletOutputStream out = null;
try {
out = response.getOutputStream();
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcelFactory.write(out, SysUserInfo.class).build();
int index = 0;
if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; ) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = noPageDiy(searchVo);
if (Common.isNotNull(list)) {
ExcelUtil<SysUserInfo> util = new ExcelUtil<>(SysUserInfo.class);
for (SysUserInfo vo : list) {
util.convertEntity(vo, null, null, null);
}
}
if (Common.isNotNull(list)) {
WriteSheet writeSheet = EasyExcelFactory.writerSheet("新权限-账号管理表" + index).build();
excelWriter.write(list, writeSheet);
index++;
}
i = i + CommonConstants.EXCEL_EXPORT_LIMIT;
if (Common.isNotNull(list)) {
list.clear();
}
}
} else {
WriteSheet writeSheet = EasyExcelFactory.writerSheet("新权限-账号管理表" + index).build();
excelWriter.write(list, writeSheet);
}
if (Common.isNotNull(list)) {
list.clear();
}
out.flush();
excelWriter.finish();
} catch (Exception e) {
log.error("执行异常", e);
} finally {
try {
if (null != out) {
out.close();
}
} catch (IOException e) {
log.error("执行异常", e);
}
}
}
@Override
public List<SysUserInfo> noPageDiy(SysUserInfoSearchVo searchVo) {
LambdaQueryWrapper<SysUserInfo> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
if (Common.isNotNull(idList)) {
wrapper.in(SysUserInfo::getFdId, idList);
}
if (searchVo.getLimitStart() >= 0 && searchVo.getLimitEnd() > 0) {
wrapper.last(" limit " + searchVo.getLimitStart() + "," + searchVo.getLimitEnd());
}
wrapper.orderByDesc(BaseEntity::getCreateTime);
return baseMapper.selectList(wrapper);
}
private Long noPageCountDiy(SysUserInfoSearchVo searchVo) {
LambdaQueryWrapper<SysUserInfo> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
if (Common.isNotNull(idList)) {
wrapper.in(SysUserInfo::getFdId, idList);
}
return baseMapper.selectCount(wrapper);
}
private LambdaQueryWrapper buildQueryWrapper(SysUserInfoSearchVo entity) {
LambdaQueryWrapper<SysUserInfo> wrapper = Wrappers.lambdaQuery();
if (ArrayUtil.isNotEmpty(entity.getCreateTimes())) {
wrapper.ge(SysUserInfo::getCreateTime, entity.getCreateTimes()[0])
.le(SysUserInfo::getCreateTime,
entity.getCreateTimes()[1]);
}
if (Common.isNotNull(entity.getCreateName())) {
wrapper.eq(SysUserInfo::getCreateName, entity.getCreateName());
}
return wrapper;
}
@Override
public R<List<ErrorMessage>> importDiy(InputStream inputStream) {
List<ErrorMessage> errorMessageList = new ArrayList<>();
ExcelUtil<SysUserInfoVo> util1 = new ExcelUtil<>(SysUserInfoVo.class);
// 写法2:
// 匿名内部类 不用额外写一个DemoDataListener
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
try {
EasyExcel.read(inputStream, SysUserInfoVo.class, new ReadListener<SysUserInfoVo>() {
/**
* 单次缓存的数据量
*/
public static final int BATCH_COUNT = CommonConstants.BATCH_COUNT;
/**
*临时存储
*/
private List<SysUserInfoVo> cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
@Override
public void invoke(SysUserInfoVo data, AnalysisContext context) {
ReadRowHolder readRowHolder = context.readRowHolder();
Integer rowIndex = readRowHolder.getRowIndex();
data.setRowIndex(rowIndex + 1);
ErrorMessage errorMessage = util1.checkEntity(data, data.getRowIndex());
if (Common.isNotNull(errorMessage)) {
errorMessageList.add(errorMessage);
} else {
cachedDataList.add(data);
}
if (cachedDataList.size() >= BATCH_COUNT) {
saveData();
// 存储完成清理 list
cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
}
}
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
saveData();
}
/**
* 加上存储数据库
*/
private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size());
importSysUserInfo(cachedDataList, errorMessageList);
log.info("存储数据库成功!");
}
}).sheet().doRead();
} catch (Exception e) {
log.error(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR, e);
return R.failed(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR);
}
return R.ok(errorMessageList);
}
private void importSysUserInfo(List<SysUserInfoVo> excelVOList, List<ErrorMessage> errorMessageList) {
// 个性化校验逻辑
ErrorMessage errorMsg;
// 执行数据插入操作 组装
for (int i = 0; i < excelVOList.size(); i++) {
SysUserInfoVo excel = excelVOList.get(i);
// 数据合法情况 TODO
// 插入
insertExcel(excel);
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), CommonConstants.SAVE_SUCCESS));
}
}
/**
* 插入excel bad record
*/
private void insertExcel(SysUserInfoVo excel) {
SysUserInfo insert = new SysUserInfo();
BeanUtil.copyProperties(excel, insert);
this.save(insert);
}
}
package com.yifu.cloud.plus.v1.permission.service.impl;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import cn.hutool.core.util.ArrayUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.permission.mapper.SysUserRoleResMapper;
import com.yifu.cloud.plus.v1.permission.service.SysUserRoleResService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserRoleRes;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserRoleResSearchVo;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 新权限-账号-角色关联表
*
* @author hgw
* @date 2023-08-29 14:49:40
*/
@Log4j2
@Service
public class SysUserRoleResServiceImpl extends ServiceImpl<SysUserRoleResMapper, SysUserRoleRes> implements SysUserRoleResService {
/**
* 新权限-账号-角色关联表简单分页查询
*
* @param sysUserRoleRes 新权限-账号-角色关联表
* @return
*/
@Override
public IPage<SysUserRoleRes> getSysUserRoleResPage(Page<SysUserRoleRes> page, SysUserRoleResSearchVo sysUserRoleRes) {
return baseMapper.getSysUserRoleResPage(page, sysUserRoleRes);
}
@Override
public List<SysUserRoleRes> noPageDiy(SysUserRoleResSearchVo searchVo) {
LambdaQueryWrapper<SysUserRoleRes> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
if (Common.isNotNull(idList)) {
wrapper.in(SysUserRoleRes::getFdId, idList);
}
if (searchVo.getLimitStart() >= 0 && searchVo.getLimitEnd() > 0) {
wrapper.last(" limit " + searchVo.getLimitStart() + "," + searchVo.getLimitEnd());
}
wrapper.orderByDesc(BaseEntity::getCreateTime);
return baseMapper.selectList(wrapper);
}
private LambdaQueryWrapper buildQueryWrapper(SysUserRoleResSearchVo entity) {
LambdaQueryWrapper<SysUserRoleRes> wrapper = Wrappers.lambdaQuery();
if (ArrayUtil.isNotEmpty(entity.getCreateTimes())) {
wrapper.ge(SysUserRoleRes::getCreateTime, entity.getCreateTimes()[0])
.le(SysUserRoleRes::getCreateTime,
entity.getCreateTimes()[1]);
}
if (Common.isNotNull(entity.getCreateName())) {
wrapper.eq(SysUserRoleRes::getCreateName, entity.getCreateName());
}
return wrapper;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the yifu4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.permission.mapper.SysRoleInfoMapper">
<resultMap id="sysRoleInfoMap" type="com.yifu.cloud.plus.v1.yifu.permission.entity.SysRoleInfo">
<id property="fdId" column="fd_id"/>
<result property="roleName" column="role_name"/>
<result property="remark" column="remark"/>
<result property="status" column="status"/>
<result property="deleteFlag" column="delete_flag"/>
<result property="dataAuth" column="data_auth"/>
<result property="createBy" column="CREATE_BY"/>
<result property="createName" column="CREATE_NAME"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="updateBy" column="UPDATE_BY"/>
<result property="updateTime" column="UPDATE_TIME"/>
</resultMap>
<sql id="Base_Column_List">
a.fd_id,
a.role_name,
a.remark,
a.status,
a.delete_flag,
a.data_auth,
a.CREATE_BY,
a.CREATE_NAME,
a.CREATE_TIME,
a.UPDATE_BY,
a.UPDATE_TIME
</sql>
<sql id="sysRoleInfo_where">
<if test="sysRoleInfo != null">
<if test="sysRoleInfo.fdId != null and sysRoleInfo.fdId.trim() != ''">
AND a.fd_id = #{sysRoleInfo.fdId}
</if>
<if test="sysRoleInfo.roleName != null and sysRoleInfo.roleName.trim() != ''">
AND a.role_name = #{sysRoleInfo.roleName}
</if>
<if test="sysRoleInfo.remark != null and sysRoleInfo.remark.trim() != ''">
AND a.remark = #{sysRoleInfo.remark}
</if>
<if test="sysRoleInfo.status != null">
AND a.status = #{sysRoleInfo.status}
</if>
<if test="sysRoleInfo.deleteFlag != null">
AND a.delete_flag = #{sysRoleInfo.deleteFlag}
</if>
<if test="sysRoleInfo.dataAuth != null and sysRoleInfo.dataAuth.trim() != ''">
AND a.data_auth = #{sysRoleInfo.dataAuth}
</if>
<if test="sysRoleInfo.createBy != null and sysRoleInfo.createBy.trim() != ''">
AND a.CREATE_BY = #{sysRoleInfo.createBy}
</if>
<if test="sysRoleInfo.createName != null and sysRoleInfo.createName.trim() != ''">
AND a.CREATE_NAME = #{sysRoleInfo.createName}
</if>
<if test="sysRoleInfo.createTime != null">
AND a.CREATE_TIME = #{sysRoleInfo.createTime}
</if>
<if test="sysRoleInfo.updateBy != null and sysRoleInfo.updateBy.trim() != ''">
AND a.UPDATE_BY = #{sysRoleInfo.updateBy}
</if>
<if test="sysRoleInfo.updateTime != null">
AND a.UPDATE_TIME = #{sysRoleInfo.updateTime}
</if>
</if>
</sql>
<!--sysRoleInfo简单分页查询-->
<select id="getSysRoleInfoPage" resultMap="sysRoleInfoMap">
SELECT
<include refid="Base_Column_List"/>
FROM sys_role_info a
<where>
1=1
<include refid="sysRoleInfo_where"/>
</where>
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the yifu4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.permission.mapper.SysRoleMenuResMapper">
<resultMap id="sysRoleMenuResMap" type="com.yifu.cloud.plus.v1.yifu.permission.entity.SysRoleMenuRes">
<id property="fdId" column="fd_id"/>
<result property="roleId" column="role_id"/>
<result property="menuId" column="menu_id"/>
</resultMap>
<sql id="Base_Column_List">
a.fd_id,
a.role_id,
a.menu_id
</sql>
<sql id="sysRoleMenuRes_where">
<if test="sysRoleMenuRes != null">
<if test="sysRoleMenuRes.fdId != null and sysRoleMenuRes.fdId.trim() != ''">
AND a.fd_id = #{sysRoleMenuRes.fdId}
</if>
<if test="sysRoleMenuRes.roleId != null and sysRoleMenuRes.roleId.trim() != ''">
AND a.role_id = #{sysRoleMenuRes.roleId}
</if>
<if test="sysRoleMenuRes.menuId != null and sysRoleMenuRes.menuId.trim() != ''">
AND a.menu_id = #{sysRoleMenuRes.menuId}
</if>
</if>
</sql>
<!--sysRoleMenuRes简单分页查询-->
<select id="getSysRoleMenuResPage" resultMap="sysRoleMenuResMap">
SELECT
<include refid="Base_Column_List"/>
FROM sys_role_menu_res a
<where>
1=1
<include refid="sysRoleMenuRes_where"/>
</where>
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the yifu4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.permission.mapper.SysUserInfoMapper">
<resultMap id="sysUserInfoMap" type="com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserInfo">
<id property="fdId" column="fd_id"/>
<result property="fdName" column="fd_name"/>
<result property="fdLoginName" column="fd_login_name"/>
<result property="fdLdapDn" column="fd_ldap_dn"/>
<result property="fdDeptName" column="fd_dept_name"/>
<result property="fdMobileNo" column="fd_mobile_no"/>
<result property="fdEmail" column="fd_email"/>
<result property="status" column="status"/>
<result property="roleNames" column="role_names"/>
<result property="createBy" column="CREATE_BY"/>
<result property="createName" column="CREATE_NAME"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="updateBy" column="UPDATE_BY"/>
<result property="updateTime" column="UPDATE_TIME"/>
</resultMap>
<sql id="Base_Column_List">
a.fd_id,
a.fd_name,
a.fd_login_name,
a.fd_ldap_dn,
a.fd_dept_name,
a.fd_mobile_no,
a.fd_email,
a.status,
a.role_names,
a.CREATE_BY,
a.CREATE_NAME,
a.CREATE_TIME,
a.UPDATE_BY,
a.UPDATE_TIME
</sql>
<sql id="sysUserInfo_where">
<if test="sysUserInfo != null">
<if test="sysUserInfo.fdId != null and sysUserInfo.fdId.trim() != ''">
AND a.fd_id = #{sysUserInfo.fdId}
</if>
<if test="sysUserInfo.fdName != null and sysUserInfo.fdName.trim() != ''">
AND a.fd_name = #{sysUserInfo.fdName}
</if>
<if test="sysUserInfo.fdLoginName != null and sysUserInfo.fdLoginName.trim() != ''">
AND a.fd_login_name = #{sysUserInfo.fdLoginName}
</if>
<if test="sysUserInfo.fdLdapDn != null and sysUserInfo.fdLdapDn.trim() != ''">
AND a.fd_ldap_dn = #{sysUserInfo.fdLdapDn}
</if>
<if test="sysUserInfo.fdDeptName != null and sysUserInfo.fdDeptName.trim() != ''">
AND a.fd_dept_name = #{sysUserInfo.fdDeptName}
</if>
<if test="sysUserInfo.fdMobileNo != null and sysUserInfo.fdMobileNo.trim() != ''">
AND a.fd_mobile_no = #{sysUserInfo.fdMobileNo}
</if>
<if test="sysUserInfo.fdEmail != null and sysUserInfo.fdEmail.trim() != ''">
AND a.fd_email = #{sysUserInfo.fdEmail}
</if>
<if test="sysUserInfo.status != null">
AND a.status = #{sysUserInfo.status}
</if>
<if test="sysUserInfo.roleNames != null and sysUserInfo.roleNames.trim() != ''">
AND a.role_names = #{sysUserInfo.roleNames}
</if>
<if test="sysUserInfo.createBy != null and sysUserInfo.createBy.trim() != ''">
AND a.CREATE_BY = #{sysUserInfo.createBy}
</if>
<if test="sysUserInfo.createName != null and sysUserInfo.createName.trim() != ''">
AND a.CREATE_NAME = #{sysUserInfo.createName}
</if>
<if test="sysUserInfo.createTime != null">
AND a.CREATE_TIME = #{sysUserInfo.createTime}
</if>
<if test="sysUserInfo.updateBy != null and sysUserInfo.updateBy.trim() != ''">
AND a.UPDATE_BY = #{sysUserInfo.updateBy}
</if>
<if test="sysUserInfo.updateTime != null">
AND a.UPDATE_TIME = #{sysUserInfo.updateTime}
</if>
</if>
</sql>
<!--sysUserInfo简单分页查询-->
<select id="getSysUserInfoPage" resultMap="sysUserInfoMap">
SELECT
<include refid="Base_Column_List"/>
FROM sys_user_info a
<where>
1=1
<include refid="sysUserInfo_where"/>
</where>
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the yifu4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.permission.mapper.SysUserRoleResMapper">
<resultMap id="sysUserRoleResMap" type="com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserRoleRes">
<id property="fdId" column="fd_id"/>
<result property="userId" column="user_id"/>
<result property="roleId" column="role_id"/>
</resultMap>
<sql id="Base_Column_List">
a.fd_id,
a.user_id,
a.role_id
</sql>
<sql id="sysUserRoleRes_where">
<if test="sysUserRoleRes != null">
<if test="sysUserRoleRes.fdId != null and sysUserRoleRes.fdId.trim() != ''">
AND a.fd_id = #{sysUserRoleRes.fdId}
</if>
<if test="sysUserRoleRes.userId != null and sysUserRoleRes.userId.trim() != ''">
AND a.user_id = #{sysUserRoleRes.userId}
</if>
<if test="sysUserRoleRes.roleId != null and sysUserRoleRes.roleId.trim() != ''">
AND a.role_id = #{sysUserRoleRes.roleId}
</if>
</if>
</sql>
<!--sysUserRoleRes简单分页查询-->
<select id="getSysUserRoleResPage" resultMap="sysUserRoleResMap">
SELECT
<include refid="Base_Column_List"/>
FROM sys_user_role_res a
<where>
1=1
<include refid="sysUserRoleRes_where"/>
</where>
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment