package cn.com.ty.lift.ud.dataBank.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import cn.com.ty.lift.ud.dataBank.mapper.LiftControlMapper;
import cn.com.ty.lift.ud.dataBank.mapper.entity.LiftControlEntity;
import cn.com.ty.lift.ud.dataBank.service.ILiftControlService;

/**
 * 电梯系统 -ServiceImpl
 *
 * @author Xson
 * @date 2020-04-23
 */
@Service
@Transactional
public class LiftControlServiceImpl extends ServiceImpl<LiftControlMapper,LiftControlEntity>
    implements ILiftControlService {
	
	@Autowired
	private LiftControlMapper liftControlMapper;

	@Override
	public void updateByIds(List<Long> ids, Integer status) {
		for(Long id : ids) {
			LiftControlEntity bit = new LiftControlEntity();
			bit.setId(id);
			bit.setStatuz(status);
			liftControlMapper.updateById(bit);
		}
	}

	@Override
	public void updateTopFlagByIds(List<Long> ids, Integer status) {
		for(Long id : ids) {
			LiftControlEntity bit = new LiftControlEntity();
			bit.setId(id);
			bit.setTopFlag(status);
			liftControlMapper.updateById(bit);
		}
	}

	@Override
	public List<LiftControlEntity> queryAll() {
		return liftControlMapper.queryAll();
	}


}
