diff --git a/heritage-mybatisplus/pom.xml b/heritage-mybatisplus/pom.xml new file mode 100644 index 0000000..f8b6f96 --- /dev/null +++ b/heritage-mybatisplus/pom.xml @@ -0,0 +1,46 @@ + + + 4.0.0 + + org.leocoder.heritage + heritage-backend + ${revision} + + + + coder-mybatis-plus + heritage-mybatisplus + MybatisPlus插件 + + + + + org.leocoder.heritage + heritage-model + ${revision} + + + + com.mysql + mysql-connector-j + + + + com.baomidou + mybatis-plus-spring-boot3-starter + + + + com.baomidou + mybatis-plus-jsqlparser + + + + p6spy + p6spy + + + + \ No newline at end of file diff --git a/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/anno/EnableMybatisPlus.java b/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/anno/EnableMybatisPlus.java new file mode 100755 index 0000000..24ebb9e --- /dev/null +++ b/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/anno/EnableMybatisPlus.java @@ -0,0 +1,19 @@ +package org.leocoder.heritage.mybatisplus.anno; + +import org.leocoder.heritage.mybatisplus.config.MyBatisPlusConfiguration; +import org.springframework.context.annotation.Import; + +import java.lang.annotation.*; + +/*** + * @description [Mybatis-Plus插件开关] + * @author Leocoder + */ +@Target({ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +@Inherited +@Import({ MyBatisPlusConfiguration.class }) +public @interface EnableMybatisPlus { + +} diff --git a/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/config/CommonMetaObjectHandler.java b/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/config/CommonMetaObjectHandler.java new file mode 100755 index 0000000..d8b63d7 --- /dev/null +++ b/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/config/CommonMetaObjectHandler.java @@ -0,0 +1,30 @@ +package org.leocoder.heritage.mybatisplus.config; + +import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; +import lombok.extern.slf4j.Slf4j; +import org.apache.ibatis.reflection.MetaObject; + +import java.time.LocalDateTime; + +/** + * @description [新增 或 修改数据给定默认值] + * @author Leocoder + * 如何使用?如下所示: + * @TableField(value = "create_time", fill = FieldFill.INSERT) + * @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE) + */ +@Slf4j +public class CommonMetaObjectHandler implements MetaObjectHandler { + + @Override + public void insertFill(MetaObject metaObject) { + this.setFieldValByName("createTime", LocalDateTime.now(), metaObject); + this.setFieldValByName("updateTime", LocalDateTime.now(), metaObject); + } + + @Override + public void updateFill(MetaObject metaObject) { + log.info("自动填充修改时间..."); + this.setFieldValByName("updateTime", LocalDateTime.now(), metaObject); + } +} diff --git a/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/config/MyBatisPlusConfiguration.java b/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/config/MyBatisPlusConfiguration.java new file mode 100755 index 0000000..66b9777 --- /dev/null +++ b/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/config/MyBatisPlusConfiguration.java @@ -0,0 +1,107 @@ +package org.leocoder.heritage.mybatisplus.config; + +import cn.hutool.core.net.NetUtil; +import com.baomidou.mybatisplus.core.incrementer.DefaultIdentifierGenerator; +import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator; +import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; +import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor; +import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.transaction.annotation.EnableTransactionManagement; + +/** + * @author Leocoder + * @description [分页配置和自动填充] + */ +@Configuration +@EnableTransactionManagement +// 多包名使用 例如 org.leocoder.heritage.domain.**.mapper,com.xxx.**.mapper +@MapperScan("org.leocoder.**.mapper") +public class MyBatisPlusConfiguration { + + /** + * @description [MybatisPlus拦截器] + * @author Leocoder + */ + @Bean + public MybatisPlusInterceptor mybatisPlusInterceptor() { + MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); + // 分页插件 + interceptor.addInnerInterceptor(paginationInnerInterceptor()); + // 乐观锁插件 + interceptor.addInnerInterceptor(optimisticLockerInnerInterceptor()); + return interceptor; + } + + /** + * @description [自动填充创建时间和修改时间] + * @author Leocoder + */ + @Bean + public CommonMetaObjectHandler commonMetaObjectHandler() { + return new CommonMetaObjectHandler(); + } + + /** + * @description [乐观锁插件] + * @author Leocoder + */ + @Bean + public OptimisticLockerInnerInterceptor optimisticLockerInterceptor() { + return new OptimisticLockerInnerInterceptor(); + } + + /** + * 使用网卡信息绑定雪花生成器 + * 防止集群雪花ID重复 + */ + @Bean + public IdentifierGenerator idGenerator() { + return new DefaultIdentifierGenerator(NetUtil.getLocalhost()); + } + + /** + * @description [逻辑删除插件-yml进行配置过,这里不进行配置] + * @author Leocoder + * + * @TableLogic(value = "N",delval = "Y") + * @TableLogic(value = "0",delval = "1") + */ + // @Bean + // public GlobalConfig globalConfig() { + // GlobalConfig globalConfig = new GlobalConfig(); + // GlobalConfig.DbConfig dbConfig = new GlobalConfig.DbConfig(); + // dbConfig.setLogicDeleteValue("0"); + // dbConfig.setLogicNotDeleteValue("1"); + // globalConfig.setDbConfig(dbConfig); + // return globalConfig; + // } + + /** + * @description [乐观锁插件] + * @author Leocoder + */ + public OptimisticLockerInnerInterceptor optimisticLockerInnerInterceptor() { + return new OptimisticLockerInnerInterceptor(); + } + + /** + * @description [分页插件,自动识别数据库类型] + * @author Leocoder + */ + public PaginationInnerInterceptor paginationInnerInterceptor() { + PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor(); + paginationInnerInterceptor.setOptimizeJoin(true); + // 设置最大单页限制数量,默认 500 条,-1 不受限制 + paginationInnerInterceptor.setMaxLimit(500L); + paginationInnerInterceptor.setOverflow(false); + // 如果配置多个插件,切记分页最后添加 + // paginationInnerInterceptor.setDbType(DbType.MYSQL); + // paginationInnerInterceptor.setDbType(DbType.ORACLE); + // 如果有多数据源可以不配具体类型,否则都建议配上具体的DbType[本项目已经使用多数据源,无需进行上方注释的配置] + return paginationInnerInterceptor; + } + +} diff --git a/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/handler/CustomIdGenerator.java b/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/handler/CustomIdGenerator.java new file mode 100755 index 0000000..b089ba9 --- /dev/null +++ b/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/handler/CustomIdGenerator.java @@ -0,0 +1,23 @@ +package org.leocoder.heritage.mybatisplus.handler; + +import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator; + +import java.util.Random; + +/*** + * @description [CustomIdGenerator] + * @author Leocoder + */ +public class CustomIdGenerator implements IdentifierGenerator { + + @Override + public Long nextId(Object entity) { + // 可以将当前传入的class全类名来作为bizKey,或者提取参数来生成bizKey进行分布式Id调用生成. + String bizKey = entity.getClass().getName(); + // 根据bizKey调用分布式ID生成 + long id = new Random().nextLong(); + // 返回生成的id值即可. + return id; + } + +} diff --git a/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/mapper/system/SysDictDataMapper.java b/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/mapper/system/SysDictDataMapper.java new file mode 100644 index 0000000..821985b --- /dev/null +++ b/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/mapper/system/SysDictDataMapper.java @@ -0,0 +1,14 @@ +package org.leocoder.heritage.mybatisplus.mapper.system; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; +import org.leocoder.heritage.domain.pojo.system.SysDictData; + +/** + * @author Leocoder + * @description [字典数据表-数据库连接层] + */ +@Mapper +public interface SysDictDataMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/mapper/system/SysDictTypeMapper.java b/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/mapper/system/SysDictTypeMapper.java new file mode 100644 index 0000000..0c84737 --- /dev/null +++ b/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/mapper/system/SysDictTypeMapper.java @@ -0,0 +1,14 @@ +package org.leocoder.heritage.mybatisplus.mapper.system; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; +import org.leocoder.heritage.domain.pojo.system.SysDictType; + +/** + * @author Leocoder + * @description [字典类型表-数据库连接层] + */ +@Mapper +public interface SysDictTypeMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/mapper/system/SysFileMapper.java b/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/mapper/system/SysFileMapper.java new file mode 100755 index 0000000..a707aa9 --- /dev/null +++ b/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/mapper/system/SysFileMapper.java @@ -0,0 +1,15 @@ +package org.leocoder.heritage.mybatisplus.mapper.system; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; +import org.leocoder.heritage.domain.pojo.system.SysFile; + +/** + * @description [文件资源表-数据库连接层] + * @author Leocoder + */ +@Mapper +public interface SysFileMapper extends BaseMapper { + + +} diff --git a/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/mapper/system/SysJobMapper.java b/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/mapper/system/SysJobMapper.java new file mode 100644 index 0000000..5638ecf --- /dev/null +++ b/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/mapper/system/SysJobMapper.java @@ -0,0 +1,14 @@ +package org.leocoder.heritage.mybatisplus.mapper.system; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; +import org.leocoder.heritage.domain.pojo.system.SysJob; + +/** + * @author Leocoder + * @description [定时任务数据访问层] + */ +@Mapper +public interface SysJobMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/mapper/system/SysLoginLogMapper.java b/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/mapper/system/SysLoginLogMapper.java new file mode 100755 index 0000000..d81ebc0 --- /dev/null +++ b/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/mapper/system/SysLoginLogMapper.java @@ -0,0 +1,14 @@ +package org.leocoder.heritage.mybatisplus.mapper.system; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; +import org.leocoder.heritage.domain.pojo.system.SysLoginLog; + +/** + * @author Leocoder + * @description [系统访问记录-数据库连接层] + */ +@Mapper +public interface SysLoginLogMapper extends BaseMapper { + +} diff --git a/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/mapper/system/SysLoginUserMapper.java b/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/mapper/system/SysLoginUserMapper.java new file mode 100755 index 0000000..17648e1 --- /dev/null +++ b/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/mapper/system/SysLoginUserMapper.java @@ -0,0 +1,31 @@ +package org.leocoder.heritage.mybatisplus.mapper.system; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.leocoder.heritage.domain.model.vo.system.SysLoginUserVo; +import org.leocoder.heritage.domain.pojo.system.SysLoginUser; + +import java.util.List; + +/** + * @author Leocoder + * @description [系统用户-数据库连接层] + */ +@Mapper +public interface SysLoginUserMapper extends BaseMapper { + + /** + * @description [用户表、部门表左连接查询] + * @author Leocoder + */ + Page listPage(Page page, @Param("vo") SysLoginUserVo vo); + + /** + * @description [多条件数据导出] + * @author Leocoder + */ + List listLoginUser(@Param("vo") SysLoginUserVo vo); + +} diff --git a/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/mapper/system/SysMenuMapper.java b/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/mapper/system/SysMenuMapper.java new file mode 100755 index 0000000..aec8e1b --- /dev/null +++ b/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/mapper/system/SysMenuMapper.java @@ -0,0 +1,74 @@ +package org.leocoder.heritage.mybatisplus.mapper.system; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.leocoder.heritage.domain.model.bo.element.CascaderLongBo; +import org.leocoder.heritage.domain.model.bo.system.SysMenuBo; +import org.leocoder.heritage.domain.model.vo.system.SysMenuVo; +import org.leocoder.heritage.domain.pojo.system.SysMenu; + +import java.util.List; + +/** + * @author Leocoder + * @description [菜单权限表-数据库连接层] + */ +@Mapper +public interface SysMenuMapper extends BaseMapper { + + /** + * @description [查询菜单] + * @author Leocoder + */ + List listSysMenu(@Param("vo") SysMenuVo vo); + + /** + * @description [查询用户拥有的菜单权限-AOP] + * @author Leocoder + */ + List listMenuIdData(Long userId); + + /** + * @description [菜单级联下拉框] + * @author Leocoder + */ + List cascaderList(); + + /** + * @description [根据用户ID查询当前角色所拥有的菜单列表] + * @author Leocoder + */ + List listMenuByUserId(Long userId); + + /** + * @description [超级管理员-全部菜单权限] + * @author Leocoder + */ + List listMenuAdmin(); + + /** + * @description [根据用户拥有的角色ID查询权限菜单] + * @author Leocoder + */ + List listMenuIdsByRoleId(Long roleId); + + /** + * @description [保存角色和菜单权限之间的关系] + * @author Leocoder + */ + boolean saveRoleMenu(@Param("roleId") Long roleId, @Param("menuIds") List menuIds); + + /** + * @description [删除该角色拥有的权限] + * @author Leocoder + */ + boolean deleteMenuIdsByRoleId(Long roleId); + + /** + * @description [根据角色编码查询菜单权限-Sa-Token权限] + * @author Leocoder + */ + List listMenuAuth(String roleCode); + +} diff --git a/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/mapper/system/SysOperLogMapper.java b/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/mapper/system/SysOperLogMapper.java new file mode 100644 index 0000000..75a904a --- /dev/null +++ b/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/mapper/system/SysOperLogMapper.java @@ -0,0 +1,74 @@ +package org.leocoder.heritage.mybatisplus.mapper.system; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; +import org.leocoder.heritage.domain.pojo.system.SysOperLog; + +import java.time.LocalDateTime; +import java.util.List; +import java.util.Map; + +/** + * @author Leocoder + * @description [操作日志Mapper接口] + */ +@Mapper +public interface SysOperLogMapper extends BaseMapper { + + /** + * @description [获取操作类型统计] + * @author Leocoder + */ + @Select("SELECT oper_type as operType, COUNT(*) as count FROM sys_oper_log GROUP BY oper_type") + List> getOperTypeStats(); + + /** + * @description [获取每日操作统计] + * @author Leocoder + */ + @Select("SELECT DATE(oper_time) as date, COUNT(*) as count FROM sys_oper_log " + + "WHERE oper_time >= DATE_SUB(NOW(), INTERVAL 7 DAY) GROUP BY DATE(oper_time) ORDER BY date") + List> getDailyStats(); + + /** + * @description [获取用户操作统计] + * @author Leocoder + */ + @Select("SELECT oper_man as operMan, COUNT(*) as count FROM sys_oper_log " + + "WHERE oper_time >= DATE_SUB(NOW(), INTERVAL 1 DAY) GROUP BY oper_man " + + "ORDER BY count DESC LIMIT 10") + List> getUserStats(); + + /** + * @description [获取错误操作统计] + * @author Leocoder + */ + @Select("SELECT COUNT(*) as errorCount FROM sys_oper_log WHERE oper_status = '1'") + Long getErrorCount(); + + /** + * @description [获取操作统计信息] + * @author Leocoder + */ + @Select("SELECT " + + "COUNT(*) as totalCount, " + + "COUNT(CASE WHEN oper_status = '0' THEN 1 END) as successCount, " + + "COUNT(CASE WHEN oper_status = '1' THEN 1 END) as failCount, " + + "COUNT(CASE WHEN DATE(oper_time) = CURDATE() THEN 1 END) as todayCount " + + "FROM sys_oper_log") + Map getOperationStats(); + + /** + * @description [批量插入操作日志] + * @author Leocoder + */ + int batchInsert(@Param("list") List operLogs); + + /** + * @description [清理过期日志] + * @author Leocoder + */ + int cleanExpiredLogs(@Param("expireTime") LocalDateTime expireTime); +} \ No newline at end of file diff --git a/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/mapper/system/SysPictureMapper.java b/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/mapper/system/SysPictureMapper.java new file mode 100755 index 0000000..92c09ed --- /dev/null +++ b/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/mapper/system/SysPictureMapper.java @@ -0,0 +1,15 @@ +package org.leocoder.heritage.mybatisplus.mapper.system; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; +import org.leocoder.heritage.domain.pojo.system.SysPicture; + +/** + * @description [图库表-数据库连接层] + * @author Leocoder + */ +@Mapper +public interface SysPictureMapper extends BaseMapper { + + +} diff --git a/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/mapper/system/SysRoleMapper.java b/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/mapper/system/SysRoleMapper.java new file mode 100755 index 0000000..6ce724a --- /dev/null +++ b/heritage-mybatisplus/src/main/java/org/leocoder/heritage/mybatisplus/mapper/system/SysRoleMapper.java @@ -0,0 +1,77 @@ +package org.leocoder.heritage.mybatisplus.mapper.system; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.leocoder.heritage.domain.model.bo.element.SelectLongBo; +import org.leocoder.heritage.domain.model.bo.element.TransferLongBo; +import org.leocoder.heritage.domain.model.vo.base.BaseVo; +import org.leocoder.heritage.domain.model.vo.system.SysRoleVo; +import org.leocoder.heritage.domain.pojo.system.SysRole; +import org.leocoder.heritage.domain.pojo.system.SysUserRole; + +import java.util.List; + +/** + * @author Leocoder + * @description [角色信息表-数据库连接层] + */ +@Mapper +public interface SysRoleMapper extends BaseMapper { + + /** + * @description [多条件分页查询] + * @author Leocoder + */ + Page listPage(@Param("page") Page page, @Param("vo") SysRoleVo vo); + + /** + * @description [根据用户ID查询拥有的角色-AOP] + * @author Leocoder + */ + List listRoleIdData(Long userId); + + /** + * @description [查询是否拥有超级管理员角色-AOP] + * @author Leocoder + */ + List listSysUserRole(Long userId); + + /** + * @description [查询所有正常角色] + * @author Leocoder + */ + List listLeftRole(); + + /** + * @description [查询当前用户拥有角色-穿梭框右侧] + * @author Leocoder + */ + List listRightRole(Long userId); + + /** + * @description [删除当前用户拥有的角色] + * @author Leocoder + */ + void deleteUserRole(Long userId); + + /** + * @description [添加当前用户选中的角色] + * @author Leocoder + */ + boolean batchAddUserRole(@Param("userId") Long userId, @Param("roleIds") List roleIds); + + /** + * @description [查询用户拥有正常角色-Sa-Token角色权限] + * @author Leocoder + */ + List listAuthRoleCode(Long userId); + + /** + * @description [获取角色下拉框] + * @author Leocoder + */ + List listRoleElSelect(@Param("vo") BaseVo vo); + +} diff --git a/heritage-mybatisplus/src/main/resources/mapper/system/SysDictDataMapper.xml b/heritage-mybatisplus/src/main/resources/mapper/system/SysDictDataMapper.xml new file mode 100644 index 0000000..e078c93 --- /dev/null +++ b/heritage-mybatisplus/src/main/resources/mapper/system/SysDictDataMapper.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/heritage-mybatisplus/src/main/resources/mapper/system/SysDictTypeMapper.xml b/heritage-mybatisplus/src/main/resources/mapper/system/SysDictTypeMapper.xml new file mode 100644 index 0000000..aa4cbf8 --- /dev/null +++ b/heritage-mybatisplus/src/main/resources/mapper/system/SysDictTypeMapper.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/heritage-mybatisplus/src/main/resources/mapper/system/SysFileMapper.xml b/heritage-mybatisplus/src/main/resources/mapper/system/SysFileMapper.xml new file mode 100644 index 0000000..ea4f1ca --- /dev/null +++ b/heritage-mybatisplus/src/main/resources/mapper/system/SysFileMapper.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/heritage-mybatisplus/src/main/resources/mapper/system/SysLoginLogMapper.xml b/heritage-mybatisplus/src/main/resources/mapper/system/SysLoginLogMapper.xml new file mode 100644 index 0000000..77e6233 --- /dev/null +++ b/heritage-mybatisplus/src/main/resources/mapper/system/SysLoginLogMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/heritage-mybatisplus/src/main/resources/mapper/system/SysLoginUserMapper.xml b/heritage-mybatisplus/src/main/resources/mapper/system/SysLoginUserMapper.xml new file mode 100644 index 0000000..ee0716e --- /dev/null +++ b/heritage-mybatisplus/src/main/resources/mapper/system/SysLoginUserMapper.xml @@ -0,0 +1,88 @@ + + + + + + + + + + diff --git a/heritage-mybatisplus/src/main/resources/mapper/system/SysMenuMapper.xml b/heritage-mybatisplus/src/main/resources/mapper/system/SysMenuMapper.xml new file mode 100644 index 0000000..08ede19 --- /dev/null +++ b/heritage-mybatisplus/src/main/resources/mapper/system/SysMenuMapper.xml @@ -0,0 +1,218 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + DELETE FROM + sys_role_menu + WHERE + role_id = #{roleId} + + + + + INSERT INTO + sys_role_menu (role_id, menu_id) + VALUES + + (#{roleId}, #{menuId}) + + + + diff --git a/heritage-mybatisplus/src/main/resources/mapper/system/SysOperLogMapper.xml b/heritage-mybatisplus/src/main/resources/mapper/system/SysOperLogMapper.xml new file mode 100644 index 0000000..f464d3f --- /dev/null +++ b/heritage-mybatisplus/src/main/resources/mapper/system/SysOperLogMapper.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO sys_oper_log ( + oper_name, oper_type, method_name, request_method, system_type, + oper_man, oper_url, oper_ip, oper_location, oper_param, + json_result, oper_status, error_msg, oper_time, cost_time + ) VALUES + + ( + #{item.operName}, #{item.operType}, #{item.methodName}, + #{item.requestMethod}, #{item.systemType}, #{item.operMan}, + #{item.operUrl}, #{item.operIp}, #{item.operLocation}, + #{item.operParam}, #{item.jsonResult}, #{item.operStatus}, + #{item.errorMsg}, #{item.operTime}, #{item.costTime} + ) + + + + + + DELETE FROM sys_oper_log WHERE oper_time < #{expireTime} + + + \ No newline at end of file diff --git a/heritage-mybatisplus/src/main/resources/mapper/system/SysPictureMapper.xml b/heritage-mybatisplus/src/main/resources/mapper/system/SysPictureMapper.xml new file mode 100644 index 0000000..4f4fd77 --- /dev/null +++ b/heritage-mybatisplus/src/main/resources/mapper/system/SysPictureMapper.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/heritage-mybatisplus/src/main/resources/mapper/system/SysRoleMapper.xml b/heritage-mybatisplus/src/main/resources/mapper/system/SysRoleMapper.xml new file mode 100644 index 0000000..4170f76 --- /dev/null +++ b/heritage-mybatisplus/src/main/resources/mapper/system/SysRoleMapper.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + DELETE FROM + sys_user_role + WHERE + user_id = #{userId} + + + + + INSERT INTO + sys_user_role + ( + user_id, + role_id + ) + VALUES + + (#{userId},#{roleId}) + + + + + + +