Commit c94d3502 authored by liqin's avatar liqin 💬

bug fixed

parent 7dd8a390
...@@ -20,14 +20,15 @@ import java.util.List; ...@@ -20,14 +20,15 @@ import java.util.List;
*/ */
public interface LearningContentBoardMapper extends BaseMapper<LearningContentBoard> { 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.exhibition_board_id=eb.id and lcb.learning_content_id = #{learningContentId}") @Select("SELECT lcb.*, eb.`name` as exhibition_board_name FROM learning_content_board lcb, exhibition_board eb WHERE lcb.exhibition_board_id = eb.id and lcb.learning_content_id = #{learningContentId} order by lcb.sortorder desc")
List<LearningContentBoard> selectBoardListByLearningContentId(String learningContentId); List<LearningContentBoard> selectBoardListByLearningContentId(String learningContentId);
@Select("<script>" @Select("<script>"
+ "SELECT eb.* FROM learning_content_board lcb, exhibition_board eb " + "SELECT eb.* FROM learning_content_board lcb, exhibition_board eb "
+ "WHERE lcb.exhibition_board_id = eb.id " + "WHERE lcb.exhibition_board_id = eb.id "
+ "<if test='learningContentId != null'>and lcb.learning_content_id = #{learningContentId} </if>" + "<if test='learningContentId != null'>and lcb.learning_content_id = #{learningContentId} </if>"
+ "<if test='nameOrCode != null'>and eb.name like CONCAT('%', #{nameOrCode}, '%')</if>" + "<if test='nameOrCode != null'>and eb.name like CONCAT('%', #{nameOrCode}, '%') </if>"
+ "order by lcb.sortorder desc"
+ "</script>" + "</script>"
) )
IPage<ExhibitionBoard> selectBoardPageByLearningContentId(Page<?> page, String learningContentId, String nameOrCode); IPage<ExhibitionBoard> selectBoardPageByLearningContentId(Page<?> page, String learningContentId, String nameOrCode);
......
...@@ -61,6 +61,8 @@ public class LearningContentBoardController extends BaseController { ...@@ -61,6 +61,8 @@ public class LearningContentBoardController extends BaseController {
LearningContentBoard::getId, LearningContentBoard::getId,
LearningContentBoard::getLearningContentId, LearningContentBoard::getLearningContentId,
LearningContentBoard::getExhibitionBoardId); LearningContentBoard::getExhibitionBoardId);
// 设置排序规则
queryWrapper.orderByDesc(LearningContentBoard::getSortorder);
Page<LearningContentBoard> page = this.learningContentBoardService.page(getPage(), queryWrapper); Page<LearningContentBoard> page = this.learningContentBoardService.page(getPage(), queryWrapper);
return getResult(page); return getResult(page);
} }
......
...@@ -254,7 +254,7 @@ public class LearningContentController extends BaseController { ...@@ -254,7 +254,7 @@ public class LearningContentController extends BaseController {
.le(LearningContent::getCreateTime, genericPageParam.getEndDate().atTime(23, 59, 59)); .le(LearningContent::getCreateTime, genericPageParam.getEndDate().atTime(23, 59, 59));
} }
// 设置排序规则 // 设置排序规则
queryWrapper.orderByDesc(LearningContent::getCreateTime); queryWrapper.orderByDesc(LearningContent::getSortorder);
// 设置查询内容 // 设置查询内容
queryWrapper.select( queryWrapper.select(
LearningContent::getId, LearningContent::getId,
......
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