package com.ssm.manage.service.impl;

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

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

@Service
public class CourseMoneyServiceImpl extends BaseServiceImpl<CourseMoney> implements CourseMoneyService {

    @Autowired
    private CourseMoneyMapper mapper;

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

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

    @Override
    public void saveList(List<CourseMoney> courseInsert) {
        mapper.saveList(courseInsert);
    }

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