From 02f18587bd8860b305e2c688e20465be166bb48c Mon Sep 17 00:00:00 2001 From: huanghongfa <huanghongfa123456> Date: 星期四, 22 七月 2021 15:14:03 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/test' into test --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActMessageDAO.java | 21 ++++++++++++++++----- 1 files changed, 16 insertions(+), 5 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActMessageDAO.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActMessageDAO.java index fc49de0..b42ce60 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActMessageDAO.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActMessageDAO.java @@ -29,21 +29,32 @@ @Select("select * from com_act_message_back where msg_id=#{id} order by create_at desc") List<ComActMessageBackVO> selectMsgBackList(@Param("id")Long id); - @Select("select * from com_act_message where (sendto_user_id in (select id from com_pb_member_role t1 where t1.phone=#{comActMessageVO.phone})) or (sendto_user_id in (select id from com_pb_service_team t2 where t2.phone=#{comActMessageVO.phone})) order by create_at desc") + @Select("<script>" + + "select * from com_act_message " + + " where " + + " ((sendto_user_id in (select id from com_pb_member_role t1 where t1.phone=#{comActMessageVO.phone})) " + + " or (sendto_user_id in (select id from com_pb_service_team t2 where t2.phone=#{comActMessageVO.phone})))" + + "<if test='comActMessageVO.status != null'>" + + " and status=#{comActMessageVO.status} \n" + + " </if> " + + " order by create_at desc"+ + "</script>") IPage<PageComActMessageVO> pageSendMeMessageApplets(Page page, @Param("comActMessageVO")ComActMessageVO comActMessageVO); @Select("select * from com_act_message where user_id=#{comActMessageVO.userId} order by create_at desc") IPage<PageComActMessageVO> pageMyMessageApplets(Page page, @Param("comActMessageVO")ComActMessageVO comActMessageVO); - @Select("select * from com_act_message where sendto_user_id=#{comActMessageVO.sendtoUserId} and ispublic=1") + @Select("select * from com_act_message where sendto_user_id=#{comActMessageVO.sendtoUserId} and ispublic=1 order by create_at desc ") IPage<PageComActMessageVO> pageMessageByUserApplets(Page page, @Param("comActMessageVO")ComActMessageVO comActMessageVO); @Update("update com_act_message set ispublic=#{ispublic} where id=#{id}") void updatePublic(@Param("ispublic") Integer ispublic,@Param("id") Long id); @Select("<script> " + - "SELECT * \n" + - "FROM\n" + - "com_act_message t where t.community_id=#{comActMessageVO.communityId}\n" + + "SELECT t.id,t.msg_content,t.photo_pah,t.phone,t.sendto_user_id,t.sendto_user_name,t.status,t.ispublic," + + "t.user_id,t.user_account,t.user_name,t.user_phone,t.community_id,t.create_at,t.type, u.phone as userAccount \n" + + "FROM \n" + + " com_act_message t LEFT JOIN sys_user u ON t.user_id = u.user_id " + + " where t.community_id=#{comActMessageVO.communityId}\n" + "<if test='comActMessageVO.userAccount != null and comActMessageVO.userAccount.trim() != ""'>" + " and t.user_account=#{comActMessageVO.userAccount} \n" + " </if> " + -- Gitblit v1.7.1