package com.unis.base.server.service.impl;

import com.github.pagehelper.PageHelper;
import com.unis.base.common.vo.EquipmentRecordsQueryVO;
import com.unis.base.common.vo.EquipmentRecordsVO;
import com.unis.base.server.domain.EquipmentRecordsDomain;
import com.unis.base.server.service.EquipmentRecordsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author WangZL
 * @version 1.0
 * @Title EquipmentRecordsServiceImpl
 * @ProjectName 设备记录服务实现层
 * @Description
 * @date 2019/07/22 17点26分
 */
@Service
public class EquipmentRecordsServiceImpl implements EquipmentRecordsService {

	@Resource
	private EquipmentRecordsDomain equipmentRecordsDomain;

	/**
	 * 获取设备记录列表
	 * @param equipmentRecordsQueryVO
	 * @return
	 */
	@Override
	public List<EquipmentRecordsVO> getEquipmentRecordsList(EquipmentRecordsQueryVO equipmentRecordsQueryVO) {
		return equipmentRecordsDomain.getEquipmentRecordsList(equipmentRecordsQueryVO);
	}

	/**
	 * 分页获取设备记录列表
	 * @param equipmentRecordsQueryVO
	 * @param pageNum
	 * @param pageSize
	 * @return
	 */
	@Override
	public List<EquipmentRecordsVO> getEquipmentRecordsPage(EquipmentRecordsQueryVO equipmentRecordsQueryVO, Integer pageNum, Integer pageSize) {
		PageHelper.startPage(pageNum, pageSize);
		return equipmentRecordsDomain.getEquipmentRecordsList(equipmentRecordsQueryVO);
	}

	/**
	 * 根据设备编号获取设备记录
	 * @param sbbajlId
	 * @return
	 */
	@Override
	public EquipmentRecordsVO getEquipmentRecordsInfoById(Integer sbbajlId) {
		return equipmentRecordsDomain.getEquipmentRecordsInfo(sbbajlId);
	}

	/**
	 * 添加设备记录
	 * @param equipmentRecordsVO
	 * @return
	 */
	@Override
	public int insert(EquipmentRecordsVO equipmentRecordsVO) {
		return equipmentRecordsDomain.insert(equipmentRecordsVO);
	}

}
