kongdeqiang
2026-04-13 e7d90fd46364afb25c9c0cb9c1a5784f7aac6bf9
src/main/resources/mybatis/mapper/OspfMonitorMapper.xml
@@ -9,12 +9,13 @@
      <result column="USERNAME" property="username" jdbcType="CHAR" />
      <result column="PASSWORD" property="password" jdbcType="CHAR" />
      <result column="CREATE_TIME" property="createTime" jdbcType="TIMESTAMP" />
      <result column="REMOTE_TYPE" property="remoteType" jdbcType="CHAR" />
   </resultMap>
   <sql id="tableColumnList">
      ID,HOST_NAME, INFO_CONTENT, STATE,USERNAME,PASSWORD,CREATE_TIME
      ID,HOST_NAME, INFO_CONTENT, STATE,USERNAME,PASSWORD,CREATE_TIME,REMOTE_TYPE
   </sql>
   <sql id="queryByParams">
      <if test="hostname != null">
         <choose>
@@ -54,19 +55,19 @@
         <![CDATA[ AND AREA_NUM = #{areaNum} ]]>
      </if>
   </sql>
   <select id="selectById" resultMap="resultMap" parameterType="java.lang.String">
      SELECT
      <include refid="tableColumnList" />
      FROM OSPF_MONITOR WHERE ID=#{id}
   </select>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
      DELETE FROM OSPF_MONITOR WHERE ID = #{id}
   </delete>
   <delete id="deleteByDate"  parameterType="map">
      DELETE FROM OSPF_MONITOR WHERE
      <if test="_databaseId == 'mysql'">
@@ -79,12 +80,12 @@
         <![CDATA[  CREATE_TIME <=  to_date(#{endTime},'yyyy-MM-dd hh24:mi:ss')]]>
      </if>
   </delete>
   <delete id="deleteByAccHname"  parameterType="map">
      DELETE FROM OSPF_MONITOR WHERE ACCOUNT = #{account} AND HOST_NAME = #{hostname}
   </delete>
   <delete id="deleteById" parameterType="java.lang.String">
      DELETE FROM OSPF_MONITOR WHERE ID IN
      <foreach item="item" index="index" collection="array" open="(" separator="," close=")">
@@ -103,9 +104,9 @@
            end;
         </when>
         <otherwise>
            INSERT INTO OSPF_MONITOR (ID,HOST_NAME,INFO_CONTENT,STATE,USERNAME,PASSWORD,CREATE_TIME)  VALUES
            INSERT INTO OSPF_MONITOR (ID,HOST_NAME,INFO_CONTENT,STATE,USERNAME,PASSWORD,CREATE_TIME,REMOTE_TYPE)  VALUES
            <foreach collection="list" item="item" index="index" separator="," >
               (#{item.id},#{item.hostname},#{item.infoContent},#{item.state},#{item.username},#{item.password},#{item.createTime})
               (#{item.id},#{item.hostname},#{item.infoContent},#{item.state},#{item.username},#{item.password},#{item.createTime},#{item.remoteType})
            </foreach>
         </otherwise>
      </choose>
@@ -120,7 +121,8 @@
            <if test="state != null" >STATE,</if>
            <if test="username != null" >USERNAME,</if>
            <if test="password != null" >PASSWORD,</if>
            <if test="createTime != null" >CREATE_TIME</if>
            <if test="createTime != null" >CREATE_TIME,</if>
          <if test="remoteType != null" >REMOTE_TYPE</if>
       </trim>
       <trim prefix="values (" suffix=")" suffixOverrides="," >
            <if test="id != null" >#{id},</if>
@@ -129,7 +131,8 @@
            <if test="state != null" >#{state},</if>
         <if test="username != null" >#{username},</if>
         <if test="password != null" >#{password},</if>
            <if test="createTime != null" >#{createTime}</if>
            <if test="createTime != null" >#{createTime},</if>
          <if test="remoteType != null" >#{remoteType}</if>
       </trim>
   </insert>
@@ -151,7 +154,7 @@
      </where>
       ORDER BY CREATE_TIME DESC
   </select>
   <select id="selectByParams" parameterType="map" resultMap="resultMap">
      SELECT
      <include refid="tableColumnList" />
@@ -184,9 +187,12 @@
         <if test="createTime != null">
            CREATE_TIME = #{createTime},
         </if>
          <if test="remoteType != null">
            REMOTE_TYPE = #{remoteType},
         </if>
      </set>
      WHERE ID = #{id}
   </update>
</mapper>
</mapper>