From bc255523cee23a2270620d365b0d68cbbd36ba20 Mon Sep 17 00:00:00 2001 From: Guava Date: Thu, 22 Jun 2023 21:24:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=9F=A5=E8=AF=A2=E6=A1=88?= =?UTF-8?q?=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/boecase/dao/CasesRecordDao.java | 31 ++++++++++++++++--- .../CasesRecommendLaunchImportData.java | 2 +- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/servers/boe-server-all/src/main/java/com/xboe/module/boecase/dao/CasesRecordDao.java b/servers/boe-server-all/src/main/java/com/xboe/module/boecase/dao/CasesRecordDao.java index 24a92f4b..2b434bca 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/module/boecase/dao/CasesRecordDao.java +++ b/servers/boe-server-all/src/main/java/com/xboe/module/boecase/dao/CasesRecordDao.java @@ -18,8 +18,15 @@ import org.springframework.stereotype.Repository; @Repository public interface CasesRecordDao extends JpaRepository, JpaSpecificationExecutor { - @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}" + + @Query(nativeQuery = true, value = "select b.id,b.sys_create_aid,b.sys_create_by,b.sys_create_time,b.deleted,b.sys_update_by,b.sys_update_time,b.sys_version," + + "b.excellent_time,b.excellent,b.case_value,b.readers,b.keyword5,b.keyword4,b.keyword3,b.keyword2,b.keyword1,b.case_theme_description,b.case_theme" + + ",b.case_type2,b.case_type1,b.case_type,b.case_owner_org,b.case_specialty_sequence,b.case_other_contributor,b.case_owner_phone,b.case_owner_department" + + ",b.case_owner,b.case_flow,b.case_scope,b.is_leadership_plan,b.case_channel,b.email,b.contact_number,b.department,b.drafter,b.end_time,b.drafting_time," + + "b.confidentiality_level,b.approval_number,b.major_type,b.org_domain_parent3,b.org_domain_parent2,b.org_domain_parent,b.org_domain,b.summary,b.cites,b.recommends," + + "b.favorites,b.shares,b.praises,b.comments,b.views,b.status,b.top_time,b.is_top,b.recommend_time,b.bre_commend,b.cover_url,b.author_name,b.author_id,b.file_name" + + ",b.file_path,b.content,b.company_id,b.title" + + " from boe_cases_recommend_push_record a LEFT JOIN boe_cases b on a.case_id = b.id and b.deleted=0 " + + " where a.deleted=0 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},'%')" + @@ -28,10 +35,26 @@ public interface CasesRecordDao extends JpaRepository, JpaSpecifi " 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.majorType} is not 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") + " group by b.id order by a.sys_create_time DESC", + countQuery = "select count(*)" + + " from boe_cases_recommend_push_record a LEFT JOIN boe_cases b on a.case_id = b.id and b.deleted=0 " + + " where a.deleted=0 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 not 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") Page queryList(Pageable pageable, @Param("condition") CasePageVo casePage); } diff --git a/servers/boe-server-all/src/main/java/com/xboe/module/boecase/entity/CasesRecommendLaunchImportData.java b/servers/boe-server-all/src/main/java/com/xboe/module/boecase/entity/CasesRecommendLaunchImportData.java index 66e342c5..ae87891d 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/module/boecase/entity/CasesRecommendLaunchImportData.java +++ b/servers/boe-server-all/src/main/java/com/xboe/module/boecase/entity/CasesRecommendLaunchImportData.java @@ -15,7 +15,7 @@ import javax.persistence.Table; @Data @Entity @EqualsAndHashCode(callSuper = false) -@Table(name = SysConstant.TABLE_PRE + "cases_recommend_launch_import") +@Table(name = SysConstant.TABLE_PRE + "cases_recommend_launch_import_data") public class CasesRecommendLaunchImportData extends BaseEntity { /**