first commit by ailanyin

This commit is contained in:
2021-11-29 10:00:15 +08:00
commit 0523155715
161 changed files with 19134 additions and 0 deletions

View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<parent>
<artifactId>vis389_backend</artifactId>
<groupId>com.ailanyin</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ailanyin-model-mapper</artifactId>
<dependencies>
<dependency>
<groupId>com.ailanyin</groupId>
<artifactId>ailanyin-common</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>com.dameng</groupId>
<artifactId>Dm7JdbcDriver17</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,37 @@
package com.ailanyin.mapper;
import com.ailanyin.model.ExceptionLog;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author ailanyin
* @version 1.0
* @since 2021/11/2 0002 下午 17:21
*/
public interface ExceptionLogMapper {
/**
* 新增异常
*
* @param exceptionLog exceptionLog
*/
void insertExceptionLog(ExceptionLog exceptionLog);
/**
* 批量删除异常
*
* @param logIds ids
*/
void deleteBatchIds(@Param("ids") List<String> logIds);
/**
* 条件查询
*
* @param exceptionLog exceptionLog
* @return list
*/
List<ExceptionLog> selectListByParam(ExceptionLog exceptionLog);
}

View File

@ -0,0 +1,37 @@
package com.ailanyin.mapper;
import com.ailanyin.model.SysBlacklistUser;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author ailanyin
* @version 1.0
* @since 2021/11/1 0001 下午 15:08
*/
public interface SysBlacklistUserMapper {
/**
* 新增黑名单
*
* @param blacklistUser 黑名单
*/
void insertBlacklistUser(SysBlacklistUser blacklistUser);
/**
* 批量删除黑名单
*
* @param idList idList
*/
void deleteBatchIds(@Param("ids") List<String> idList);
/**
* 条件查询
*
* @param blacklistUser blacklistUser
* @return list
*/
List<SysBlacklistUser> selectByParam(SysBlacklistUser blacklistUser);
}

View File

@ -0,0 +1,68 @@
package com.ailanyin.mapper;
import com.ailanyin.model.SysConfig;
import java.util.List;
/**
* @author ailanyin
* @version 1.0
* @since 2021/10/15 0015 下午 16:44
*/
public interface SysConfigMapper {
/**
* 查询参数配置信息
*
* @param config 参数配置信息
* @return 参数配置信息
*/
SysConfig selectConfig(SysConfig config);
/**
* 查询参数配置列表
*
* @param config 参数配置信息
* @return 参数配置集合
*/
List<SysConfig> selectConfigList(SysConfig config);
/**
* 根据键名查询参数配置信息
*
* @param configKey 参数键名
* @return 参数配置信息
*/
SysConfig checkConfigKeyUnique(String configKey);
/**
* 新增参数配置
*
* @param config 参数配置信息
* @return 结果
*/
int insertConfig(SysConfig config);
/**
* 修改参数配置
*
* @param config 参数配置信息
* @return 结果
*/
int updateConfig(SysConfig config);
/**
* 删除参数配置
*
* @param configId 参数ID
*/
void deleteConfigById(Long configId);
/**
* 批量删除参数信息
*
* @param configIds 需要删除的参数ID
* @return 结果
*/
int deleteConfigByIds(Long[] configIds);
}

View File

@ -0,0 +1,115 @@
package com.ailanyin.mapper;
import com.ailanyin.model.SysDept;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author ailanyin
* @version 1.0
* @since 2021/10/15 0015 上午 10:03
*/
public interface SysDeptMapper {
/**
* 查询部门管理数据
*
* @param dept 部门信息
* @return 部门信息集合
*/
List<SysDept> selectDeptList(SysDept dept);
/**
* 根据角色ID查询部门树信息
*
* @param roleId 角色ID
* @param deptCheckStrictly 部门树选择项是否关联显示
* @return 选中部门列表
*/
List<Integer> selectDeptListByRoleId(@Param("roleId") Long roleId, @Param("deptCheckStrictly") boolean deptCheckStrictly);
/**
* 根据部门ID查询信息
*
* @param deptId 部门ID
* @return 部门信息
*/
SysDept selectDeptById(Long deptId);
/**
* 根据ID查询所有子部门
*
* @param deptId 部门ID
* @return 部门列表
*/
List<SysDept> selectChildrenDeptById(Long deptId);
/**
* 根据ID查询所有子部门正常状态
*
* @param deptId 部门ID
* @return 子部门数
*/
int selectNormalChildrenDeptById(Long deptId);
/**
* 是否存在子节点
*
* @param deptId 部门ID
* @return 结果
*/
int hasChildByDeptId(Long deptId);
/**
* 查询部门是否存在用户
*
* @param deptId 部门ID
* @return 结果
*/
int checkDeptExistUser(Long deptId);
/**
* 校验部门名称是否唯一
*
* @param deptName 部门名称
* @param parentId 父部门ID
* @return 结果
*/
SysDept checkDeptNameUnique(@Param("deptName") String deptName, @Param("parentId") Long parentId);
/**
* 新增部门信息
*
* @param dept 部门信息
*/
void insertDept(SysDept dept);
/**
* 修改部门信息
*
* @param dept 部门信息
*/
void updateDept(SysDept dept);
/**
* 修改所在部门正常状态
*
* @param deptIds 部门ID组
*/
void updateDeptStatusNormal(Long[] deptIds);
/**
* 修改子元素关系
*
* @param deptList 子元素
*/
void updateDeptChildren(@Param("deptList") List<SysDept> deptList);
/**
* 删除部门管理信息
*
* @param deptId 部门ID
*/
void deleteDeptById(Long deptId);
}

View File

@ -0,0 +1,96 @@
package com.ailanyin.mapper;
import com.ailanyin.model.SysDictData;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 字典表 数据层
*
* @author ruoyi
*/
public interface SysDictDataMapper
{
/**
* 根据条件分页查询字典数据
*
* @param dictData 字典数据信息
* @return 字典数据集合信息
*/
public List<SysDictData> selectDictDataList(SysDictData dictData);
/**
* 根据字典类型查询字典数据
*
* @param dictType 字典类型
* @return 字典数据集合信息
*/
public List<SysDictData> selectDictDataByType(String dictType);
/**
* 根据字典类型和字典键值查询字典数据信息
*
* @param dictType 字典类型
* @param dictValue 字典键值
* @return 字典标签
*/
public String selectDictLabel(@Param("dictType") String dictType, @Param("dictValue") String dictValue);
/**
* 根据字典数据ID查询信息
*
* @param dictCode 字典数据ID
* @return 字典数据
*/
public SysDictData selectDictDataById(Long dictCode);
/**
* 查询字典数据
*
* @param dictType 字典类型
* @return 字典数据
*/
public int countDictDataByType(String dictType);
/**
* 通过字典ID删除字典数据信息
*
* @param dictCode 字典数据ID
* @return 结果
*/
public int deleteDictDataById(Long dictCode);
/**
* 批量删除字典数据信息
*
* @param dictCodes 需要删除的字典数据ID
* @return 结果
*/
public int deleteDictDataByIds(Long[] dictCodes);
/**
* 新增字典数据信息
*
* @param dictData 字典数据信息
* @return 结果
*/
public int insertDictData(SysDictData dictData);
/**
* 修改字典数据信息
*
* @param dictData 字典数据信息
* @return 结果
*/
public int updateDictData(SysDictData dictData);
/**
* 同步修改字典类型
*
* @param oldDictType 旧字典类型
* @param newDictType 新旧字典类型
* @return 结果
*/
public int updateDictDataType(@Param("oldDictType") String oldDictType, @Param("newDictType") String newDictType);
}

View File

@ -0,0 +1,86 @@
package com.ailanyin.mapper;
import com.ailanyin.model.SysDictType;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 字典表 数据层
*
* @author ruoyi
*/
@Mapper
public interface SysDictTypeMapper
{
/**
* 根据条件分页查询字典类型
*
* @param dictType 字典类型信息
* @return 字典类型集合信息
*/
public List<SysDictType> selectDictTypeList(SysDictType dictType);
/**
* 根据所有字典类型
*
* @return 字典类型集合信息
*/
public List<SysDictType> selectDictTypeAll();
/**
* 根据字典类型ID查询信息
*
* @param dictId 字典类型ID
* @return 字典类型
*/
public SysDictType selectDictTypeById(Long dictId);
/**
* 根据字典类型查询信息
*
* @param dictType 字典类型
* @return 字典类型
*/
public SysDictType selectDictTypeByType(String dictType);
/**
* 通过字典ID删除字典信息
*
* @param dictId 字典ID
* @return 结果
*/
public int deleteDictTypeById(Long dictId);
/**
* 批量删除字典类型信息
*
* @param dictIds 需要删除的字典ID
* @return 结果
*/
public int deleteDictTypeByIds(Long[] dictIds);
/**
* 新增字典类型信息
*
* @param dictType 字典类型信息
* @return 结果
*/
public int insertDictType(SysDictType dictType);
/**
* 修改字典类型信息
*
* @param dictType 字典类型信息
* @return 结果
*/
public int updateDictType(SysDictType dictType);
/**
* 校验字典类型称是否唯一
*
* @param dictType 字典类型
* @return 结果
*/
public SysDictType checkDictTypeUnique(String dictType);
}

View File

@ -0,0 +1,38 @@
package com.ailanyin.mapper;
import com.ailanyin.model.SysLog;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author ailanyin
* @version 1.0
* @since 2021/10/28 0028 下午 14:51
*/
public interface SysLogMapper {
/**
* 批量删除日志
*
* @param logIds logIds
*/
void deleteBatchIds(@Param("ids") List<String> logIds);
/**
* 条件查询
*
* @param sysLog sysLog
* @return list
*/
List<SysLog> selectByParam(SysLog sysLog);
/**
* 新增日志
*
* @param sysLog log
*/
void insertLog(SysLog sysLog);
}

View File

@ -0,0 +1,122 @@
package com.ailanyin.mapper;
import com.ailanyin.model.SysMenu;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author ailanyin
* @version 1.0
* @since 2021/10/15 0015 上午 10:03
*/
public interface SysMenuMapper
{
/**
* 查询系统菜单列表
*
* @param menu 菜单信息
* @return 菜单列表
*/
List<SysMenu> selectMenuList(SysMenu menu);
/**
* 查询用户所有权限
*
* @return 权限列表
*/
List<String> selectMenuPerms();
/**
* 根据用户查询系统菜单列表
*
* @param menu 菜单信息
* @return 菜单列表
*/
List<SysMenu> selectMenuListByUserId(SysMenu menu);
/**
* 根据用户ID查询权限
*
* @param userId 用户ID
* @return 权限列表
*/
List<String> selectMenuPermsByUserId(Long userId);
/**
* 根据用户ID查询权限
*
* @param userId 用户ID
* @return 权限列表
*/
List<SysMenu> selectSysMenuPermsByUserId(Long userId);
/**
* 根据用户ID查询菜单
*
* @return 菜单列表
*/
List<SysMenu> selectMenuTreeAll();
/**
* 根据用户ID查询菜单
*
* @param userId 用户ID
* @return 菜单列表
*/
List<SysMenu> selectMenuTreeByUserId(Long userId);
/**
* 根据角色ID查询菜单树信息
*
* @param roleId 角色ID
* @param menuCheckStrictly 菜单树选择项是否关联显示
* @return 选中菜单列表
*/
List<Integer> selectMenuListByRoleId(@Param("roleId") Long roleId, @Param("menuCheckStrictly") boolean menuCheckStrictly);
/**
* 根据菜单ID查询信息
*
* @param menuId 菜单ID
* @return 菜单信息
*/
SysMenu selectMenuById(Long menuId);
/**
* 是否存在菜单子节点
*
* @param menuId 菜单ID
* @return 结果
*/
int hasChildByMenuId(Long menuId);
/**
* 新增菜单信息
*
* @param menu 菜单信息
*/
void insertMenu(SysMenu menu);
/**
* 修改菜单信息
*
* @param menu 菜单信息
*/
void updateMenu(SysMenu menu);
/**
* 删除菜单管理信息
*
* @param menuId 菜单ID
*/
void deleteMenuById(Long menuId);
/**
* 校验菜单名称是否唯一
*
* @param menuName 菜单名称
* @param parentId 父菜单ID
* @return 结果
*/
SysMenu checkMenuNameUnique(@Param("menuName") String menuName, @Param("parentId") Long parentId);
}

View File

@ -0,0 +1,97 @@
package com.ailanyin.mapper;
import com.ailanyin.model.SysPost;
import java.util.List;
/**
* 岗位信息 数据层
*
* @author ruoyi
*/
public interface SysPostMapper {
/**
* 查询岗位数据集合
*
* @param post 岗位信息
* @return 岗位数据集合
*/
List<SysPost> selectPostList(SysPost post);
/**
* 查询所有岗位
*
* @return 岗位列表
*/
List<SysPost> selectPostAll();
/**
* 通过岗位ID查询岗位信息
*
* @param postId 岗位ID
* @return 角色对象信息
*/
SysPost selectPostById(Long postId);
/**
* 根据用户ID获取岗位选择框列表
*
* @param userId 用户ID
* @return 选中岗位ID列表
*/
List<Integer> selectPostListByUserId(Long userId);
/**
* 查询用户所属岗位组
*
* @param userName 用户名
* @return 结果
*/
List<SysPost> selectPostsByUserName(String userName);
/**
* 删除岗位信息
*
* @param postId 岗位ID
* @return 结果
*/
int deletePostById(Long postId);
/**
* 批量删除岗位信息
*
* @param postIds 需要删除的岗位ID
*/
void deletePostByIds(Long[] postIds);
/**
* 修改岗位信息
*
* @param post 岗位信息
*/
void updatePost(SysPost post);
/**
* 新增岗位信息
*
* @param post 岗位信息
*/
void insertPost(SysPost post);
/**
* 校验岗位名称
*
* @param postName 岗位名称
* @return 结果
*/
SysPost checkPostNameUnique(String postName);
/**
* 校验岗位编码
*
* @param postCode 岗位编码
* @return 结果
*/
SysPost checkPostCodeUnique(String postCode);
}

