DYL
2025-02-08 9ae51914e2f142774088db5eb5aa451ecca64c6e
zhitan-system/src/main/resources/mapper/basicSetup/SysEquipmentfileMapper.xml
@@ -1,50 +1,48 @@
<?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">
        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>
    <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};
    <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>
        <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}
    INSERT INTO sys_equipmentfile (node_id, filepath)
    VALUES(#{nodeId}, #{filePath}) ON CONFLICT (node_id) DO
    UPDATE
    SET filepath = excluded.filepath
  </update>
  <select id="getConfigure" resultMap="SysEquipmentFile">
    select node_id, filepath
    from sys_equipmentfile
    where node_id = #{nodeId};
  </select>
    <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>
    <select id="getConfigureTag" resultMap="SysSvgInfo">
        select id, param, tag
        from sys_svg_info
        where node_id = #{nodeId}
    </select>
</mapper>