package com.ruoyi.system.service.impl; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ruoyi.common.basic.PageInfo; import com.ruoyi.common.constant.DictConstants; import com.ruoyi.common.utils.DictUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.system.mapper.TFaultAreaDicMapper; import com.ruoyi.system.model.TDept; import com.ruoyi.system.model.TFaultAreaDic; import com.ruoyi.system.query.TFaultAreaDicQuery; import com.ruoyi.system.service.TFaultAreaDicService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.system.vo.TFaultAreaDicVO; import com.ruoyi.system.vo.TenantVO; import org.springframework.stereotype.Service; import java.util.List; /** *

* 故障区域 服务实现类 *

* * @author xiaochen * @since 2025-01-17 */ @Service public class TFaultAreaDicServiceImpl extends ServiceImpl implements TFaultAreaDicService { @Override public PageInfo pageList(TFaultAreaDicQuery query) { PageInfo pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); List list = this.baseMapper.pageList(query,pageInfo); pageInfo.setRecords(list); return pageInfo; } @Override public boolean isExit(TFaultAreaDic dto) { if(StringUtils.isNotEmpty(dto.getId())){ // 修改 return this.count(Wrappers.lambdaQuery(TFaultAreaDic.class).ne(TFaultAreaDic::getId, dto.getId()).eq(TFaultAreaDic::getFaultAreaName, dto.getFaultAreaName())) > 0; }else { // 新增 return this.count(Wrappers.lambdaQuery(TFaultAreaDic.class).eq(TFaultAreaDic::getFaultAreaName, dto.getFaultAreaName())) > 0; } } @Override public List getAreaDicList() { return this.baseMapper.getAreaDicList(); } }