package com.xhkjedu.sexam.service.exam;

import com.xhkjedu.sexam.mapper.exam.ESubjectBadstudentMapper;
import com.xhkjedu.sexam.model.exam.ESubjectBadstudent;
import com.xhkjedu.utils.N_Utils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ESubjectBadstudentService {
    @Resource
    private ESubjectBadstudentMapper eSubjectBadstudentMapper;

    //添加
    public void save(ESubjectBadstudent model) {
        model.setCreatetime(N_Utils.getSecondTimestamp());
        eSubjectBadstudentMapper.insertSelective(model);
    }

    //删除
    public Integer deleteById(Integer id) {
        return eSubjectBadstudentMapper.deleteByPrimaryKey(id);
    }

    //修改
    public Integer update(ESubjectBadstudent model) {
        return eSubjectBadstudentMapper.updateByPrimaryKeySelective(model);
    }

    //获取详情
    public ESubjectBadstudent findById(Integer id) {
        return eSubjectBadstudentMapper.selectByPrimaryKey(id);
    }

    //获取列表
    public List <ESubjectBadstudent> listAll() {
        return eSubjectBadstudentMapper.selectAll();
    }
}
