From 42239f79490e7130a63d51a67efd1f2c8d23be37 Mon Sep 17 00:00:00 2001
From: xyh <18782104331@139.com>
Date: 星期五, 18 六月 2021 09:50:44 +0800
Subject: [PATCH] 平均耗时格式

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActMicroWishDAO.java |   30 ++++++++++++++++++++++++++----
 1 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActMicroWishDAO.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActMicroWishDAO.java
index cce0fae..ce38416 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActMicroWishDAO.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActMicroWishDAO.java
@@ -9,8 +9,10 @@
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * @program: springcloud_k8s_panzhihuazhihuishequ
@@ -25,6 +27,7 @@
             "SELECT\n" +
             "w.id,\n" +
             "u.name sponsor_name,\n" +
+            "u.nick_name userNickName,\n" +
             "u.image_url ,\n" +
             "w.sponsor_phone,\n" +
             "w.wish_name,\n" +
@@ -62,18 +65,24 @@
             "<if test='comActMicroWishVO.sponsorPhone != null and comActMicroWishVO.sponsorPhone.trim() != &quot;&quot;'>" +
             "AND w.sponsor_phone like concat(#{comActMicroWishVO.sponsorPhone},'%')  \n" +
             " </if> " +
-            "<if test='comActMicroWishVO.status != null and comActMicroWishVO.status!=0 and comActMicroWishVO.isPageMyWish==null'>" +
+            "<if test='comActMicroWishVO.status != null and comActMicroWishVO.status!=0 and comActMicroWishVO.status!=3 and comActMicroWishVO.isPageMyWish==null'>" +
             "AND w.`status` = #{comActMicroWishVO.status} \n" +
             " </if> " +
+            "<if test='comActMicroWishVO.status == 3  and comActMicroWishVO.isPageMyWish==null'>" +
+            "AND ( w.`status` = 3 or  w.`status` = 5 )\n" +
+            " </if> " +
             "<if test='comActMicroWishVO.status != null and comActMicroWishVO.status!=0 and comActMicroWishVO.isPageMyWish!=null and comActMicroWishVO.status==1'>" +
-            "AND w.`status` in (1,2) \n" +
+            "AND w.`status` =1 \n" +
+            " </if> " +
+            "<if test='comActMicroWishVO.status != null and comActMicroWishVO.status==3  and comActMicroWishVO.isPageMyWish!=null '>" +
+            "AND w.`status` in (2, 3) \n" +
             " </if> " +
             "<if test='comActMicroWishVO.createBegin != null '>" +
             "AND w.create_at BETWEEN #{comActMicroWishVO.createBegin} \n" +
             "AND #{comActMicroWishVO.createEnd}" +
             " </if> " +
             "<if test='comActMicroWishVO.isApplets != null and comActMicroWishVO.isApplets != 0'>" +
-            "AND w.status  in (3,6) \n" +
+            "AND w.status  in (3, 5, 6) \n" +
             " </if> " +
             "<if test='comActMicroWishVO.userId != null and comActMicroWishVO.userId != 0'>" +
             "AND w.sponsor_id  =#{comActMicroWishVO.userId} \n" +
@@ -86,12 +95,13 @@
             " </if> " +
             " </where>" +
             " group by w.id  \n"+
-            "ORDER BY w.`status` asc, w.create_at desc "+
+            "ORDER BY  w.create_at desc "+
             "</script>")
     IPage<ComActMicroWishVO> pageMicroWish(Page page, @Param("comActMicroWishVO") ComActMicroWishVO comActMicroWishVO);
     @Select("SELECT\n" +
             "w.id,\n" +
             "u.name sponsor_name,\n" +
+            "u.nick_name userNickName,\n" +
             "w.create_at,\n" +
             "u.image_url,\n" +
             "w.sponsor_phone,\n" +
@@ -148,4 +158,16 @@
             "GROUP BY\n" +
             "\tw.community_id\n")
     List<TodoEventsVO> selectNeedToDo(@Param("communityId") Long communityId, @Param("userId") Long userId);
+
+    @Update("update com_act_micro_wish set `status`=6, evaluate_at=now() where `status`=5 and TIMESTAMPDIFF(HOUR, feedback_at, SYSDATE())>=72")
+    int updateStatusAutoConfirm();
+
+    @Select("SELECT COUNT(id) AS completedNum," +
+            "(SELECT COUNT(id) FROM com_act_micro_wish WHERE community_id = #{communityId} AND (status =1 OR status =2 OR status = 3 OR status = 4 OR status = 5)) AS willNum ," +
+            "(SELECT COUNT(id) FROM com_act_micro_wish WHERE community_id = #{communityId} AND create_at LIKE CONCAT(#{nowDate},'%')) AS currentNum " +
+            "FROM com_act_micro_wish WHERE community_id = #{communityId} AND status = 6 ")
+    Map<String, Long> countByCommunityId(@Param("communityId") Long communityId,@Param("nowDate") String nowDate);
+
+    @Select("SELECT photo_path_list FROM com_act_micro_wish WHERE community_id = #{communityId} AND (status =1 OR status =2 OR status = 3 OR status = 5 OR status = 6) ORDER BY create_at DESC limit #{pageSize}")
+    List<String> getAllImgs(@Param("communityId") Long communityId,@Param("pageSize") Integer pageSize);
 }

--
Gitblit v1.7.1