package com.platform.modules.live.service.impl;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.platform.modules.live.dao.LiveSceneCheckDao;
import com.platform.modules.live.entity.LiveSceneCheckEntity;

import com.platform.modules.live.service.LiveSceneCheckService;
import org.springframework.transaction.annotation.Transactional;

import java.util.Arrays;

@Service("liveSceneCheckService")
@Transactional
public class LiveSceneCheckServiceImpl extends ServiceImpl<LiveSceneCheckDao, LiveSceneCheckEntity> implements LiveSceneCheckService {

	@Override
	public void save(LiveSceneCheckEntity liveSceneCheck){
		this.baseMapper.insert(liveSceneCheck);
	}
	
	@Override
	public void update(LiveSceneCheckEntity liveSceneCheck){
		this.baseMapper.update(liveSceneCheck, null);
	}
	
	@Override
	public void delete(Integer id){
		this.baseMapper.deleteById(id);
	}
	
	@Override
	public void deleteBatch(Integer[] ids){
		this.baseMapper.deleteBatchIds(Arrays.asList(ids));
	}

	@Override
	public void saveOrUpdate(LiveSceneCheckEntity liveSceneCheck) {
		if (liveSceneCheck.getId() == null) {
			this.baseMapper.insert(liveSceneCheck);
		} else {
			this.baseMapper.updateById(liveSceneCheck);
		}
	}

}
