From 8b7258c9427882bb1798f1502eaa35184c6e374e Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Fri, 09 Aug 2024 14:29:18 +0800
Subject: [PATCH] 短信指定楼栋发送

---
 src/main/java/org/springblade/modules/discuss/mapper/TopicsMapper.xml |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/src/main/java/org/springblade/modules/discuss/mapper/TopicsMapper.xml b/src/main/java/org/springblade/modules/discuss/mapper/TopicsMapper.xml
index e48221c..113fc29 100644
--- a/src/main/java/org/springblade/modules/discuss/mapper/TopicsMapper.xml
+++ b/src/main/java/org/springblade/modules/discuss/mapper/TopicsMapper.xml
@@ -116,7 +116,9 @@
         LEFT JOIN jczz_topics jts ON jts.id = jut.topics_id
         WHERE
         jut.article_id = jt.article_id
-        AND jts.parent_id = jt.id  AND jut.household_id = #{householdId} AND jut.house_code = #{houseCode}
+        AND jts.parent_id = jt.id
+        <if test="householdId != null ">   AND jut.household_id = #{householdId}</if>
+          AND jut.house_code = #{houseCode}
         limit 1
         ) selected
         FROM
@@ -141,4 +143,20 @@
     </select>
 
 
+    <select id="getTopicstotalbyarticleid" resultType="org.springblade.modules.discuss.dto.TopicsDTO">
+
+        SELECT
+            jt.discuss_content,
+            jt.option_content,
+            ( SELECT count( 1 ) FROM jczz_user_topics jut WHERE jut.topics_id = jt.id ) number
+        FROM
+            jczz_topics jt
+        WHERE
+            jt.article_id = #{articleId}
+          AND jt.`level` = 2
+          and jt.delete_flag = 0
+
+    </select>
+
+
 </mapper>

--
Gitblit v1.9.3