feat: 修改模块名称
This commit is contained in:
55
qing-yu-club-auth/qing-yu-club-auth-infra/pom.xml
Normal file
55
qing-yu-club-auth/qing-yu-club-auth-infra/pom.xml
Normal file
@@ -0,0 +1,55 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.landaiqing</groupId>
|
||||
<artifactId>qing-yu-club-auth</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>qing-yu-club-auth-infra</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>qing-yu-club-auth-infra</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<!--jdbcStarter-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-jdbc</artifactId>
|
||||
<version>2.4.2</version>
|
||||
</dependency>
|
||||
<!--druid连接池-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid-spring-boot-starter</artifactId>
|
||||
<version>1.1.21</version>
|
||||
</dependency>
|
||||
<!--mysql-->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>8.0.33</version>
|
||||
</dependency>
|
||||
<!--mybatis plus-->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<version>3.4.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.landaiqing</groupId>
|
||||
<artifactId>qing-yu-club-auth-common</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
@@ -0,0 +1,52 @@
|
||||
package com.landaiqing.auth.infra.basic.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* (AuthPermission)实体类
|
||||
*/
|
||||
@Data
|
||||
public class AuthPermission implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String name;
|
||||
|
||||
private Long parentId;
|
||||
|
||||
private Integer type;
|
||||
|
||||
private String menuUrl;
|
||||
|
||||
private Integer status;
|
||||
|
||||
private Integer show;
|
||||
|
||||
private String icon;
|
||||
|
||||
private String permissionKey;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createdBy;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createdTime;
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private String updateBy;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
private Integer isDeleted;
|
||||
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,38 @@
|
||||
package com.landaiqing.auth.infra.basic.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* (AuthRole)实体类
|
||||
*/
|
||||
@Data
|
||||
public class AuthRole implements Serializable {
|
||||
private Long id;
|
||||
|
||||
private String roleName;
|
||||
|
||||
private String roleKey;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createdBy;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createdTime;
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private String updateBy;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
private Integer isDeleted;
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,40 @@
|
||||
package com.landaiqing.auth.infra.basic.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* (AuthRolePermission)实体类
|
||||
*/
|
||||
@Data
|
||||
public class AuthRolePermission implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private Long roleId;
|
||||
|
||||
private Long permissionId;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createdBy;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createdTime;
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private String updateBy;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
private Integer isDeleted;
|
||||
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,56 @@
|
||||
package com.landaiqing.auth.infra.basic.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* (AuthUser)实体类
|
||||
*/
|
||||
@Data
|
||||
public class AuthUser implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String userName;
|
||||
|
||||
private String nickName;
|
||||
|
||||
private String email;
|
||||
|
||||
private String phone;
|
||||
|
||||
private String password;
|
||||
|
||||
private Integer sex;
|
||||
|
||||
private String avatar;
|
||||
|
||||
private Integer status;
|
||||
|
||||
private String introduce;
|
||||
|
||||
private String extJson;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createdBy;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createdTime;
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private String updateBy;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
private Integer isDeleted;
|
||||
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,39 @@
|
||||
package com.landaiqing.auth.infra.basic.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* (AuthUserRole)实体类
|
||||
*/
|
||||
@Data
|
||||
public class AuthUserRole implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private Long userId;
|
||||
|
||||
private Long roleId;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createdBy;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createdTime;
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private String updateBy;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
private Integer isDeleted;
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,84 @@
|
||||
package com.landaiqing.auth.infra.basic.mapper;
|
||||
|
||||
import com.landaiqing.auth.infra.basic.entity.AuthPermission;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (AuthPermission)表数据库访问层
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-2-18 18:55:50
|
||||
*/
|
||||
public interface AuthPermissionDao {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
AuthPermission queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询指定行数据
|
||||
*
|
||||
* @param authPermission 查询条件
|
||||
* @return 对象列表
|
||||
*/
|
||||
List<AuthPermission> queryAllByLimit(AuthPermission authPermission);
|
||||
|
||||
/**
|
||||
* 统计总行数
|
||||
*
|
||||
* @param authPermission 查询条件
|
||||
* @return 总行数
|
||||
*/
|
||||
long count(AuthPermission authPermission);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param authPermission 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insert(AuthPermission authPermission);
|
||||
|
||||
/**
|
||||
* 批量新增数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<AuthPermission> 实例对象列表
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insertBatch(@Param("entities") List<AuthPermission> entities);
|
||||
|
||||
/**
|
||||
* 批量新增或按主键更新数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<AuthPermission> 实例对象列表
|
||||
* @return 影响行数
|
||||
* @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
|
||||
*/
|
||||
int insertOrUpdateBatch(@Param("entities") List<AuthPermission> entities);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param authPermission 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int update(AuthPermission authPermission);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 影响行数
|
||||
*/
|
||||
int deleteById(Long id);
|
||||
|
||||
List<AuthPermission> queryByRoleList(@Param("list") List<Long> roleIdList);
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,84 @@
|
||||
package com.landaiqing.auth.infra.basic.mapper;
|
||||
|
||||
import com.landaiqing.auth.infra.basic.entity.AuthRole;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (AuthRole)表数据库访问层
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-2-18 18:55:50
|
||||
*/
|
||||
public interface AuthRoleDao {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
AuthRole queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询指定行数据
|
||||
*
|
||||
* @param authRole 查询条件
|
||||
* @return 对象列表
|
||||
*/
|
||||
AuthRole queryAllByLimit(AuthRole authRole);
|
||||
|
||||
/**
|
||||
* 统计总行数
|
||||
*
|
||||
* @param authRole 查询条件
|
||||
* @return 总行数
|
||||
*/
|
||||
long count(AuthRole authRole);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param authRole 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insert(AuthRole authRole);
|
||||
|
||||
/**
|
||||
* 批量新增数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<AuthRole> 实例对象列表
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insertBatch(@Param("entities") List<AuthRole> entities);
|
||||
|
||||
/**
|
||||
* 批量新增或按主键更新数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<AuthRole> 实例对象列表
|
||||
* @return 影响行数
|
||||
* @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
|
||||
*/
|
||||
int insertOrUpdateBatch(@Param("entities") List<AuthRole> entities);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param authRole 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int update(AuthRole authRole);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 影响行数
|
||||
*/
|
||||
int deleteById(Long id);
|
||||
|
||||
List<AuthRole> queryByRoleList(@Param("list") List<Long> roleIdList);
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,82 @@
|
||||
package com.landaiqing.auth.infra.basic.mapper;
|
||||
|
||||
import com.landaiqing.auth.infra.basic.entity.AuthRolePermission;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (AuthRolePermission)表数据库访问层
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-2-18 18:55:50
|
||||
*/
|
||||
public interface AuthRolePermissionDao {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
AuthRolePermission queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询指定行数据
|
||||
*
|
||||
* @param authRolePermission 查询条件
|
||||
* @return 对象列表
|
||||
*/
|
||||
List<AuthRolePermission> queryAllByLimit(AuthRolePermission authRolePermission);
|
||||
|
||||
/**
|
||||
* 统计总行数
|
||||
*
|
||||
* @param authRolePermission 查询条件
|
||||
* @return 总行数
|
||||
*/
|
||||
long count(AuthRolePermission authRolePermission);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param authRolePermission 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insert(AuthRolePermission authRolePermission);
|
||||
|
||||
/**
|
||||
* 批量新增数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<AuthRolePermission> 实例对象列表
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insertBatch(@Param("entities") List<AuthRolePermission> entities);
|
||||
|
||||
/**
|
||||
* 批量新增或按主键更新数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<AuthRolePermission> 实例对象列表
|
||||
* @return 影响行数
|
||||
* @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
|
||||
*/
|
||||
int insertOrUpdateBatch(@Param("entities") List<AuthRolePermission> entities);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param authRolePermission 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int update(AuthRolePermission authRolePermission);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 影响行数
|
||||
*/
|
||||
int deleteById(Long id);
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,84 @@
|
||||
package com.landaiqing.auth.infra.basic.mapper;
|
||||
|
||||
import com.landaiqing.auth.infra.basic.entity.AuthUser;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (AuthUser)表数据库访问层
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-2-18 18:55:50
|
||||
*/
|
||||
public interface AuthUserDao {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
AuthUser queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询指定行数据
|
||||
*
|
||||
* @param authUser 查询条件
|
||||
* @return 对象列表
|
||||
*/
|
||||
List<AuthUser> queryAllByLimit(AuthUser authUser);
|
||||
|
||||
/**
|
||||
* 统计总行数
|
||||
*
|
||||
* @param authUser 查询条件
|
||||
* @return 总行数
|
||||
*/
|
||||
long count(AuthUser authUser);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param authUser 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insert(AuthUser authUser);
|
||||
|
||||
/**
|
||||
* 批量新增数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<AuthUser> 实例对象列表
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insertBatch(@Param("entities") List<AuthUser> entities);
|
||||
|
||||
/**
|
||||
* 批量新增或按主键更新数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<AuthUser> 实例对象列表
|
||||
* @return 影响行数
|
||||
* @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
|
||||
*/
|
||||
int insertOrUpdateBatch(@Param("entities") List<AuthUser> entities);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param authUser 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int update(AuthUser authUser);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 影响行数
|
||||
*/
|
||||
int deleteById(Long id);
|
||||
|
||||
Integer updateByUserName(AuthUser authUser);
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,82 @@
|
||||
package com.landaiqing.auth.infra.basic.mapper;
|
||||
|
||||
import com.landaiqing.auth.infra.basic.entity.AuthUserRole;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (AuthUserRole)表数据库访问层
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-2-18 18:55:50
|
||||
*/
|
||||
public interface AuthUserRoleDao {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
AuthUserRole queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询指定行数据
|
||||
*
|
||||
* @param authUserRole 查询条件
|
||||
* @return 对象列表
|
||||
*/
|
||||
List<AuthUserRole> queryAllByLimit(AuthUserRole authUserRole);
|
||||
|
||||
/**
|
||||
* 统计总行数
|
||||
*
|
||||
* @param authUserRole 查询条件
|
||||
* @return 总行数
|
||||
*/
|
||||
long count(AuthUserRole authUserRole);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param authUserRole 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insert(AuthUserRole authUserRole);
|
||||
|
||||
/**
|
||||
* 批量新增数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<AuthUserRole> 实例对象列表
|
||||
* @return 影响行数
|
||||
*/
|
||||
int insertBatch(@Param("entities") List<AuthUserRole> entities);
|
||||
|
||||
/**
|
||||
* 批量新增或按主键更新数据(MyBatis原生foreach方法)
|
||||
*
|
||||
* @param entities List<AuthUserRole> 实例对象列表
|
||||
* @return 影响行数
|
||||
* @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
|
||||
*/
|
||||
int insertOrUpdateBatch(@Param("entities") List<AuthUserRole> entities);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param authUserRole 实例对象
|
||||
* @return 影响行数
|
||||
*/
|
||||
int update(AuthUserRole authUserRole);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 影响行数
|
||||
*/
|
||||
int deleteById(Long id);
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,50 @@
|
||||
package com.landaiqing.auth.infra.basic.service;
|
||||
|
||||
import com.landaiqing.auth.infra.basic.entity.AuthPermission;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (AuthPermission)表服务接口
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-2-18 18:55:50
|
||||
*/
|
||||
public interface AuthPermissionService {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
AuthPermission queryById(Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param authPermission 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
int insert(AuthPermission authPermission);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param authPermission 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
int update(AuthPermission authPermission);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean deleteById(Long id);
|
||||
|
||||
List<AuthPermission> queryByRoleList(List<Long> roleIdList);
|
||||
|
||||
}
|
@@ -0,0 +1,52 @@
|
||||
package com.landaiqing.auth.infra.basic.service;
|
||||
|
||||
import com.landaiqing.auth.infra.basic.entity.AuthRolePermission;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (AuthRolePermission)表服务接口
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-2-18 18:55:50
|
||||
*/
|
||||
public interface AuthRolePermissionService {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
AuthRolePermission queryById(Long id);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param authRolePermission 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
AuthRolePermission insert(AuthRolePermission authRolePermission);
|
||||
|
||||
int batchInsert(List<AuthRolePermission> authRolePermissionList);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param authRolePermission 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
AuthRolePermission update(AuthRolePermission authRolePermission);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean deleteById(Long id);
|
||||
|
||||
List<AuthRolePermission> queryByCondition(AuthRolePermission authRolePermission);
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,55 @@
|
||||
package com.landaiqing.auth.infra.basic.service;
|
||||
|
||||
import com.landaiqing.auth.infra.basic.entity.AuthRole;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (AuthRole)表服务接口
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-2-18 18:55:50
|
||||
*/
|
||||
public interface AuthRoleService {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
AuthRole queryById(Long id);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param authRole 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
Integer insert(AuthRole authRole);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param authRole 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
Integer update(AuthRole authRole);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean deleteById(Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 根据条件查询角色
|
||||
*/
|
||||
AuthRole queryByCondition(AuthRole authRole);
|
||||
|
||||
List<AuthRole> queryByRoleList(List<Long> roleIdList);
|
||||
|
||||
}
|
@@ -0,0 +1,45 @@
|
||||
package com.landaiqing.auth.infra.basic.service;
|
||||
|
||||
import com.landaiqing.auth.infra.basic.entity.AuthUserRole;
|
||||
|
||||
/**
|
||||
* (AuthUserRole)表服务接口
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-2-18 18:55:50
|
||||
*/
|
||||
public interface AuthUserRoleService {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
AuthUserRole queryById(Long id);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param authUserRole 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
AuthUserRole insert(AuthUserRole authUserRole);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param authUserRole 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
AuthUserRole update(AuthUserRole authUserRole);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean deleteById(Long id);
|
||||
|
||||
}
|
@@ -0,0 +1,54 @@
|
||||
package com.landaiqing.auth.infra.basic.service;
|
||||
|
||||
import com.landaiqing.auth.infra.basic.entity.AuthUser;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (AuthUser)表服务接口
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-2-18 18:55:50
|
||||
*/
|
||||
public interface AuthUserService {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
AuthUser queryById(Long id);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param authUser 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
Integer insert(AuthUser authUser);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param authUser 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
Integer update(AuthUser authUser);
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean deleteById(Long id);
|
||||
|
||||
/**
|
||||
* 根据条件查询数量
|
||||
*/
|
||||
List<AuthUser> queryByCondition(AuthUser authUser);
|
||||
|
||||
Integer updateByUserName(AuthUser authUser);
|
||||
|
||||
}
|
@@ -0,0 +1,69 @@
|
||||
package com.landaiqing.auth.infra.basic.service.impl;
|
||||
|
||||
import com.landaiqing.auth.infra.basic.entity.AuthPermission;
|
||||
import com.landaiqing.auth.infra.basic.mapper.AuthPermissionDao;
|
||||
import com.landaiqing.auth.infra.basic.service.AuthPermissionService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (AuthPermission)表服务实现类
|
||||
*
|
||||
* @author landaiqing
|
||||
*/
|
||||
@Service("authPermissionService")
|
||||
public class AuthPermissionServiceImpl implements AuthPermissionService {
|
||||
@Resource
|
||||
private AuthPermissionDao authPermissionDao;
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public AuthPermission queryById(Long id) {
|
||||
return this.authPermissionDao.queryById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param authPermission 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public int insert(AuthPermission authPermission) {
|
||||
return this.authPermissionDao.insert(authPermission);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param authPermission 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public int update(AuthPermission authPermission) {
|
||||
return this.authPermissionDao.update(authPermission);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteById(Long id) {
|
||||
return this.authPermissionDao.deleteById(id) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AuthPermission> queryByRoleList(List<Long> roleIdList) {
|
||||
return this.authPermissionDao.queryByRoleList(roleIdList);
|
||||
}
|
||||
}
|
@@ -0,0 +1,78 @@
|
||||
package com.landaiqing.auth.infra.basic.service.impl;
|
||||
|
||||
import com.landaiqing.auth.infra.basic.entity.AuthRolePermission;
|
||||
import com.landaiqing.auth.infra.basic.mapper.AuthRolePermissionDao;
|
||||
import com.landaiqing.auth.infra.basic.service.AuthRolePermissionService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (AuthRolePermission)表服务实现类
|
||||
*
|
||||
* @author landaiqing
|
||||
*/
|
||||
@Service("authRolePermissionService")
|
||||
public class AuthRolePermissionServiceImpl implements AuthRolePermissionService {
|
||||
@Resource
|
||||
private AuthRolePermissionDao authRolePermissionDao;
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public AuthRolePermission queryById(Long id) {
|
||||
return this.authRolePermissionDao.queryById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param authRolePermission 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public AuthRolePermission insert(AuthRolePermission authRolePermission) {
|
||||
this.authRolePermissionDao.insert(authRolePermission);
|
||||
return authRolePermission;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int batchInsert(List<AuthRolePermission> authRolePermissionList) {
|
||||
return this.authRolePermissionDao.insertBatch(authRolePermissionList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param authRolePermission 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public AuthRolePermission update(AuthRolePermission authRolePermission) {
|
||||
this.authRolePermissionDao.update(authRolePermission);
|
||||
return this.queryById(authRolePermission.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteById(Long id) {
|
||||
return this.authRolePermissionDao.deleteById(id) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AuthRolePermission> queryByCondition(AuthRolePermission authRolePermission) {
|
||||
return this.authRolePermissionDao.queryAllByLimit(authRolePermission);
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,75 @@
|
||||
package com.landaiqing.auth.infra.basic.service.impl;
|
||||
|
||||
import com.landaiqing.auth.infra.basic.entity.AuthRole;
|
||||
import com.landaiqing.auth.infra.basic.mapper.AuthRoleDao;
|
||||
import com.landaiqing.auth.infra.basic.service.AuthRoleService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (AuthRole)表服务实现类
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-2-18 18:55:50
|
||||
*/
|
||||
@Service("authRoleService")
|
||||
public class AuthRoleServiceImpl implements AuthRoleService {
|
||||
@Resource
|
||||
private AuthRoleDao authRoleDao;
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public AuthRole queryById(Long id) {
|
||||
return this.authRoleDao.queryById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param authRole 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public Integer insert(AuthRole authRole) {
|
||||
return this.authRoleDao.insert(authRole);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param authRole 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public Integer update(AuthRole authRole) {
|
||||
return this.authRoleDao.update(authRole);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteById(Long id) {
|
||||
return this.authRoleDao.deleteById(id) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AuthRole queryByCondition(AuthRole authRole) {
|
||||
return authRoleDao.queryAllByLimit(authRole);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AuthRole> queryByRoleList(List<Long> roleIdList) {
|
||||
return authRoleDao.queryByRoleList(roleIdList);
|
||||
}
|
||||
}
|
@@ -0,0 +1,65 @@
|
||||
package com.landaiqing.auth.infra.basic.service.impl;
|
||||
|
||||
import com.landaiqing.auth.infra.basic.entity.AuthUserRole;
|
||||
import com.landaiqing.auth.infra.basic.mapper.AuthUserRoleDao;
|
||||
import com.landaiqing.auth.infra.basic.service.AuthUserRoleService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* (AuthUserRole)表服务实现类
|
||||
*
|
||||
* @author landaiqing
|
||||
*/
|
||||
@Service("authUserRoleService")
|
||||
public class AuthUserRoleServiceImpl implements AuthUserRoleService {
|
||||
@Resource
|
||||
private AuthUserRoleDao authUserRoleDao;
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public AuthUserRole queryById(Long id) {
|
||||
return this.authUserRoleDao.queryById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param authUserRole 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public AuthUserRole insert(AuthUserRole authUserRole) {
|
||||
this.authUserRoleDao.insert(authUserRole);
|
||||
return authUserRole;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param authUserRole 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public AuthUserRole update(AuthUserRole authUserRole) {
|
||||
this.authUserRoleDao.update(authUserRole);
|
||||
return this.queryById(authUserRole.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteById(Long id) {
|
||||
return this.authUserRoleDao.deleteById(id) > 0;
|
||||
}
|
||||
}
|
@@ -0,0 +1,75 @@
|
||||
package com.landaiqing.auth.infra.basic.service.impl;
|
||||
|
||||
import com.landaiqing.auth.infra.basic.entity.AuthUser;
|
||||
import com.landaiqing.auth.infra.basic.mapper.AuthUserDao;
|
||||
import com.landaiqing.auth.infra.basic.service.AuthUserService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (AuthUser)表服务实现类
|
||||
*
|
||||
* @author landaiqing
|
||||
*/
|
||||
@Service("authUserService")
|
||||
public class AuthUserServiceImpl implements AuthUserService {
|
||||
@Resource
|
||||
private AuthUserDao authUserDao;
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public AuthUser queryById(Long id) {
|
||||
return this.authUserDao.queryById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
*
|
||||
* @param authUser 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public Integer insert(AuthUser authUser) {
|
||||
return this.authUserDao.insert(authUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
*
|
||||
* @param authUser 实例对象
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public Integer update(AuthUser authUser) {
|
||||
return this.authUserDao.update(authUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过主键删除数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteById(Long id) {
|
||||
return this.authUserDao.deleteById(id) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AuthUser> queryByCondition(AuthUser authUser) {
|
||||
return this.authUserDao.queryAllByLimit(authUser);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer updateByUserName(AuthUser authUser) {
|
||||
return this.authUserDao.updateByUserName(authUser);
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,51 @@
|
||||
package com.landaiqing.auth.infra.basic.utils;
|
||||
|
||||
import com.alibaba.druid.filter.config.ConfigTools;
|
||||
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.NoSuchProviderException;
|
||||
|
||||
/**
|
||||
* 数据库加密util
|
||||
*
|
||||
* @author: landaiqing
|
||||
* @date: 2024-2-18 18:55:50
|
||||
*/
|
||||
public class DruidEncryptUtil {
|
||||
|
||||
private static String publicKey;
|
||||
|
||||
private static String privateKey;
|
||||
|
||||
static {
|
||||
try {
|
||||
String[] keyPair = ConfigTools.genKeyPair(512);
|
||||
privateKey = keyPair[0];
|
||||
System.out.println("privateKey:" + privateKey);
|
||||
publicKey = keyPair[1];
|
||||
System.out.println("publicKey:" + publicKey);
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
e.printStackTrace();
|
||||
} catch (NoSuchProviderException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static String encrypt(String plainText) throws Exception {
|
||||
String encrypt = ConfigTools.encrypt(privateKey, plainText);
|
||||
System.out.println("encrypt:" + encrypt);
|
||||
return encrypt;
|
||||
}
|
||||
|
||||
public static String decrypt(String encryptText) throws Exception {
|
||||
String decrypt = ConfigTools.decrypt(publicKey, encryptText);
|
||||
System.out.println("decrypt:" + decrypt);
|
||||
return decrypt;
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
String encrypt = encrypt("123456");
|
||||
System.out.println("encrypt:" + encrypt);
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,17 @@
|
||||
package com.landaiqing.auth.infra.config;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
public class MybatisConfiguration {
|
||||
|
||||
@Bean
|
||||
public MybatisPlusInterceptor mybatisPlusInterceptor(){
|
||||
MybatisPlusInterceptor mybatisPlusInterceptor = new MybatisPlusInterceptor();
|
||||
mybatisPlusInterceptor.addInnerInterceptor(new MybatisPlusAllSqlLog());
|
||||
return mybatisPlusInterceptor;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,116 @@
|
||||
package com.landaiqing.auth.infra.config;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.inner.InnerInterceptor;
|
||||
import org.apache.ibatis.executor.Executor;
|
||||
import org.apache.ibatis.mapping.BoundSql;
|
||||
import org.apache.ibatis.mapping.MappedStatement;
|
||||
import org.apache.ibatis.mapping.ParameterMapping;
|
||||
import org.apache.ibatis.reflection.MetaObject;
|
||||
import org.apache.ibatis.session.Configuration;
|
||||
import org.apache.ibatis.session.ResultHandler;
|
||||
import org.apache.ibatis.session.RowBounds;
|
||||
import org.apache.ibatis.type.TypeHandlerRegistry;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.text.DateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.regex.Matcher;
|
||||
|
||||
public class MybatisPlusAllSqlLog implements InnerInterceptor {
|
||||
public static final Logger log = LoggerFactory.getLogger("sys-sql");
|
||||
|
||||
@Override
|
||||
public void beforeQuery(Executor executor, MappedStatement ms, Object parameter, RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql) throws SQLException {
|
||||
logInfo(boundSql, ms, parameter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeUpdate(Executor executor, MappedStatement ms, Object parameter) throws SQLException {
|
||||
BoundSql boundSql = ms.getBoundSql(parameter);
|
||||
logInfo(boundSql, ms, parameter);
|
||||
}
|
||||
|
||||
private static void logInfo(BoundSql boundSql, MappedStatement ms, Object parameter) {
|
||||
try {
|
||||
log.info("parameter = " + parameter);
|
||||
// 获取到节点的id,即sql语句的id
|
||||
String sqlId = ms.getId();
|
||||
log.info("sqlId = " + sqlId);
|
||||
// 获取节点的配置
|
||||
Configuration configuration = ms.getConfiguration();
|
||||
// 获取到最终的sql语句
|
||||
String sql = getSql(configuration, boundSql, sqlId);
|
||||
log.info("完整的sql:{}", sql);
|
||||
} catch (Exception e) {
|
||||
log.error("异常:{}", e.getLocalizedMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
// 封装了一下sql语句,使得结果返回完整xml路径下的sql语句节点id + sql语句
|
||||
public static String getSql(Configuration configuration, BoundSql boundSql, String sqlId) {
|
||||
return sqlId + ":" + showSql(configuration, boundSql);
|
||||
}
|
||||
|
||||
// 进行?的替换
|
||||
public static String showSql(Configuration configuration, BoundSql boundSql) {
|
||||
// 获取参数
|
||||
Object parameterObject = boundSql.getParameterObject();
|
||||
List<ParameterMapping> parameterMappings = boundSql.getParameterMappings();
|
||||
// sql语句中多个空格都用一个空格代替
|
||||
String sql = boundSql.getSql().replaceAll("[\\s]+", " ");
|
||||
if (!CollectionUtils.isEmpty(parameterMappings) && parameterObject != null) {
|
||||
// 获取类型处理器注册器,类型处理器的功能是进行java类型和数据库类型的转换
|
||||
TypeHandlerRegistry typeHandlerRegistry = configuration.getTypeHandlerRegistry();
|
||||
// 如果根据parameterObject.getClass()可以找到对应的类型,则替换
|
||||
if (typeHandlerRegistry.hasTypeHandler(parameterObject.getClass())) {
|
||||
sql = sql.replaceFirst("\\?",
|
||||
Matcher.quoteReplacement(getParameterValue(parameterObject)));
|
||||
} else {
|
||||
// MetaObject主要是封装了originalObject对象,提供了get和set的方法用于获取和设置originalObject的属性值,主要支持对JavaBean、Collection、Map三种类型对象的操作
|
||||
MetaObject metaObject = configuration.newMetaObject(parameterObject);
|
||||
for (ParameterMapping parameterMapping : parameterMappings) {
|
||||
String propertyName = parameterMapping.getProperty();
|
||||
if (metaObject.hasGetter(propertyName)) {
|
||||
Object obj = metaObject.getValue(propertyName);
|
||||
sql = sql.replaceFirst("\\?",
|
||||
Matcher.quoteReplacement(getParameterValue(obj)));
|
||||
} else if (boundSql.hasAdditionalParameter(propertyName)) {
|
||||
// 该分支是动态sql
|
||||
Object obj = boundSql.getAdditionalParameter(propertyName);
|
||||
sql = sql.replaceFirst("\\?",
|
||||
Matcher.quoteReplacement(getParameterValue(obj)));
|
||||
} else {
|
||||
// 打印出缺失,提醒该参数缺失并防止错位
|
||||
sql = sql.replaceFirst("\\?", "缺失");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return sql;
|
||||
}
|
||||
|
||||
// 如果参数是String,则添加单引号, 如果是日期,则转换为时间格式器并加单引号; 对参数是null和不是null的情况作了处理
|
||||
private static String getParameterValue(Object obj) {
|
||||
String value;
|
||||
if (obj instanceof String) {
|
||||
value = "'" + obj.toString() + "'";
|
||||
} else if (obj instanceof Date) {
|
||||
DateFormat formatter = DateFormat.getDateTimeInstance(DateFormat.DEFAULT,
|
||||
DateFormat.DEFAULT, Locale.CHINA);
|
||||
value = "'" + formatter.format(new Date()) + "'";
|
||||
} else {
|
||||
if (obj != null) {
|
||||
value = obj.toString();
|
||||
} else {
|
||||
value = "";
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,52 @@
|
||||
package com.landaiqing.auth.infra.config;
|
||||
|
||||
import org.apache.ibatis.cache.CacheKey;
|
||||
import org.apache.ibatis.executor.Executor;
|
||||
import org.apache.ibatis.mapping.BoundSql;
|
||||
import org.apache.ibatis.mapping.MappedStatement;
|
||||
import org.apache.ibatis.plugin.*;
|
||||
import org.apache.ibatis.session.ResultHandler;
|
||||
import org.apache.ibatis.session.RowBounds;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
|
||||
@Intercepts({
|
||||
@Signature(type = Executor.class, method = "update", args = {MappedStatement.class,
|
||||
Object.class}),
|
||||
@Signature(type = Executor.class, method = "query", args = {MappedStatement.class,
|
||||
Object.class, RowBounds.class, ResultHandler.class, CacheKey.class, BoundSql.class})})
|
||||
public class SqlStatementInterceptor implements Interceptor {
|
||||
|
||||
public static final Logger log = LoggerFactory.getLogger("sys-sql");
|
||||
|
||||
@Override
|
||||
public Object intercept(Invocation invocation) throws Throwable {
|
||||
long startTime = System.currentTimeMillis();
|
||||
try {
|
||||
return invocation.proceed();
|
||||
} finally {
|
||||
long timeConsuming = System.currentTimeMillis() - startTime;
|
||||
log.info("执行SQL:{}ms", timeConsuming);
|
||||
if (timeConsuming > 999 && timeConsuming < 5000) {
|
||||
log.info("执行SQL大于1s:{}ms", timeConsuming);
|
||||
} else if (timeConsuming >= 5000 && timeConsuming < 10000) {
|
||||
log.info("执行SQL大于5s:{}ms", timeConsuming);
|
||||
} else if (timeConsuming >= 10000) {
|
||||
log.info("执行SQL大于10s:{}ms", timeConsuming);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object plugin(Object target) {
|
||||
return Plugin.wrap(target, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setProperties(Properties properties) {
|
||||
|
||||
}
|
||||
}
|
@@ -0,0 +1,232 @@
|
||||
<?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="com.landaiqing.auth.infra.basic.mapper.AuthPermissionDao">
|
||||
|
||||
<resultMap type="com.landaiqing.auth.infra.basic.entity.AuthPermission" id="AuthPermissionMap">
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="name" column="name" jdbcType="VARCHAR"/>
|
||||
<result property="parentId" column="parent_id" jdbcType="INTEGER"/>
|
||||
<result property="type" column="type" jdbcType="INTEGER"/>
|
||||
<result property="menuUrl" column="menu_url" jdbcType="VARCHAR"/>
|
||||
<result property="status" column="status" jdbcType="INTEGER"/>
|
||||
<result property="show" column="show" jdbcType="INTEGER"/>
|
||||
<result property="icon" column="icon" jdbcType="VARCHAR"/>
|
||||
<result property="permissionKey" column="permission_key" jdbcType="VARCHAR"/>
|
||||
<result property="createdBy" column="created_by" jdbcType="VARCHAR"/>
|
||||
<result property="createdTime" column="created_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="isDeleted" column="is_deleted" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
<!--查询单个-->
|
||||
<select id="queryById" resultMap="AuthPermissionMap">
|
||||
select id,
|
||||
name,
|
||||
parent_id,
|
||||
type,
|
||||
menu_url,
|
||||
status, `show`, icon, permission_key, created_by, created_time, update_by, update_time, is_deleted
|
||||
from auth_permission
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<!--查询指定行数据-->
|
||||
<select id="queryAllByLimit" resultMap="AuthPermissionMap">
|
||||
select
|
||||
id, name, parent_id, type, menu_url, status, `show`, icon, permission_key, created_by, created_time, update_by,
|
||||
update_time, is_deleted
|
||||
from auth_permission
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
and name = #{name}
|
||||
</if>
|
||||
<if test="parentId != null">
|
||||
and parent_id = #{parentId}
|
||||
</if>
|
||||
<if test="type != null">
|
||||
and type = #{type}
|
||||
</if>
|
||||
<if test="menuUrl != null and menuUrl != ''">
|
||||
and menu_url = #{menuUrl}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
and status = #{status}
|
||||
</if>
|
||||
<if test="show != null">
|
||||
and show = #{show}
|
||||
</if>
|
||||
<if test="icon != null and icon != ''">
|
||||
and icon = #{icon}
|
||||
</if>
|
||||
<if test="permissionKey != null and permissionKey != ''">
|
||||
and permission_key = #{permissionKey}
|
||||
</if>
|
||||
<if test="createdBy != null and createdBy != ''">
|
||||
and created_by = #{createdBy}
|
||||
</if>
|
||||
<if test="createdTime != null">
|
||||
and created_time = #{createdTime}
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
and update_by = #{updateBy}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
and update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="isDeleted != null">
|
||||
and is_deleted = #{isDeleted}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!--统计总行数-->
|
||||
<select id="count" resultType="java.lang.Long">
|
||||
select count(1)
|
||||
from auth_permission
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
and name = #{name}
|
||||
</if>
|
||||
<if test="parentId != null">
|
||||
and parent_id = #{parentId}
|
||||
</if>
|
||||
<if test="type != null">
|
||||
and type = #{type}
|
||||
</if>
|
||||
<if test="menuUrl != null and menuUrl != ''">
|
||||
and menu_url = #{menuUrl}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
and status = #{status}
|
||||
</if>
|
||||
<if test="show != null">
|
||||
and show = #{show}
|
||||
</if>
|
||||
<if test="icon != null and icon != ''">
|
||||
and icon = #{icon}
|
||||
</if>
|
||||
<if test="permissionKey != null and permissionKey != ''">
|
||||
and permission_key = #{permissionKey}
|
||||
</if>
|
||||
<if test="createdBy != null and createdBy != ''">
|
||||
and created_by = #{createdBy}
|
||||
</if>
|
||||
<if test="createdTime != null">
|
||||
and created_time = #{createdTime}
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
and update_by = #{updateBy}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
and update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="isDeleted != null">
|
||||
and is_deleted = #{isDeleted}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="queryByRoleList" resultMap="AuthPermissionMap">
|
||||
select * from auth_permission
|
||||
where id in
|
||||
<foreach open="(" close=")" collection="list" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into auth_permission(name, parent_id, `type`, menu_url, status, `show`, icon, permission_key, created_by, created_time, update_by, update_time, is_deleted)
|
||||
values (#{name}, #{parentId}, #{type}, #{menuUrl}, #{status}, #{show}, #{icon}, #{permissionKey}, #{createdBy}, #{createdTime}, #{updateBy}, #{updateTime}, #{isDeleted})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into auth_permission(name, parent_id, `type`, menu_url, status, `show`, icon, permission_key, created_by, created_time, update_by, update_time, is_deleted)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.name}, #{entity.parentId}, #{entity.type}, #{entity.menuUrl}, #{entity.status}, #{entity.show}, #{entity.icon}, #{entity.permissionKey}, #{entity.createdBy}, #{entity.createdTime}, #{entity.updateBy}, #{entity.updateTime}, #{entity.isDeleted})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into auth_permission(name, parent_id, `type`, menu_url, status, `show`, icon, permission_key, created_by, created_time, update_by, update_time, is_deleted)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.name}, #{entity.parentId}, #{entity.type}, #{entity.menuUrl}, #{entity.status}, #{entity.show}, #{entity.icon}, #{entity.permissionKey}, #{entity.createdBy}, #{entity.createdTime}, #{entity.updateBy}, #{entity.updateTime}, #{entity.isDeleted})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
name = values(name),
|
||||
parent_id = values(parent_id),
|
||||
`type` = values(type),
|
||||
menu_url = values(menu_url),
|
||||
status = values(status),
|
||||
`show` = values(show),
|
||||
icon = values(icon),
|
||||
permission_key = values(permission_key),
|
||||
created_by = values(created_by),
|
||||
created_time = values(created_time),
|
||||
update_by = values(update_by),
|
||||
update_time = values(update_time),
|
||||
is_deleted = values(is_deleted)
|
||||
</insert>
|
||||
|
||||
<!--通过主键修改数据-->
|
||||
<update id="update">
|
||||
update auth_permission
|
||||
<set>
|
||||
<if test="name != null and name != ''">
|
||||
name = #{name},
|
||||
</if>
|
||||
<if test="parentId != null">
|
||||
parent_id = #{parentId},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
`type` = #{type},
|
||||
</if>
|
||||
<if test="menuUrl != null and menuUrl != ''">
|
||||
menu_url = #{menuUrl},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status = #{status},
|
||||
</if>
|
||||
<if test="show != null">
|
||||
`show` = #{show},
|
||||
</if>
|
||||
<if test="icon != null and icon != ''">
|
||||
icon = #{icon},
|
||||
</if>
|
||||
<if test="permissionKey != null and permissionKey != ''">
|
||||
permission_key = #{permissionKey},
|
||||
</if>
|
||||
<if test="createdBy != null and createdBy != ''">
|
||||
created_by = #{createdBy},
|
||||
</if>
|
||||
<if test="createdTime != null">
|
||||
created_time = #{createdTime},
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
update_by = #{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime},
|
||||
</if>
|
||||
<if test="isDeleted != null">
|
||||
is_deleted = #{isDeleted},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
delete from auth_permission where id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
@@ -0,0 +1,173 @@
|
||||
<?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="com.landaiqing.auth.infra.basic.mapper.AuthRoleDao">
|
||||
|
||||
<resultMap type="com.landaiqing.auth.infra.basic.entity.AuthRole" id="AuthRoleMap">
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="roleName" column="role_name" jdbcType="VARCHAR"/>
|
||||
<result property="roleKey" column="role_key" jdbcType="VARCHAR"/>
|
||||
<result property="createdBy" column="created_by" jdbcType="VARCHAR"/>
|
||||
<result property="createdTime" column="created_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="isDeleted" column="is_deleted" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
<!--查询单个-->
|
||||
<select id="queryById" resultMap="AuthRoleMap">
|
||||
select id,
|
||||
role_name,
|
||||
role_key,
|
||||
created_by,
|
||||
created_time,
|
||||
update_by,
|
||||
update_time,
|
||||
is_deleted
|
||||
from auth_role
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<!--查询指定行数据-->
|
||||
<select id="queryAllByLimit" resultMap="AuthRoleMap">
|
||||
select
|
||||
id, role_name, role_key, created_by, created_time, update_by, update_time, is_deleted
|
||||
from auth_role
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="roleName != null and roleName != ''">
|
||||
and role_name = #{roleName}
|
||||
</if>
|
||||
<if test="roleKey != null and roleKey != ''">
|
||||
and role_key = #{roleKey}
|
||||
</if>
|
||||
<if test="createdBy != null and createdBy != ''">
|
||||
and created_by = #{createdBy}
|
||||
</if>
|
||||
<if test="createdTime != null">
|
||||
and created_time = #{createdTime}
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
and update_by = #{updateBy}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
and update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="isDeleted != null">
|
||||
and is_deleted = #{isDeleted}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!--统计总行数-->
|
||||
<select id="count" resultType="java.lang.Long">
|
||||
select count(1)
|
||||
from auth_role
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="roleName != null and roleName != ''">
|
||||
and role_name = #{roleName}
|
||||
</if>
|
||||
<if test="roleKey != null and roleKey != ''">
|
||||
and role_key = #{roleKey}
|
||||
</if>
|
||||
<if test="createdBy != null and createdBy != ''">
|
||||
and created_by = #{createdBy}
|
||||
</if>
|
||||
<if test="createdTime != null">
|
||||
and created_time = #{createdTime}
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
and update_by = #{updateBy}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
and update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="isDeleted != null">
|
||||
and is_deleted = #{isDeleted}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="queryByRoleList" resultMap="AuthRoleMap">
|
||||
select *
|
||||
from auth_role
|
||||
where id in
|
||||
<foreach open="(" close=")" collection="list" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into auth_role(role_name, role_key, created_by, created_time, update_by, update_time, is_deleted)
|
||||
values (#{roleName}, #{roleKey}, #{createdBy}, #{createdTime}, #{updateBy}, #{updateTime}, #{isDeleted})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into auth_role(role_name, role_key, created_by, created_time, update_by, update_time, is_deleted)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.roleName}, #{entity.roleKey}, #{entity.createdBy}, #{entity.createdTime}, #{entity.updateBy},
|
||||
#{entity.updateTime}, #{entity.isDeleted})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into auth_role(role_name, role_key, created_by, created_time, update_by, update_time, is_deleted)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.roleName}, #{entity.roleKey}, #{entity.createdBy}, #{entity.createdTime}, #{entity.updateBy},
|
||||
#{entity.updateTime}, #{entity.isDeleted})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
role_name = values(role_name),
|
||||
role_key = values(role_key),
|
||||
created_by = values(created_by),
|
||||
created_time = values(created_time),
|
||||
update_by = values(update_by),
|
||||
update_time = values(update_time),
|
||||
is_deleted = values(is_deleted)
|
||||
</insert>
|
||||
|
||||
<!--通过主键修改数据-->
|
||||
<update id="update">
|
||||
update auth_role
|
||||
<set>
|
||||
<if test="roleName != null and roleName != ''">
|
||||
role_name = #{roleName},
|
||||
</if>
|
||||
<if test="roleKey != null and roleKey != ''">
|
||||
role_key = #{roleKey},
|
||||
</if>
|
||||
<if test="createdBy != null and createdBy != ''">
|
||||
created_by = #{createdBy},
|
||||
</if>
|
||||
<if test="createdTime != null">
|
||||
created_time = #{createdTime},
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
update_by = #{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime},
|
||||
</if>
|
||||
<if test="isDeleted != null">
|
||||
is_deleted = #{isDeleted},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
delete
|
||||
from auth_role
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
@@ -0,0 +1,156 @@
|
||||
<?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="com.landaiqing.auth.infra.basic.mapper.AuthRolePermissionDao">
|
||||
|
||||
<resultMap type="com.landaiqing.auth.infra.basic.entity.AuthRolePermission" id="AuthRolePermissionMap">
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="roleId" column="role_id" jdbcType="INTEGER"/>
|
||||
<result property="permissionId" column="permission_id" jdbcType="INTEGER"/>
|
||||
<result property="createdBy" column="created_by" jdbcType="VARCHAR"/>
|
||||
<result property="createdTime" column="created_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="isDeleted" column="is_deleted" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
<!--查询单个-->
|
||||
<select id="queryById" resultMap="AuthRolePermissionMap">
|
||||
select
|
||||
id, role_id, permission_id, created_by, created_time, update_by, update_time, is_deleted
|
||||
from auth_role_premission
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<!--查询指定行数据-->
|
||||
<select id="queryAllByLimit" resultMap="AuthRolePermissionMap">
|
||||
select
|
||||
id, role_id, permission_id, created_by, created_time, update_by, update_time, is_deleted
|
||||
from auth_role_permission
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="roleId != null">
|
||||
and role_id = #{roleId}
|
||||
</if>
|
||||
<if test="permissionId != null">
|
||||
and permission_id = #{permissionId}
|
||||
</if>
|
||||
<if test="createdBy != null and createdBy != ''">
|
||||
and created_by = #{createdBy}
|
||||
</if>
|
||||
<if test="createdTime != null">
|
||||
and created_time = #{createdTime}
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
and update_by = #{updateBy}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
and update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="isDeleted != null">
|
||||
and is_deleted = #{isDeleted}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!--统计总行数-->
|
||||
<select id="count" resultType="java.lang.Long">
|
||||
select count(1)
|
||||
from auth_role_permission
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="roleId != null">
|
||||
and role_id = #{roleId}
|
||||
</if>
|
||||
<if test="permissionId != null">
|
||||
and permission_id = #{permissionId}
|
||||
</if>
|
||||
<if test="createdBy != null and createdBy != ''">
|
||||
and created_by = #{createdBy}
|
||||
</if>
|
||||
<if test="createdTime != null">
|
||||
and created_time = #{createdTime}
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
and update_by = #{updateBy}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
and update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="isDeleted != null">
|
||||
and is_deleted = #{isDeleted}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into auth_role_premission(role_id, permission_id, created_by, created_time, update_by, update_time, is_deleted)
|
||||
values (#{roleId}, #{permissionId}, #{createdBy}, #{createdTime}, #{updateBy}, #{updateTime}, #{isDeleted})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into auth_role_permission(role_id, permission_id, created_by, created_time, update_by, update_time,
|
||||
is_deleted)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.roleId}, #{entity.permissionId}, #{entity.createdBy}, #{entity.createdTime}, #{entity.updateBy},
|
||||
#{entity.updateTime}, #{entity.isDeleted})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into auth_role_permission(role_id, permission_id, created_by, created_time, update_by, update_time, is_deleted)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.roleId}, #{entity.permissionId}, #{entity.createdBy}, #{entity.createdTime}, #{entity.updateBy}, #{entity.updateTime}, #{entity.isDeleted})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
role_id = values(role_id),
|
||||
permission_id = values(permission_id),
|
||||
created_by = values(created_by),
|
||||
created_time = values(created_time),
|
||||
update_by = values(update_by),
|
||||
update_time = values(update_time),
|
||||
is_deleted = values(is_deleted)
|
||||
</insert>
|
||||
|
||||
<!--通过主键修改数据-->
|
||||
<update id="update">
|
||||
update auth_role_permission
|
||||
<set>
|
||||
<if test="roleId != null">
|
||||
role_id = #{roleId},
|
||||
</if>
|
||||
<if test="permissionId != null">
|
||||
permission_id = #{permissionId},
|
||||
</if>
|
||||
<if test="createdBy != null and createdBy != ''">
|
||||
created_by = #{createdBy},
|
||||
</if>
|
||||
<if test="createdTime != null">
|
||||
created_time = #{createdTime},
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
update_by = #{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime},
|
||||
</if>
|
||||
<if test="isDeleted != null">
|
||||
is_deleted = #{isDeleted},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
delete from auth_role_premission where id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
@@ -0,0 +1,294 @@
|
||||
<?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="com.landaiqing.auth.infra.basic.mapper.AuthUserDao">
|
||||
|
||||
<resultMap type="com.landaiqing.auth.infra.basic.entity.AuthUser" id="AuthUserMap">
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="userName" column="user_name" jdbcType="VARCHAR"/>
|
||||
<result property="nickName" column="nick_name" jdbcType="VARCHAR"/>
|
||||
<result property="email" column="email" jdbcType="VARCHAR"/>
|
||||
<result property="phone" column="phone" jdbcType="VARCHAR"/>
|
||||
<result property="password" column="password" jdbcType="VARCHAR"/>
|
||||
<result property="sex" column="sex" jdbcType="INTEGER"/>
|
||||
<result property="avatar" column="avatar" jdbcType="VARCHAR"/>
|
||||
<result property="status" column="status" jdbcType="INTEGER"/>
|
||||
<result property="introduce" column="introduce" jdbcType="VARCHAR"/>
|
||||
<result property="extJson" column="ext_json" jdbcType="VARCHAR"/>
|
||||
<result property="createdBy" column="created_by" jdbcType="VARCHAR"/>
|
||||
<result property="createdTime" column="created_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="isDeleted" column="is_deleted" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
<!--查询单个-->
|
||||
<select id="queryById" resultMap="AuthUserMap">
|
||||
select
|
||||
id, user_name, nick_name, email, phone, password, sex, avatar, status, introduce, ext_json, created_by, created_time, update_by, update_time, is_deleted
|
||||
from auth_user
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<!--查询指定行数据-->
|
||||
<select id="queryAllByLimit" resultMap="AuthUserMap">
|
||||
select
|
||||
id, user_name, nick_name, email, phone, password, sex, avatar, status, introduce, ext_json, created_by, created_time, update_by, update_time, is_deleted
|
||||
from auth_user
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="userName != null and userName != ''">
|
||||
and user_name = #{userName}
|
||||
</if>
|
||||
<if test="nickName != null and nickName != ''">
|
||||
and nick_name = #{nickName}
|
||||
</if>
|
||||
<if test="email != null and email != ''">
|
||||
and email = #{email}
|
||||
</if>
|
||||
<if test="phone != null and phone != ''">
|
||||
and phone = #{phone}
|
||||
</if>
|
||||
<if test="password != null and password != ''">
|
||||
and password = #{password}
|
||||
</if>
|
||||
<if test="sex != null">
|
||||
and sex = #{sex}
|
||||
</if>
|
||||
<if test="avatar != null and avatar != ''">
|
||||
and avatar = #{avatar}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
and status = #{status}
|
||||
</if>
|
||||
<if test="introduce != null and introduce != ''">
|
||||
and introduce = #{introduce}
|
||||
</if>
|
||||
<if test="extJson != null and extJson != ''">
|
||||
and ext_json = #{extJson}
|
||||
</if>
|
||||
<if test="createdBy != null and createdBy != ''">
|
||||
and created_by = #{createdBy}
|
||||
</if>
|
||||
<if test="createdTime != null">
|
||||
and created_time = #{createdTime}
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
and update_by = #{updateBy}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
and update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="isDeleted != null">
|
||||
and is_deleted = #{isDeleted}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!--统计总行数-->
|
||||
<select id="count" resultType="java.lang.Long">
|
||||
select count(1)
|
||||
from auth_user
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="userName != null and userName != ''">
|
||||
and user_name = #{userName}
|
||||
</if>
|
||||
<if test="nickName != null and nickName != ''">
|
||||
and nick_name = #{nickName}
|
||||
</if>
|
||||
<if test="email != null and email != ''">
|
||||
and email = #{email}
|
||||
</if>
|
||||
<if test="phone != null and phone != ''">
|
||||
and phone = #{phone}
|
||||
</if>
|
||||
<if test="password != null and password != ''">
|
||||
and password = #{password}
|
||||
</if>
|
||||
<if test="sex != null">
|
||||
and sex = #{sex}
|
||||
</if>
|
||||
<if test="avatar != null and avatar != ''">
|
||||
and avatar = #{avatar}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
and status = #{status}
|
||||
</if>
|
||||
<if test="introduce != null and introduce != ''">
|
||||
and introduce = #{introduce}
|
||||
</if>
|
||||
<if test="extJson != null and extJson != ''">
|
||||
and ext_json = #{extJson}
|
||||
</if>
|
||||
<if test="createdBy != null and createdBy != ''">
|
||||
and created_by = #{createdBy}
|
||||
</if>
|
||||
<if test="createdTime != null">
|
||||
and created_time = #{createdTime}
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
and update_by = #{updateBy}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
and update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="isDeleted != null">
|
||||
and is_deleted = #{isDeleted}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
<selectKey resultType="java.lang.Long" keyProperty="id" order="AFTER">
|
||||
SELECT LAST_INSERT_ID()
|
||||
</selectKey>
|
||||
insert into auth_user(user_name, nick_name, email, phone, password, sex, avatar, status, introduce, ext_json, created_by, created_time, update_by, update_time, is_deleted)
|
||||
values (#{userName}, #{nickName}, #{email}, #{phone}, #{password}, #{sex}, #{avatar}, #{status}, #{introduce}, #{extJson}, #{createdBy}, #{createdTime}, #{updateBy}, #{updateTime}, #{isDeleted})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into auth_user(user_name, nick_name, email, phone, password, sex, avatar, status, introduce, ext_json, created_by, created_time, update_by, update_time, is_deleted)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.userName}, #{entity.nickName}, #{entity.email}, #{entity.phone}, #{entity.password}, #{entity.sex}, #{entity.avatar}, #{entity.status}, #{entity.introduce}, #{entity.extJson}, #{entity.createdBy}, #{entity.createdTime}, #{entity.updateBy}, #{entity.updateTime}, #{entity.isDeleted})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into auth_user(user_name, nick_name, email, phone, password, sex, avatar, status, introduce, ext_json, created_by, created_time, update_by, update_time, is_deleted)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.userName}, #{entity.nickName}, #{entity.email}, #{entity.phone}, #{entity.password}, #{entity.sex}, #{entity.avatar}, #{entity.status}, #{entity.introduce}, #{entity.extJson}, #{entity.createdBy}, #{entity.createdTime}, #{entity.updateBy}, #{entity.updateTime}, #{entity.isDeleted})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
user_name = values(user_name),
|
||||
nick_name = values(nick_name),
|
||||
email = values(email),
|
||||
phone = values(phone),
|
||||
password = values(password),
|
||||
sex = values(sex),
|
||||
avatar = values(avatar),
|
||||
status = values(status),
|
||||
introduce = values(introduce),
|
||||
ext_json = values(ext_json),
|
||||
created_by = values(created_by),
|
||||
created_time = values(created_time),
|
||||
update_by = values(update_by),
|
||||
update_time = values(update_time),
|
||||
is_deleted = values(is_deleted)
|
||||
</insert>
|
||||
|
||||
<!--通过主键修改数据-->
|
||||
<update id="update">
|
||||
update auth_user
|
||||
<set>
|
||||
<if test="userName != null and userName != ''">
|
||||
user_name = #{userName},
|
||||
</if>
|
||||
<if test="nickName != null and nickName != ''">
|
||||
nick_name = #{nickName},
|
||||
</if>
|
||||
<if test="email != null and email != ''">
|
||||
email = #{email},
|
||||
</if>
|
||||
<if test="phone != null and phone != ''">
|
||||
phone = #{phone},
|
||||
</if>
|
||||
<if test="password != null and password != ''">
|
||||
password = #{password},
|
||||
</if>
|
||||
<if test="sex != null">
|
||||
sex = #{sex},
|
||||
</if>
|
||||
<if test="avatar != null and avatar != ''">
|
||||
avatar = #{avatar},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status = #{status},
|
||||
</if>
|
||||
<if test="introduce != null and introduce != ''">
|
||||
introduce = #{introduce},
|
||||
</if>
|
||||
<if test="extJson != null and extJson != ''">
|
||||
ext_json = #{extJson},
|
||||
</if>
|
||||
<if test="createdBy != null and createdBy != ''">
|
||||
created_by = #{createdBy},
|
||||
</if>
|
||||
<if test="createdTime != null">
|
||||
created_time = #{createdTime},
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
update_by = #{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime},
|
||||
</if>
|
||||
<if test="isDeleted != null">
|
||||
is_deleted = #{isDeleted},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateByUserName">
|
||||
update auth_user
|
||||
<set>
|
||||
<if test="nickName != null and nickName != ''">
|
||||
nick_name = #{nickName},
|
||||
</if>
|
||||
<if test="email != null and email != ''">
|
||||
email = #{email},
|
||||
</if>
|
||||
<if test="phone != null and phone != ''">
|
||||
phone = #{phone},
|
||||
</if>
|
||||
<if test="password != null and password != ''">
|
||||
password = #{password},
|
||||
</if>
|
||||
<if test="sex != null">
|
||||
sex = #{sex},
|
||||
</if>
|
||||
<if test="avatar != null and avatar != ''">
|
||||
avatar = #{avatar},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status = #{status},
|
||||
</if>
|
||||
<if test="introduce != null and introduce != ''">
|
||||
introduce = #{introduce},
|
||||
</if>
|
||||
<if test="extJson != null and extJson != ''">
|
||||
ext_json = #{extJson},
|
||||
</if>
|
||||
<if test="createdBy != null and createdBy != ''">
|
||||
created_by = #{createdBy},
|
||||
</if>
|
||||
<if test="createdTime != null">
|
||||
created_time = #{createdTime},
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
update_by = #{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime},
|
||||
</if>
|
||||
<if test="isDeleted != null">
|
||||
is_deleted = #{isDeleted},
|
||||
</if>
|
||||
</set>
|
||||
where user_name = #{userName}
|
||||
</update>
|
||||
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
delete from auth_user where id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
@@ -0,0 +1,154 @@
|
||||
<?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="com.landaiqing.auth.infra.basic.mapper.AuthUserRoleDao">
|
||||
|
||||
<resultMap type="com.landaiqing.auth.infra.basic.entity.AuthUserRole" id="AuthUserRoleMap">
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="userId" column="user_id" jdbcType="INTEGER"/>
|
||||
<result property="roleId" column="role_id" jdbcType="INTEGER"/>
|
||||
<result property="createdBy" column="created_by" jdbcType="VARCHAR"/>
|
||||
<result property="createdTime" column="created_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="isDeleted" column="is_deleted" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
<!--查询单个-->
|
||||
<select id="queryById" resultMap="AuthUserRoleMap">
|
||||
select
|
||||
id, user_id, role_id, created_by, created_time, update_by, update_time, is_deleted
|
||||
from auth_user_role
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<!--查询指定行数据-->
|
||||
<select id="queryAllByLimit" resultMap="AuthUserRoleMap">
|
||||
select
|
||||
id, user_id, role_id, created_by, created_time, update_by, update_time, is_deleted
|
||||
from auth_user_role
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
and user_id = #{userId}
|
||||
</if>
|
||||
<if test="roleId != null">
|
||||
and role_id = #{roleId}
|
||||
</if>
|
||||
<if test="createdBy != null and createdBy != ''">
|
||||
and created_by = #{createdBy}
|
||||
</if>
|
||||
<if test="createdTime != null">
|
||||
and created_time = #{createdTime}
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
and update_by = #{updateBy}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
and update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="isDeleted != null">
|
||||
and is_deleted = #{isDeleted}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!--统计总行数-->
|
||||
<select id="count" resultType="java.lang.Long">
|
||||
select count(1)
|
||||
from auth_user_role
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
and user_id = #{userId}
|
||||
</if>
|
||||
<if test="roleId != null">
|
||||
and role_id = #{roleId}
|
||||
</if>
|
||||
<if test="createdBy != null and createdBy != ''">
|
||||
and created_by = #{createdBy}
|
||||
</if>
|
||||
<if test="createdTime != null">
|
||||
and created_time = #{createdTime}
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
and update_by = #{updateBy}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
and update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="isDeleted != null">
|
||||
and is_deleted = #{isDeleted}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into auth_user_role(user_id, role_id, created_by, created_time, update_by, update_time, is_deleted)
|
||||
values (#{userId}, #{roleId}, #{createdBy}, #{createdTime}, #{updateBy}, #{updateTime}, #{isDeleted})
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into auth_user_role(user_id, role_id, created_by, created_time, update_by, update_time, is_deleted)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.userId}, #{entity.roleId}, #{entity.createdBy}, #{entity.createdTime}, #{entity.updateBy}, #{entity.updateTime}, #{entity.isDeleted})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into auth_user_role(user_id, role_id, created_by, created_time, update_by, update_time, is_deleted)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.userId}, #{entity.roleId}, #{entity.createdBy}, #{entity.createdTime}, #{entity.updateBy}, #{entity.updateTime}, #{entity.isDeleted})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
user_id = values(user_id),
|
||||
role_id = values(role_id),
|
||||
created_by = values(created_by),
|
||||
created_time = values(created_time),
|
||||
update_by = values(update_by),
|
||||
update_time = values(update_time),
|
||||
is_deleted = values(is_deleted)
|
||||
</insert>
|
||||
|
||||
<!--通过主键修改数据-->
|
||||
<update id="update">
|
||||
update auth_user_role
|
||||
<set>
|
||||
<if test="userId != null">
|
||||
user_id = #{userId},
|
||||
</if>
|
||||
<if test="roleId != null">
|
||||
role_id = #{roleId},
|
||||
</if>
|
||||
<if test="createdBy != null and createdBy != ''">
|
||||
created_by = #{createdBy},
|
||||
</if>
|
||||
<if test="createdTime != null">
|
||||
created_time = #{createdTime},
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
update_by = #{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime},
|
||||
</if>
|
||||
<if test="isDeleted != null">
|
||||
is_deleted = #{isDeleted},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!--通过主键删除-->
|
||||
<delete id="deleteById">
|
||||
delete from auth_user_role where id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
Reference in New Issue
Block a user