From b3c6911c1e78563dc04998dd7bfb510130a9fcec Mon Sep 17 00:00:00 2001 From: huanghongfa <18228131219@163.com> Date: 星期一, 01 二月 2021 16:37:52 +0800 Subject: [PATCH] auth --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActMicroWishDAO.java | 77 ++++++++++++++++++++++++++++++++------ 1 files changed, 65 insertions(+), 12 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 541e3fe..41d2770 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 @@ -4,10 +4,13 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.panzhihua.common.model.vos.community.ComActMicroWishVO; +import com.panzhihua.common.model.vos.community.TodoEventsVO; import com.panzhihua.service_community.model.dos.ComActMicroWishDO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; + +import java.util.List; /** * @program: springcloud_k8s_panzhihuazhihuishequ @@ -26,10 +29,15 @@ "w.sponsor_phone,\n" + "w.wish_name,\n" + "w.`status`,\n" + - "count(wu.id)start_num,\n" + + "w.`feedback_at`,\n" + + "w.`examine_at`,\n" + + "w.`distribution_at`,\n" + + "w.`evaluate_at`,\n" + + "w.`photo_path_list`,\n" + + "count(wu.id)star_num,\n" + "w.`detail`,\n" + - "w.start_num,\n" + "w.form,\n" + + "w.reject_reason,\n" + "su.`name` responsible_name,\n" + "w.score,\n" + "w.create_at \n" + @@ -38,50 +46,73 @@ "left join com_act_micro_wish_user wu on w.id=wu.micro_wish_id "+ "JOIN sys_user u ON w.sponsor_id = u.user_id \n" + "<if test='comActMicroWishVO.sponsorName != null and comActMicroWishVO.sponsorName.trim() != ""'>" + - "AND u.name = #{comActMicroWishVO.sponsorName} \n" + + "AND u.name like concat(#{comActMicroWishVO.sponsorName},'%') \n" + " </if> " + + "<if test='comActMicroWishVO.responsibleName == null or comActMicroWishVO.responsibleName.trim() == ""'>" + "LEFT JOIN sys_user su ON w.responsible_id = su.user_id \n" + + " </if> " + "<if test='comActMicroWishVO.responsibleName != null and comActMicroWishVO.responsibleName.trim() != ""'>" + - "AND su.`name` = #{comActMicroWishVO.responsibleName} \n" + + " JOIN sys_user su ON w.responsible_id = su.user_id \n" + + "AND su.`name` like concat(#{comActMicroWishVO.responsibleName},'%') \n" + " </if> " + - "WHERE\n" + - "w.community_id=#{comActMicroWishVO.communityId} \n" + + " <where>" + + "<if test='comActMicroWishVO.communityId != null and comActMicroWishVO.communityId != 0'>" + + " and w.community_id=#{comActMicroWishVO.communityId} \n" + + " </if> " + "<if test='comActMicroWishVO.sponsorPhone != null and comActMicroWishVO.sponsorPhone.trim() != ""'>" + - "AND w.sponsor_phone = #{comActMicroWishVO.sponsorPhone} \n" + + "AND w.sponsor_phone like concat(#{comActMicroWishVO.sponsorPhone},'%') \n" + " </if> " + - "<if test='comActMicroWishVO.status != null '>" + + "<if test='comActMicroWishVO.status != null and comActMicroWishVO.status!=0 and comActMicroWishVO.isPageMyWish==null'>" + "AND w.`status` = #{comActMicroWishVO.status} \n" + " </if> " + - "<if test='comActMicroWishVO.createBegin != null and comActMicroWishVO.createBegin.trim() != ""'>" + + "<if test='comActMicroWishVO.status != null and comActMicroWishVO.status!=0 and comActMicroWishVO.isPageMyWish!=null and comActMicroWishVO.status==1'>" + + "AND w.`status` in (1,2) \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" + " </if> " + + "<if test='comActMicroWishVO.userId != null and comActMicroWishVO.userId != 0'>" + + "AND w.sponsor_id =#{comActMicroWishVO.userId} \n" + + " </if> " + + "<if test='comActMicroWishVO.backUserId != null and comActMicroWishVO.backUserId != 0 and comActMicroWishVO.status==3 '>" + + "AND w.responsible_id =#{comActMicroWishVO.backUserId} \n" + + " </if> " + + "<if test='comActMicroWishVO.backUserId != null and comActMicroWishVO.backUserId != 0 and comActMicroWishVO.status==0 '>" + + "and (w.status in(1,2,4,5,6) or (w.status=3 and w.responsible_id =#{comActMicroWishVO.backUserId}))\n" + + " </if> " + + " </where>" + " group by w.id \n"+ - "ORDER BY w.`status`, w.create_at "+ + "ORDER BY w.`status` asc, w.create_at desc "+ "</script>") IPage<ComActMicroWishVO> pageMicroWish(Page page, @Param("comActMicroWishVO") ComActMicroWishVO comActMicroWishVO); @Select("SELECT\n" + "w.id,\n" + - "w.start_num,\n" + "u.name sponsor_name,\n" + "w.create_at,\n" + "u.image_url,\n" + "w.sponsor_phone,\n" + "w.`status`,\n" + + "w.`sponsor_id`,\n" + "w.wish_name,\n" + - "count(wu.id)startNum,\n" + + "count(wu.id)starNum,\n" + "w.detail,\n" + "w.photo_path_list,\n" + "su.`name` responsible_name,\n" + "w.form,\n" + + "w.reject_reason,\n" + "w.examine_at,\n" + "w.finish,\n" + "w.finish_photo_path_list,\n" + "w.finish_at,\n" + "w.score,\n" + + "w.feedback,\n" + + "w.feedback_at,\n" + + "w.feedback_photo_path_list,\n" + + "w.distribution_at,\n" + "w.evaluate_at,\n" + "w.evaluate \n" + "FROM\n" + @@ -94,4 +125,26 @@ " group by w.id " ) ComActMicroWishVO detailMicroWish(Long id); + @Select("SELECT\n" + + "'2' type\n" + + "FROM\n" + + "com_act_micro_wish w \n" + + "WHERE\n" + + "w.community_id = #{communityId} \n" + + "AND w.`status` = 1\n" + + "\n" + + "union all \n" + + "\n" + + "SELECT\n" + + "'2' type\n" + + "FROM\n" + + "\tcom_act_micro_wish w \n" + + "WHERE\n" + + "\tw.community_id = #{communityId} \n" + + "\tAND w.`status` = 3 \n" + + "\tAND w.form = 1 \n" + + "\tAND w.responsible_id = #{userId} \n" + + "GROUP BY\n" + + "\tw.community_id\n") + List<TodoEventsVO> selectNeedToDo(@Param("communityId") Long communityId, @Param("userId") Long userId); } -- Gitblit v1.7.1