From 53696e317005ba4668fd1efc27cc49cbdfb8dbfb Mon Sep 17 00:00:00 2001
From: 龚焕茏 <2842157468@qq.com>
Date: 星期一, 26 八月 2024 18:29:04 +0800
Subject: [PATCH] feat:图像资源

---
 ycl-server/src/main/resources/mapper/zgyw/ImageResourceSecurityDetailMapper.xml |   35 ++++++++++++++++++++++++++---------
 1 files changed, 26 insertions(+), 9 deletions(-)

diff --git a/ycl-server/src/main/resources/mapper/zgyw/ImageResourceSecurityDetailMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/ImageResourceSecurityDetailMapper.xml
index 7cf6eed..56f3aef 100644
--- a/ycl-server/src/main/resources/mapper/zgyw/ImageResourceSecurityDetailMapper.xml
+++ b/ycl-server/src/main/resources/mapper/zgyw/ImageResourceSecurityDetailMapper.xml
@@ -16,7 +16,7 @@
     </resultMap>
 
     <sql id="selectImageResourceSecurityDetailVo">
-        select id,
+        SELECT id,
                ip,
                dept_id,
                alarm_category,
@@ -24,14 +24,24 @@
                num,
                alarm_time,
                create_time
-        from t_image_resource_security_detail
+        FROM t_image_resource_security_detail
     </sql>
 
-    <select id="selectImageResourceSecurityDetailList" resultMap="ImageResourceSecurityDetailResult">
-        <include refid="selectImageResourceSecurityDetailVo"/>
+    <select id="selectImageResourceSecurityDetailList" resultType="com.ycl.platform.domain.entity.ImageResourceSecurityDetail">
+        select id,
+        ip,
+        a.dept_id,
+        dept_name,
+        alarm_category,
+        alarm_level,
+        num,
+        alarm_time,
+        a.create_time
+        from t_image_resource_security_detail a
+        LEFT JOIN sys_dept b ON a.dept_id = b.dept_id AND b.del_flag = 0
         <where>
             <if test="ip != null  and ip != ''">and ip = #{ip}</if>
-            <if test="deptId != null ">and dept_id = #{deptId}</if>
+            <if test="deptId != null ">and a.dept_id = #{deptId}</if>
             <if test="alarmCategory != null  and alarmCategory != ''">and alarm_category = #{alarmCategory}</if>
             <if test="alarmLevel != null ">and alarm_level = #{alarmLevel}</if>
             <if test="num != null ">and num = #{num}</if>
@@ -40,7 +50,7 @@
     </select>
 
     <select id="selectImageResourceSecurityDetailById">
-            resultMap="ImageResourceSecurityDetailResult">
+        resultMap="ImageResourceSecurityDetailResult">
         <include refid="selectImageResourceSecurityDetailVo"/>
         where id = #{id}
     </select>
@@ -67,6 +77,13 @@
         </trim>
     </insert>
 
+    <insert id="saveBatch">
+        INSERT INTO t_image_resource_security_detail (ip, dept_id, alarm_category, alarm_level, num, alarm_time, create_time) VALUES
+        <foreach collection="list" item="item" index="index" separator=",">
+            (#{item.ip}, #{item.deptId}, #{item.alarmCategory}, #{item.alarmLevel}, #{item.num}, #{item.alarmTime}, NOW())
+        </foreach>
+    </insert>
+
     <update id="updateImageResourceSecurityDetail">
         update t_image_resource_security_detail
         <trim prefix="SET" suffixOverrides=",">
@@ -82,9 +99,9 @@
     </update>
 
     <delete id="deleteImageResourceSecurityDetailById">
-        delete
-        from t_image_resource_security_detail
-        where id = #{id}
+        DELETE
+        FROM t_image_resource_security_detail
+        WHERE id = #{id}
     </delete>
 
     <delete id="deleteImageResourceSecurityDetailByIds">

--
Gitblit v1.8.0