From 575e94e9db7e507ecec2441d24a13e9415fd9f03 Mon Sep 17 00:00:00 2001
From: CeDo <cedoogle@gmail.com>
Date: 星期三, 19 五月 2021 19:56:05 +0800
Subject: [PATCH] Merge branch 'cedoodev' into test
---
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDynDAO.java | 101 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 101 insertions(+), 0 deletions(-)
diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDynDAO.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDynDAO.java
new file mode 100644
index 0000000..97a23b0
--- /dev/null
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDynDAO.java
@@ -0,0 +1,101 @@
+package com.panzhihua.service_community.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.panzhihua.common.model.vos.community.ComActActivityVO;
+import com.panzhihua.common.model.vos.community.ComActDynVO;
+import com.panzhihua.service_community.model.dos.ComActDynDO;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
+
+/**
+ * @program: springcloud_k8s_panzhihuazhihuishequ
+ * @description: 社区动态
+ * @author: huang.hongfa weixin hhf9596 qq 959656820
+ * @create: 2020-12-07 14:06
+ **/
+@Mapper
+public interface ComActDynDAO extends BaseMapper<ComActDynDO> {
+ @Select("<script> " +
+ "SELECT \n" +
+ "d.id,\n" +
+ "d.title,\n" +
+ "COUNT(u.id)readNum,\n" +
+ "d.`status`,\n" +
+ "d.`content`,\n" +
+ "d.`cover`,\n" +
+ "d.`type`,\n" +
+ "d.`cover_mode`,\n" +
+ "d.is_topping,\n" +
+ "d.publish_at,\n" +
+ "d.create_at,\n" +
+ "ca.name as communityName \n" +
+ "FROM\n" +
+ "com_act_dyn d\n" +
+ "LEFT JOIN com_act_dyn_user u ON d.id = u.dyn_id \n" +
+ "LEFT JOIN com_act ca ON d.community_id = ca.community_id \n" +
+ "WHERE 1=1 \n" +
+ "<if test='comActDynVO.choice == 0 '>" +
+ "and d.community_id=#{comActDynVO.communityId}\n" +
+ " </if> " +
+ "<if test='comActDynVO.title != null and comActDynVO.title.trim() != ""'>" +
+ "AND d.title like concat(#{comActDynVO.title},'%') \n" +
+ " </if> " +
+ "<if test='comActDynVO.isTopping != null '>" +
+ "AND d.is_topping = #{comActDynVO.isTopping} \n" +
+ " </if> " +
+ "<if test='comActDynVO.status != null '>" +
+ "AND d.`status` = #{comActDynVO.status} \n" +
+ " </if> " +
+ "<if test='comActDynVO.publishAtBegin != null '>" +
+ "AND d.publish_at BETWEEN #{comActDynVO.publishAtBegin} \n" +
+ "AND #{comActDynVO.publishAtEnd}" +
+ " </if> " +
+ " group by d.id "+
+ " order by d.is_topping desc, d.create_at desc "+
+ "</script>")
+ IPage<ComActDynVO> pageDynamic(Page page, @Param("comActDynVO") ComActDynVO comActDynVO);
+ @Update("update com_act_dyn set `status`=1 WHERE `status`=0 and TIMESTAMPDIFF(MINUTE, SYSDATE(), publish_at)<=0 ")
+ int timedTaskDynStatus();
+
+ @Select("<script> " +
+ "SELECT \n" +
+ "d.id,\n" +
+ "d.title,\n" +
+ "COUNT(u.id)readNum,\n" +
+ "d.`status`,\n" +
+ "d.`content`,\n" +
+ "d.`cover`,\n" +
+ "d.`type`,\n" +
+ "d.`cover_mode`,\n" +
+ "d.is_topping,\n" +
+ "d.publish_at,\n" +
+ "d.create_at,\n" +
+ "ca.name as communityName \n" +
+ "FROM\n" +
+ "com_act_dyn d\n" +
+ "LEFT JOIN com_act_dyn_user u ON d.id = u.dyn_id \n" +
+ "LEFT JOIN com_act ca ON d.community_id = ca.community_id \n" +
+ "WHERE \n" +
+ "d.community_id=#{comActDynVO.communityId}\n" +
+ "<if test='comActDynVO.title != null and comActDynVO.title.trim() != ""'>" +
+ "AND d.title like concat(#{comActDynVO.title},'%') \n" +
+ " </if> " +
+ "<if test='comActDynVO.isTopping != null '>" +
+ "AND d.is_topping = #{comActDynVO.isTopping} \n" +
+ " </if> " +
+ "<if test='comActDynVO.status != null '>" +
+ "AND d.`status` = #{comActDynVO.status} \n" +
+ " </if> " +
+ "<if test='comActDynVO.publishAtBegin != null '>" +
+ "AND d.publish_at BETWEEN #{comActDynVO.publishAtBegin} \n" +
+ "AND #{comActDynVO.publishAtEnd}" +
+ " </if> " +
+ " group by d.id "+
+ " order by d.is_topping desc, d.create_at desc "+
+ "</script>")
+ IPage<ComActDynVO> pageDynamicByAdmin(Page page, @Param("comActDynVO") ComActDynVO comActDynVO);
+}
--
Gitblit v1.7.1