package com.qmth.qrzk.repository.user.service.impl;

import com.qmth.qrzk.repository.common.base.BaseDao;
import com.qmth.qrzk.repository.service.query.CorrigendumQueryParams;
import com.qmth.qrzk.repository.task.PaperCorrigendum;
import com.qmth.qrzk.repository.user.model.Course;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PaperCorrigendumService {

    private static final Logger log = Logger.getLogger(PaperCorrigendumService.class);

    @Autowired
    private BaseDao dao;


    public List<PaperCorrigendum> queryCorrigendum(CorrigendumQueryParams params) {
        return dao.getPagerList("queryPaperCorrigendum", params);
    }

    public void updateCorrigendum(PaperCorrigendum corrigendum) {
        dao.update("updatePaperCorrigendum", corrigendum);
    }

    public void addCorrigendum(PaperCorrigendum corrigendum) {
        dao.insert("addPaperCorrigendum", corrigendum);
    }


    public void delete(int id) {
        dao.delete("delCorrigendumById", id);
    }

    public PaperCorrigendum findById(Integer id) {
        return dao.getObject("getPaperCorrigendumById", id);
    }


    public List<PaperCorrigendum> list() {
        return dao.getList("queryPaperCorrigendum");
    }

    public List<String> queryAllBatch() {
        return dao.getList("queryAllBatch");
    }
}

