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.basic.PageInfo;
|
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.system.mapper.TLargeOrganizationMapper;
|
import com.ruoyi.system.model.TAppUser;
|
import com.ruoyi.system.model.TLargeOrganization;
|
import com.ruoyi.system.model.TLargeOrganization;
|
import com.ruoyi.system.query.TLargeOrganizationQuery;
|
import com.ruoyi.system.service.TLargeOrganizationService;
|
import org.springframework.stereotype.Service;
|
|
import java.util.List;
|
|
/**
|
* <p>
|
* 大屏-社会组织 服务实现类
|
* </p>
|
*
|
* @author xiaochen
|
* @since 2025-11-11
|
*/
|
@Service
|
public class TLargeOrganizationServiceImpl extends ServiceImpl<TLargeOrganizationMapper, TLargeOrganization> implements TLargeOrganizationService {
|
|
@Override
|
public boolean isExit(TLargeOrganization dto) {
|
if(StringUtils.isNotEmpty(dto.getId())){
|
// 修改
|
return this.count(Wrappers.lambdaQuery(TLargeOrganization.class).ne(TLargeOrganization::getId, dto.getId()).eq(TLargeOrganization::getOrganizationName, dto.getOrganizationName())) > 0;
|
}else {
|
// 新增
|
return this.count(Wrappers.lambdaQuery(TLargeOrganization.class).eq(TLargeOrganization::getOrganizationName, dto.getOrganizationName())) > 0;
|
}
|
}
|
|
@Override
|
public PageInfo<TLargeOrganization> pageList(TLargeOrganizationQuery query) {
|
PageInfo<TLargeOrganization> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize());
|
List<TLargeOrganization> list = this.baseMapper.pageList(query,pageInfo);
|
pageInfo.setRecords( list);
|
return pageInfo;
|
}
|
}
|