View File

@ -0,0 +1,46 @@
package com.ailanyin.mapper;
import com.ailanyin.model.SysRoleDept;
import java.util.List;
/**
* 角色与部门关联表 数据层
*
* @author ruoyi
*/
public interface SysRoleDeptMapper
{
/**
* 通过角色ID删除角色和部门关联
*
* @param roleId 角色ID
* @return 结果
*/
public int deleteRoleDeptByRoleId(Long roleId);
/**
* 批量删除角色部门关联信息
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteRoleDept(Long[] ids);
/**
* 查询部门使用数量
*
* @param deptId 部门ID
* @return 结果
*/
public int selectCountRoleDeptByDeptId(Long deptId);
/**
* 批量新增角色部门信息
*
* @param roleDeptList 角色部门列表
* @return 结果
*/
public int batchRoleDept(List<SysRoleDept> roleDeptList);
}

View File

@ -0,0 +1,105 @@
package com.ailanyin.mapper;
import com.ailanyin.model.SysRole;
import java.util.List;
/**
* @author ailanyin
* @version 1.0
* @since 2021/10/15 0015 上午 10:03
*/
public interface SysRoleMapper {
/**
* 根据条件分页查询角色数据
*
* @param role 角色信息
* @return 角色数据集合信息
*/
List<SysRole> selectRoleList(SysRole role);
/**
* 根据用户ID查询角色
*
* @param userId 用户ID
* @return 角色列表
*/
List<SysRole> selectRolePermissionByUserId(Long userId);
/**
* 查询所有角色
*
* @return 角色列表
*/
List<SysRole> selectRoleAll();
/**
* 根据用户ID获取角色选择框列表
*
* @param userId 用户ID
* @return 选中角色ID列表
*/
List<Integer> selectRoleListByUserId(Long userId);
/**
* 通过角色ID查询角色
*
* @param roleId 角色ID
* @return 角色对象信息
*/
SysRole selectRoleById(Long roleId);
/**
* 根据用户ID查询角色
*
* @param userName 用户名
* @return 角色列表
*/
List<SysRole> selectRolesByUserName(String userName);
/**
* 校验角色名称是否唯一
*
* @param roleName 角色名称
* @return 角色信息
*/
SysRole checkRoleNameUnique(String roleName);
/**
* 校验角色权限是否唯一
*
* @param roleKey 角色权限
* @return 角色信息
*/
SysRole checkRoleKeyUnique(String roleKey);
/**
* 修改角色信息
*
* @param role 角色信息
*/
void updateRole(SysRole role);
/**
* 新增角色信息
*
* @param role 角色信息
*/
void insertRole(SysRole role);
/**
* 通过角色ID删除角色
*
* @param roleId 角色ID
* @return 结果
*/
int deleteRoleById(Long roleId);
/**
* 批量删除角色信息
*
* @param roleIds 需要删除的角色ID
*/
void deleteRoleByIds(Long[] roleIds);
}

View File

@ -0,0 +1,46 @@
package com.ailanyin.mapper;
import com.ailanyin.model.SysRoleMenu;
import java.util.List;
/**
* 角色与菜单关联表 数据层
*
* @author ruoyi
*/
public interface SysRoleMenuMapper
{
/**
* 查询菜单使用数量
*
* @param menuId 菜单ID
* @return 结果
*/
public int checkMenuExistRole(Long menuId);
/**
* 通过角色ID删除角色和菜单关联
*
* @param roleId 角色ID
* @return 结果
*/
public int deleteRoleMenuByRoleId(Long roleId);
/**
* 批量删除角色菜单关联信息
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteRoleMenu(Long[] ids);
/**
* 批量新增角色菜单信息
*
* @param roleMenuList 角色菜单列表
* @return 结果
*/
public int batchRoleMenu(List<SysRoleMenu> roleMenuList);
}

View File

@ -0,0 +1,155 @@
package com.ailanyin.mapper;
import com.ailanyin.model.SysUser;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
/**
* @author ailanyin
* @version 1.0
* @since 2021/10/15 0015 上午 10:03
*/
public interface SysUserMapper {
/**
* 根据条件分页查询用户列表
*
* @param sysUser 用户信息
* @return 用户信息集合信息
*/
List<SysUser> selectUserList(SysUser sysUser);
/**
* 根据条件分页查询未已配用户角色列表
*
* @param user 用户信息
* @return 用户信息集合信息
*/
List<SysUser> selectAllocatedList(SysUser user);
/**
* 根据条件分页查询未分配用户角色列表
*
* @param user 用户信息
* @return 用户信息集合信息
*/
List<SysUser> selectUnallocatedList(SysUser user);
/**
* 通过用户名查询用户
*
* @param userName 用户名
* @return 用户对象信息
*/
SysUser selectUserByUserName(String userName);
/**
* 通过用户ID查询用户
*
* @param userId 用户ID
* @return 用户对象信息
*/
SysUser selectUserById(Long userId);
/**
* 新增用户信息
*
* @param user 用户信息
*/
void insertUser(SysUser user);
/**
* 修改用户信息
*
* @param user 用户信息
*/
void updateUser(SysUser user);
/**
* 修改用户头像
*
* @param userName 用户名
* @param avatar 头像地址
*/
void updateUserAvatar(@Param("userName") String userName, @Param("avatar") String avatar);
/**
* 重置用户密码
*
* @param userName 用户名
* @param password 密码
*/
void resetUserPwd(@Param("userName") String userName, @Param("password") String password);
/**
* 通过用户ID删除用户
*
* @param userId 用户ID
* @return 结果
*/
int deleteUserById(Long userId);
/**
* 批量删除用户信息
*
* @param userIds 需要删除的用户ID
*/
void deleteUserByIds(Long[] userIds);
/**
* 校验用户名称是否唯一
*
* @param userName 用户名称
* @return 结果
*/
int checkUserNameUnique(String userName);
/**
* 校验手机号码是否唯一
*
* @param phonenumber 手机号码
* @return 结果
*/
SysUser checkPhoneUnique(String phonenumber);
/**
* 校验email是否唯一
*
* @param email 用户邮箱
* @return 结果
*/
SysUser checkEmailUnique(String email);
/**
* 已删除用户列表
*
* @param user user
* @return list
*/
List<SysUser> selectDeleteUserList(SysUser user);
/**
* 恢复已删除的用户
*
* @param userIds ids
*/
void recoveryDeleteUser(List<Long> userIds);
/**
* 彻底删除用户
*
* @param userId ids
*/
void realDeleteUser(List<Long> userId);
/**
* 更新用户最后登录的ip和时间
*
* @param username username
* @param ip 最后登录位置
* @param time 最后登录时间
*/
void updateUserLastLoginIpAndTime(@Param("userName") String username, @Param("ip") String ip, @Param("time") Date time);
}

View File

@ -0,0 +1,46 @@
package com.ailanyin.mapper;
import com.ailanyin.model.SysUserPost;
import java.util.List;
/**
* 用户与岗位关联表 数据层
*
* @author ruoyi
*/
public interface SysUserPostMapper
{
/**
* 通过用户ID删除用户和岗位关联
*
* @param userId 用户ID
* @return 结果
*/
public int deleteUserPostByUserId(Long userId);
/**
* 通过岗位ID查询岗位使用数量
*
* @param postId 岗位ID
* @return 结果
*/
public int countUserPostById(Long postId);
/**
* 批量删除用户和岗位关联
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteUserPost(Long[] ids);
/**
* 批量新增用户岗位信息
*
* @param userPostList 用户角色列表
* @return 结果
*/
public int batchUserPost(List<SysUserPost> userPostList);
}

View File

@ -0,0 +1,58 @@
package com.ailanyin.mapper;
import com.ailanyin.model.SysUserRole;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author ailanyin
* @version 1.0
* @since 2021/10/15 0015 下午 13:01
*/
public interface SysUserRoleMapper {
/**
* 通过用户ID删除用户和角色关联
*
* @param userId 用户ID
*/
void deleteUserRoleByUserId(Long userId);
/**
* 批量删除用户和角色关联
*
* @param ids 需要删除的数据ID
*/
void deleteUserRole(Long[] ids);
/**
* 通过角色ID查询角色使用数量
*
* @param roleId 角色ID
* @return 结果
*/
int countUserRoleByRoleId(Long roleId);
/**
* 批量新增用户角色信息
*
* @param userRoleList 用户角色列表
*/
void batchUserRole(List<SysUserRole> userRoleList);
/**
* 删除用户和角色关联信息
*
* @param userRole 用户和角色关联信息
*/
void deleteUserRoleInfo(SysUserRole userRole);
/**
* 批量取消授权用户角色
*
* @param roleId 角色ID
* @param userIds 需要删除的用户数据ID
*/
void deleteUserRoleInfos(@Param("roleId") Long roleId, @Param("userIds") Long[] userIds);
}

View File

@ -0,0 +1,30 @@
package com.ailanyin.model;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @author ailanyin
* @version 1.0
* @since 2021/11/2 0002 下午 17:08
*/
@Data
public class ExceptionLog implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "序号")
private String exceptionId;
@ApiModelProperty(value = "异常原因")
private String exceptionReason;
@ApiModelProperty(value = "堆栈信息")
private String detailInfo;
@ApiModelProperty(value = "异常时间")
private Date createTime;
}

View File

@ -0,0 +1,40 @@
package com.ailanyin.model;
import cn.afterturn.easypoi.excel.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.Map;
/**
* 黑名单
*
* @author ailanyin
* @version 1.0
* @since 2021/11/1 0001 下午 15:05
*/
@Data
public class SysBlacklistUser implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "序号")
@Excel(name = "名单编号", width = 25)
private String id;
@ApiModelProperty(value = "IP地址")
@Excel(name = "IP地址", width = 20)
private String ip;
@ApiModelProperty(value = "具体位置")
@Excel(name = "具体位置", width = 30)
private String address;
@ApiModelProperty(value = "拉黑原因")
@Excel(name = "拉黑原因", width = 25)
private String reason;
@ApiModelProperty(value = "拉黑时间")
@Excel(name = "拉黑时间", format = "yyyy-MM-dd HH:mm:ss", width = 25)
private Date createTime;
@ApiModelProperty(value = "查询参数")
private Map<String, Object> params;
}

View File

