PubCluePoolServiceImpl.java 1.77 KB
package cn.fw.valhalla.service.data.impl;

import cn.fw.valhalla.dao.mapper.PubCluePoolMapper;
import cn.fw.valhalla.domain.db.pub.PubCluePool;
import cn.fw.valhalla.domain.dto.FollowPoolDTO;
import cn.fw.valhalla.domain.dto.PubCluePoolReportDTO;
import cn.fw.valhalla.domain.dto.PubCluePoolReportQueryDTO;
import cn.fw.valhalla.domain.query.FollowPoolQueryVO;
import cn.fw.valhalla.service.data.PubCluePoolService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Optional;

/**
 * 公共池线索
 *
 * @author : kurisu
 * @version : 1.0
 * @className : PubCluePoolServiceImpl
 * @description : 公共池线索
 * @date : 2023-03-20 10:36
 */
@Slf4j
@Service
public class PubCluePoolServiceImpl extends ServiceImpl<PubCluePoolMapper, PubCluePool> implements PubCluePoolService {
    @Override
    public List<FollowPoolDTO> followList(FollowPoolQueryVO queryVO) {
        Integer current = queryVO.getCurrent();
        Integer pageSize = queryVO.getPageSize();
        Integer startIndex = (current - 1) * pageSize;
        return Optional.ofNullable(getBaseMapper().followList(startIndex, pageSize, queryVO)).orElse(new ArrayList<>());
    }

    @Override
    public long followListCount(FollowPoolQueryVO queryVO) {
        return Optional.ofNullable(getBaseMapper().followListCount(queryVO)).orElse(0L);
    }

    /**
     * 查询站岗分配
     * @param dto
     * @return
     */
    @Override
    public List<PubCluePoolReportDTO> countPubCluePoolList(PubCluePoolReportQueryDTO dto){
        return Optional.ofNullable(getBaseMapper().countPubCluePoolList(dto)).orElse(Collections.emptyList());
    }
}