From f03fd9baf8163a4429133a41a183d28abc9e66fd Mon Sep 17 00:00:00 2001
From: cloudroam <cloudroam>
Date: 星期日, 29 十二月 2024 11:39:12 +0800
Subject: [PATCH] add:阿里云短信模板获取签名和模板信息5

---
 src/main/resources/mapper/system/UserMapper.xml |   77 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 77 insertions(+), 0 deletions(-)

diff --git a/src/main/resources/mapper/system/UserMapper.xml b/src/main/resources/mapper/system/UserMapper.xml
index d1e3d96..6d05c79 100644
--- a/src/main/resources/mapper/system/UserMapper.xml
+++ b/src/main/resources/mapper/system/UserMapper.xml
@@ -89,4 +89,81 @@
         </foreach>
 
     </select>
+
+    <select id="searchUserInfo" resultType="com.mzl.flower.dto.response.system.UserListInfoDTO">
+        SELECT
+            user_id,
+            id,
+            name AS loginName,
+            contact_tel tel,
+            type
+        FROM (
+                 SELECT user_id, id, name, contact_tel, 'supplier' AS type
+                 FROM t_supplier_info
+                 WHERE user_id IN (SELECT id FROM t_user WHERE type = 'supplier')
+
+                 UNION ALL
+
+                 SELECT user_id, id, name, contact_tel, 'partner' AS type
+                 FROM t_partner_info
+                 WHERE user_id IN (SELECT id FROM t_user WHERE type = 'partner')
+
+                 UNION ALL
+
+                 SELECT c.user_id, c.id, c.name, u.tel AS contact_tel, 'customer' AS type
+                 FROM t_customer_info c
+                          JOIN t_user u ON c.user_id = u.id
+                 WHERE c.user_id IN (SELECT id FROM t_user WHERE type = 'customer')
+             ) AS combined_table
+        <where>
+        <if test="condition.userType != null and condition.userType != ''">
+            AND type = #{condition.userType}
+        </if>
+        <if test="condition.id != null and condition.id != ''">
+            AND id = #{condition.id}
+        </if>
+        <if test="condition.loginName != null and condition.loginName != ''">
+            AND name = #{condition.loginName}
+        </if>
+        <if test="condition.tel != null and condition.tel != ''">
+            AND contact_tel = #{condition.tel}
+        </if>
+        </where>
+    </select>
+
+    <select id="getSelectList" resultType="com.mzl.flower.dto.response.sms.SmsSelectVO">
+        SELECT
+        user_id,
+        id,
+        name AS loginName,
+        contact_tel tel,
+        type
+        FROM (
+        SELECT user_id, id, name, contact_tel, 'supplier' AS type
+        FROM t_supplier_info
+        WHERE user_id IN (SELECT id FROM t_user WHERE type = 'supplier')
+
+        UNION ALL
+
+        SELECT user_id, id, name, contact_tel, 'partner' AS type
+        FROM t_partner_info
+        WHERE user_id IN (SELECT id FROM t_user WHERE type = 'partner')
+
+        UNION ALL
+
+        SELECT c.user_id, c.id, c.name, u.tel AS contact_tel, 'customer' AS type
+        FROM t_customer_info c
+        JOIN t_user u ON c.user_id = u.id
+        WHERE c.user_id IN (SELECT id FROM t_user WHERE type = 'customer')
+        ) AS combined_table
+        <where>
+            1=1
+            <if test="idList != null and idList.size() > 0">
+                AND user_id IN
+                <foreach collection="idList" item="id" open="(" separator="," close=")">
+                    #{id}
+                </foreach>
+            </if>
+        </where>
+    </select>
 </mapper>

--
Gitblit v1.9.3