Commit 91d8305c authored by wzp's avatar wzp

app需求变动

parent f3d0ef45
......@@ -17,4 +17,6 @@ import java.util.List;
public interface ExhibitionBoardMapper extends BaseMapper<ExhibitionBoard> {
List<ExhibitionBoard> getList(@Param("learningProjectId") String learningProjectId, @Param("isPublished") boolean isPublished);
List<ExhibitionBoard> getByContentList(@Param("learningContentId") String learningContentId, @Param("isPublished") boolean isPublished);
}
......@@ -122,7 +122,7 @@ public interface LearningContentBoardMapper extends BaseMapper<LearningContentBo
@Select("<script>"
+ "SELECT eb.* FROM learning_project p,learning_content lc,learning_content_board lcb, exhibition_board eb "
+ "WHERE lcb.exhibition_board_id = eb.id and p.id = lc.learning_project_id and lc.id = lcb.learning_content_id "
+ "and eb.is_published = 1 and eb.is_deleted = 0 and lc.is_deleted = 0 and lc.is_published = 1"
+ "and eb.is_published = 1 and eb.is_deleted = 0 and lc.is_deleted = 0 and lc.is_published = 1 and lc.is_major = 1 "
+ "<if test='learningProjectId != null'>and p.id = #{learningProjectId} </if>"
+ "<if test='nameOrCode != null'>"
+"AND ( eb.name LIKE CONCAT('%', #{nameOrCode}, '%') OR eb.name_pin_yin LIKE CONCAT('%', #{nameOrCode}, '%') " +
......@@ -133,4 +133,24 @@ public interface LearningContentBoardMapper extends BaseMapper<LearningContentBo
+ "</script>"
)
IPage<ExhibitionBoard> getBoardPageByLearningProjectId(Page<ExhibitionBoard> page, String learningProjectId, String nameOrCode);
@Select("SELECT t.* FROM " +
"("
+ "SELECT a.*, eb.id exhibition_board_id, eb.name exhibition_board_name, eb.cover exhibition_board_cover " +
"FROM learning_content_board lcb, learning_content lc, exhibition_board eb, video_content vc, asset a " +
"WHERE lcb.learning_content_id = lc.id and lcb.exhibition_board_id = eb.id and eb.video_content_id = vc.id " +
"and vc.id = a.ref_item_id and lc.is_published = 1 and lc.is_deleted = 0 and eb.is_published = 1 " +
"and eb.is_deleted = 0 and vc.is_deleted = 0 and vc.is_published = 1 and a.is_published = 1 " +
"and a.is_published = 1 and a.file_type = 'VIDEO' and lc.is_major = 1 " +
"union " +
"SELECT a.*, eb.id exhibition_board_id, eb.name exhibition_board_name, eb.cover exhibition_board_cover " +
"FROM learning_content_board lcb, learning_content lc, exhibition_board eb, asset a " +
" WHERE lcb.learning_content_id = lc.id and lcb.exhibition_board_id = eb.id and eb.id = a.ref_item_id " +
"and lc.is_published = 1 and lc.is_deleted = 0 and eb.is_published = 1 and eb.is_deleted = 0 " +
"and a.is_published = 1 and a.is_published = 1 and a.file_cat = 'EXHIBITION_BOARD_DATUM' " +
"and a.file_type = 'VIDEO' and lc.is_major = 1"
+ ") t"
)
IPage<Asset> selectAssetPageAll(Page<Asset> page);
}
......@@ -3,6 +3,7 @@ package cn.chnmuseum.party.service;
import cn.chnmuseum.party.model.ExhibitionBoard;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.Collection;
import java.util.List;
/**
......@@ -16,4 +17,6 @@ import java.util.List;
public interface ExhibitionBoardService extends IService<ExhibitionBoard> {
List<ExhibitionBoard> getList(String learningProjectId, boolean b);
List<ExhibitionBoard> getByContentList(String learningContentId, boolean b);
}
......@@ -23,8 +23,15 @@ public class ExhibitionBoardServiceImpl extends ServiceImpl<ExhibitionBoardMappe
@Autowired
private ExhibitionBoardMapper exhibitionBoardMapper;
//根据学习项目id查询所有展板
@Override
public List<ExhibitionBoard> getList(String learningProjectId, boolean isPublished) {
return exhibitionBoardMapper.getList(learningProjectId,isPublished);
}
//根据学习内容id查询所有展板
@Override
public List<ExhibitionBoard> getByContentList(String learningContentId, boolean isPublished) {
return exhibitionBoardMapper.getByContentList(learningContentId,isPublished);
}
}
......@@ -39,11 +39,15 @@ public class LearningContentBoardServiceImpl extends ServiceImpl<LearningContent
@Override
public IPage<Asset> getAssetPageByOrganCode(Page<Asset> page, String organCode) {
return learningContentBoardMapper.selectAssetPageByOrganCode(page, organCode);
//查询所有可看子学习内容视频列表
// return learningContentBoardMapper.selectAssetPageByOrganCode(page, organCode);
//直接查询主学习内容更新视频
return learningContentBoardMapper.selectAssetPageAll(page);
}
@Override
public IPage<ExhibitionBoard> getBoardPageByLearningProjectId(Page<ExhibitionBoard> page, String learningProjectId, String nameOrCode) {
//直接关联主学习内容查询展板
return learningContentBoardMapper.getBoardPageByLearningProjectId(page, learningProjectId, nameOrCode);
}
......
......@@ -35,9 +35,18 @@
select e.name,e.cover,lb.sortorder,e.create_time
from exhibition_board e
left join learning_content_board lb on lb.exhibition_board_id = e.id
left join learning_content lc on lb.learning_content_id = lc.id and lc.is_deleted = 0
left join learning_project p on lc.learning_project_id = p.id
where e.is_published = #{isPublished} and p.id = #{learningProjectId} and e.is_deleted = 0 and lc.is_deleted = 0 and lc.is_published = 1
inner join learning_content lc on lb.learning_content_id = lc.id and lc.is_deleted = 0 and lc.is_published = 1 and lc.is_major = 1
left join learning_project p on lc.learning_project_id = p.id and p.id = #{learningProjectId}
where e.is_published = #{isPublished} and e.is_deleted = 0
order by lb.sortorder desc,e.create_time DESC
</select>
<select id="getByContentList" resultMap="BaseResultMap">
select e.name,e.cover,lb.sortorder,e.create_time
from exhibition_board e
left join learning_content_board lb on lb.exhibition_board_id = e.id
inner join learning_content lc on lb.learning_content_id = lc.id and lc.id = #{learningContentId}
where e.is_published = #{isPublished} and e.is_deleted = 0
order by lb.sortorder desc,e.create_time DESC
</select>
......
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