From a469e6f48a0312cb6c5a183a89fb79b9807ef13d Mon Sep 17 00:00:00 2001 From: tangxiaobao <303826152@qq.com> Date: 星期一, 06 九月 2021 18:20:17 +0800 Subject: [PATCH] 办事指南分页查询按时间降序排列 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActMicroWishDAO.java | 23 +++++++++++++++-------- 1 files changed, 15 insertions(+), 8 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 b8eff85..bd1ec69 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 @@ -45,6 +45,10 @@ "w.reject_reason, " + "su.`name` responsible_name, " + "w.score, " + + "w.img_width, " + + "w.finish_at, " + + "w.aim_num, " + + "w.img_height, " + "w.create_at " + "FROM " + "com_act_micro_wish w " + @@ -54,10 +58,10 @@ "AND u.name like concat(#{comActMicroWishVO.sponsorName},'%') " + " </if> " + "<if test='comActMicroWishVO.responsibleName == null or comActMicroWishVO.responsibleName.trim() == ""'>" + - "LEFT JOIN sys_user su ON w.responsible_id = su.user_id " + + "LEFT JOIN com_pb_service_team su ON w.responsible_id = su.id " + " </if> " + "<if test='comActMicroWishVO.responsibleName != null and comActMicroWishVO.responsibleName.trim() != ""'>" + - " JOIN sys_user su ON w.responsible_id = su.user_id " + + " JOIN com_pb_service_team su ON w.responsible_id = su.id " + "AND su.`name` like concat(#{comActMicroWishVO.responsibleName},'%') " + " </if> " + " <where>" + @@ -71,7 +75,7 @@ "AND w.`status` = #{comActMicroWishVO.status} " + " </if> " + "<if test='comActMicroWishVO.status == 3 and comActMicroWishVO.isPageMyWish==null'>" + - "AND ( w.`status` = 3 or w.`status` = 5 ) " + + "AND w.`status` = 3 " + " </if> " + "<if test='comActMicroWishVO.status != null and comActMicroWishVO.status!=0 and comActMicroWishVO.isPageMyWish!=null and comActMicroWishVO.status==1'>" + "AND w.`status` =1 " + @@ -83,7 +87,7 @@ "AND w.create_at BETWEEN #{comActMicroWishVO.createBegin} " + "AND #{comActMicroWishVO.createEnd}" + " </if> " + - "<if test='comActMicroWishVO.isApplets != null and comActMicroWishVO.isApplets != 0'>" + + "<if test='comActMicroWishVO.isApplets != null and comActMicroWishVO.isApplets != 0 and comActMicroWishVO.status != null and comActMicroWishVO.status != 7'>" + "AND w.status in (3, 5, 6) " + " </if> " + "<if test='comActMicroWishVO.userId != null and comActMicroWishVO.userId != 0'>" + @@ -105,6 +109,7 @@ "u.name sponsor_name, " + "u.nick_name userNickName, " + "w.create_at, " + + "w.aim_num, " + "u.image_url, " + "w.sponsor_phone, " + "w.`status`, " + @@ -126,11 +131,13 @@ "w.feedback_photo_path_list, " + "w.distribution_at, " + "w.evaluate_at, " + + "w.img_width, " + + "w.img_height, " + "w.evaluate " + "FROM " + "com_act_micro_wish w " + "JOIN sys_user u ON w.sponsor_id = u.user_id " + - "LEFT JOIN sys_user su ON w.responsible_id = su.user_id " + + "LEFT JOIN com_pb_service_team su ON w.responsible_id = su.id " + "LEFT JOIN com_act_micro_wish_user wu ON w.id = wu.micro_wish_id " + "WHERE " + "w.id =#{id}"+ @@ -165,8 +172,8 @@ 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 " + + "(SELECT COUNT(id) FROM com_act_micro_wish WHERE community_id = #{communityId} AND (status =1 OR status =2 OR status = 3 OR status = 5)) AS willNum ," + + "(SELECT COUNT(id) FROM com_act_micro_wish WHERE community_id = #{communityId} AND (status =1 OR status =2 OR status = 3 OR status = 5 OR status = 6) 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); @@ -195,7 +202,7 @@ "FROM " + " com_act_micro_wish AS camw " + " LEFT JOIN sys_user AS su ON su.user_id = camw.sponsor_id " + - " LEFT JOIN sys_user AS su1 ON su1.user_id = camw.responsible_id " + + " LEFT JOIN com_pb_service_team AS su1 ON su1.id = camw.responsible_id " + " <where> " + "<if test='microListDTO.status != null'>" + "AND camw.`status` =#{microListDTO.status} " + -- Gitblit v1.7.1