package com.xinelu.manage.service.scheduleplandetail.impl;

import com.xinelu.manage.domain.scheduleplandetail.SchedulePlanDetail;
import com.xinelu.manage.mapper.scheduleplandetail.SchedulePlanDetailMapper;
import com.xinelu.manage.service.scheduleplandetail.ISchedulePlanDetailService;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;

/**
* @author haown
* @description 针对表【schedule_plan_detail(医生排班计划明细表)】的数据库操作Service实现
* @createDate 2023-09-21 17:21:38
*/
@Service
public class SchedulePlanDetailServiceImpl implements ISchedulePlanDetailService {

	@Resource
	private SchedulePlanDetailMapper planDetailMapper;

	@Override public int save(SchedulePlanDetail planDetail) {
		return planDetailMapper.insert(planDetail);
	}

	@Override public List<SchedulePlanDetail> getList(SchedulePlanDetail planDetail) {
		return planDetailMapper.getList(planDetail);
	}

	@Override public int update(SchedulePlanDetail planDetail) {
		return planDetailMapper.updateByPrimaryKeySelective(planDetail);
	}

	@Override public int batchUpdate(List<SchedulePlanDetail> planDetailList) {
		AtomicInteger flag = new AtomicInteger();
		planDetailList.forEach(planDetail -> {
			flag.addAndGet(planDetailMapper.updateByPrimaryKeySelective(planDetail));
		});
		return flag.get();
	}

	@Override public SchedulePlanDetail getById(Long id) {
		return planDetailMapper.selectByPrimaryKey(id);
	}
}




