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

import com.github.pagehelper.PageHelper;
import com.unis.base.common.vo.SinkpointRecordsQueryVO;
import com.unis.base.common.vo.SinkpointRecordsVO;
import com.unis.base.server.domain.SinkpointRecordsDomain;
import com.unis.base.server.service.SinkpointRecordsService;
import org.springframework.stereotype.Service;

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

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

	@Resource
	private SinkpointRecordsDomain sinkpointRecordsDomain;

	/**
	 * 获取库点记录列表
	 * @param sinkpointRecordsQueryVO
	 * @return
	 */
	@Override
	public List<SinkpointRecordsVO> getSinkpointRecordsList(SinkpointRecordsQueryVO sinkpointRecordsQueryVO) {
		return sinkpointRecordsDomain.getSinkpointRecordsList(sinkpointRecordsQueryVO);
	}

	/**
	 * 分页获取库点记录列表
	 * @param sinkpointRecordsQueryVO
	 * @param pageNum
	 * @param pageSize
	 * @return
	 */
	@Override
	public List<SinkpointRecordsVO> getSinkpointRecordsPage(SinkpointRecordsQueryVO sinkpointRecordsQueryVO, Integer pageNum, Integer pageSize) {
		PageHelper.startPage(pageNum, pageSize);
		return sinkpointRecordsDomain.getSinkpointRecordsList(sinkpointRecordsQueryVO);
	}

	/**
	 * 获取库点记录详情
	 * @param kdbabh
	 * @return
	 */
	@Override
	public SinkpointRecordsVO getSinkpointRecordsInfoById(String kdbabh) {
		return sinkpointRecordsDomain.getSinkpointRecordsInfo(kdbabh);
	}

	/**
	 * 添加库点记录
	 * @param sinkpointRecordsVO
	 * @return
	 */
	@Override
	public String insert(SinkpointRecordsVO sinkpointRecordsVO) {
		return sinkpointRecordsDomain.insert(sinkpointRecordsVO);
	}

	/**
	 * 更新库点记录
	 * @param sinkpointRecordsVO
	 * @return
	 */
	@Override
	public int update(SinkpointRecordsVO sinkpointRecordsVO) {
		return sinkpointRecordsDomain.update(sinkpointRecordsVO);
	}

}
