MatchScheduleServiceImpl.java 2.29 KB
package com.zhongzhi.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zhongzhi.common.constant.ProjectType;
import com.zhongzhi.dao.MatchDictDAO;
import com.zhongzhi.model.MatchDictDO;
import com.zhongzhi.model.MatchScheduleDO;
import com.zhongzhi.dao.MatchScheduleDAO;
import com.zhongzhi.service.MatchScheduleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 时间安排 服务实现类
 * </p>
 *
 * @author DengMin
 * @since 2021-05-27
 */
@Service
public class MatchScheduleServiceImpl extends ServiceImpl<MatchScheduleDAO, MatchScheduleDO> implements MatchScheduleService {


    @Autowired
    private MatchDictDAO matchDictDAO;

    @Override
    public List<MatchScheduleDO> getMatchSchedule(MatchScheduleDO matchScheduleDO) {



        MatchDictDO matchDictDO = matchDictDAO.selectOne(new QueryWrapper<MatchDictDO>()
                .lambda()
                .eq(MatchDictDO::getId, matchScheduleDO.getMatchId())
                .eq(MatchDictDO::getMatchType, ProjectType.SEED_TRACK)
                .eq(MatchDictDO::getStatus, 1));
        List<MatchScheduleDO> list = new ArrayList<>();
        if (matchDictDO != null) {
            list = this.baseMapper.selectList(new QueryWrapper<MatchScheduleDO>()
                    .lambda()
                    .eq(MatchScheduleDO::getMatchId, matchDictDO.getId()));
        }
        return list;
    }

    @Override
    public List<MatchScheduleDO> getVocationalMatchSchedule(MatchScheduleDO matchScheduleDO) {



        MatchDictDO matchDictDO = matchDictDAO.selectOne(new QueryWrapper<MatchDictDO>()
                .lambda()
                .eq(MatchDictDO::getId, matchScheduleDO.getMatchId())
                .eq(MatchDictDO::getMatchType, ProjectType.VOCATIONAL)
                .eq(MatchDictDO::getStatus, 1));
        List<MatchScheduleDO> list = new ArrayList<>();
        if (matchDictDO != null) {
            list = this.baseMapper.selectList(new QueryWrapper<MatchScheduleDO>()
                    .lambda()
                    .eq(MatchScheduleDO::getMatchId, matchDictDO.getId()));
        }
        return list;
    }
}