mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-09 02:46:50 +08:00
推荐案例根据推荐id查询
This commit is contained in:
@@ -21,6 +21,7 @@ public interface CasesRecordDao extends JpaRepository<Cases, String>, JpaSpecifi
|
||||
@Query(nativeQuery = true, value = "select c.* from ( select b.*" +
|
||||
" from boe_cases_recommend_push_record a INNER JOIN boe_cases b on a.case_id = b.id" +
|
||||
" where b.deleted=0 and a.push_status = 3 and a.push_user_id= :#{#condition.userId}" +
|
||||
" and if(IFNULL(:#{#condition.refId},'') !='' ,a.recommend_id = :#{#condition.refId},1=1) " +
|
||||
" and if(IFNULL(:#{#condition.keyWord},'')!='',b.title like CONCAT('%',:#{#condition.keyWord},'%')" +
|
||||
" or b.author_name like CONCAT('%',:#{#condition.keyWord},'%')" +
|
||||
" or b.keyword1 like CONCAT('%',:#{#condition.keyWord},'%')" +
|
||||
@@ -37,6 +38,7 @@ public interface CasesRecordDao extends JpaRepository<Cases, String>, JpaSpecifi
|
||||
countQuery = "select count(*) FROM (select c.* from ( select b.*" +
|
||||
" from boe_cases_recommend_push_record a INNER JOIN boe_cases b on a.case_id = b.id " +
|
||||
" where b.deleted=0 and a.push_status = 3 and a.push_user_id= :#{#condition.userId}" +
|
||||
" and if(IFNULL(:#{#condition.refId},'') !='' ,a.recommend_id = :#{#condition.refId},1=1) " +
|
||||
" and if(IFNULL(:#{#condition.keyWord},'')!='',b.title like CONCAT('%',:#{#condition.keyWord},'%')" +
|
||||
" or b.author_name like CONCAT('%',:#{#condition.keyWord},'%')" +
|
||||
" or b.keyword1 like CONCAT('%',:#{#condition.keyWord},'%')" +
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.xboe.module.boecase.dto;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.xboe.module.scorm.rte.model.datatype.Int;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
|
||||
@@ -62,6 +63,11 @@ public class CasePageVo extends PageDto {
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 推荐id
|
||||
*/
|
||||
private Long refId;
|
||||
|
||||
public boolean isYearsEmpty() {
|
||||
return CollUtil.isEmpty(this.years);
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@ class CasesServiceImplTest {
|
||||
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,false);
|
||||
CasePageVo pageVo = mapper.readValue(jsonStr, CasePageVo.class);
|
||||
pageVo.setUserId("965342027497607168");
|
||||
pageVo.setRefId(1125371361194614787L);
|
||||
PageList<Cases> casesV2 = casesService.queryRecommendPageCasesV2(pageVo);
|
||||
System.out.println(casesV2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user