业务部门信息
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
package com.cwhelp.modules.system.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.cwhelp.common.enums.StatusEnum;
|
||||
import com.cwhelp.common.utils.StatusUtil;
|
||||
import com.cwhelp.component.excel.annotation.Excel;
|
||||
import com.cwhelp.component.excel.enums.ExcelType;
|
||||
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.SQLDelete;
|
||||
@@ -59,7 +61,7 @@ public class User implements Serializable {
|
||||
@Excel(value = "状态", dict = "DATA_STATUS")
|
||||
private Byte status = StatusEnum.OK.getCode();
|
||||
|
||||
@ManyToOne(fetch=FetchType.EAGER)
|
||||
@ManyToOne(fetch=FetchType.LAZY)
|
||||
@JoinColumn(name="dept_id")
|
||||
@JsonIgnore
|
||||
private Dept dept;
|
||||
|
||||
+1
-1
@@ -12,5 +12,5 @@ public interface ActionLogRepository extends JpaRepository<ActionLog, Long> {
|
||||
* @param model 模型(表名)
|
||||
* @param recordId 数据ID
|
||||
*/
|
||||
public List<ActionLog> findByModelAndRecordId(String model, Long recordId);
|
||||
List<ActionLog> findByModelAndRecordId(String model, Long recordId);
|
||||
}
|
||||
|
||||
+2
-2
@@ -20,7 +20,7 @@ public interface BaseRepository<T, ID> extends JpaRepository<T,ID> {
|
||||
* @param id 主键ID
|
||||
* @param status 状态
|
||||
*/
|
||||
public T findByIdAndStatus(Long id, Byte status);
|
||||
T findByIdAndStatus(Long id, Byte status);
|
||||
|
||||
/**
|
||||
* 批量更新数据状态
|
||||
@@ -32,5 +32,5 @@ public interface BaseRepository<T, ID> extends JpaRepository<T,ID> {
|
||||
@Modifying
|
||||
@Transactional
|
||||
@Query("update #{#entityName} set status = ?1 where id in ?2 and status <> " + StatusConst.DELETE)
|
||||
public Integer updateStatus(Byte status, List<Long> id);
|
||||
Integer updateStatus(Byte status, List<Long> id);
|
||||
}
|
||||
|
||||
+4
-4
@@ -16,20 +16,20 @@ public interface DeptRepository extends BaseRepository<Dept, Long> {
|
||||
* 查找多个部门
|
||||
* @param ids id列表
|
||||
*/
|
||||
public List<Dept> findByIdIn(List<Long> ids);
|
||||
List<Dept> findByIdIn(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获取排序最大值
|
||||
* @param pid 父部门ID
|
||||
*/
|
||||
@Query("select max(sort) from Menu m where m.pid = ?1 and m.status <> " + StatusConst.DELETE)
|
||||
public Integer findSortMax(long pid);
|
||||
Integer findSortMax(long pid);
|
||||
|
||||
/**
|
||||
* 根据父ID查找子孙部门
|
||||
* @param pids pid列表
|
||||
*/
|
||||
public List<Dept> findByPidsLikeAndStatus(String pids, Byte status);
|
||||
List<Dept> findByPidsLikeAndStatus(String pids, Byte status);
|
||||
|
||||
/**
|
||||
* 根据父级部门ID获取本级全部部门
|
||||
@@ -37,6 +37,6 @@ public interface DeptRepository extends BaseRepository<Dept, Long> {
|
||||
* @param pid 父部门ID
|
||||
* @param notId 需要排除的部门ID
|
||||
*/
|
||||
public List<Dept> findByPidAndIdNot(Sort sort, long pid, long notId);
|
||||
List<Dept> findByPidAndIdNot(Sort sort, long pid, long notId);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -12,12 +12,12 @@ public interface DictRepository extends BaseRepository<Dict, Long> {
|
||||
* @param name 字典标识
|
||||
* @param status 状态
|
||||
*/
|
||||
public Dict findByNameAndStatus(String name, Byte status);
|
||||
Dict findByNameAndStatus(String name, Byte status);
|
||||
|
||||
/**
|
||||
* 根据标识查询字典数据,且排查指定ID的字典
|
||||
* @param name 字典标识
|
||||
* @param id 字典ID
|
||||
*/
|
||||
public Dict findByNameAndIdNot(String name, Long id);
|
||||
Dict findByNameAndIdNot(String name, Long id);
|
||||
}
|
||||
|
||||
+7
-7
@@ -18,32 +18,32 @@ public interface MenuRepository extends BaseRepository<Menu, Long> {
|
||||
* 查找多个菜单
|
||||
* @param ids id列表
|
||||
*/
|
||||
public List<Menu> findByIdIn(List<Long> ids);
|
||||
List<Menu> findByIdIn(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 查找响应状态的菜单
|
||||
* @param sort 排序对象
|
||||
*/
|
||||
public List<Menu> findAllByStatus(Sort sort, Byte status);
|
||||
List<Menu> findAllByStatus(Sort sort, Byte status);
|
||||
|
||||
/**
|
||||
* 查询菜单URL
|
||||
* @param url id列表
|
||||
*/
|
||||
public Menu findByUrl(String url);
|
||||
Menu findByUrl(String url);
|
||||
|
||||
/**
|
||||
* 根据父ID查找子菜单
|
||||
* @param pids pid列表
|
||||
*/
|
||||
public List<Menu> findByPidsLikeAndStatus(String pids, Byte status);
|
||||
List<Menu> findByPidsLikeAndStatus(String pids, Byte status);
|
||||
|
||||
/**
|
||||
* 获取排序最大值
|
||||
* @param pid 父菜单ID
|
||||
*/
|
||||
@Query("select max(sort) from Menu m where m.pid = ?1 and m.status <> " + StatusConst.DELETE)
|
||||
public Integer findSortMax(long pid);
|
||||
Integer findSortMax(long pid);
|
||||
|
||||
/**
|
||||
* 根据父级菜单ID获取本级全部菜单
|
||||
@@ -51,7 +51,7 @@ public interface MenuRepository extends BaseRepository<Menu, Long> {
|
||||
* @param pid 父菜单ID
|
||||
* @param notId 需要排除的菜单ID
|
||||
*/
|
||||
public List<Menu> findByPidAndIdNot(Sort sort, long pid, long notId);
|
||||
List<Menu> findByPidAndIdNot(Sort sort, long pid, long notId);
|
||||
|
||||
/**
|
||||
* 取消菜单与角色之间的关系
|
||||
@@ -60,5 +60,5 @@ public interface MenuRepository extends BaseRepository<Menu, Long> {
|
||||
@Modifying
|
||||
@Transactional
|
||||
@Query(value = "DELETE FROM sys_role_menu WHERE menu_id = ?1", nativeQuery = true)
|
||||
public Integer cancelRoleJoin(Long id);
|
||||
Integer cancelRoleJoin(Long id);
|
||||
}
|
||||
|
||||
+7
-7
@@ -18,34 +18,34 @@ public interface RoleRepository extends BaseRepository<Role,Long> {
|
||||
* 查找多个角色
|
||||
* @param ids id列表
|
||||
*/
|
||||
public List<Role> findByIdIn(List<Long> ids);
|
||||
List<Role> findByIdIn(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 查找相应状态的角色
|
||||
* @param sort 排序对象
|
||||
*/
|
||||
public List<Role> findAllByStatus(Sort sort, Byte status);
|
||||
List<Role> findAllByStatus(Sort sort, Byte status);
|
||||
|
||||
/**
|
||||
* 查询指定用户的角色列表
|
||||
* @param id 用户ID
|
||||
* @param status 角色状态
|
||||
*/
|
||||
public Set<Role> findByUsers_IdAndStatus(Long id, Byte status);
|
||||
Set<Role> findByUsers_IdAndStatus(Long id, Byte status);
|
||||
|
||||
/**
|
||||
* 根据标识查询角色数据,且排查指定ID的角色
|
||||
* @param name 角色标识
|
||||
* @param id 角色ID
|
||||
*/
|
||||
public Role findByNameAndIdNot(String name, Long id);
|
||||
Role findByNameAndIdNot(String name, Long id);
|
||||
|
||||
/**
|
||||
* 判断指定的用户是否存在角色
|
||||
* @param id 用户ID
|
||||
* @param status 角色状态
|
||||
*/
|
||||
public Boolean existsByUsers_IdAndStatus(Long id, Byte status);
|
||||
Boolean existsByUsers_IdAndStatus(Long id, Byte status);
|
||||
|
||||
/**
|
||||
* 取消角色与用户之间的关系
|
||||
@@ -54,7 +54,7 @@ public interface RoleRepository extends BaseRepository<Role,Long> {
|
||||
@Modifying
|
||||
@Transactional
|
||||
@Query(value = "DELETE FROM sys_user_role WHERE role_id in ?1", nativeQuery = true)
|
||||
public Integer cancelUserJoin(List<Long> ids);
|
||||
Integer cancelUserJoin(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 取消角色与菜单之间的关系
|
||||
@@ -63,6 +63,6 @@ public interface RoleRepository extends BaseRepository<Role,Long> {
|
||||
@Modifying
|
||||
@Transactional
|
||||
@Query(value = "DELETE FROM sys_role_menu WHERE role_id in ?1", nativeQuery = true)
|
||||
public Integer cancelMenuJoin(List<Long> ids);
|
||||
Integer cancelMenuJoin(List<Long> ids);
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -12,6 +12,6 @@ public interface UploadRepository extends JpaRepository<Upload, Long> {
|
||||
* 查找指定文件sha1记录
|
||||
* @param sha1 文件sha1值
|
||||
*/
|
||||
public Upload findBySha1(String sha1);
|
||||
Upload findBySha1(String sha1);
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -16,7 +16,7 @@ public interface UserRepository extends BaseRepository<User, Long>, JpaSpecifica
|
||||
* @param username 用户名
|
||||
* @return 用户数据
|
||||
*/
|
||||
public User findByUsername(String username);
|
||||
User findByUsername(String username);
|
||||
|
||||
/**
|
||||
* 根据用户名查询用户数据,且排查指定ID的用户
|
||||
@@ -24,16 +24,16 @@ public interface UserRepository extends BaseRepository<User, Long>, JpaSpecifica
|
||||
* @param id 排除的用户ID
|
||||
* @return 用户数据
|
||||
*/
|
||||
public User findByUsernameAndIdNot(String username, Long id);
|
||||
User findByUsernameAndIdNot(String username, Long id);
|
||||
|
||||
/**
|
||||
* 查找多个相应部门的用户列表
|
||||
*/
|
||||
public List<User> findByDept(Dept dept);
|
||||
List<User> findByDept(Dept dept);
|
||||
|
||||
/**
|
||||
* 删除多条数据
|
||||
* @param ids ID列表
|
||||
*/
|
||||
public Integer deleteByIdIn(List<Long> ids);
|
||||
Integer deleteByIdIn(List<Long> ids);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user