package com.yd.dal.service.marketing.Impl;

import com.yd.dal.entity.marketing.MktLeadsGoals;
import com.yd.dal.mapper.marketing.MktLeadsGoalsMapper;
import com.yd.dal.service.marketing.MktLeadsGoalsDALService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;

@Service("mktLeadsGoalsDALService")
public class MktLeadsGoalsDALServiceImpl implements MktLeadsGoalsDALService {

    @Resource
    private MktLeadsGoalsMapper mktLeadsGoalsMapper;

    @Override
    public void saveMktLeadsGoals(MktLeadsGoals mktLeadsGoals) {
        mktLeadsGoalsMapper.insertSelective(mktLeadsGoals);
    }

    @Override
    public void updateIsActiveIsNull(Long practitionerId, Integer year,Integer goalsType) {
        mktLeadsGoalsMapper.updateIsActiveIsNull(practitionerId, year,goalsType) ;
    }

    @Override
    public List<MktLeadsGoals> findByMktLeadsGoals(MktLeadsGoals mktLeadsGoals) {
        return mktLeadsGoalsMapper.selectByMktLeadsGoals(mktLeadsGoals);
    }

    @Override
    public List<MktLeadsGoals> selectByPractitionerIds(List<Long> practitionerIds, int year) {
        return mktLeadsGoalsMapper.selectByPractitionerIds( practitionerIds, year);
    }

    @Override
    public List<MktLeadsGoals> findByTypeAndTimeUnitAndSubordinateSystemId(Integer goalsType, Integer statisticTimeUnit, Long subordinateSystemId) {
        return mktLeadsGoalsMapper.findByTypeAndTimeUnitAndSubordinateSystemId(goalsType,statisticTimeUnit,subordinateSystemId);
    }

    @Override
    public List<MktLeadsGoals> findByTypeAndTimeUnitAndPractitionerId(Integer goalsType, Integer statisticTimeUnit, Long practitionerId) {
        return mktLeadsGoalsMapper.findByTypeAndTimeUnitAndPractitionerId(goalsType,statisticTimeUnit,practitionerId);
    }
}
