SubjectTestDictServiceImpl.java
1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package com.meishu.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.meishu.dto.test.GetAllTestDTO;
import com.meishu.model.SubjectTestDictDO;
import com.meishu.mapper.SubjectTestDictMapper;
import com.meishu.service.SubjectTestDictService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.meishu.util.ConstantUtils;
import com.meishu.vo.test.GetAllTestVO;
import com.meishu.vo.test.GetTestReportVO;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 测评表 服务实现类
* </p>
*
* @author Tuyp
* @since 2021-05-20
*/
@Service
public class SubjectTestDictServiceImpl extends ServiceImpl<SubjectTestDictMapper, SubjectTestDictDO> implements SubjectTestDictService {
public IPage<GetAllTestVO> getAllTest(GetAllTestDTO getAllTestDTO){
Page pager = new Page(getAllTestDTO.getPageNum(), getAllTestDTO.getPageSize());
return this.baseMapper.getAllTest(pager,getAllTestDTO.getRuleId(),getAllTestDTO.getTestName());
}
public List<GetAllTestVO> getTest(GetAllTestDTO getAllTestDTO){
return this.baseMapper.getTest(getAllTestDTO.getRuleId(),getAllTestDTO.getTestName());
}
public String insertTest(SubjectTestDictDO subjectTestDictDO){
this.baseMapper.insert(subjectTestDictDO);
return ConstantUtils.ADD_SUCCESS;
}
public String updateTest(SubjectTestDictDO subjectTestDictDO){
this.baseMapper.updateById(subjectTestDictDO);
return ConstantUtils.SUCCESS_UPDATE;
}
public String deleteByTestId(SubjectTestDictDO subjectTestDictDO){
this.baseMapper.deleteById(subjectTestDictDO.getId());
return ConstantUtils.DELETE_SUCCESS;
}
}