package com.yiboshi.science.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yiboshi.science.base.BaseServiceImpl;
import com.yiboshi.science.dao.ComProjcetResearchDAO;
import com.yiboshi.science.entity.ComProjcetResearch;
import com.yiboshi.science.param.dto.ComProjcetResearchDTO;
import com.yiboshi.science.param.query.ComProjcetResearchQueryVO;
import com.yiboshi.science.service.ComProjcetResearchService;
import org.springframework.stereotype.Service;

import java.util.Objects;

/**
 * 项目申请书在研项目情况表 Service 实现类
 * 
 * @author lkl
 * @version 2021-08-26
 */
@Service
public class ComProjcetResearchServiceImpl extends BaseServiceImpl<ComProjcetResearchDAO,ComProjcetResearchQueryVO, ComProjcetResearchDTO,ComProjcetResearch> implements ComProjcetResearchService {
    @Override
    protected void setCriteriaForQuery(ComProjcetResearchQueryVO vo, QueryWrapper<ComProjcetResearchQueryVO> criteria) {
        if(Objects.nonNull(vo.getProjId())){
            criteria.eq("proj_id", vo.getProjId());
        }
        if(Objects.nonNull(vo.getProjNo())){
            criteria.eq("proj_no", vo.getProjNo());
        }
        if(Objects.nonNull(vo.getProjName())){
            criteria.eq("proj_name", vo.getProjName());
        }
        if(Objects.nonNull(vo.getApproveUnit())){
            criteria.eq("approve_unit", vo.getApproveUnit());
        }
        if(Objects.nonNull(vo.getHeadName())){
            criteria.eq("head_name", vo.getHeadName());
        }
        if(Objects.nonNull(vo.getAgeLimit())){
            criteria.eq("age_limit", vo.getAgeLimit());
        }
        if(Objects.nonNull(vo.getFunding())){
            criteria.eq("funding", vo.getFunding());
        }
        if(Objects.nonNull(vo.getRelation())){
            criteria.eq("relation", vo.getRelation());
        }
    }
}