This commit is contained in:
zlwu committed 2025-12-24 17:20:14 +08:00
1 parent e86cae8515
commit 8c0a2d904c
4 files changed
+6 -6

No files matched your search

@@ -168,7 +168,7 @@ public class SysDeptServiceImpl implements ISysDeptService, DeptService {
* @param deptId 部门ID
* @return 部门信息
*/
@Cacheable(cacheNames = CacheNames.SYS_DEPT, key = "#deptId")
// @Cacheable(cacheNames = CacheNames.SYS_DEPT, key = "#deptId")
@Override
public SysDeptVo selectDeptById(Long deptId) {
SysDeptVo dept = baseMapper.selectVoById(deptId);
@@ -123,7 +123,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService, DictService
* @param dictType 字典类型
* @return 字典类型
*/
@Cacheable(cacheNames = CacheNames.SYS_DICT_TYPE, key = "#dictType")
// @Cacheable(cacheNames = CacheNames.SYS_DICT_TYPE, key = "#dictType")
@Override
public SysDictTypeVo selectDictTypeByType(String dictType) {
return baseMapper.selectVoOne(new LambdaQueryWrapper<SysDictType>().eq(SysDictType::getDictType, dictType));
@@ -734,7 +734,7 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
* @param userId 用户ID
* @return 用户账户
*/
@Cacheable(cacheNames = CacheNames.SYS_USER_NAME, key = "#userId")
// @Cacheable(cacheNames = CacheNames.SYS_USER_NAME, key = "#userId")
@Override
public String selectUserNameById(Long userId) {
SysUser sysUser = baseMapper.selectOne(new LambdaQueryWrapper<SysUser>()
@@ -749,7 +749,7 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
* @return 用户账户
*/
@Override
@Cacheable(cacheNames = CacheNames.SYS_NICKNAME, key = "#userId")
// @Cacheable(cacheNames = CacheNames.SYS_NICKNAME, key = "#userId")
public String selectNicknameById(Long userId) {
SysUser sysUser = baseMapper.selectOne(new LambdaQueryWrapper<SysUser>()
.select(SysUser::getNickName).eq(SysUser::getUserId, userId));
@@ -77,7 +77,6 @@ public class XgStudentServiceImpl implements IXgStudentService {
* 优化版本:使用专门的SQL查询,避免全表查询,提升性能
*/
@Override
@Cacheable(value = "student_tree", key = "'tree_data'", unless = "#result == null || #result.isEmpty()")
public List<XgStudentTreeVo> getTreeData() {
// 使用专门的SQL查询获取树形结构所需的最少数据
List<Map<String, Object>> treeNodes = baseMapper.selectTreeNodes();
@@ -145,7 +144,8 @@ public class XgStudentServiceImpl implements IXgStudentService {
* 根据班级ID获取学生列表
*/
@Override
@Cacheable(value = "student_list", key = "'class_' + #classId", unless = "#result == null || #result.isEmpty()")
// @Cacheable(value = "student_list", key = "'class_' + #classId", unless =
// "#result == null || #result.isEmpty()")
public List<XgStudentVo> getStudentsByClassId(Long classId) {
LambdaQueryWrapper<XgStudentMsg> lqw = Wrappers.lambdaQuery();
lqw.eq(XgStudentMsg::getClassId, classId);