mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-11 03:46:50 +08:00
提交推荐查询
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
package com.xboe.module.boecase.dao;
|
||||
|
||||
import com.xboe.module.boecase.dto.CasePageVo;
|
||||
import com.xboe.module.boecase.entity.Cases;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @author : civism
|
||||
* @version 1.0
|
||||
* @date 2023/6/20 18:55
|
||||
*/
|
||||
@Repository
|
||||
public interface CasesRecordDao extends JpaRepository<Cases, String>, JpaSpecificationExecutor<Cases> {
|
||||
|
||||
@Query(nativeQuery = true, value = "select b.* from boe_cases_recommend_push_record a LEFT JOIN boe_cases b on. a.case_id = b.id and b.deleted=false " +
|
||||
" where a.deleted=false and a.push_user_id= :#{#condition.userId}" +
|
||||
" and if(:#{#condition.keyWord} is not null,b.title like CONCAT('%',:#{#condition.keyWord},'%')" +
|
||||
" or b.author_name like CONCAT('%',:#{#condition.keyWord},'%')" +
|
||||
" or b.keyword1 like CONCAT('%',:#{#condition.keyWord},'%')" +
|
||||
" or b.keyword2 like CONCAT('%',:#{#condition.keyWord},'%')" +
|
||||
" or b.keyword3 like CONCAT('%',:#{#condition.keyWord},'%')" +
|
||||
" or b.keyword4 like CONCAT('%',:#{#condition.keyWord},'%')" +
|
||||
" or b.keyword5 like CONCAT('%',:#{#condition.keyWord},'%'),1=1)" +
|
||||
" and if(:#{#condition.years} is not null ,YEAR(b.sys_create_time) in (:#{#condition.years}),1=1 )" +
|
||||
" and if(:#{#condition.majorType} is nto null ,b.major_type = :#{#condition.majorType},1=1) " +
|
||||
" and if(:#{#condition.org1} is not null,b.org_domain_parent in (:#{#condition.org1}),1=1)" +
|
||||
" and if(:#{#condition.org2} is not null,b.org_domain_parent2 in (:#{#condition.org2}),1=1)" +
|
||||
" and if(:#{#condition.org3} is not null,b.org_domain_parent3 in (:#{#condition.org3}),1=1)" +
|
||||
" group by b.id order by a.sys_create_time DESC")
|
||||
Page<Cases> queryList(Pageable pageable, @Param("condition") CasePageVo casePage);
|
||||
}
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.xboe.module.boecase.dto;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Data
|
||||
public class CasePageVo extends PageDto {
|
||||
@@ -51,4 +54,31 @@ public class CasePageVo extends PageDto {
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 人员id
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
|
||||
public List<String> getOrg1() {
|
||||
if (CollectionUtils.isNotEmpty(this.orgDomainDtos)) {
|
||||
return orgDomainDtos.stream().map(OrgDomainDto::getOrgDomainParent).filter(StrUtil::isNotBlank).collect(Collectors.toList());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<String> getOrg2() {
|
||||
if (CollectionUtils.isNotEmpty(this.orgDomainDtos)) {
|
||||
return orgDomainDtos.stream().map(OrgDomainDto::getOrgDomainParent2).filter(StrUtil::isNotBlank).collect(Collectors.toList());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<String> getOrg3() {
|
||||
if (CollectionUtils.isNotEmpty(this.orgDomainDtos)) {
|
||||
return orgDomainDtos.stream().map(OrgDomainDto::getOrgDomainParent3).filter(StrUtil::isNotBlank).collect(Collectors.toList());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user