From d5e655ff9eb0d3cff17925dae7295c8cb5010b64 Mon Sep 17 00:00:00 2001
From: 935090232@qq.com <ak473600000>
Date: Sun, 24 Jan 2021 15:05:41 +0800
Subject: [PATCH] 消息提醒

---
 zq-erp/src/main/resources/mybatis/mapper/hive/SysVipLabelDao.xml |   26 ++++++++++++++++++++------
 1 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipLabelDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipLabelDao.xml
index 059acf2..b42140a 100644
--- a/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipLabelDao.xml
+++ b/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipLabelDao.xml
@@ -16,7 +16,7 @@
             user_id,
             color
         ) values (
-            #{createTime},
+            now(),
             #{createBy},
             #{id},
             #{label},
@@ -25,6 +25,19 @@
             #{isAll},
             #{userId},
             #{color}
+        )
+    </insert>
+
+    <insert id="insertRelate" parameterType="com.matrix.system.hive.bean.SysVipLabel" useGeneratedKeys="true"
+            keyProperty="id">
+        insert sys_vip_label_relate (
+            id,
+            label_id,
+            vip_id
+        ) values (
+            #{id},
+            #{labelId},
+            #{vipId}
         )
     </insert>
 
@@ -48,9 +61,10 @@
 
 
     <select id="selectByVipId" resultType="com.matrix.system.hive.bean.SysVipLabel">
-        select *
-        from sys_vip_label
-        where vip_id=#{vipId}
+        select b.*
+        from sys_vip_label_relate a
+        inner join sys_vip_label b on a.label_id=b.id
+        where a.vip_id=#{vipId}
     </select>
 
     <select id="selectByModel" resultType="com.matrix.system.hive.bean.SysVipLabel">
@@ -82,8 +96,8 @@
         </if>
     </select>
 
-    <delete id="deleteByVipId">
-        delete from sys_vip_label
+    <delete id="deleteRelateByVipId">
+        delete from sys_vip_label_relate
         where vip_id=#{vipId}
     </delete>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.1