From 17bccd09afb6e6a4fffa0409d7d5285e88442103 Mon Sep 17 00:00:00 2001
From: huanghongfa <18228131219@163.com>
Date: 星期四, 31 十二月 2020 16:05:57 +0800
Subject: [PATCH] 志愿者团新增接口
---
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActEasyPhotoDAO.java | 23 ++++++++++++++++++-----
1 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActEasyPhotoDAO.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActEasyPhotoDAO.java
index d28a3b3..a121c94 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActEasyPhotoDAO.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActEasyPhotoDAO.java
@@ -27,52 +27,65 @@
"p.happen_addr,\n" +
"su.`name` handler_name,\n" +
"p.`status`,\n" +
+ "p.`detail`,\n" +
+ "p.`photo_path_list`,\n" +
"p.create_at,\n" +
"p.examine_at \n" +
"FROM\n" +
"com_act_easy_photo p\n" +
"JOIN sys_user u ON p.sponsor_id = u.user_id \n" +
+ "<if test='comActEasyPhotoVO.userId != null and comActEasyPhotoVO.userId != 0'>" +
+ "AND u.`user_id` = #{comActEasyPhotoVO.userId} \n" +
+ " </if> " +
"left join com_act_easy_photo_user pu ON p.id = pu.easy_photo_id \n" +
"<if test='comActEasyPhotoVO.sponsorName != null and comActEasyPhotoVO.sponsorName.trim() != ""'>" +
"AND u.`name` = #{comActEasyPhotoVO.sponsorName} \n" +
" </if> " +
- "JOIN sys_user su ON p.handler_id = su.user_id \n" +
+ "left JOIN sys_user su ON p.handler_id = su.user_id \n" +
"<if test='comActEasyPhotoVO.handlerName != null and comActEasyPhotoVO.handlerName.trim() != ""'>" +
"AND su.`name` = #{comActEasyPhotoVO.handlerName} \n" +
" </if> " +
- " where p.community_id=#{comActEasyPhotoVO.communityId} " +
+ "<where>"+
+ "<if test='comActEasyPhotoVO.communityId != null and comActEasyPhotoVO.communityId != 0'>" +
+ " and p.community_id=#{comActEasyPhotoVO.communityId} " +
+ " </if> " +
"<if test='comActEasyPhotoVO.happenAddr != null and comActEasyPhotoVO.happenAddr.trim() != ""'>" +
"AND p.happen_addr = #{comActEasyPhotoVO.happenAddr} \n" +
" </if> " +
- "<if test='comActEasyPhotoVO.status != null '>" +
+ "<if test='comActEasyPhotoVO.status != null and comActEasyPhotoVO.status!=0' >" +
"AND p.`status` = #{comActEasyPhotoVO.status} \n" +
" </if> " +
- "<if test='comActEasyPhotoVO.createBegin != null and comActEasyPhotoVO.createBegin.trim() != ""'>" +
+ "<if test='comActEasyPhotoVO.createBegin != null '>" +
"AND p.create_at BETWEEN #{comActEasyPhotoVO.createBegin} \n" +
"AND #{comActEasyPhotoVO.createEnd}" +
" </if> " +
"<if test='comActEasyPhotoVO.sponsorId != null and comActEasyPhotoVO.sponsorId != 0'>" +
"AND p.sponsor_id =#{comActEasyPhotoVO.sponsorId} \n" +
" </if> " +
+ "</where>"+
" group by p.id "+
"</script>")
IPage<ComActEasyPhotoVO> pageEasyPhoto(Page page, @Param("comActEasyPhotoVO") ComActEasyPhotoVO comActEasyPhotoVO);
@Select("SELECT \n" +
"p.id,\n" +
"p.create_at,\n" +
- "u.`name`,\n" +
+ "u.`name` sponsorName,\n" +
"u.`image_url`,\n" +
"u.phone,\n" +
"p.detail,\n" +
+ "p.status,\n" +
+ "p.is_hide,\n" +
"p.happen_addr,\n" +
"su.`name`,\n" +
"p.handle_result,\n" +
"p.photo_path_list,\n" +
+ "count(pu.id)giveThumbsUpNum,\n" +
"p.handle_photo_list\n" +
"FROM\n" +
"com_act_easy_photo p\n" +
"JOIN sys_user u on p.sponsor_id=u.user_id\n" +
"LEFT JOIN sys_user su on p.handler_id=su.user_id\n" +
+ "LEFT JOIN com_act_easy_photo_user pu on p.id=pu.easy_photo_id\n" +
"WHERE p.id=#{id}")
ComActEasyPhotoVO detailEasyPhoto(Long id);
}
--
Gitblit v1.7.1