学员案例查询

This commit is contained in:
buerjun
2023-06-27 13:53:54 +08:00
parent 4639772025
commit 3053545ef5
4 changed files with 20 additions and 31 deletions

View File

@@ -49,7 +49,9 @@ public class CasePageVo extends PageDto {
private List<Long> notInIds;
/**
* excellent 最佳案例
* excellent 最佳
* hot 最热
* new 最新
* recommend 推荐
*/
private String type;

View File

@@ -50,4 +50,12 @@ public class CasesRecommend extends BaseEntity {
/**推荐组织名称*/
@Column(name = "recommend_org_name", length = 255)
private String recommendOrgName;
public CasesRecommend() {
}
public CasesRecommend(String id, String recommendOrgName) {
this.setId(id);
this.recommendOrgName = recommendOrgName;
}
}

View File

@@ -185,13 +185,13 @@ public class CasesServiceImpl implements ICasesService {
List<IFieldFilter> filters = new ArrayList<>();
filters.add(FieldFilters.eq("deleted", false));
List<IFieldFilter> likes = new ArrayList<IFieldFilter>();
likes.add(FieldFilters.like("title", LikeMatchMode.ANYWHERE, caseVo.getKeyWord()));
likes.add(FieldFilters.like("authorName", LikeMatchMode.ANYWHERE, caseVo.getKeyWord()));
likes.add(FieldFilters.like("keyword1", LikeMatchMode.ANYWHERE, caseVo.getKeyWord()));
likes.add(FieldFilters.like("keyword2", LikeMatchMode.ANYWHERE, caseVo.getKeyWord()));
likes.add(FieldFilters.like("keyword3", LikeMatchMode.ANYWHERE, caseVo.getKeyWord()));
likes.add(FieldFilters.like("keyword4", LikeMatchMode.ANYWHERE, caseVo.getKeyWord()));
likes.add(FieldFilters.like("keyword5", LikeMatchMode.ANYWHERE, caseVo.getKeyWord()));
likes.add(FieldFilters.like("title", LikeMatchMode.ANYWHERE, keyword));
likes.add(FieldFilters.like("authorName", LikeMatchMode.ANYWHERE, keyword));
likes.add(FieldFilters.like("keyword1", LikeMatchMode.ANYWHERE, keyword));
likes.add(FieldFilters.like("keyword2", LikeMatchMode.ANYWHERE, keyword));
likes.add(FieldFilters.like("keyword3", LikeMatchMode.ANYWHERE, keyword));
likes.add(FieldFilters.like("keyword4", LikeMatchMode.ANYWHERE, keyword));
likes.add(FieldFilters.like("keyword5", LikeMatchMode.ANYWHERE, keyword));
List<Long> notInIds = caseVo.getNotInIds();
if (CollUtil.isNotEmpty(notInIds)) {
filters.add(FieldFilters.notIn("id", notInIds));

View File

@@ -26,32 +26,11 @@ class CasesServiceImplTest {
@Test
void queryPageCasesV2() throws JsonProcessingException {
String jsonStr = "{\n" +
"\t\"pageIndex\": 1,\n" +
"\t\"pageSize\": 10,\n" +
"\t\"isTop\": false,\n" +
"\t\"orderField\": \"excellent\",\n" +
"\t\"majorType\": \"\",\n" +
"\t\"orgDomainDtos\": [],\n" +
"\t\"orderAsc\": false,\n" +
"\t\"excellent\": true,\n" +
"\t\"years\": [2023],\n" +
"\t\"breCommend\": true,\n" +
"\t\"caseType\": \"\",\n" +
"\t\"authorName\": \"\",\n" +
"\t\"notInIds\": [],\n" +
"\t\"type\": \"recommend\",\n" +
"\t\"userId\": \"\",\n" +
"\t\"parent\": \"\",\n" +
"\t\"children\": [],\n" +
"\t\"name\": \"\",\n" +
"\t\"firstId\": \"\",\n" +
"\t\"secondId\": \"\",\n" +
"\t\"threeId\": \"\"\n" +
"}";
String jsonStr = "{\"pageIndex\":1,\"pageSize\":10,\"orderField\":\"excellent\",\"majorType\":\"\",\"orgDomainDtos\":[],\"orderAsc\":false,\"excellent\":true,\"breCommend\":true,\"caseType\":\"\",\"authorName\":\"\",\"notInIds\":[],\"type\":\"recommend\",\"userId\":\"\",\"parent\":\"\",\"children\":[],\"name\":\"\",\"years\":[2023,2022,2020,2021]}";
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,false);
CasePageVo pageVo = mapper.readValue(jsonStr, CasePageVo.class);
pageVo.setUserId("965342027497607168");
PageList<Cases> casesV2 = casesService.queryPageCasesV2(pageVo);
System.out.println(casesV2);
}