xuhy
2025-11-11 0111f782fc0ab99cc0ddb747617a6b85717e6b68
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package com.ruoyi.system.service.impl;
 
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.mapper.TLargeDeptMapper;
import com.ruoyi.system.model.TLargeDept;
import com.ruoyi.system.model.TLargeDept;
import com.ruoyi.system.service.TLargeDeptService;
import org.springframework.stereotype.Service;
 
/**
 * <p>
 * 大屏-组织部门 服务实现类
 * </p>
 *
 * @author xiaochen
 * @since 2025-11-11
 */
@Service
public class TLargeDeptServiceImpl extends ServiceImpl<TLargeDeptMapper, TLargeDept> implements TLargeDeptService {
 
    @Override
    public boolean isExit(TLargeDept dto) {
        if(StringUtils.isNotEmpty(dto.getId())){
            // 修改
            return this.count(Wrappers.lambdaQuery(TLargeDept.class).ne(TLargeDept::getId, dto.getId()).eq(TLargeDept::getDeptName, dto.getDeptName())) > 0;
        }else {
            // 新增
            return this.count(Wrappers.lambdaQuery(TLargeDept.class).eq(TLargeDept::getDeptName, dto.getDeptName())) > 0;
        }
    }
}