package com.ssm.manage.dao.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ssm.core.impl.BaseDaoImpl;
import com.ssm.manage.dao.SsmStoreAccountOutinDao;
import com.ssm.manage.dao.SsmStoreTurnTreatmentDao;
import com.ssm.manage.entity.RechargeAccountOutin;
import com.ssm.manage.entity.SmsException;
import com.ssm.manage.entity.StoreTurnTreatment;
import com.ssm.manage.mapper.SsmStoreAccountOutinMapper;
import com.ssm.manage.mapper.SsmStoreTurnTreatmentMapper;
import com.ssm.manage.query.RechargeAccountOutinRequest;
import com.ssm.manage.query.StoreTurnTreatmentQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

@Component
public class SsmStoreAccountOutinDaoImpl extends BaseDaoImpl<RechargeAccountOutin> implements SsmStoreAccountOutinDao {

    @Autowired
    private SsmStoreAccountOutinMapper mapper;

    @Override
    public SsmStoreAccountOutinMapper getMapper() {
        return mapper;
    }


    @Override
    public PageInfo<RechargeAccountOutin> selectPage(RechargeAccountOutinRequest rechargeAccountOutinRequest) throws SmsException {
        PageHelper.startPage(rechargeAccountOutinRequest.getPageNum(),rechargeAccountOutinRequest.getPageSize(),rechargeAccountOutinRequest.getOrderAndSort());
        List<RechargeAccountOutin> lists= mapper.selectPage(rechargeAccountOutinRequest);
        PageInfo<RechargeAccountOutin> pageInfo = new PageInfo<>(lists);
        return pageInfo;
    }

    @Override
    public List<RechargeAccountOutin> getNum(RechargeAccountOutin rechargeAccountOutin) {
        return mapper.getDocNum(rechargeAccountOutin);
    }
}
