package com.thhy.secure.modules.biz.exam.service.impl;
|
|
import com.thhy.secure.modules.biz.exam.entity.Answer;
|
import com.thhy.secure.modules.biz.exam.mapper.AnswerMapper;
|
import com.thhy.secure.modules.biz.exam.service.AnswerService;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
import org.springframework.transaction.annotation.Transactional;
|
|
import java.io.Serializable;
|
import java.util.List;
|
|
/**
|
* 服务实现类
|
* @author zhang_xiao_bo
|
* @since 2023-05-26 09:23:16
|
*/
|
@Service
|
public class AnswerServiceImpl implements AnswerService {
|
|
|
|
@Autowired
|
private AnswerMapper answerMapper;
|
|
public Answer get(Serializable id){
|
return answerMapper.queryById(id);
|
}
|
|
public List<Answer> findList(Answer answer){
|
return answerMapper.findList(answer);
|
}
|
|
/**
|
* 增加和修改
|
* @param answer
|
*/
|
@Transactional
|
public void addAnswer(Answer answer){
|
if(answer.getAnsId() == null){
|
//增加操作
|
answerMapper.insert(answer);
|
}else{
|
//修改操作
|
answerMapper.update(answer);
|
}
|
|
}
|
|
/**
|
* 修改
|
* @param answer
|
*/
|
public void update(Answer answer){
|
answerMapper.update(answer);
|
}
|
|
/**
|
* 删除
|
* @param ansId
|
*/
|
public void delete(Serializable ansId){
|
answerMapper.deletelogic(ansId);
|
}
|
}
|