| | |
| | | package com.ots.project.exam.service.impl; |
| | | |
| | | import com.ots.common.utils.DateUtils; |
| | | import com.ots.common.utils.text.Convert; |
| | | import com.ots.project.exam.domain.TExamLevel; |
| | |
| | | import com.ots.project.exam.service.ITSubjectService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 维度表Service业务层处理 |
| | | * |
| | | * @author ots |
| | | * @date 2019-12-09 |
| | | */ |
| | | @Service("subject") |
| | | public class TSubjectServiceImpl implements ITSubjectService { |
| | | @Autowired |
| | | private TSubjectMapper tSubjectMapper; |
| | | |
| | | @Autowired |
| | | private TExamLevelMapper tExamLevelMapper; |
| | | |
| | | |
| | | /** |
| | | * 查询维度表 |
| | | * |
| | | * @param id 维度表ID |
| | | * @return 维度表 |
| | | */ |
| | | @Override |
| | | public TSubject selectTSubjectById(Long id) { |
| | | return tSubjectMapper.selectTSubjectById(id); |
| | | } |
| | | |
| | | @Override |
| | | public TSubject selectTSubjectAndTLeveById(Long id) { |
| | | return tSubjectMapper.selectTSubjectAndTLeveById(id); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询维度表列表 |
| | | * |
| | | * @param tSubject 维度表 |
| | | * @return 维度表 |
| | | */ |
| | | @Override |
| | | public List<TSubject> selectTSubjectList(TSubject tSubject) { |
| | | return tSubjectMapper.selectTSubjectList(tSubject); |
| | | } |
| | | |
| | | @Override |
| | | public List<TSubject> selectTSubjectList() { |
| | | return tSubjectMapper.selectTSubjectList(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 新增维度表 |
| | | * |
| | | * @param tSubject 维度表 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int insertTSubject(TSubject tSubject) { |
| | | tSubject.setCreateTime(DateUtils.getNowDate()); |
| | |
| | | tSubject.setLevelName(tExamLevel.getLevelName()); |
| | | return tSubjectMapper.insertTSubject(tSubject); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改维度表 |
| | | * |
| | | * @param tSubject 维度表 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int updateTSubject(TSubject tSubject) { |
| | | tSubject.setUpdateTime(DateUtils.getNowDate()); |
| | |
| | | tSubject.setLevelName(tExamLevel.getLevelName()); |
| | | return tSubjectMapper.updateTSubject(tSubject); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除维度表对象 |
| | | * |
| | | * @param ids 需要删除的数据ID |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteTSubjectByIds(String ids) { |
| | | return tSubjectMapper.deleteTSubjectByIds(Convert.toStrArray(ids)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除维度表信息 |
| | | * |
| | | * @param id 维度表ID |
| | | * @return 结果 |
| | | */ |
| | | public int deleteTSubjectById(Long id) { |
| | | return tSubjectMapper.deleteTSubjectById(id); |
| | | } |
| | | |
| | | @Override |
| | | public List<TSubject> selectTSubjectAndTLeveByTemplateId(String questionTemplateId) { |
| | | return tSubjectMapper.selectTSubjectAndTLeveByTemplateId(questionTemplateId); |