xuhy
2025-11-06 603acbf0bd5c9ad0290c4d126a3f32faa218d7b0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TEmploymentInfoServiceImpl.java
@@ -1,10 +1,19 @@
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.TEmploymentInfoMapper;
import com.ruoyi.system.model.TAdvertisement;
import com.ruoyi.system.model.TEmploymentInfo;
import com.ruoyi.system.model.TEmploymentInfo;
import com.ruoyi.system.query.TEmploymentInfoQuery;
import com.ruoyi.system.service.TEmploymentInfoService;
import com.ruoyi.system.vo.TEmploymentInfoVO;
import org.springframework.stereotype.Service;
import java.util.List;
/**
 * <p>
@@ -17,4 +26,22 @@
@Service
public class TEmploymentInfoServiceImpl extends ServiceImpl<TEmploymentInfoMapper, TEmploymentInfo> implements TEmploymentInfoService {
    @Override
    public boolean isExit(TEmploymentInfo dto) {
        if(StringUtils.isNotEmpty(dto.getId())){
            // 修改
            return this.count(Wrappers.lambdaQuery(TEmploymentInfo.class).ne(TEmploymentInfo::getId, dto.getId()).eq(TEmploymentInfo::getInfoTitle, dto.getInfoTitle())) > 0;
        }else {
            // 新增
            return this.count(Wrappers.lambdaQuery(TEmploymentInfo.class).eq(TEmploymentInfo::getInfoTitle, dto.getInfoTitle())) > 0;
        }
    }
    @Override
    public PageInfo<TEmploymentInfoVO> pageList(TEmploymentInfoQuery query) {
        PageInfo<TEmploymentInfoVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize());
        List<TEmploymentInfoVO> list = this.baseMapper.pageList(query,pageInfo);
        pageInfo.setRecords(list);
        return pageInfo;
    }
}