提交 c31765f7 authored 作者: liupengfei's avatar liupengfei

--no commit message

上级 304e29b9
...@@ -359,6 +359,11 @@ public class FgEbookController { ...@@ -359,6 +359,11 @@ public class FgEbookController {
@GetMapping(value = "/related/books") @GetMapping(value = "/related/books")
public CallBack<List<FgAboutEbookListVO>> getRelatedBooks(String id, Integer num) { public CallBack<List<FgAboutEbookListVO>> getRelatedBooks(String id, Integer num) {
List<FgAboutEbookListVO> list = ebookservice.getRelatedBooks(id, num); List<FgAboutEbookListVO> list = ebookservice.getRelatedBooks(id, num);
if(list.isEmpty()){
FgQueryOtherEbookForm form = new FgQueryOtherEbookForm();
form.setNum(num);
list = ebookservice.getOtherEbook(form);
}
list.forEach(f -> { list.forEach(f -> {
FgQueryCommentForm queryCommentForm = new FgQueryCommentForm(); FgQueryCommentForm queryCommentForm = new FgQueryCommentForm();
queryCommentForm.setResourceId(f.getId()); queryCommentForm.setResourceId(f.getId());
......
...@@ -280,4 +280,22 @@ public interface FgEbookMapper extends BaseMapper<Ebook>{ ...@@ -280,4 +280,22 @@ public interface FgEbookMapper extends BaseMapper<Ebook>{
+ "eq(rr.objectId, resourceId) " + "eq(rr.objectId, resourceId) "
+ "</script>") + "</script>")
List<FgAboutEbookListVO> getRelatedVideos(@Param("resourceId")String resourceId); List<FgAboutEbookListVO> getRelatedVideos(@Param("resourceId")String resourceId);
/**
* 同类图书排行
* @param form
* @return
* @author ycw
* @date: 2019年2月18日 下午1:49:56
*/
@Select("<script>"
+ "select DISTINCT bb.id, bb.name, bb.translatorId, bb.translator,a.authorId,a.author, "
+ "bb.publisher,DATE_FORMAT(bb.publishTime,'%Y-%m-%d') publishTime, bb.status, be.price, be.priceOption, be.realPrice, be.cover, be.synopsis, be.bookStatus, be.browseNum, bb.resourceType "
+ "FROM res_book bb "
+ "LEFT JOIN res_ebook be ON bb.id = be.id "
+ "LEFT JOIN (SELECT resourceId,authorId,author FROM res_relation_author GROUP BY resourceId) a on be.id = a.resourceId "
+ "WHERE be.bookStatus = 1 "
+ "eq(id,form.id) "
+ "</script>")
List<FgAboutEbookListVO> getOtherEbook(@Param("form")FgQueryOtherEbookForm form);
} }
...@@ -169,4 +169,13 @@ public interface FgEbookService extends BaseService<Ebook, String>{ ...@@ -169,4 +169,13 @@ public interface FgEbookService extends BaseService<Ebook, String>{
* @date: 2020年9月3日 下午5:20:52 * @date: 2020年9月3日 下午5:20:52
*/ */
List<FgAboutEbookListVO> getRelatedBooks(String objectId, Integer num); List<FgAboutEbookListVO> getRelatedBooks(String objectId, Integer num);
/**
* 同类图书排行
* @param form
* @return
* @author ycw
* @date: 2019年1月11日 下午5:46:06
*/
List<FgAboutEbookListVO> getOtherEbook(FgQueryOtherEbookForm form);
} }
...@@ -790,4 +790,11 @@ public class FgEbookServiceImpl extends BaseServiceImpl<Ebook, String> implement ...@@ -790,4 +790,11 @@ public class FgEbookServiceImpl extends BaseServiceImpl<Ebook, String> implement
List<FgAboutEbookListVO>list = ebookMapper.getRelatedBooks(reourceId); List<FgAboutEbookListVO>list = ebookMapper.getRelatedBooks(reourceId);
return list; return list;
} }
@Override
public List<FgAboutEbookListVO> getOtherEbook(FgQueryOtherEbookForm form) {
PageHelper.startPage(1, form.getNum(), "browseNum desc");
List<FgAboutEbookListVO> list = ebookMapper.getOtherEbook(form);
return list;
}
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论