ExerciseCourseTreeMappingServiceImpl.java
1.65 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
package com.meishu.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.meishu.dto.exercise.QueryCourseTreeExerciseDTO;
import com.meishu.dto.exercise.UpdateStatusDTO;
import com.meishu.model.CourseTreeDO;
import com.meishu.model.ExerciseCourseTreeMappingDO;
import com.meishu.mapper.ExerciseCourseTreeMappingMapper;
import com.meishu.service.ExerciseCourseTreeMappingService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.meishu.util.ConstantUtils;
import com.meishu.vo.exercise.QueryCourseTreeExerciseVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 课程知识树--题目字典表 服务实现类
* </p>
*
* @author Tuyp
* @since 2021-05-24
*/
@Service
public class ExerciseCourseTreeMappingServiceImpl extends ServiceImpl<ExerciseCourseTreeMappingMapper, ExerciseCourseTreeMappingDO> implements ExerciseCourseTreeMappingService {
@Autowired
private ExerciseCourseTreeMappingMapper exerciseCourseTreeMappingMapper;
public String updateStatus(UpdateStatusDTO updateStatusDTO){
List<Long> ids = updateStatusDTO.getIds();
for (Long lg : ids){
ExerciseCourseTreeMappingDO exerciseCourseTreeMappingDO = this.baseMapper.selectById(lg);
exerciseCourseTreeMappingDO.setStatus(updateStatusDTO.getStatus());
this.baseMapper.updateById(exerciseCourseTreeMappingDO);
}
return ConstantUtils.SET_SUCCESS;
}
}