package com.railway.business.baseinfo.service.impl;

import com.railway.business.baseinfo.mapper.BusFdfxjyqMapper;
import com.railway.business.baseinfo.domain.BusFdfxjyq;
import com.railway.business.baseinfo.service.IBusFdfxjyqService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* 分段分相绝缘器
* @author wuhonghao
* @date 2021/10/13
*/
@Service
@Transactional(readOnly = true)
public class BusFdfxjyqServiceImpl implements IBusFdfxjyqService{

	private final BusFdfxjyqMapper busFdfxjyqMapper;

	public BusFdfxjyqServiceImpl(BusFdfxjyqMapper busFdfxjyqMapper) {
		this.busFdfxjyqMapper = busFdfxjyqMapper;
	}

	/**
	* 新增
	*/
	@Override
	@Transactional(rollbackFor = Exception.class)
	public int create(BusFdfxjyq busFdfxjyq) {
		return busFdfxjyqMapper.insert(busFdfxjyq);
	}

	/**
	* 删除
	*/
	@Override
	@Transactional(rollbackFor = Exception.class)
	public int delete(String[] ids) {
		int r =0;
		for (String id : ids) {
			int j= busFdfxjyqMapper.delete(id);
			r = r + j;
		}
		return	r;
	}

	/**
	* 更新
	*/
	@Override
	@Transactional(rollbackFor = Exception.class)
	public int update(BusFdfxjyq busFdfxjyq) {
		return busFdfxjyqMapper.update(busFdfxjyq);
	}

	/**
	* 获取单个
	*/
	@Override
	public BusFdfxjyq getInfo(String id) {
		return busFdfxjyqMapper.getInfo(id);
	}

	/**
	* 查询列表
	*/
	@Override
	public List<BusFdfxjyq> getList(BusFdfxjyq busFdfxjyq) {
		return busFdfxjyqMapper.getList(busFdfxjyq);
	}
}
