Commit 7ee932c9 authored by liqin's avatar liqin 💬

bug fixed

parent e6f1fe7e
......@@ -2,6 +2,9 @@ package cn.wisenergy.chnmuseum.party.mapper;
import cn.wisenergy.chnmuseum.party.model.LearningContentBoard;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/**
* <p>
......@@ -13,4 +16,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface LearningContentBoardMapper extends BaseMapper<LearningContentBoard> {
@Select("SELECT lcb.*, eb.`name` as exhibition_board_name FROM learning_content_board lcb, exhibition_board eb WHERE lcb.learning_content_id=eb.id and lcb.learning_content_id = #{learningContentId}")
List<LearningContentBoard> selectBoardListByLearningContentId(String learningContentId);
}
......@@ -109,6 +109,10 @@ public class LearningContent implements Serializable {
@TableField(exist = false)
private String learningProjectName;
@ApiModelProperty("展板列表")
@TableField(exist = false)
private List<LearningContentBoard> learningContentBoardList;
@ApiModelProperty("所含展板数量(列表使用)")
@TableField(exist = false)
private Integer exhibitionBoardCount;
......
......@@ -3,6 +3,8 @@ package cn.wisenergy.chnmuseum.party.service;
import cn.wisenergy.chnmuseum.party.model.LearningContentBoard;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* <p>
* 学习内容展板 服务类
......@@ -13,4 +15,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface LearningContentBoardService extends IService<LearningContentBoard> {
List<LearningContentBoard> getBoardListByLearningContentId(String learningContentId);
}
package cn.wisenergy.chnmuseum.party.service.impl;
import cn.wisenergy.chnmuseum.party.model.LearningContentBoard;
import cn.wisenergy.chnmuseum.party.mapper.LearningContentBoardMapper;
import cn.wisenergy.chnmuseum.party.model.LearningContentBoard;
import cn.wisenergy.chnmuseum.party.service.LearningContentBoardService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* <p>
* 学习内容展板 服务实现类
......@@ -17,4 +20,12 @@ import org.springframework.stereotype.Service;
@Service
public class LearningContentBoardServiceImpl extends ServiceImpl<LearningContentBoardMapper, LearningContentBoard> implements LearningContentBoardService {
@Resource
private LearningContentBoardMapper learningContentBoardMapper;
@Override
public List<LearningContentBoard> getBoardListByLearningContentId(String learningContentId) {
return learningContentBoardMapper.selectBoardListByLearningContentId(learningContentId);
}
}
......@@ -208,10 +208,15 @@ public class LearningContentController extends BaseController {
@RequiresPermissions("learning:content:get:id")
public Map<String, Object> getById(@PathVariable("id") String id) {
LearningContent learningContent = learningContentService.getById(id);
LearningProject learningProject = this.learningProjectService.getById(learningContent.getLearningProjectId());
if (learningProject != null) {
learningContent.setLearningProjectName(learningProject.getName());
}
final List<LearningContentBoard> learningContentBoardList = learningContentBoardService.getBoardListByLearningContentId(id);
learningContent.setLearningContentBoardList(learningContentBoardList);
return getResult(learningContent);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment