package com.dxhy.base.service.receipt;

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

import org.springframework.stereotype.Service;

import com.dxhy.base.dao.BaseInvoiceOutDao;
import com.dxhy.base.model.BaseReceiptInvoiceView;
import com.dxhy.common.service.impl.MpBaseServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

/**
 * @author peipei.li
 * @date 2019-04-25 进项税明细关联抵账表
 */
@Service("baseIInvoiceOutService")
public class BaseInvoiceOutServiceImpl extends MpBaseServiceImpl<BaseInvoiceOutDao, BaseReceiptInvoiceView>
    implements BaseIInvoiceOutService {
    /**
     * @param filter
     *            请求参数
     * @return 返回结果
     */
    @Override
    public PageInfo<BaseReceiptInvoiceView> listPageByInvoice(Map<String, Object> filter) {
        // 分页参数
        PageHelper.startPage(Integer.parseInt(filter.get("curr").toString()),
            Integer.parseInt(filter.get("size").toString()));
        List<BaseReceiptInvoiceView> list = super.baseMapper.listPageByInvoice(filter);
        return new PageInfo<>(list);
    }

    /**
     * 不分页
     *
     * @param filter
     *            请求参数
     * @return 返回结果
     */
    @Override
    public BaseReceiptInvoiceView querySumForInvoice(Map<String, Object> filter) {
        return super.baseMapper.querySumForInvoice(filter);
    }
}
