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/UserTopicsMapper.xml | 33 +++++++++++++++++++++++----------
1 files changed, 23 insertions(+), 10 deletions(-)
diff --git a/src/main/java/org/springblade/modules/discuss/mapper/UserTopicsMapper.xml b/src/main/java/org/springblade/modules/discuss/mapper/UserTopicsMapper.xml
index 2422490..95ae488 100644
--- a/src/main/java/org/springblade/modules/discuss/mapper/UserTopicsMapper.xml
+++ b/src/main/java/org/springblade/modules/discuss/mapper/UserTopicsMapper.xml
@@ -196,14 +196,14 @@
jhs.district_name
FROM
jczz_user_topics as jut
- LEFT JOIN jczz_household jh ON jh.id = jut.household_id and jh.is_deleted = 0
+ LEFT JOIN jczz_household jh ON jh.id = jut.household_id
LEFT JOIN jczz_doorplate_address jda ON jda.address_code = jh.house_code
LEFT JOIN jczz_topics jt on jt.id = jut.topics_id
LEFT JOIN blade_user bu ON jh.associated_user_id = bu.id AND bu.is_deleted = 0
LEFT JOIN jczz_house jhs on jhs.house_code= jda.address_code
<where>
and jt.discuss_content != '议事规则'
- and jt.discuss_content != '管理公约'
+ and jt.discuss_content != '管理规约'
<if test="id != null ">and jut.id = #{id}</if>
<if test="name != null and name != ''">
and bu.name like concat('%',#{name},'%')
@@ -233,7 +233,7 @@
</select>
<select id="getHouseholdList" resultType="org.springblade.modules.discuss.excel.holdExcel">
SELECT
- DISTINCT(jh.id),
+ jh.id,
jh.room,
jh.building,
jh.house_name,
@@ -243,11 +243,9 @@
(
SELECT
group_concat( jt.id ) AS optionContent
- FROM
- jczz_user_topics jut
- LEFT JOIN jczz_topics jt ON jt.id = jut.topics_id
- WHERE
- jut.house_code = jh.house_code
+ FROM jczz_topics jt
+ WHERE jt.id = jut.topics_id
+ and jut.house_code = jh.house_code
AND jut.article_id = #{articleId}
) optionContent,
(SELECT jhd.name from jczz_household jhd where jhd.house_code = jh.house_code AND jhd.is_deleted = 0 and jhd.relationship = 1 limit 1 ) name,
@@ -255,8 +253,8 @@
FROM
jczz_house jh
LEFT JOIN jczz_household jhd ON jhd.house_code = jh.house_code
- AND jh.is_deleted = 0
- LEFT JOIN jczz_user_topics jut on jut.household_id = jhd.id
+ AND jh.is_deleted = 0 and jhd.relationship = 1
+ LEFT JOIN jczz_user_topics jut on jut.household_id = jhd.id AND jut.article_id = #{articleId}
<where>
<if test="aoiCodeList != null and aoiCodeList.size() > 0">
and jh.district_code in
@@ -265,6 +263,21 @@
</foreach>
</if>
</where>
+ GROUP BY id
+ </select>
+
+ <select id="getUserTopicsTotal" resultType="java.util.Map">
+ SELECT IFNULL(sum(a.area), 0) AS area,
+ IFNULL(COUNT(1), 0) number
+ FROM (SELECT DISTINCT jut.house_code,
+ jh.area
+ FROM jczz_user_topics jut
+ LEFT JOIN jczz_household jhd ON jhd.id = jut.household_id
+ LEFT JOIN jczz_house jh ON jh.house_code = jhd.house_code
+ LEFT JOIN jczz_topics jt ON jt.id = jut.topics_id
+ AND jt.delete_flag = 0
+ WHERE jut.article_id = #{articleId}) a
+
</select>
--
Gitblit v1.9.3