package com.fuzamei.service.serviceImpl;

import java.util.List;

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

import com.fuzamei.entity.OperationHistory;
import com.fuzamei.entity.OperationHistoryAdmin;
import com.fuzamei.entity.OperationType;
import com.fuzamei.entity.Params;
import com.fuzamei.entity.SendOrder;
import com.fuzamei.mapperInterface.OperationHistoryMapper;
import com.fuzamei.service.OperationHistoryService;
import com.fuzamei.util.PageDTO;
@Service
public class OperationHistoryServiceImpl implements OperationHistoryService {
	
	@Autowired
	private OperationHistoryMapper operationHistoryMapper;

	@Override
	public PageDTO queryOperationHistory(Params params) {
		PageDTO pageDto=new PageDTO();
		List<OperationHistory> orderList = operationHistoryMapper.queryOperationHistory(params);
		int count = operationHistoryMapper.findQueryCount(params);
		pageDto.setRows(orderList);
		pageDto.setTotal(count);
		return pageDto;
	}

	@Override
	public List<OperationType> showAllOperationTypeOfUser() {
		return operationHistoryMapper.showAllOperationTypeOfUser();
	}

	@Override
	public List<OperationType> showAllOperationTypeOfAdmin() {
		return operationHistoryMapper.showAllOperationTypeOfAdmin();
	}

	@Override
	public PageDTO queryOperationHistoryByAdmin(Params params) {
		PageDTO pageDto=new PageDTO();
		List<OperationHistoryAdmin> orderList = operationHistoryMapper.queryOperationHistoryByAdmin(params);
		int count = operationHistoryMapper.findQueryCountByAdmin(params);
		pageDto.setRows(orderList);
		pageDto.setTotal(count);
		return pageDto;
	}
	
	
}
