DYL
2025-02-08 e4cadfadfab518969ae83ef5b1db1cc12caed5e7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
  PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhitan.basicSetup.mapper.SysEquipmentfileMapper">
  <resultMap id="SysEquipmentFile"
    type="com.zhitan.realtimedata.domain.SysEquipmentFile">
    <result property="nodeId" column="node_id"/>
    <result property="filePath" column="filepath"/>
  </resultMap>
  <resultMap id="SysSvgInfo"
    type="com.zhitan.realtimedata.domain.SysSvgInfo">
    <result property="id" column="id"/>
    <result property="param" column="param"/>
    <result property="tag" column="tag"/>
  </resultMap>
 
  <insert id="saveSettingInfo">
    delete
    from sys_svg_info
    where node_id = #{nodeId};
 
    <foreach collection="svgInfo" item="info" separator=";">
      insert into sys_svg_info (id, node_id, param, tag)
      values (#{info.id}, #{nodeId}, #{info.param}, #{info.tag});
    </foreach>
  </insert>
 
  <update id="saveEquipmentFile">
    insert into sys_equipmentfile (node_id, filepath)
    select #{nodeId}, #{filePath}
    on conflict
      (node_id)
    do update
    set filepath = #{filePath}
  </update>
 
  <select id="getConfigure" resultMap="SysEquipmentFile">
    select node_id, filepath
    from sys_equipmentfile
    where node_id = #{nodeId};
  </select>
 
  <select id="getConfigureTag" resultMap="SysSvgInfo">
    select id, param, tag
    from sys_svg_info
    where node_id = #{nodeId}
  </select>
 
</mapper>