package com.example.service;

import com.example.bean.DailyReport;
import com.example.mapper.DailyReportMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DailyReportService {
    @Autowired
    private DailyReportMapper dailyReportMapper;

    public int addDailyReport(DailyReport dailyReport)
    {
        dailyReport.errorCheck();
        return dailyReportMapper.addDailyReport(dailyReport);
    }

    public int updateDailyReport(DailyReport dailyReport)
    {
        dailyReport.errorCheck();
        return dailyReportMapper.updateDailyReport(dailyReport);
    }

    public List<DailyReport> selectByUserid(String userid)
    {
        return dailyReportMapper.selectByUserId(userid);
    }
}
