package com.iamberry.cms.service.machine;

import java.util.List;

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

import com.iamberry.cms.core.entity.Machine;
import com.iamberry.cms.face.machine.MachineService;
import com.iamberry.cms.service.mapper.MachineMapper;

@Service
public class MachineServiceImpl implements MachineService {
	
	@Autowired
	private MachineMapper machineMapper;

	@Override
	public List<Machine> selectMachineList(Machine machine) {
		// TODO Auto-generated method stub
		return machineMapper.selectMachineList(machine);
	}

	@Override
	public Integer selectMachineListCount(Machine machine) {
		// TODO Auto-generated method stub
		int count = machineMapper.selectMachineListCount(machine);
		return	count = count % machine.getPage().getPageSize() == 0? count/machine.getPage().getPageSize():(count/machine.getPage().getPageSize())+1;
	}

}
