package com.ssm.manage.service.impl;

import com.ssm.core.service.impl.BaseServiceImpl;
import com.ssm.manage.dao.BaseDao;
import com.ssm.manage.entity.CourseMoney;
import com.ssm.manage.entity.RechargeMoney;
import com.ssm.manage.extendEntity.NegativeDayStatistic;
import com.ssm.manage.mapper.RechargeMoneyMapper;
import com.ssm.manage.service.CourseMoneyService;
import com.ssm.manage.service.RechargeMoneyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.text.SimpleDateFormat;
import java.util.List;

@Service
public class RechargeMoneyServiceImpl extends BaseServiceImpl<RechargeMoney> implements RechargeMoneyService {


    @Autowired
    private RechargeMoneyMapper mapper;

    @Override
    public BaseDao<RechargeMoney> getDao() {
        return null;
    }

    @Override
    public List<RechargeMoney> selectByDate(String rechargeDate) {
        return mapper.selectByDate(rechargeDate);
    }

    @Override
    public void saveList(List<RechargeMoney> rechargeInsert) {
        mapper.saveList(rechargeInsert);
    }

    @Override
    public List<RechargeMoney> fixedNegativeCardByRecharge(NegativeDayStatistic negativeDayStatistic) {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM");
        negativeDayStatistic.setSelectDate(simpleDateFormat.format(negativeDayStatistic.getStartTime()));
        return mapper.fixedNegativeCardByRecharge(negativeDayStatistic);
    }
}
