From 7f7186c940190e06aeb08413b531bdce6520ea66 Mon Sep 17 00:00:00 2001
From: huanghongfa <huanghongfa123456>
Date: 星期三, 08 九月 2021 14:31:59 +0800
Subject: [PATCH] 微心愿操作记录接口改版
---
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDiscussOptionUserDAO.java | 32 +++++++++++++++++++++-----------
1 files changed, 21 insertions(+), 11 deletions(-)
diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDiscussOptionUserDAO.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDiscussOptionUserDAO.java
index 286df72..a074860 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDiscussOptionUserDAO.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDiscussOptionUserDAO.java
@@ -1,8 +1,11 @@
package com.panzhihua.service_community.dao;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.panzhihua.service_community.model.dos.ComActDiscussOptionUserDO;
-import org.apache.ibatis.annotations.Mapper;
/**
* @program: springcloud_k8s_panzhihuazhihuishequ
@@ -12,14 +15,21 @@
**/
@Mapper
public interface ComActDiscussOptionUserDAO extends BaseMapper<ComActDiscussOptionUserDO> {
- // @Select("<script> " +
-// " <where>" +
-// "<if test='nameCn != null and nameCn.trim() != ""'>" +
-// " </if> " +
-// "<if test='nameCn != null and nameCn.trim() != ""'>" +
-// " </if> " +
-// "<if test='nameCn != null and nameCn.trim() != ""'>" +
-// " </if> " +
-// " </where>" +
-// "</script>")
+ // @Select("<script> " +
+ // " <where>" +
+ // "<if test='nameCn != null and nameCn.trim() != ""'>" +
+ // " </if> " +
+ // "<if test='nameCn != null and nameCn.trim() != ""'>" +
+ // " </if> " +
+ // "<if test='nameCn != null and nameCn.trim() != ""'>" +
+ // " </if> " +
+ // " </where>" +
+ // "</script>")
+ @Select("SELECT \n" + "COUNT(ou.id)\n" + "FROM\n" + "com_act_discuss d\n"
+ + "JOIN com_act_discuss_option o ON d.id = o.discuss_id and d.id=#{id}\n"
+ + "JOIN com_act_discuss_option_user ou ON o.id = ou.discuss_option_id and ou.user_id=#{loginUserId}")
+ int selectHaveVote(@Param("id") Long id, @Param("loginUserId") Long loginUserId);
+
+ @Select("select count(id) from com_act_discuss_option_user where discuss_option_id = #{discussOptionId} and user_id = #{userId}")
+ int selectHaveVotes(@Param("discussOptionId") Long discussOptionId, @Param("userId") Long userId);
}
--
Gitblit v1.7.1