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

import com.github.pagehelper.PageHelper;
import com.unis.base.common.vo.CompanyRecordsQueryVO;
import com.unis.base.common.vo.CompanyRecordsVO;
import com.unis.base.server.domain.CompanyRecordsDomain;
import com.unis.base.server.service.CompanyRecordsService;
import org.springframework.stereotype.Service;

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

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

	@Resource
	private CompanyRecordsDomain companyRecordsDomain;

	/**
	 * 获取企业记录列表
	 * @param companyRecordsQueryVO
	 * @return
	 */
	@Override
	public List<CompanyRecordsVO> getCompanyRecordsList(CompanyRecordsQueryVO companyRecordsQueryVO) {
		return companyRecordsDomain.getCompanyRecordsList(companyRecordsQueryVO);
	}

	/**
	 * 分页获取企业记录列表
	 * @param companyRecordsQueryVO
	 * @param pageNum
	 * @param pageSize
	 * @return
	 */
	@Override
	public List<CompanyRecordsVO> getCompanyRecordsPage(CompanyRecordsQueryVO companyRecordsQueryVO, Integer pageNum, Integer pageSize) {
		PageHelper.startPage(pageNum, pageSize);
		return companyRecordsDomain.getCompanyRecordsList(companyRecordsQueryVO);
	}

	/**
	 * 获取企业记录详情
	 * @param qybabh
	 * @return
	 */
	@Override
	public CompanyRecordsVO getCompanyRecordsInfoById(String qybabh) {
		return companyRecordsDomain.getCompanyRecordsInfo(qybabh);
	}

	/**
	 * 添加企业记录
	 * @param companyRecordsVO
	 * @return
	 */
	@Override
	public String insert(CompanyRecordsVO companyRecordsVO) {
		return companyRecordsDomain.insert(companyRecordsVO);
	}

	/**
	 * 更新企业记录信息
	 * @param companyRecordsVO
	 * @return
	 */
	@Override
	public int update(CompanyRecordsVO companyRecordsVO) {
		return companyRecordsDomain.update(companyRecordsVO);
	}

}
