Commit c94d3502 authored by liqin's avatar liqin 💬

bug fixed

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