package cn.com.qmth.stmms.biz.mark.service.Impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.com.qmth.stmms.biz.common.BaseQueryService;
import cn.com.qmth.stmms.biz.mark.dao.ProblemTypeDao;
import cn.com.qmth.stmms.biz.mark.model.ProblemType;
import cn.com.qmth.stmms.biz.mark.service.ProblemTypeService;

@Service
public class ProblemTypeServiceImpl extends BaseQueryService<ProblemType> implements ProblemTypeService {

    @Autowired
    private ProblemTypeDao problemDao;

    @Override
    public ProblemType save(ProblemType p) {
        return problemDao.save(p);
    }

    @Override
    public ProblemType findById(Integer id) {
        return problemDao.findOne(id);
    }

    @Transactional
    @Override
    public void deleteById(Integer id) {
        problemDao.delete(id);
    }

    @Override
    public void delete(ProblemType p) {
        problemDao.delete(p);
    }

    @Override
    public List<ProblemType> findByExamId(Integer examId) {
        return problemDao.findByExamId(examId);
    }

}