@ -0,0 +1,105 @@
package com.ailanyin.model;
import com.ailanyin.common.model.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
/**
* 参数配置表 sys_config
*
* @author ruoyi
*/
public class SysConfig extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 参数主键 */
private Long configId;
/** 参数名称 */
private String configName;
/** 参数键名 */
private String configKey;
/** 参数键值 */
private String configValue;
/** 系统内置Y是 N否 */
private String configType;
public Long getConfigId()
{
return configId;
}
public void setConfigId(Long configId)
{
this.configId = configId;
}
@NotBlank(message = "参数名称不能为空")
@Size(min = 0, max = 100, message = "参数名称不能超过100个字符")
public String getConfigName()
{
return configName;
}
public void setConfigName(String configName)
{
this.configName = configName;
}
@NotBlank(message = "参数键名长度不能为空")
@Size(min = 0, max = 100, message = "参数键名长度不能超过100个字符")
public String getConfigKey()
{
return configKey;
}
public void setConfigKey(String configKey)
{
this.configKey = configKey;
}
@NotBlank(message = "参数键值不能为空")
@Size(min = 0, max = 500, message = "参数键值长度不能超过500个字符")
public String getConfigValue()
{
return configValue;
}
public void setConfigValue(String configValue)
{
this.configValue = configValue;
}
public String getConfigType()
{
return configType;
}
public void setConfigType(String configType)
{
this.configType = configType;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("configId", getConfigId())
.append("configName", getConfigName())
.append("configKey", getConfigKey())
.append("configValue", getConfigValue())
.append("configType", getConfigType())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

View File

@ -0,0 +1,173 @@
package com.ailanyin.model;
import com.ailanyin.common.model.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.ArrayList;
import java.util.List;
/**
* 部门
*
* @author ailanyin
* @version 1.0
* @since 2021/10/15 0015 上午 10:05
*/
public class SysDept extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "部门ID")
private Long deptId;
@ApiModelProperty(value = "父部门ID")
private Long parentId;
@ApiModelProperty(value = "祖级列表")
private String ancestors;
@ApiModelProperty(value = "部门名称")
private String deptName;
@ApiModelProperty(value = "显示顺序")
private String orderNum;
@ApiModelProperty(value = "负责人")
private String leader;
@ApiModelProperty(value = "联系电话")
private String phone;
@ApiModelProperty(value = "邮箱")
private String email;
@ApiModelProperty(value = "部门状态:0正常,1停用")
private String status;
@ApiModelProperty(value = "删除标志0代表存在 2代表删除")
private String delFlag;
@ApiModelProperty(value = "父部门名称")
private String parentName;
@ApiModelProperty(value = "子部门")
private List<SysDept> children = new ArrayList<SysDept>();
public Long getDeptId() {
return deptId;
}
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
public Long getParentId() {
return parentId;
}
public void setParentId(Long parentId) {
this.parentId = parentId;
}
public String getAncestors() {
return ancestors;
}
public void setAncestors(String ancestors) {
this.ancestors = ancestors;
}
public String getDeptName() {
return deptName;
}
public void setDeptName(String deptName) {
this.deptName = deptName;
}
public String getOrderNum() {
return orderNum;
}
public void setOrderNum(String orderNum) {
this.orderNum = orderNum;
}
public String getLeader() {
return leader;
}
public void setLeader(String leader) {
this.leader = leader;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public String getParentName() {
return parentName;
}
public void setParentName(String parentName) {
this.parentName = parentName;
}
public List<SysDept> getChildren() {
return children;
}
public void setChildren(List<SysDept> children) {
this.children = children;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("deptId", getDeptId())
.append("parentId", getParentId())
.append("ancestors", getAncestors())
.append("deptName", getDeptName())
.append("orderNum", getOrderNum())
.append("leader", getLeader())
.append("phone", getPhone())
.append("email", getEmail())
.append("status", getStatus())
.append("delFlag", getDelFlag())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -0,0 +1,166 @@
package com.ailanyin.model;
import com.ailanyin.common.constant.UserConstants;
import com.ailanyin.common.model.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
/**
* 字典数据表 sys_dict_data
*
* @author ruoyi
*/
public class SysDictData extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 字典编码
*/
private Long dictCode;
/**
* 字典排序
*/
private Long dictSort;
/**
* 字典标签
*/
private String dictLabel;
/**
* 字典键值
*/
private String dictValue;
/**
* 字典类型
*/
private String dictType;
/**
* 样式属性(其他样式扩展)
*/
private String cssClass;
/**
* 表格字典样式
*/
private String listClass;
/**
* 是否默认Y是 N否
*/
private String isDefault;
/**
* 状态0正常 1停用
*/
private String status;
public Long getDictCode() {
return dictCode;
}
public void setDictCode(Long dictCode) {
this.dictCode = dictCode;
}
public Long getDictSort() {
return dictSort;
}
public void setDictSort(Long dictSort) {
this.dictSort = dictSort;
}
@NotBlank(message = "字典标签不能为空")
@Size(min = 0, max = 100, message = "字典标签长度不能超过100个字符")
public String getDictLabel() {
return dictLabel;
}
public void setDictLabel(String dictLabel) {
this.dictLabel = dictLabel;
}
@NotBlank(message = "字典键值不能为空")
@Size(min = 0, max = 100, message = "字典键值长度不能超过100个字符")
public String getDictValue() {
return dictValue;
}
public void setDictValue(String dictValue) {
this.dictValue = dictValue;
}
@NotBlank(message = "字典类型不能为空")
@Size(min = 0, max = 100, message = "字典类型长度不能超过100个字符")
public String getDictType() {
return dictType;
}
public void setDictType(String dictType) {
this.dictType = dictType;
}
@Size(min = 0, max = 100, message = "样式属性长度不能超过100个字符")
public String getCssClass() {
return cssClass;
}
public void setCssClass(String cssClass) {
this.cssClass = cssClass;
}
public String getListClass() {
return listClass;
}
public void setListClass(String listClass) {
this.listClass = listClass;
}
public boolean getDefault() {
return UserConstants.YES.equals(this.isDefault) ? true : false;
}
public String getIsDefault() {
return isDefault;
}
public void setIsDefault(String isDefault) {
this.isDefault = isDefault;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("dictCode", getDictCode())
.append("dictSort", getDictSort())
.append("dictLabel", getDictLabel())
.append("dictValue", getDictValue())
.append("dictType", getDictType())
.append("cssClass", getCssClass())
.append("listClass", getListClass())
.append("isDefault", getIsDefault())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

View File

@ -0,0 +1,89 @@
package com.ailanyin.model;
import com.ailanyin.common.model.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
/**
* 字典类型表 sys_dict_type
*
* @author ruoyi
*/
public class SysDictType extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 字典主键 */
private Long dictId;
/** 字典名称 */
private String dictName;
/** 字典类型 */
private String dictType;
/** 状态0正常 1停用 */
private String status;
public Long getDictId()
{
return dictId;
}
public void setDictId(Long dictId)
{
this.dictId = dictId;
}
@NotBlank(message = "字典名称不能为空")
@Size(min = 0, max = 100, message = "字典类型名称长度不能超过100个字符")
public String getDictName()
{
return dictName;
}
public void setDictName(String dictName)
{
this.dictName = dictName;
}
@NotBlank(message = "字典类型不能为空")
@Size(min = 0, max = 100, message = "字典类型类型长度不能超过100个字符")
public String getDictType()
{
return dictType;
}
public void setDictType(String dictType)
{
this.dictType = dictType;
}
public String getStatus()
{
return status;
}
public void setStatus(String status)
{
this.status = status;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("dictId", getDictId())
.append("dictName", getDictName())
.append("dictType", getDictType())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

View File

@ -0,0 +1,57 @@
package com.ailanyin.model;
import cn.afterturn.easypoi.excel.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.Map;
/**
* @author ailanyin
* @version 1.0
* @since 2021/10/15 0015 上午 10:05
*/
@Data
public class SysLog implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@Excel(name = "日志编号", width = 30)
private String id;
@ApiModelProperty(value = "操作描述")
@Excel(name = "操作描述", width = 30)
private String description;
@ApiModelProperty(value = "操作用户")
@Excel(name = "请求人员")
private String username;
@ApiModelProperty(value = "访问时间")
@Excel(name = "请求时间", format = "yyyy-MM-dd HH:mm:ss", width = 30)
private Date startTime;
@ApiModelProperty(value = "执行时间")
@Excel(name = "请求耗时")
private Integer spendTime;
@ApiModelProperty(value = "请求类型")
@Excel(name = "请求方式")
private String method;
@ApiModelProperty(value = "IP地址")
@Excel(name = "请求地址")
private String ip;
@ApiModelProperty(value = "请求路径")
private String uri;
@ApiModelProperty(value = "请求参数")
private String parameter;
private Map<String, Object> params;
}

View File

@ -0,0 +1,251 @@
package com.ailanyin.model;
import com.ailanyin.common.model.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.ArrayList;
import java.util.List;
/**
* @author ailanyin
* @version 1.0
* @since 2021/10/15 0015 上午 10:08
*/
public class SysMenu extends BaseEntity
{
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "菜单ID")
private Long menuId;
@ApiModelProperty(value = "菜单名称")
private String menuName;
@ApiModelProperty(value = "父菜单名称")
private String parentName;
@ApiModelProperty(value = "父菜单ID")
private Long parentId;
@ApiModelProperty(value = "显示顺序")
private String orderNum;
@ApiModelProperty(value = "路由地址")
private String path;
@ApiModelProperty(value = "组件路径")
private String component;
@ApiModelProperty(value = "路由参数")
private String query;
@ApiModelProperty(value = "是否为外链(0->是,1->否)")
private String isFrame;
@ApiModelProperty(value = "是否缓存(0->是,1->否)")
private String isCache;
@ApiModelProperty(value = "类型(M目录 C菜单 F按钮)")
private String menuType;
@ApiModelProperty(value = "显示状态(0显示 1隐藏)")
private String visible;
@ApiModelProperty(value = "菜单状态(0显示 1隐藏)")
private String status;
@ApiModelProperty(value = "权限字符串")
private String perms;
@ApiModelProperty(value = "菜单图标")
private String icon;
@ApiModelProperty(value = "子菜单")
private List<SysMenu> children = new ArrayList<SysMenu>();
public Long getMenuId()
{
return menuId;
}
public void setMenuId(Long menuId)
{
this.menuId = menuId;
}
public String getMenuName()
{
return menuName;
}
public void setMenuName(String menuName)
{
this.menuName = menuName;
}
public String getParentName()
{
return parentName;
}
public void setParentName(String parentName)
{
this.parentName = parentName;
}
public Long getParentId()
{
return parentId;
}
public void setParentId(Long parentId)
{
this.parentId = parentId;
}
public String getOrderNum()
{
return orderNum;
}
public void setOrderNum(String orderNum)
{
this.orderNum = orderNum;
}
public String getPath()
{
return path;
}
public void setPath(String path)
{
this.path = path;
}
public String getComponent()
{
return component;
}
public void setComponent(String component)
{
this.component = component;
}
public String getQuery()
{
return query;
}
public void setQuery(String query)
{
this.query = query;
}
public String getIsFrame()
{
return isFrame;
}
public void setIsFrame(String isFrame)
{
this.isFrame = isFrame;
}
public String getIsCache()
{
return isCache;
}
public void setIsCache(String isCache)
{
this.isCache = isCache;
}
public String getMenuType()
{
return menuType;
}
public void setMenuType(String menuType)
{
this.menuType = menuType;
}
public String getVisible()
{
return visible;
}
public void setVisible(String visible)
{
this.visible = visible;
}
public String getStatus()
{
return status;
}
public void setStatus(String status)
{
this.status = status;
}
public String getPerms()
{
return perms;
}
public void setPerms(String perms)
{
this.perms = perms;
}
public String getIcon()
{
return icon;
}
public void setIcon(String icon)
{
this.icon = icon;
}
public List<SysMenu> getChildren()
{
return children;
}
public void setChildren(List<SysMenu> children)
{
this.children = children;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("menuId", getMenuId())
.append("menuName", getMenuName())
.append("parentId", getParentId())
.append("orderNum", getOrderNum())
.append("path", getPath())
.append("component", getComponent())
.append("isFrame", getIsFrame())
.append("IsCache", getIsCache())
.append("menuType", getMenuType())
.append("visible", getVisible())
.append("status ", getStatus())
.append("perms", getPerms())
.append("icon", getIcon())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

View File

@ -0,0 +1,121 @@
package com.ailanyin.model;
import com.ailanyin.common.model.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
/**
* 岗位实体
*
* @author ailanyin
* @version 1.0
* @since 2021/10/15 0015 上午 10:00
*/
public class SysPost extends BaseEntity
{
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "岗位序号")
private Long postId;
@ApiModelProperty(value = "岗位编码")
private String postCode;
@ApiModelProperty(value = "岗位名称")
private String postName;
@ApiModelProperty(value = "岗位排序")
private String postSort;
@ApiModelProperty(value = "状态0正常 1停用")
private String status;
@ApiModelProperty(value = "用户是否存在此岗位标识 默认不存在")
private boolean flag = false;
public Long getPostId()
{
return postId;
}
public void setPostId(Long postId)
{
this.postId = postId;
}
@NotBlank(message = "岗位编码不能为空")
@Size(min = 0, max = 64, message = "岗位编码长度不能超过64个字符")
public String getPostCode()
{
return postCode;
}
public void setPostCode(String postCode)
{
this.postCode = postCode;
}
@NotBlank(message = "岗位名称不能为空")
@Size(min = 0, max = 50, message = "岗位名称长度不能超过50个字符")
public String getPostName()
{
return postName;
}
public void setPostName(String postName)
{
this.postName = postName;
}
@NotBlank(message = "显示顺序不能为空")
public String getPostSort()
{
return postSort;
}
public void setPostSort(String postSort)
{
this.postSort = postSort;
}
public String getStatus()
{
return status;
}
public void setStatus(String status)
{
this.status = status;
}
public boolean isFlag()
{
return flag;
}
public void setFlag(boolean flag)
{
this.flag = flag;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("postId", getPostId())
.append("postCode", getPostCode())
.append("postName", getPostName())
.append("postSort", getPostSort())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

View File

@ -0,0 +1,182 @@
package com.ailanyin.model;
import com.ailanyin.common.model.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import java.util.Arrays;
/**
* @author ailanyin
* @version 1.0
* @since 2021/10/15 0015 上午 10:06
*/
public class SysRole extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "角色ID")
private Long roleId;
@ApiModelProperty(value = "角色名称")
private String roleName;
@ApiModelProperty(value = "角色权限")
private String roleKey;
@ApiModelProperty(value = "角色排序")
private String roleSort;
@ApiModelProperty(value = "数据范围1所有数据权限2自定义数据权限3本部门数据权限4本部门及以下数据权限5仅本人数据权限")
private String dataScope;
@ApiModelProperty(value = "菜单树选择项是否关联显示( 0父子不互相关联显示 1父子互相关联显示")
private boolean menuCheckStrictly;
@ApiModelProperty(value = "部门树选择项是否关联显示0父子不互相关联显示 1父子互相关联显示 ")
private boolean deptCheckStrictly;
@ApiModelProperty(value = "角色状态0正常 1停用")
private String status;
@ApiModelProperty(value = "删除标志0代表存在 2代表删除")
private String delFlag;
@ApiModelProperty(value = "用户是否存在此角色标识 默认不存在")
private boolean flag = false;
@ApiModelProperty(value = "菜单组")
private Long[] menuIds;
@ApiModelProperty(value = "部门组(数据权限)")
private Long[] deptIds;
public SysRole() {
}
public SysRole(Long roleId) {
this.roleId = roleId;
}
public Long getRoleId() {
return roleId;
}
public void setRoleId(Long roleId) {
this.roleId = roleId;
}
public boolean isAdmin() {
return isAdmin(this.roleId);
}
public static boolean isAdmin(Long roleId) {
return roleId != null && 1L == roleId;
}
public String getRoleName() {
return roleName;
}
public void setRoleName(String roleName) {
this.roleName = roleName;
}
public String getRoleKey() {
return roleKey;
}
public void setRoleKey(String roleKey) {
this.roleKey = roleKey;
}
public String getRoleSort() {
return roleSort;
}
public void setRoleSort(String roleSort) {
this.roleSort = roleSort;
}
public String getDataScope() {
return dataScope;
}
public void setDataScope(String dataScope) {
this.dataScope = dataScope;
}
public boolean isMenuCheckStrictly() {
return menuCheckStrictly;
}
public void setMenuCheckStrictly(boolean menuCheckStrictly) {
this.menuCheckStrictly = menuCheckStrictly;
}
public boolean isDeptCheckStrictly() {
return deptCheckStrictly;
}
public void setDeptCheckStrictly(boolean deptCheckStrictly) {
this.deptCheckStrictly = deptCheckStrictly;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public boolean isFlag() {
return flag;
}
public void setFlag(boolean flag) {
this.flag = flag;
}
public Long[] getMenuIds() {
return menuIds;
}
public void setMenuIds(Long[] menuIds) {
this.menuIds = menuIds;
}
public Long[] getDeptIds() {
return deptIds;
}
public void setDeptIds(Long[] deptIds) {
this.deptIds = deptIds;
}
@Override
public String toString() {
return "SysRole{" +
"roleId=" + roleId +
", roleName='" + roleName + '\'' +
", roleKey='" + roleKey + '\'' +
", roleSort='" + roleSort + '\'' +
", dataScope='" + dataScope + '\'' +
", menuCheckStrictly=" + menuCheckStrictly +
", deptCheckStrictly=" + deptCheckStrictly +
", status='" + status + '\'' +
", delFlag='" + delFlag + '\'' +
", flag=" + flag +
", menuIds=" + Arrays.toString(menuIds) +
", deptIds=" + Arrays.toString(deptIds) +
'}';
}
}

View File

@ -0,0 +1,46 @@
package com.ailanyin.model;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 角色和部门关联 sys_role_dept
*
* @author ruoyi
*/
public class SysRoleDept
{
/** 角色ID */
private Long roleId;
/** 部门ID */
private Long deptId;
public Long getRoleId()
{
return roleId;
}
public void setRoleId(Long roleId)
{
this.roleId = roleId;
}
public Long getDeptId()
{
return deptId;
}
public void setDeptId(Long deptId)
{
this.deptId = deptId;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("roleId", getRoleId())
.append("deptId", getDeptId())
.toString();
}
}

View File

@ -0,0 +1,46 @@
package com.ailanyin.model;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 角色和菜单关联 sys_role_menu
*
* @author ruoyi
*/
public class SysRoleMenu
{
/** 角色ID */
private Long roleId;
/** 菜单ID */
private Long menuId;
public Long getRoleId()
{
return roleId;
}
public void setRoleId(Long roleId)
{
this.roleId = roleId;
}
public Long getMenuId()
{
return menuId;
}
public void setMenuId(Long menuId)
{
this.menuId = menuId;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("roleId", getRoleId())
.append("menuId", getMenuId())
.toString();
}
}

View File

@ -0,0 +1,270 @@
package com.ailanyin.model;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.ailanyin.common.model.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
/**
* @author ailanyin
* @version 1.0
* @since 2021/10/15 0015 上午 10:03
*/
public class SysUser extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "用户ID")
@Excel(name = "用户序号", width = 20)
private Long userId;
@ApiModelProperty(value = "部门ID")
@Excel(name = "部门编号", width = 20)
private Long deptId;
@ApiModelProperty(value = "用户账号")
@Excel(name = "登录账号", width = 20)
private String userName;
@ApiModelProperty(value = "用户昵称")
@Excel(name = "用户昵称", width = 20)
private String nickName;
@ApiModelProperty(value = "用户邮箱")
@Excel(name = "用户邮箱", width = 20)
private String email;
@ApiModelProperty(value = "手机号码")
@Excel(name = "手机号码", width = 20)
private String phonenumber;
@ApiModelProperty(value = "用户性别")
@Excel(name = "用户性别", replace = {"男_0", "女_1","未知_2"})
private String sex;
@ApiModelProperty(value = "用户头像")
private String avatar;
@ApiModelProperty(value = "密码")
private String password;
@ApiModelProperty(value = "帐号状态0正常 1停用")
@Excel(name = "帐号状态", replace = {"正常_0", "停用_1"})
private String status;
@ApiModelProperty(value = "删除标志0代表存在 2代表删除")
private String delFlag;
@ApiModelProperty(value = "最后登录IP")
@Excel(name = "最后登录IP", width = 20)
private String loginIp;
@ApiModelProperty(value = "最后登录时间")
@Excel(name = "最后登录时间", format = "yyyy-MM-dd HH:mm:ss", width = 30)
private Date loginDate;
@ApiModelProperty(value = "部门对象")
private SysDept dept;
@ApiModelProperty(value = "角色对象")
private List<SysRole> roles;
@ApiModelProperty(value = "角色组")
private Long[] roleIds;
@ApiModelProperty(value = "岗位组")
private Long[] postIds;
@ApiModelProperty(value = "角色ID")
private Long roleId;
public SysUser() {
}
public SysUser(Long userId) {
this.userId = userId;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public boolean isAdmin() {
return isAdmin(this.userId);
}
public static boolean isAdmin(Long userId) {
return userId != null && 1L == userId;
}
public Long getDeptId() {
return deptId;
}
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPhonenumber() {
return phonenumber;
}
public void setPhonenumber(String phonenumber) {
this.phonenumber = phonenumber;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public String getAvatar() {
return avatar;
}
public void setAvatar(String avatar) {
this.avatar = avatar;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public String getLoginIp() {
return loginIp;
}
public void setLoginIp(String loginIp) {
this.loginIp = loginIp;
}
public Date getLoginDate() {
return loginDate;
}
public void setLoginDate(Date loginDate) {
this.loginDate = loginDate;
}
public SysDept getDept() {
return dept;
}
public void setDept(SysDept dept) {
this.dept = dept;
}
public List<SysRole> getRoles() {
return roles;
}
public void setRoles(List<SysRole> roles) {
this.roles = roles;
}
public Long[] getRoleIds() {
return roleIds;
}
public void setRoleIds(Long[] roleIds) {
this.roleIds = roleIds;
}
public Long[] getPostIds() {
return postIds;
}
public void setPostIds(Long[] postIds) {
this.postIds = postIds;
}
public Long getRoleId() {
return roleId;
}
public void setRoleId(Long roleId) {
this.roleId = roleId;
}
@Override
public String toString() {
return "SysUser{" +
"userId=" + userId +
", deptId=" + deptId +
", userName='" + userName + '\'' +
", nickName='" + nickName + '\'' +
", email='" + email + '\'' +
", phonenumber='" + phonenumber + '\'' +
", sex='" + sex + '\'' +
", avatar='" + avatar + '\'' +
", password='" + password + '\'' +
", status='" + status + '\'' +
", delFlag='" + delFlag + '\'' +
", loginIp='" + loginIp + '\'' +
", loginDate=" + loginDate +
", dept=" + dept +
", roles=" + roles +
", roleIds=" + Arrays.toString(roleIds) +
", postIds=" + Arrays.toString(postIds) +
", roleId=" + roleId +
'}';
}
}

View File

@ -0,0 +1,46 @@
package com.ailanyin.model;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 用户和岗位关联 sys_user_post
*
* @author ruoyi
*/
public class SysUserPost
{
/** 用户ID */
private Long userId;
/** 岗位ID */
private Long postId;
public Long getUserId()
{
return userId;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getPostId()
{
return postId;
}
public void setPostId(Long postId)
{
this.postId = postId;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("userId", getUserId())
.append("postId", getPostId())
.toString();
}
}

View File

@ -0,0 +1,46 @@
package com.ailanyin.model;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 用户和角色关联 sys_user_role
*
* @author ruoyi
*/
public class SysUserRole
{
/** 用户ID */
private Long userId;
/** 角色ID */
private Long roleId;
public Long getUserId()
{
return userId;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getRoleId()
{
return roleId;
}
public void setRoleId(Long roleId)
{
this.roleId = roleId;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("userId", getUserId())
.append("roleId", getRoleId())
.toString();
}
}

View File

@ -0,0 +1,76 @@
package com.ailanyin.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.io.Serializable;
import java.util.List;
import java.util.stream.Collectors;
/**
* Treeselect树结构实体类
*
* @author ruoyi
*/
public class TreeSelect implements Serializable
{
private static final long serialVersionUID = 1L;
/** 节点ID */
private Long id;
/** 节点名称 */
private String label;
/** 子节点 */
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private List<TreeSelect> children;
public TreeSelect()
{
}
public TreeSelect(SysDept dept)
{
this.id = dept.getDeptId();
this.label = dept.getDeptName();
this.children = dept.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
}
public TreeSelect(SysMenu menu)
{
this.id = menu.getMenuId();
this.label = menu.getMenuName();
this.children = menu.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
}
public Long getId()
{
return id;
}
public void setId(Long id)
{
this.id = id;
}
public String getLabel()
{
return label;
}
public void setLabel(String label)
{
this.label = label;
}
public List<TreeSelect> getChildren()
{
return children;
}
public void setChildren(List<TreeSelect> children)
{
this.children = children;
}
}

View File

@ -0,0 +1,61 @@
<?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.ailanyin.mapper.ExceptionLogMapper">
<resultMap id="BaseResultMap" type="com.ailanyin.model.ExceptionLog">
<id column="exception_id" jdbcType="BIGINT" property="exceptionId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.ailanyin.model.ExceptionLog">
<result column="exception_reason" jdbcType="LONGVARCHAR" property="exceptionReason" />
<result column="detail_info" jdbcType="LONGVARCHAR" property="detailInfo" />
</resultMap>
<insert id="insertExceptionLog">
insert into ROOT."exception_log"
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="exceptionId != null">
"exception_id",
</if>
<if test="createTime != null">
"create_time",
</if>
<if test="exceptionReason != null">
"exception_reason",
</if>
<if test="detailInfo != null">
"detail_info",
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="exceptionId != null">
#{exceptionId},
</if>
<if test="createTime != null">
#{createTime},
</if>
<if test="exceptionReason != null">
#{exceptionReason},
</if>
<if test="detailInfo != null">
#{detailInfo},
</if>
</trim>
</insert>
<delete id="deleteBatchIds">
delete from ROOT."exception_log"
where "exception_id" in
<foreach collection="ids" item="item" index="index"
separator="," open="(" close=")">
#{item}
</foreach>
</delete>
<select id="selectListByParam" resultMap="ResultMapWithBLOBs">
select "exception_id","create_time","exception_reason","detail_info"
from ROOT."exception_log"
order by "create_time" desc
</select>
</mapper>

View File

@ -0,0 +1,83 @@
<?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.ailanyin.mapper.SysBlacklistUserMapper">
<resultMap id="BaseResultMap" type="com.ailanyin.model.SysBlacklistUser">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="ip" jdbcType="VARCHAR" property="ip" />
<result column="address" jdbcType="VARCHAR" property="address" />
<result column="reason" jdbcType="VARCHAR" property="reason" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
</resultMap>
<sql id="Base_Column_List">
"id", "ip", "address", "reason", "create_time"
</sql>
<insert id="insertBlacklistUser" parameterType="com.ailanyin.model.SysBlacklistUser">
insert into ROOT."sys_blacklist_user"
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
"id",
</if>
<if test="ip != null">
"ip",
</if>
<if test="address != null">
"address",
</if>
<if test="reason != null">
"reason",
</if>
<if test="createTime != null">
"create_time",
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="ip != null">
#{ip,jdbcType=VARCHAR},
</if>
<if test="address != null">
#{address,jdbcType=VARCHAR},
</if>
<if test="reason != null">
#{reason,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<delete id="deleteBatchIds">
delete from ROOT."sys_blacklist_user"
where "id" in
<foreach collection="ids" item="item" index="index"
separator="," open="(" close=")">
#{item}
</foreach>
</delete>
<select id="selectByParam" resultMap="BaseResultMap">
select "id", "ip", "address", "reason", "create_time"
from ROOT."sys_blacklist_user"
<where>
<if test="ip != null and ip != ''">
"ip" like concat('%', #{ip}, '%')
</if>
<if test="reason != null and reason != ''">
AND "reason" = #{reason}
</if>
<if test="params != null"><!-- 开始时间检索 -->
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
AND date_format("create_time",'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
AND date_format("create_time",'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
</if>
</where>
order by "create_time" desc
</select>
</mapper>

View File

@ -0,0 +1,112 @@
<?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.ailanyin.mapper.SysConfigMapper">
<resultMap type="SysConfig" id="SysConfigResult">
<id property="configId" column="config_id" />
<result property="configName" column="config_name" />
<result property="configKey" column="config_key" />
<result property="configValue" column="config_value" />
<result property="configType" column="config_type" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectConfigVo">
select "config_id", "config_name", "config_key", "config_value", "config_type", "create_by", "create_time", "update_by", "update_time", "remark"
from ROOT."sys_config"
</sql>
<!-- 查询条件 -->
<sql id="sqlwhereSearch">
<where>
<if test="configId !=null">
and "config_id" = #{configId}
</if>
<if test="configKey !=null and configKey != ''">
and "config_key" = #{configKey}
</if>
</where>
</sql>
<select id="selectConfig" parameterType="SysConfig" resultMap="SysConfigResult">
<include refid="selectConfigVo"/>
<include refid="sqlwhereSearch"/>
</select>
<select id="selectConfigList" parameterType="SysConfig" resultMap="SysConfigResult">
<include refid="selectConfigVo"/>
<where>
<if test="configName != null and configName != ''">
AND "config_name" like concat(concat('%',#{configName}),'%')
</if>
<if test="configType != null and configType != ''">
AND "config_type" = #{configType}
</if>
<if test="configKey != null and configKey != ''">
AND "config_key" like concat(concat('%',#{configKey}),'%')
</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
and "create_time" &gt;= to_date(#{params.beginTime},'yyyy-MM-dd HH24:mi:ss')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
and "create_time" &lt;= to_date(#{params.endTime},'yyyy-MM-dd HH24:mi:ss')
</if>
</where>
</select>
<select id="checkConfigKeyUnique" parameterType="String" resultMap="SysConfigResult">
<include refid="selectConfigVo"/>
where "config_key" = #{configKey}
</select>
<insert id="insertConfig" parameterType="SysConfig" >
insert into ROOT."sys_config" (
<if test="configName != null and configName != '' ">"config_name",</if>
<if test="configKey != null and configKey != '' ">"config_key",</if>
<if test="configValue != null and configValue != '' ">"config_value",</if>
<if test="configType != null and configType != '' ">"config_type",</if>
<if test="createBy != null and createBy != ''">"create_by",</if>
<if test="remark != null and remark != ''">"remark",</if>
"create_time"
)values(
<if test="configName != null and configName != ''">#{configName},</if>
<if test="configKey != null and configKey != ''">#{configKey},</if>
<if test="configValue != null and configValue != ''">#{configValue},</if>
<if test="configType != null and configType != ''">#{configType},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="remark != null and remark != ''">#{remark},</if>
sysdate
)
</insert>
<update id="updateConfig" parameterType="SysConfig">
update ROOT."sys_config"
<set>
<if test="configName != null and configName != ''">"config_name" = #{configName},</if>
<if test="configKey != null and configKey != ''">"config_key" = #{configKey},</if>
<if test="configValue != null and configValue != ''">"config_value" = #{configValue},</if>
<if test="configType != null and configType != ''">"config_type" = #{configType},</if>
<if test="updateBy != null and updateBy != ''">"update_by" = #{updateBy},</if>
<if test="remark != null">"remark" = #{remark},</if>
"update_time" = sysdate
</set>
where "config_id" = #{configId}
</update>
<delete id="deleteConfigByIds" parameterType="String">
delete from ROOT."sys_config" where "config_id" in
<foreach item="configId" collection="array" open="(" separator="," close=")">
#{configId}
</foreach>
</delete>
<delete id="deleteConfigById">
delete from ROOT."sys_config" where "config_id" = #{configId}
</delete>
</mapper>

View File

@ -0,0 +1,185 @@
<?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.ailanyin.mapper.SysDeptMapper">
<resultMap type="SysDept" id="SysDeptResult">
<id property="deptId" column="dept_id" />
<result property="parentId" column="parent_id" />
<result property="ancestors" column="ancestors" />
<result property="deptName" column="dept_name" />
<result property="orderNum" column="order_num" />
<result property="leader" column="leader" />
<result property="phone" column="phone" />
<result property="email" column="email" />
<result property="status" column="status" />
<result property="delFlag" column="del_flag" />
<result property="parentName" column="parent_name" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectDeptVo">
select d."dept_id", d."parent_id", d."ancestors", d."dept_name", d."order_num", d."leader", d."phone", d."email", d."status", d."del_flag", d."create_by", d."create_time"
from ROOT."sys_dept" d
</sql>
<select id="selectRoleDeptTree" parameterType="Long" resultType="String">
select concat(d."dept_id", d."dept_name") as "dept_name"
from ROOT."sys_dept" d
left join ROOT."sys_role_dept" rd on d."dept_id" = rd."dept_id"
where d."del_flag" = '0' and rd."role_id" = #{roleId}
order by d."parent_id", d."order_num"
</select>
<select id="hasChildByDeptId" parameterType="Long" resultType="int">
select count(1) from ROOT."sys_dept"
where "del_flag" = '0' and "parent_id" = #{deptId} limit 1
</select>
<select id="selectDeptList" parameterType="SysDept" resultMap="SysDeptResult">
<include refid="selectDeptVo"/>
where d."del_flag" = '0'
<if test="parentId != null and parentId != 0">
AND "parent_id" = #{parentId}
</if>
<if test="deptName != null and deptName != ''">
AND "dept_name" like concat(concat('%',#{deptName}),'%')
</if>
<if test="status != null and status != ''">
AND "status" = #{status}
</if>
<!-- 数据范围过滤 -->
${params.dataScope}
order by d."parent_id", d."order_num"
</select>
<select id="checkDeptExistUser" parameterType="Long" resultType="int">
select count(1) from ROOT."sys_user" where "dept_id" = #{deptId} and "del_flag" = '0'
</select>
<select id="selectDeptCount" parameterType="SysDept" resultType="int">
select count(1) from ROOT."sys_dept"
where "del_flag" = '0'
<if test="deptId != null and deptId != 0"> and "dept_id" = #{deptId} </if>
<if test="parentId != null and parentId != 0"> and "parent_id" = #{parentId} </if>
</select>
<select id="checkDeptNameUnique" resultMap="SysDeptResult">
<include refid="selectDeptVo"/>
where "dept_name"=#{deptName} and "parent_id" = #{parentId}
</select>
<select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult">
select d."dept_id", d."parent_id", d."ancestors", d."dept_name", d."order_num", d."leader", d."phone", d."email", d."status",
(select "dept_name" from ROOT."sys_dept" where "dept_id" = d."parent_id") "parent_name"
from ROOT."sys_dept" d
where d."dept_id" = #{deptId}
</select>
<select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult">
select * from ROOT."sys_dept" where "ancestors" like concat(concat('%,',#{deptName}),'%,')
</select>
<insert id="insertDept" parameterType="SysDept" >
insert into ROOT."sys_dept"(
<if test="parentId != null and parentId != 0">"parent_id",</if>
<if test="deptName != null and deptName != ''">"dept_name",</if>
<if test="ancestors != null and ancestors != ''">"ancestors",</if>
<if test="orderNum != null and orderNum != ''">"order_num",</if>
<if test="leader != null and leader != ''">"leader",</if>
<if test="phone != null and phone != ''">"phone",</if>
<if test="email != null and email != ''">"email",</if>
<if test="status != null">"status",</if>
<if test="createBy != null and createBy != ''">"create_by",</if>
"create_time"
)values(
<if test="parentId != null and parentId != 0">#{parentId},</if>
<if test="deptName != null and deptName != ''">#{deptName},</if>
<if test="ancestors != null and ancestors != ''">#{ancestors},</if>
<if test="orderNum != null and orderNum != ''">#{orderNum},</if>
<if test="leader != null and leader != ''">#{leader},</if>
<if test="phone != null and phone != ''">#{phone},</if>
<if test="email != null and email != ''">#{email},</if>
<if test="status != null">#{status},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate
)
</insert>
<update id="updateDept" parameterType="SysDept">
update ROOT."sys_dept"
<set>
<if test="parentId != null and parentId != 0">"parent_id" = #{parentId},</if>
<if test="deptName != null and deptName != ''">"dept_name" = #{deptName},</if>
<if test="ancestors != null and ancestors != ''">"ancestors" = #{ancestors},</if>
<if test="orderNum != null and orderNum != ''">"order_num" = #{orderNum},</if>
<if test="leader != null">"leader" = #{leader},</if>
<if test="phone != null">"phone" = #{phone},</if>
<if test="email != null">"email" = #{email},</if>
<if test="status != null and status != ''">"status" = #{status},</if>
<if test="updateBy != null and updateBy != ''">"update_by" = #{updateBy},</if>
"update_time" = sysdate
</set>
where "dept_id" = #{deptId}
</update>
<update id="updateDeptChildren" parameterType="java.util.List">
update ROOT."sys_dept" set "ancestors" =
<foreach collection="deptList" item="item" index="index"
separator=" " open="case &quot;dept_id&quot;" close="end">
when #{item.deptId} then #{item.ancestors}
</foreach>
where "dept_id" in
<foreach collection="deptList" item="item" index="index"
separator="," open="(" close=")">
#{item.deptId}
</foreach>
</update>
<delete id="deleteDeptById" parameterType="Long">
update ROOT."sys_dept" set "del_flag" = '2' where "dept_id" = #{deptId}
</delete>
<update id="updateDeptStatus" parameterType="SysDept">
update ROOT."sys_dept"
<set>
<if test="status != null and status != ''">"status" = #{status},</if>
<if test="updateBy != null and updateBy != ''">"update_by" = #{updateBy},</if>
"update_time" = sysdate
</set>
where "dept_id" in (${"ancestors"})
</update>
<select id="selectAllChild" resultMap="SysDeptResult">
<include refid="selectDeptVo"/>
where d."del_flag" = '0' AND d."parent_id" = #{deptId}
</select>
<select id="selectAllGrandson" resultMap="SysDeptResult">
<include refid="selectDeptVo"/>
where d."del_flag" = '0'
AND d."ancestors" like concat(concat('%,',#{deptId}),',%')
</select>
<update id="updateDeptStatusNormal" parameterType="Long">
update ROOT."sys_dept" set "status" = '0' where "dept_id" in
<foreach collection="array" item="deptId" open="(" separator="," close=")">
#{deptId}
</foreach>
</update>
<select id="selectDeptListByRoleId" resultType="Integer">
select d."dept_id"
from ROOT."sys_dept" d
left join ROOT."sys_role_dept" rd on d."dept_id" = rd."dept_id"
where rd."role_id" = #{roleId}
<if test="deptCheckStrictly">
and d."dept_id" not in (select d."parent_id" from ROOT."sys_dept" d inner join ROOT."sys_role_dept" rd on d."dept_id" = rd."dept_id" and rd."role_id" = #{roleId})
</if>
order by d."parent_id", d."order_num"
</select>
</mapper>

View File

@ -0,0 +1,123 @@
<?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.ailanyin.mapper.SysDictDataMapper">
<resultMap type="SysDictData" id="SysDictDataResult">
<id property="dictCode" column="dict_code" />
<result property="dictSort" column="dict_sort" />
<result property="dictLabel" column="dict_label" />
<result property="dictValue" column="dict_value" />
<result property="dictType" column="dict_type" />
<result property="cssClass" column="css_class" />
<result property="listClass" column="list_class" />
<result property="isDefault" column="is_default" />
<result property="status" column="status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectDictDataVo">
select "dict_code", "dict_sort", "dict_label", "dict_value", "dict_type", "css_class", "list_class", "is_default", "status", "create_by", "create_time", "remark"
from ROOT."sys_dict_data"
</sql>
<select id="selectDictDataList" parameterType="SysDictData" resultMap="SysDictDataResult">
<include refid="selectDictDataVo"/>
<where>
<if test="dictType != null and dictType != ''">
AND "dict_type" = #{dictType}
</if>
<if test="dictLabel != null and dictLabel != ''">
AND "dict_label" like concat(concat('%',#{dictLabel}),'%')
</if>
<if test="status != null and status != ''">
AND "status" = #{status}
</if>
</where>
</select>
<select id="selectDictDataByType" parameterType="SysDictData" resultMap="SysDictDataResult">
<include refid="selectDictDataVo"/>
where "status" = '0' and "dict_type" = #{dictType} order by "dict_sort" asc
</select>
<select id="selectDictLabel" resultType="String">
select "dict_label" from ROOT."sys_dict_data"
where "dict_type" = #{dictType} and "dict_value" = #{dictValue}
</select>
<select id="selectDictDataById" parameterType="Long" resultMap="SysDictDataResult">
<include refid="selectDictDataVo"/>
where "dict_code" = #{dictCode}
</select>
<select id="countDictDataByType" resultType="Integer">
select count(1) from ROOT."sys_dict_data" where "dict_type"=#{dictType}
</select>
<delete id="deleteDictDataById" parameterType="Long">
delete from ROOT."sys_dict_data" where "dict_code" = #{dictCode}
</delete>
<delete id="deleteDictDataByIds" parameterType="String">
delete from ROOT."sys_dict_data" where "dict_code" in
<foreach collection="array" item="dictCode" open="(" separator="," close=")">
#{dictCode}
</foreach>
</delete>
<update id="updateDictData" parameterType="SysDictData">
update ROOT."sys_dict_data"
<set>
<if test="dictSort != null and dictSort != ''">"dict_sort" = #{dictSort},</if>
<if test="dictLabel != null and dictLabel != ''">"dict_label" = #{dictLabel},</if>
<if test="dictValue != null and dictValue != ''">"dict_value" = #{dictValue},</if>
<if test="dictType != null and dictType != ''">"dict_type" = #{dictType},</if>
<if test="cssClass != null">"css_class" = #{cssClass},</if>
<if test="listClass != null">"list_class" = #{listClass},</if>
<if test="isDefault != null and isDefault != ''">"is_default" = #{isDefault},</if>
<if test="status != null">"status" = #{status},</if>
<if test="remark != null">"remark" = #{remark},</if>
<if test="updateBy != null and updateBy != ''">"update_by" = #{updateBy},</if>
"update_time" = sysdate
</set>
where "dict_code" = #{dictCode}
</update>
<update id="updateDictDataType" parameterType="String">
update ROOT."sys_dict_data" set "dict_type" = #{newDictType} where "dict_type" = #{oldDictType}
</update>
<insert id="insertDictData" parameterType="SysDictData" >
insert into ROOT."sys_dict_data"(
<if test="dictSort != null and dictSort != ''">"dict_sort",</if>
<if test="dictLabel != null and dictLabel != ''">"dict_label",</if>
<if test="dictValue != null and dictValue != ''">"dict_value",</if>
<if test="dictType != null and dictType != ''">"dict_type",</if>
<if test="cssClass != null and cssClass != ''">"css_class",</if>
<if test="listClass != null and listClass != ''">"list_class",</if>
<if test="isDefault != null and isDefault != ''">"is_default",</if>
<if test="status != null">"status",</if>
<if test="remark != null and remark != ''">"remark",</if>
<if test="createBy != null and createBy != ''">"create_by",</if>
"create_time"
)values(
<if test="dictSort != null and dictSort != ''">#{dictSort},</if>
<if test="dictLabel != null and dictLabel != ''">#{dictLabel},</if>
<if test="dictValue != null and dictValue != ''">#{dictValue},</if>
<if test="dictType != null and dictType != ''">#{dictType},</if>
<if test="cssClass != null and cssClass != ''">#{cssClass},</if>
<if test="listClass != null and listClass != ''">#{listClass},</if>
<if test="isDefault != null and isDefault != ''">#{isDefault},</if>
<if test="status != null">#{status},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate
)
</insert>
</mapper>

View File

@ -0,0 +1,105 @@
<?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.ailanyin.mapper.SysDictTypeMapper">
<resultMap type="SysDictType" id="SysDictTypeResult">
<id property="dictId" column="dict_id" />
<result property="dictName" column="dict_name" />
<result property="dictType" column="dict_type" />
<result property="status" column="status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectDictTypeVo">
select "dict_id", "dict_name", "dict_type", "status", "create_by", "create_time", "remark"
from ROOT."sys_dict_type"
</sql>
<select id="selectDictTypeList" parameterType="SysDictType" resultMap="SysDictTypeResult">
<include refid="selectDictTypeVo"/>
<where>
<if test="dictName != null and dictName != ''">
AND "dict_name" like concat(concat('%',#{dictName}),'%')
</if>
<if test="status != null and status != ''">
AND "status" = #{status}
</if>
<if test="dictType != null and dictType != ''">
AND "dict_type" like concat(concat('%',#{dictType}),'%')
</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
and "create_time" &gt;= to_date(#{params.beginTime},'yyyy-MM-dd HH24:mi:ss')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
and "create_time" &lt;= to_date(#{params.endTime},'yyyy-MM-dd HH24:mi:ss')
</if>
</where>
</select>
<select id="selectDictTypeAll" resultMap="SysDictTypeResult">
<include refid="selectDictTypeVo"/>
</select>
<select id="selectDictTypeById" parameterType="Long" resultMap="SysDictTypeResult">
<include refid="selectDictTypeVo"/>
where "dict_id" = #{dictId}
</select>
<select id="selectDictTypeByType" parameterType="String" resultMap="SysDictTypeResult">
<include refid="selectDictTypeVo"/>
where "dict_type" = #{dictType}
</select>
<select id="checkDictTypeUnique" parameterType="String" resultMap="SysDictTypeResult">
<include refid="selectDictTypeVo"/>
where "dict_type" = #{dictType}
</select>
<delete id="deleteDictTypeById" parameterType="Long">
delete from ROOT."sys_dict_type" where "dict_id" = #{dictId}
</delete>
<delete id="deleteDictTypeByIds" parameterType="Long">
delete from ROOT."sys_dict_type" where "dict_id" in
<foreach collection="array" item="dictId" open="(" separator="," close=")">
#{dictId}
</foreach>
</delete>
<update id="updateDictType" parameterType="SysDictType">
update ROOT."sys_dict_type"
<set>
<if test="dictName != null and dictName != ''">"dict_name" = #{dictName},</if>
<if test="dictType != null and dictType != ''">"dict_type" = #{dictType},</if>
<if test="status != null">"status" = #{status},</if>
<if test="remark != null">"remark" = #{remark},</if>
<if test="updateBy != null and updateBy != ''">"update_by" = #{updateBy},</if>
"update_time" = sysdate
</set>
where "dict_id" = #{dictId}
</update>
<insert id="insertDictType" parameterType="SysDictType">
insert into ROOT."sys_dict_type"(
<if test="dictName != null and dictName != ''">"dict_name",</if>
<if test="dictType != null and dictType != ''">"dict_type",</if>
<if test="status != null">"status",</if>
<if test="remark != null and remark != ''">"remark",</if>
<if test="createBy != null and createBy != ''">"create_by",</if>
"create_time"
)values(
<if test="dictName != null and dictName != ''">#{dictName},</if>
<if test="dictType != null and dictType != ''">#{dictType},</if>
<if test="status != null">#{status},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate
)
</insert>
</mapper>

View File

@ -0,0 +1,132 @@
<?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.ailanyin.mapper.SysLogMapper">
<resultMap id="BaseResultMap" type="com.ailanyin.model.SysLog">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="username" jdbcType="VARCHAR" property="username" />
<result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
<result column="spend_time" jdbcType="BIGINT" property="spendTime" />
<result column="method" jdbcType="VARCHAR" property="method" />
<result column="ip" jdbcType="VARCHAR" property="ip" />
<result column="uri" jdbcType="VARCHAR" property="uri" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.ailanyin.model.SysLog">
<result column="parameter" jdbcType="LONGVARCHAR" property="parameter" />
</resultMap>
<sql id="Base_Column_List">
"id", "description", "username", "start_time", "spend_time", "method", "ip", "uri"
</sql>
<sql id="Blob_Column_List">
"parameter"
</sql>
<select id="selectByParam" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from ROOT."sys_log"
<where>
<if test="username != null and username != ''">
and "username" like concat('%', #{username}, '%')
</if>
<if test="description != null and description != ''">
and "description" like concat('%', #{description}, '%')
</if>
<if test="ip != null and ip != ''">
and "ip" like concat('%', #{ip}, '%')
</if>
<if test="method != null and method != ''">
AND "method" = #{method}
</if>
<if test="spendTime != null and spendTime != ''">
AND "spend_time" &gt;= #{spendTime}
</if>
<if test="params != null"><!-- 开始时间检索 -->
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
AND date_format("start_time",'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
AND date_format("start_time",'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
</if>
</where>
order by "start_time" desc
</select>
<delete id="deleteBatchIds">
delete from ROOT."sys_log"
<where>
<if test="ids != null and ids.size > 0">
"id" in
<foreach collection="ids" item="item" index="index"
separator="," open="(" close=")">
#{item}
</foreach>
</if>
</where>
</delete>
<insert id="insertLog" parameterType="com.ailanyin.model.SysLog">
insert into ROOT."sys_log"
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
"id",
</if>
<if test="description != null">
"description",
</if>
<if test="username != null">
"username",
</if>
<if test="startTime != null">
"start_time",
</if>
<if test="spendTime != null">
"spend_time",
</if>
<if test="method != null">
"method",
</if>
<if test="ip != null">
"ip",
</if>
<if test="uri != null">
"uri",
</if>
<if test="parameter != null">
"parameter",
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id},
</if>
<if test="description != null">
#{description},
</if>
<if test="username != null">
#{username},
</if>
<if test="startTime != null">
#{startTime},
</if>
<if test="spendTime != null">
#{spendTime},
</if>
<if test="method != null">
#{method},
</if>
<if test="ip != null">
#{ip},
</if>
<if test="uri != null">
#{uri},
</if>
<if test="parameter != null">
#{parameter},
</if>
</trim>
</insert>
</mapper>

View File

@ -0,0 +1,204 @@
<?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.ailanyin.mapper.SysMenuMapper">
<resultMap type="SysMenu" id="SysMenuResult">
<id property="menuId" column="menu_id" />
<result property="menuName" column="menu_name" />
<result property="parentName" column="parent_name" />
<result property="parentId" column="parent_id" />
<result property="orderNum" column="order_num" />
<result property="path" column="path" />
<result property="component" column="component" />
<result property="query" column="query" />
<result property="isFrame" column="is_frame" />
<result property="isCache" column="is_cache" />
<result property="menuType" column="menu_type" />
<result property="visible" column="visible" />
<result property="status" column="status" />
<result property="perms" column="perms" />
<result property="icon" column="icon" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectMenuVo">
select "menu_id", "menu_name", "parent_id", "order_num", "path", "component", "query", "is_frame", "is_cache", "menu_type", "visible", "status", ifnull("perms",'') as "perms", "icon", "create_time"
from ROOT."sys_menu"
</sql>
<select id="selectMenuList" parameterType="SysMenu" resultMap="SysMenuResult">
<include refid="selectMenuVo"/>
<where>
<if test="menuName != null and menuName != ''">
AND "menu_name" like concat('%', #{menuName}, '%')
</if>
<if test="visible != null and visible != ''">
AND "visible" = #{visible}
</if>
<if test="status != null and status != ''">
AND "status" = #{status}
</if>
</where>
order by "parent_id", "order_num"
</select>
<select id="selectMenuTreeAll" resultMap="SysMenuResult">
select distinct m."menu_id", m."parent_id", m."menu_name", m."path", m."component", m."query", m."visible", m."status", ifnull(m."perms",'') as "perms", m."is_frame", m."is_cache", m."menu_type", m."icon", m."order_num", m."create_time"
from ROOT."sys_menu" m where m."menu_type" in ('M', 'C') and m."status" = 0
order by m."parent_id", m."order_num"
</select>
<select id="selectMenuListByUserId" parameterType="SysMenu" resultMap="SysMenuResult">
select distinct m."menu_id", m."parent_id", m."menu_name", m."path", m."component", m."query", m."visible", m."status", ifnull(m."perms",'') as "perms", m."is_frame", m."is_cache", m."menu_type", m."icon", m."order_num", m."create_time"
from ROOT."sys_menu" m
left join ROOT."sys_role_menu" rm on m."menu_id" = rm."menu_id"
left join ROOT."sys_user_role" ur on rm."role_id" = ur."role_id"
left join ROOT."sys_role" ro on ur."role_id" = ro."role_id"
where ur."user_id" = #{params.userId}
<if test="menuName != null and menuName != ''">
AND m."menu_name" like concat('%', #{menuName}, '%')
</if>
<if test="visible != null and visible != ''">
AND m."visible" = #{visible}
</if>
<if test="status != null and status != ''">
AND m."status" = #{status}
</if>
order by m."parent_id", m."order_num"
</select>
<select id="selectMenuTreeByUserId" parameterType="Long" resultMap="SysMenuResult">
select distinct m."menu_id", m."parent_id", m."menu_name", m."path", m."component", m."query", m."visible", m."status", ifnull(m."perms",'') as "perms", m."is_frame", m."is_cache", m."menu_type", m."icon", m."order_num", m."create_time"
from ROOT."sys_menu" m
left join ROOT."sys_role_menu" rm on m."menu_id" = rm."menu_id"
left join ROOT."sys_user_role" ur on rm."role_id" = ur."role_id"
left join ROOT."sys_role" ro on ur."role_id" = ro."role_id"
left join ROOT."sys_user" u on ur."user_id" = u."user_id"
where u."user_id" = #{userId} and m."menu_type" in ('M', 'C') and m."status" = 0 AND ro."status" = 0
order by m."parent_id", m."order_num"
</select>
<select id="selectMenuListByRoleId" resultType="Integer">
select m."menu_id"
from ROOT."sys_menu" m
left join ROOT."sys_role_menu" rm on m."menu_id" = rm."menu_id"
where rm."role_id" = #{roleId}
<if test="menuCheckStrictly">
and m."menu_id" not in (select m."parent_id" from ROOT."sys_menu" m inner join ROOT."sys_role_menu" rm on m."menu_id" = rm."menu_id" and rm."role_id" = #{roleId})
</if>
order by m."parent_id", m."order_num"
</select>
<select id="selectMenuPerms" resultType="String">
select distinct m."perms"
from ROOT."sys_menu" m
left join ROOT."sys_role_menu" rm on m."menu_id" = rm."menu_id"
left join ROOT."sys_user_role" ur on rm."role_id" = ur."role_id"
</select>
<select id="selectMenuPermsByUserId" parameterType="Long" resultType="String">
select distinct m."perms"
from ROOT."sys_menu" m
left join ROOT."sys_role_menu" rm on m."menu_id" = rm."menu_id"
left join ROOT."sys_user_role" ur on rm."role_id" = ur."role_id"
left join ROOT."sys_role" r on r."role_id" = ur."role_id"
where m."status" = '0' and r."status" = '0' and ur."user_id" = #{userId}
</select>
<select id="selectSysMenuPermsByUserId" parameterType="Long" resultMap="SysMenuResult">
select m."menu_id",m."perms"
from ROOT."sys_menu" m
left join ROOT."sys_role_menu" rm on m."menu_id" = rm."menu_id"
left join ROOT."sys_user_role" ur on rm."role_id" = ur."role_id"
left join ROOT."sys_role" r on r."role_id" = ur."role_id"
where m."status" = '0' and r."status" = '0' and ur."user_id" = #{userId}
</select>
<select id="selectMenuById" parameterType="Long" resultMap="SysMenuResult">
<include refid="selectMenuVo"/>
where "menu_id" = #{menuId}
</select>
<select id="hasChildByMenuId" resultType="Integer">
select count(1) from ROOT."sys_menu" where "parent_id" = #{menuId}
</select>
<select id="checkMenuNameUnique" parameterType="SysMenu" resultMap="SysMenuResult">
<include refid="selectMenuVo"/>
where "menu_name" = #{menuName} and "parent_id" = #{parentId} limit 1
</select>
<update id="updateMenu" parameterType="SysMenu">
update ROOT."sys_menu"
<set>
<if test="menuName != null and menuName != ''">"menu_name" = #{menuName},</if>
<if test="parentId != null">"parent_id" = #{parentId},</if>
<if test="orderNum != null and orderNum != ''">"order_num" = #{orderNum},</if>
<if test="path != null and path != ''">"path" = #{path},</if>
<if test="component != null">"component" = #{component},</if>
<if test="query != null">"query" = #{query},</if>
<if test="isFrame != null and isFrame != ''">"is_frame" = #{isFrame},</if>
<if test="isCache != null and isCache != ''">"is_cache" = #{isCache},</if>
<if test="menuType != null and menuType != ''">"menu_type" = #{menuType},</if>
<if test="visible != null">"visible" = #{visible},</if>
<if test="status != null">"status" = #{status},</if>
<if test="perms !=null">"perms" = #{perms},</if>
<if test="icon !=null and icon != ''">"icon" = #{icon},</if>
<if test="remark != null and remark != ''">"remark" = #{remark},</if>
<if test="updateBy != null and updateBy != ''">"update_by" = #{updateBy},</if>
"update_time" = sysdate()
</set>
where "menu_id" = #{menuId}
</update>
<insert id="insertMenu" parameterType="SysMenu">
insert into ROOT."sys_menu"(
<if test="menuId != null and menuId != 0">"menu_id",</if>
<if test="parentId != null and parentId != 0">"parent_id",</if>
<if test="menuName != null and menuName != ''">"menu_name",</if>
<if test="orderNum != null and orderNum != ''">"order_num",</if>
<if test="path != null and path != ''">"path",</if>
<if test="component != null and component != ''">"component",</if>
<if test="query != null and query != ''">"query",</if>
<if test="isFrame != null and isFrame != ''">"is_frame",</if>
<if test="isCache != null and isCache != ''">"is_cache",</if>
<if test="menuType != null and menuType != ''">"menu_type",</if>
<if test="visible != null">"visible",</if>
<if test="status != null">"status",</if>
<if test="perms !=null and perms != ''">"perms",</if>
<if test="icon != null and icon != ''">"icon",</if>
<if test="remark != null and remark != ''">"remark",</if>
<if test="createBy != null and createBy != ''">"create_by",</if>
"create_time"
)values(
<if test="menuId != null and menuId != 0">#{menuId},</if>
<if test="parentId != null and parentId != 0">#{parentId},</if>
<if test="menuName != null and menuName != ''">#{menuName},</if>
<if test="orderNum != null and orderNum != ''">#{orderNum},</if>
<if test="path != null and path != ''">#{path},</if>
<if test="component != null and component != ''">#{component},</if>
<if test="query != null and query != ''">#{query},</if>
<if test="isFrame != null and isFrame != ''">#{isFrame},</if>
<if test="isCache != null and isCache != ''">#{isCache},</if>
<if test="menuType != null and menuType != ''">#{menuType},</if>
<if test="visible != null">#{visible},</if>
<if test="status != null">#{status},</if>
<if test="perms !=null and perms != ''">#{perms},</if>
<if test="icon != null and icon != ''">#{icon},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
)
</insert>
<delete id="deleteMenuById" parameterType="Long">
delete from ROOT."sys_menu" where "menu_id" = #{menuId}
</delete>
</mapper>

View File

@ -0,0 +1,122 @@
<?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.ailanyin.mapper.SysPostMapper">
<resultMap type="SysPost" id="SysPostResult">
<id property="postId" column="post_id" />
<result property="postCode" column="post_code" />
<result property="postName" column="post_name" />
<result property="postSort" column="post_sort" />
<result property="status" column="status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectPostVo">
select "post_id", "post_code", "post_name", "post_sort", "status", "create_by", "create_time", "remark"
from ROOT."sys_post"
</sql>
<select id="selectPostList" parameterType="SysPost" resultMap="SysPostResult">
<include refid="selectPostVo"/>
<where>
<if test="postCode != null and postCode != ''">
AND "post_code" like concat('%', #{postCode}, '%')
</if>
<if test="status != null and status != ''">
AND "status" = #{status}
</if>
<if test="postName != null and postName != ''">
AND "post_name" like concat('%', #{postName}, '%')
</if>
</where>
</select>
<select id="selectPostAll" resultMap="SysPostResult">
<include refid="selectPostVo"/>
</select>
<select id="selectPostById" parameterType="Long" resultMap="SysPostResult">
<include refid="selectPostVo"/>
where "post_id" = #{postId}
</select>
<select id="selectPostListByUserId" parameterType="Long" resultType="Integer">
select p."post_id"
from ROOT."sys_post" p
left join ROOT."sys_user_post" up on up."post_id" = p."post_id"
left join ROOT."sys_user" u on u."user_id" = up."user_id"
where u."user_id" = #{userId}
</select>
<select id="selectPostsByUserName" parameterType="String" resultMap="SysPostResult">
select p."post_id", p."post_name", p."post_code"
from ROOT."sys_post" p
left join ROOT."sys_user_post" up on up."post_id" = p."post_id"
left join ROOT."sys_user" u on u."user_id" = up."user_id"
where u."user_name" = #{userName}
</select>
<select id="checkPostNameUnique" parameterType="String" resultMap="SysPostResult">
<include refid="selectPostVo"/>
where "post_name" = #{postName} limit 1
</select>
<select id="checkPostCodeUnique" parameterType="String" resultMap="SysPostResult">
<include refid="selectPostVo"/>
where "post_code" = #{postCode} limit 1
</select>
<update id="updatePost" parameterType="SysPost">
update ROOT."sys_post"
<set>
<if test="postCode != null and postCode != ''">"post_code" = #{postCode},</if>
<if test="postName != null and postName != ''">"post_name" = #{postName},</if>
<if test="postSort != null and postSort != ''">"post_sort" = #{postSort},</if>
<if test="status != null and status != ''">"status" = #{status},</if>
<if test="remark != null">"remark" = #{remark},</if>
<if test="updateBy != null and updateBy != ''">"update_by" = #{updateBy},</if>
"update_time" = sysdate()
</set>
where "post_id" = #{postId}
</update>
<insert id="insertPost" parameterType="SysPost" useGeneratedKeys="true" keyProperty="postId">
insert into ROOT."sys_post"(
<if test="postId != null and postId != 0">"post_id",</if>
<if test="postCode != null and postCode != ''">"post_code",</if>
<if test="postName != null and postName != ''">"post_name",</if>
<if test="postSort != null and postSort != ''">"post_sort",</if>
<if test="status != null and status != ''">"status",</if>
<if test="remark != null and remark != ''">"remark",</if>
<if test="createBy != null and createBy != ''">"create_by",</if>
"create_time"
)values(
<if test="postId != null and postId != 0">#{postId},</if>
<if test="postCode != null and postCode != ''">#{postCode},</if>
<if test="postName != null and postName != ''">#{postName},</if>
<if test="postSort != null and postSort != ''">#{postSort},</if>
<if test="status != null and status != ''">#{status},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
)
</insert>
<delete id="deletePostById" parameterType="Long">
delete from ROOT."sys_post" where "post_id" = #{postId}
</delete>
<delete id="deletePostByIds" parameterType="Long">
delete from ROOT."sys_post" where "post_id" in
<foreach collection="array" item="postId" open="(" separator="," close=")">
#{postId}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,34 @@
<?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.ailanyin.mapper.SysRoleDeptMapper">
<resultMap type="SysRoleDept" id="SysRoleDeptResult">
<result property="roleId" column="role_id" />
<result property="deptId" column="dept_id" />
</resultMap>
<delete id="deleteRoleDeptByRoleId" parameterType="Long">
delete from ROOT."sys_role_dept" where "role_id" = #{roleId}
</delete>
<select id="selectCountRoleDeptByDeptId" resultType="Integer">
select count(1) from ROOT."sys_role_dept" where "dept_id" = #{deptId}
</select>
<delete id="deleteRoleDept" parameterType="Long">
delete from ROOT."sys_role_dept" where "role_id" in
<foreach collection="array" item="roleId" open="(" separator="," close=")">
#{roleId}
</foreach>
</delete>
<insert id="batchRoleDept">
insert into ROOT."sys_role_dept"("role_id", "dept_id") values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.roleId},#{item.deptId})
</foreach>
</insert>
</mapper>

View File

@ -0,0 +1,152 @@
<?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.ailanyin.mapper.SysRoleMapper">
<resultMap type="SysRole" id="SysRoleResult">
<id property="roleId" column="role_id" />
<result property="roleName" column="role_name" />
<result property="roleKey" column="role_key" />
<result property="roleSort" column="role_sort" />
<result property="dataScope" column="data_scope" />
<result property="menuCheckStrictly" column="menu_check_strictly" />
<result property="deptCheckStrictly" column="dept_check_strictly" />
<result property="status" column="status" />
<result property="delFlag" column="del_flag" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectRoleVo">
select distinct r."role_id", r."role_name", r."role_key", r."role_sort", r."data_scope", r."menu_check_strictly", r."dept_check_strictly",
r."status", r."del_flag", r."create_time", r."remark"
from ROOT."sys_role" r
left join ROOT."sys_user_role" ur on ur."role_id" = r."role_id"
left join ROOT."sys_user" u on u."user_id" = ur."user_id"
left join ROOT."sys_dept" d on u."dept_id" = d."dept_id"
</sql>
<select id="selectRoleList" parameterType="SysRole" resultMap="SysRoleResult">
<include refid="selectRoleVo"/>
where r."del_flag" = '0'
<if test="roleId != null and roleId != 0">
AND r."role_id" = #{roleId}
</if>
<if test="roleName != null and roleName != ''">
AND r."role_name" like concat('%', #{roleName}, '%')
</if>
<if test="status != null and status != ''">
AND r."status" = #{status}
</if>
<if test="roleKey != null and roleKey != ''">
AND r."role_key" like concat('%', #{roleKey}, '%')
</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(r."create_time",'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
and date_format(r."create_time",'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
<!-- 数据范围过滤 -->
${params.dataScope}
order by r."role_sort"
</select>
<select id="selectRolePermissionByUserId" parameterType="Long" resultMap="SysRoleResult">
<include refid="selectRoleVo"/>
WHERE r."del_flag" = '0' and ur."user_id" = #{userId}
</select>
<select id="selectRoleAll" resultMap="SysRoleResult">
<include refid="selectRoleVo"/>
</select>
<select id="selectRoleListByUserId" parameterType="Long" resultType="Integer">
select r."role_id"
from ROOT."sys_role" r
left join ROOT."sys_user_role" ur on ur."role_id" = r."role_id"
left join ROOT."sys_user" u on u."user_id" = ur."user_id"
where u."user_id" = #{userId}
</select>
<select id="selectRoleById" parameterType="Long" resultMap="SysRoleResult">
<include refid="selectRoleVo"/>
where r."role_id" = #{roleId}
</select>
<select id="selectRolesByUserName" parameterType="String" resultMap="SysRoleResult">
<include refid="selectRoleVo"/>
WHERE r."del_flag" = '0' and u."user_name" = #{userName}
</select>
<select id="checkRoleNameUnique" parameterType="String" resultMap="SysRoleResult">
<include refid="selectRoleVo"/>
where r."role_name" = #{roleName} limit 1
</select>
<select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult">
<include refid="selectRoleVo"/>
where r."role_key"=#{roleKey} limit 1
</select>
<insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId">
insert into ROOT."sys_role"(
<if test="roleId != null and roleId != 0">"role_id",</if>
<if test="roleName != null and roleName != ''">"role_name",</if>
<if test="roleKey != null and roleKey != ''">"role_key",</if>
<if test="roleSort != null and roleSort != ''">"role_sort",</if>
<if test="dataScope != null and dataScope != ''">"data_scope",</if>
<if test="menuCheckStrictly != null">"menu_check_strictly",</if>
<if test="deptCheckStrictly != null">"dept_check_strictly",</if>
<if test="status != null and status != ''">"status",</if>
<if test="remark != null and remark != ''">"remark",</if>
<if test="createBy != null and createBy != ''">"create_by",</if>
"create_time"
)values(
<if test="roleId != null and roleId != 0">#{roleId},</if>
<if test="roleName != null and roleName != ''">#{roleName},</if>
<if test="roleKey != null and roleKey != ''">#{roleKey},</if>
<if test="roleSort != null and roleSort != ''">#{roleSort},</if>
<if test="dataScope != null and dataScope != ''">#{dataScope},</if>
<if test="menuCheckStrictly != null">#{menuCheckStrictly},</if>
<if test="deptCheckStrictly != null">#{deptCheckStrictly},</if>
<if test="status != null and status != ''">#{status},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
)
</insert>
<update id="updateRole" parameterType="SysRole">
update ROOT."sys_role"
<set>
<if test="roleName != null and roleName != ''">"role_name" = #{roleName},</if>
<if test="roleKey != null and roleKey != ''">"role_key" = #{roleKey},</if>
<if test="roleSort != null and roleSort != ''">"role_sort" = #{roleSort},</if>
<if test="dataScope != null and dataScope != ''">"data_scope" = #{dataScope},</if>
<if test="menuCheckStrictly != null">"menu_check_strictly" = #{menuCheckStrictly},</if>
<if test="deptCheckStrictly != null">"dept_check_strictly" = #{deptCheckStrictly},</if>
<if test="status != null and status != ''">"status" = #{status},</if>
<if test="remark != null">"remark" = #{remark},</if>
<if test="updateBy != null and updateBy != ''">"update_by" = #{updateBy},</if>
"update_time" = sysdate()
</set>
where "role_id" = #{roleId}
</update>
<delete id="deleteRoleById" parameterType="Long">
update ROOT."sys_role" set "del_flag" = '2' where "role_id" = #{roleId}
</delete>
<delete id="deleteRoleByIds" parameterType="Long">
update ROOT."sys_role" set "del_flag" = '2' where "role_id" in
<foreach collection="array" item="roleId" open="(" separator="," close=")">
#{roleId}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,34 @@
<?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.ailanyin.mapper.SysRoleMenuMapper">
<resultMap type="SysRoleMenu" id="SysRoleMenuResult">
<result property="roleId" column="role_id" />
<result property="menuId" column="menu_id" />
</resultMap>
<select id="checkMenuExistRole" resultType="Integer">
select count(1) from ROOT."sys_role_menu" where "menu_id" = #{menuId}
</select>
<delete id="deleteRoleMenuByRoleId" parameterType="Long">
delete from ROOT."sys_role_menu" where "role_id"=#{roleId}
</delete>
<delete id="deleteRoleMenu" parameterType="Long">
delete from ROOT."sys_role_menu" where "role_id" in
<foreach collection="array" item="roleId" open="(" separator="," close=")">
#{roleId}
</foreach>
</delete>
<insert id="batchRoleMenu">
insert into ROOT."sys_role_menu"("role_id", "menu_id") values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.roleId},#{item.menuId})
</foreach>
</insert>
</mapper>

View File

@ -0,0 +1,254 @@
<?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.ailanyin.mapper.SysUserMapper">
<resultMap type="SysUser" id="SysUserResult">
<id property="userId" column="user_id" />
<result property="deptId" column="dept_id" />
<result property="userName" column="user_name" />
<result property="nickName" column="nick_name" />
<result property="email" column="email" />
<result property="phonenumber" column="phonenumber" />
<result property="sex" column="sex" />
<result property="avatar" column="avatar" />
<result property="password" column="password" />
<result property="status" column="status" />
<result property="delFlag" column="del_flag" />
<result property="loginIp" column="login_ip" />
<result property="loginDate" column="login_date" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<association property="dept" column="dept_id" javaType="SysDept" resultMap="deptResult" />
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
</resultMap>
<resultMap id="deptResult" type="SysDept">
<id property="deptId" column="dept_id" />
<result property="parentId" column="parent_id" />
<result property="deptName" column="dept_name" />
<result property="orderNum" column="order_num" />
<result property="leader" column="leader" />
<result property="status" column="dept_status" />
</resultMap>
<resultMap id="RoleResult" type="SysRole">
<id property="roleId" column="role_id" />
<result property="roleName" column="role_name" />
<result property="roleKey" column="role_key" />
<result property="roleSort" column="role_sort" />
<result property="dataScope" column="data_scope" />
<result property="status" column="role_status" />
</resultMap>
<sql id="selectUserVo">
select u."user_id", u."dept_id", u."user_name", u."nick_name", u."email", u."avatar", u."phonenumber", u."password", u."sex", u."status", u."del_flag", u."login_ip", u."login_date", u."create_by", u."create_time", u."remark",
d."dept_id", d."parent_id", d."dept_name", d."order_num", d."leader", d."status" as "dept_status",
r."role_id", r."role_name", r."role_key", r."role_sort", r."data_scope", r."status" as "role_status"
from ROOT."sys_user" u
left join ROOT."sys_dept" d on u."dept_id" = d."dept_id"
left join ROOT."sys_user_role" ur on u."user_id" = ur."user_id"
left join ROOT."sys_role" r on r."role_id" = ur."role_id"
</sql>
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
select u."user_id", u."dept_id", u."nick_name", u."user_name", u."email", u."avatar", u."phonenumber", u."password", u."sex", u."status", u."del_flag", u."login_ip", u."login_date", u."create_by", u."create_time", u."remark", d."dept_name", d."leader" from ROOT."sys_user" u
left join ROOT."sys_dept" d on u."dept_id" = d."dept_id"
where u."del_flag" = '0'
<if test="userId != null and userId != 0">
AND u."user_id" = #{userId}
</if>
<if test="userName != null and userName != ''">
AND u."user_name" like concat('%', #{userName}, '%')
</if>
<if test="status != null and status != ''">
AND u."status" = #{status}
</if>
<if test="phonenumber != null and phonenumber != ''">
AND u."phonenumber" like concat('%', #{phonenumber}, '%')
</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
AND date_format(u."create_time",'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
AND date_format(u."create_time",'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
<if test="deptId != null and deptId != 0">
AND (u."dept_id" = #{deptId} OR u."dept_id" IN ( SELECT t."dept_id" FROM ROOT."sys_dept" t WHERE find_in_set(#{deptId}, "ancestors") ))
</if>
<!-- 数据范围过滤 -->
${params.dataScope}
</select>
<select id="selectDeleteUserList" parameterType="SysUser" resultMap="SysUserResult">
select u."user_id", u."nick_name", u."user_name", u."phonenumber",d."dept_name" from ROOT."sys_user" u
left join ROOT."sys_dept" d on u."dept_id" = d."dept_id"
where u."del_flag" = '2'
<if test="userName != null and userName != ''">
AND u."user_name" like concat('%', #{userName}, '%')
</if>
<if test="nickName != null and nickName != ''">
AND u."nick_name" like concat('%', #{nickName}, '%')
</if>
<if test="phonenumber != null and phonenumber != ''">
AND u."phonenumber" like concat('%', #{phonenumber}, '%')
</if>
<!-- 数据范围过滤 -->
${params.dataScope}
</select>
<select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult">
select distinct u."user_id", u."dept_id", u."user_name", u."nick_name", u."email", u."phonenumber", u."status", u."create_time"
from ROOT."sys_user" u
left join ROOT."sys_dept" d on u."dept_id" = d."dept_id"
left join ROOT."sys_user_role" ur on u."user_id" = ur."user_id"
left join ROOT."sys_role" r on r."role_id" = ur."role_id"
where u."del_flag" = '0' and r."role_id" = #{roleId}
<if test="userName != null and userName != ''">
AND u."user_name" like concat('%', #{userName}, '%')
</if>
<if test="phonenumber != null and phonenumber != ''">
AND u."phonenumber" like concat('%', #{phonenumber}, '%')
</if>
<!-- 数据范围过滤 -->
${params.dataScope}
</select>
<select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult">
select distinct u."user_id", u."dept_id", u."user_name", u."nick_name", u."email", u."phonenumber", u."status", u."create_time"
from ROOT."sys_user" u
left join ROOT."sys_dept" d on u."dept_id" = d."dept_id"
left join ROOT."sys_user_role" ur on u."user_id" = ur."user_id"
left join ROOT."sys_role" r on r."role_id" = ur."role_id"
where u."del_flag" = '0' and (r."role_id" != #{roleId} or r."role_id" IS NULL)
and u."user_id" not in (select u."user_id" from ROOT."sys_user" u inner join ROOT."sys_user_role" ur on u."user_id" = ur."user_id" and ur."role_id" = #{roleId})
<if test="userName != null and userName != ''">
AND u."user_name" like concat('%', #{userName}, '%')
</if>
<if test="phonenumber != null and phonenumber != ''">
AND u."phonenumber" like concat('%', #{phonenumber}, '%')
</if>
<!-- 数据范围过滤 -->
${params.dataScope}
</select>
<select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult">
<include refid="selectUserVo"/>
where u."user_name" = #{userName}
</select>
<select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
<include refid="selectUserVo"/>
where u."user_id" = #{userId}
</select>
<select id="checkUserNameUnique" parameterType="String" resultType="int">
select count("user_id") from ROOT."sys_user" where "user_name" = #{userName} limit 1
</select>
<select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult">
select "user_id", "phonenumber" from ROOT."sys_user" where "phonenumber" = #{phonenumber} limit 1
</select>
<select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
select "user_id", "email" from ROOT."sys_user" where "email" = #{email} limit 1
</select>
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
insert into ROOT."sys_user"(
<if test="userId != null and userId != 0">"user_id",</if>
<if test="deptId != null and deptId != 0">"dept_id",</if>
<if test="userName != null and userName != ''">"user_name",</if>
<if test="nickName != null and nickName != ''">"nick_name",</if>
<if test="email != null and email != ''">"email",</if>
<if test="avatar != null and avatar != ''">"avatar",</if>
<if test="phonenumber != null and phonenumber != ''">"phonenumber",</if>
<if test="sex != null and sex != ''">"sex",</if>
<if test="password != null and password != ''">"password",</if>
<if test="status != null and status != ''">"status",</if>
<if test="createBy != null and createBy != ''">"create_by",</if>
<if test="remark != null and remark != ''">"remark",</if>
"create_time"
)values(
<if test="userId != null and userId != ''">#{userId},</if>
<if test="deptId != null and deptId != ''">#{deptId},</if>
<if test="userName != null and userName != ''">#{userName},</if>
<if test="nickName != null and nickName != ''">#{nickName},</if>
<if test="email != null and email != ''">#{email},</if>
<if test="avatar != null and avatar != ''">#{avatar},</if>
<if test="phonenumber != null and phonenumber != ''">#{phonenumber},</if>
<if test="sex != null and sex != ''">#{sex},</if>
<if test="password != null and password != ''">#{password},</if>
<if test="status != null and status != ''">#{status},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="remark != null and remark != ''">#{remark},</if>
sysdate()
)
</insert>
<update id="updateUser" parameterType="SysUser">
update ROOT."sys_user"
<set>
<if test="deptId != null and deptId != 0">"dept_id" = #{deptId},</if>
<if test="userName != null and userName != ''">"user_name" = #{userName},</if>
<if test="nickName != null and nickName != ''">"nick_name" = #{nickName},</if>
<if test="email != null ">"email" = #{email},</if>
<if test="phonenumber != null ">"phonenumber" = #{phonenumber},</if>
<if test="sex != null and sex != ''">"sex" = #{sex},</if>
<if test="avatar != null and avatar != ''">"avatar" = #{avatar},</if>
<if test="password != null and password != ''">"password" = #{password},</if>
<if test="status != null and status != ''">"status" = #{status},</if>
<if test="loginIp != null and loginIp != ''">"login_ip" = #{loginIp},</if>
<if test="loginDate != null">"login_date" = #{loginDate},</if>
<if test="updateBy != null and updateBy != ''">"update_by" = #{updateBy},</if>
<if test="remark != null">"remark" = #{remark},</if>
"update_time" = sysdate()
</set>
where "user_id" = #{userId}
</update>
<update id="updateUserStatus" parameterType="SysUser">
update ROOT."sys_user" set "status" = #{status} where "user_id" = #{userId}
</update>
<update id="updateUserAvatar" parameterType="SysUser">
update ROOT."sys_user" set "avatar" = #{avatar} where "user_name" = #{userName}
</update>
<update id="resetUserPwd" parameterType="SysUser">
update ROOT."sys_user" set "password" = #{password} where "user_name" = #{userName}
</update>
<delete id="deleteUserById" parameterType="Long">
update ROOT."sys_user" set "del_flag" = '2' where "user_id" = #{userId}
</delete>
<delete id="deleteUserByIds" parameterType="Long">
update ROOT."sys_user" set "del_flag" = '2' where "user_id" in
<foreach collection="array" item="userId" open="(" separator="," close=")">
#{userId}
</foreach>
</delete>
<update id="recoveryDeleteUser">
update ROOT."sys_user" set "del_flag" = '0' where "user_id" in
<foreach collection="list" item="userId" open="(" separator="," close=")">
#{userId}
</foreach>
</update>
<delete id="realDeleteUser">
delete from ROOT."sys_user" where "user_id" in
<foreach collection="list" item="userId" open="(" separator="," close=")">
#{userId}
</foreach>
</delete>
<update id="updateUserLastLoginIpAndTime">
update ROOT."sys_user" set "login_ip" = #{ip},"login_date" = #{time} where "user_name" = #{userName}
</update>
</mapper>

View File

@ -0,0 +1,34 @@
<?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.ailanyin.mapper.SysUserPostMapper">
<resultMap type="SysUserPost" id="SysUserPostResult">
<result property="userId" column="user_id"/>
<result property="postId" column="post_id"/>
</resultMap>
<delete id="deleteUserPostByUserId" parameterType="Long">
delete from ROOT."sys_user_post" where "user_id" = #{userId}
</delete>
<select id="countUserPostById" resultType="Integer">
select count(1) from ROOT."sys_user_post" where "post_id" = #{postId}
</select>
<delete id="deleteUserPost" parameterType="Long">
delete from ROOT."sys_user_post" where "user_id" in
<foreach collection="array" item="userId" open="(" separator="," close=")">
#{userId}
</foreach>
</delete>
<insert id="batchUserPost">
insert into ROOT."sys_user_post"("user_id", "post_id") values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.userId},#{item.postId})
</foreach>
</insert>
</mapper>

View File

@ -0,0 +1,44 @@
<?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.ailanyin.mapper.SysUserRoleMapper">
<resultMap type="SysUserRole" id="SysUserRoleResult">
<result property="userId" column="user_id" />
<result property="roleId" column="role_id" />
</resultMap>
<delete id="deleteUserRoleByUserId" parameterType="Long">
delete from ROOT."sys_user_role" where "user_id" = #{userId}
</delete>
<select id="countUserRoleByRoleId" resultType="Integer">
select count(1) from ROOT."sys_user_role" where "role_id" = #{roleId}
</select>
<delete id="deleteUserRole" parameterType="Long">
delete from ROOT."sys_user_role" where "user_id" in
<foreach collection="array" item="userId" open="(" separator="," close=")">
#{userId}
</foreach>
</delete>
<insert id="batchUserRole">
insert into ROOT."sys_user_role"("user_id", "role_id") values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.userId},#{item.roleId})
</foreach>
</insert>
<delete id="deleteUserRoleInfo" parameterType="SysUserRole">
delete from ROOT."sys_user_role" where "user_id" = #{userId} and "role_id" = #{roleId}
</delete>
<delete id="deleteUserRoleInfos">
delete from ROOT."sys_user_role" where "role_id" = #{roleId} and "user_id" in
<foreach collection="userIds" item="userId" open="(" separator="," close=")">
#{userId}
</foreach>
</delete>
</mapper>