package com.steerinfo.ems.trmactitem.service.impl;

import com.steerinfo.framework.mapper.IBaseMapper;
import com.steerinfo.framework.service.impl.BaseServiceImpl;
import com.steerinfo.ems.trmactitem.model.TRmActItem;
import com.steerinfo.ems.trmactitem.mapper.TRmActItemMapper;
import com.steerinfo.ems.trmactitem.service.ITRmActItemService;
import com.steerinfo.framework.service.pagehelper.PageHelper;
import com.steerinfo.framework.service.pagehelper.PageList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * TRmActItem服务实现：
 * @author generator
 * @version 1.0-SNAPSHORT 2019-10-11 11:41
 * 类描述
 * 修订历史：
 * 日期：2019-10-11
 * 作者：generator
 * 参考：
 * 描述：TRmActItem服务实现
 * @see null
 * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
 */
@Service(value = "tRmActItemService")
public class TRmActItemServiceImpl extends BaseServiceImpl<TRmActItem, String> implements ITRmActItemService {

    @Autowired
    private TRmActItemMapper tRmActItemMapper;

    @Override
    protected IBaseMapper<TRmActItem, String> getMapper() {
        return tRmActItemMapper;
    }


    @Override
    public List<TRmActItem> getIdAndName(String itemtype) {
        return tRmActItemMapper.getIdAndName(itemtype);
    }

    @Override
    public PageList<Map<String, Object>> getActitemDetaltsForPage(Map<String, Object> parameters, Integer pageNum, Integer pageSize) {
         PageHelper.startPage(pageNum, pageSize);
         List<Map<String, Object>> actitemDetalts = tRmActItemMapper.getActitemDetalts(parameters);
         PageList<Map<String,Object>> getInfo = new PageList<Map<String,Object>>(actitemDetalts);
        return getInfo;
    }

    @Override
    public PageList<Map<String, Object>> getPlanitemDetalts(Map<String, Object> parameters, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<Map<String, Object>> planitemDetalts = tRmActItemMapper.getPlanitemDetalts(parameters);
        PageList<Map<String,Object>> pageInfo = new PageList<>(planitemDetalts);
        return pageInfo;
    }

    @Override
    public List<TRmActItem> getforsj(String modificationtime) {
        return tRmActItemMapper.getforsj(modificationtime);
    }


    @Override
    public List<TRmActItem> getitems(String itemtype) {
        return tRmActItemMapper.getitems(itemtype);
    }


	@Override
	public PageList<Map<String, Object>> getBalanceDataForPage(Map<String, Object> parameters, Integer pageNum,
			Integer pageSize) {
		PageHelper.startPage(pageNum, pageSize);
        List<Map<String, Object>> actitemDetalts = tRmActItemMapper.getBalanceData(parameters);
        PageList<Map<String,Object>> plist = new PageList<Map<String,Object>>(actitemDetalts);
        return plist;
	}

	@Override
	public PageList<TRmActItem> queryLikewForPage(HashMap<String, Object> parmas, Integer pageNum, Integer pageSize) {
		PageHelper.startPage(pageNum, pageSize);
        List<TRmActItem> actitemDetalts = tRmActItemMapper.queryLikew(parmas);
        PageList<TRmActItem> plist = new PageList<TRmActItem>(actitemDetalts);
        return plist;
	}
	
	@Override
	public PageList<TRmActItem> queryLikefForPage(HashMap<String, Object> parmas, Integer pageNum, Integer pageSize) {
		PageHelper.startPage(pageNum, pageSize);
        List<TRmActItem> actitemDetalts = tRmActItemMapper.queryLikef(parmas);
        PageList<TRmActItem> plist = new PageList<TRmActItem>(actitemDetalts);
        return plist;
	}

	@Override
	public List<Map<String, Object>> getAssItems() {
		return tRmActItemMapper.getAssItems();
	}

	@Override
	public List<Map<String, Object>> listpv(HashMap<String, Object> parmas) {
		List<Map<String, Object>> list = tRmActItemMapper.listpv(parmas);
		return list;
	}

	@Override
	public List<Map<String, Object>> getProItems() {
		return tRmActItemMapper.getProItems();
	}
}
