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 f633b194..68a72eea 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,7 +18,7 @@ import org.springframework.stereotype.Repository; @Repository public interface CasesRecordDao extends JpaRepository, JpaSpecificationExecutor { - @Query(nativeQuery = true, value = "select b.*" + + @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.keyWord},'')!='',b.title like CONCAT('%',:#{#condition.keyWord},'%')" + @@ -33,8 +33,8 @@ public interface CasesRecordDao extends JpaRepository, JpaSpecifi " and if(:#{#condition.org1Empty}, 1=1, b.org_domain_parent in (:#{#condition.org1}))" + " and if(:#{#condition.org2Empty}, 1=1, b.org_domain_parent2 in (:#{#condition.org2}))" + " and if(:#{#condition.org3Empty}, 1=1, b.org_domain_parent3 in (:#{#condition.org3}))" + - " group by b.id order by a.sys_create_time DESC", - countQuery = "select count(*) FROM (select b.*" + + " order by a.sys_create_time DESC, a.read_flag ASC) as c group by c.id", + 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.keyWord},'')!='',b.title like CONCAT('%',:#{#condition.keyWord},'%')" + @@ -49,6 +49,6 @@ public interface CasesRecordDao extends JpaRepository, JpaSpecifi " and if(:#{#condition.org1Empty}, 1=1, b.org_domain_parent in (:#{#condition.org1}))" + " and if(:#{#condition.org2Empty}, 1=1, b.org_domain_parent2 in (:#{#condition.org2}))" + " and if(:#{#condition.org3Empty}, 1=1, b.org_domain_parent3 in (:#{#condition.org3}))" + - " group by b.id) as b") + " order by a.sys_create_time DESC, a.read_flag ASC ) as c group by c.id) as d") Page queryList(Pageable pageable, @Param("condition") CasePageVo casePage); } diff --git a/servers/boe-server-all/src/main/java/com/xboe/module/boecase/service/impl/CasesServiceImpl.java b/servers/boe-server-all/src/main/java/com/xboe/module/boecase/service/impl/CasesServiceImpl.java index 213045e5..13d9dcb8 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/module/boecase/service/impl/CasesServiceImpl.java +++ b/servers/boe-server-all/src/main/java/com/xboe/module/boecase/service/impl/CasesServiceImpl.java @@ -887,7 +887,7 @@ public class CasesServiceImpl implements ICasesService { String accountId = current.getAccountId(); List result = new ArrayList<>(); try { - String hql = "select a.caseId FROM CasesRecommendPushRecord a left join Cases b ON a.caseId = b.id WHERE a.pushUserId=?1 and a.pushStatus=4 and b.deleted = false group by a.caseId ORDER By a.pushTime DESC"; + String hql = "select a.caseId FROM CasesRecommendPushRecord a left join Cases b ON a.caseId = b.id WHERE a.pushUserId=?1 and a.pushStatus=3 and b.deleted = false group by a.caseId ORDER By a.pushTime DESC"; List listFields = casesRecommendDao.findListFields(hql, CASE_LEN, ListUtil.toList(accountId)); List caseIds = new ArrayList<>(); if (CollUtil.isNotEmpty(listFields)) {