gtsoft-snail-job-server/x-retry-server/src/main/resources/mapper/ServerNodeMapper.xml
byteblogs168 1a049541c1 fix:0.0.4.3
修复客户端配置了server.servlet.context-pat,请求重试接口404 问题
2023-01-14 21:02:28 +08:00

39 lines
2.2 KiB
XML

<?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.x.retry.server.persistence.mybatis.mapper.ServerNodeMapper">
<resultMap id="BaseResultMap" type="com.x.retry.server.persistence.mybatis.po.ServerNode">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="group_name" jdbcType="VARCHAR" property="groupName" />
<result column="host_id" jdbcType="VARCHAR" property="hostId" />
<result column="host_ip" jdbcType="VARCHAR" property="hostIp" />
<result column="host_port" jdbcType="INTEGER" property="hostPort" />
<result column="expire_at" jdbcType="TIMESTAMP" property="expireAt" />
<result column="node_type" jdbcType="TINYINT" property="nodeType" />
<result column="context_path" jdbcType="VARCHAR" property="contextPath" />
<result column="create_dt" jdbcType="TIMESTAMP" property="createDt" />
<result column="update_dt" jdbcType="TIMESTAMP" property="updateDt" />
</resultMap>
<sql id="Base_Column_List">
id, group_name, context_path, host_id, host_ip, host_port, expire_at, node_type,create_dt,update_dt
</sql>
<insert id="insertOrUpdate" parameterType="com.x.retry.server.persistence.mybatis.po.ServerNode">
insert into server_node (id, group_name, host_id, host_ip, host_port,
expire_at, node_type, context_path, create_dt)
values (#{id,jdbcType=BIGINT}, #{groupName,jdbcType=VARCHAR}, #{hostId,jdbcType=VARCHAR}, #{hostIp,jdbcType=VARCHAR},
#{hostPort,jdbcType=INTEGER},
#{expireAt,jdbcType=TIMESTAMP}, #{nodeType,jdbcType=TINYINT}, #{contextPath,jdbcType=VARCHAR}, #{createDt,jdbcType=TIMESTAMP}
) ON DUPLICATE KEY UPDATE
host_id = values(`host_id`),
host_ip = values(`host_ip`),
host_port = values(`host_port`),
expire_at = values(`expire_at`),
node_type = values(`node_type`),
create_dt = values(`create_dt`),
context_path = values(`context_path`)
</insert>
<delete id="deleteByExpireAt">
delete from server_node
where expire_at &lt;= #{endTime,jdbcType=TIMESTAMP}
</delete>
</mapper>