2024-05-21 01:33:46 +08:00
|
|
|
<?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.aizuda.snailjob.template.datasource.persistence.mapper.ServerNodeMapper">
|
|
|
|
|
2024-07-18 17:07:17 +08:00
|
|
|
<sql id="insertBatch_Column_List" >
|
|
|
|
#{item.namespaceId,jdbcType=VARCHAR},
|
|
|
|
#{item.groupName,jdbcType=VARCHAR},
|
|
|
|
#{item.hostId,jdbcType=VARCHAR},
|
|
|
|
#{item.hostIp,jdbcType=VARCHAR},
|
|
|
|
#{item.hostPort,jdbcType=INTEGER},
|
|
|
|
#{item.expireAt,jdbcType=TIMESTAMP},
|
|
|
|
#{item.nodeType,jdbcType=TINYINT},
|
|
|
|
#{item.extAttrs,jdbcType=VARCHAR},
|
|
|
|
#{item.createDt,jdbcType=TIMESTAMP}
|
|
|
|
</sql>
|
|
|
|
|
2024-06-20 14:34:37 +08:00
|
|
|
<insert id="insertBatch" parameterType="java.util.List" useGeneratedKeys="false">
|
|
|
|
INSERT INTO sj_server_node (namespace_id, group_name, host_id, host_ip, host_port,
|
|
|
|
expire_at, node_type, ext_attrs, create_dt)
|
2024-07-18 14:52:59 +08:00
|
|
|
<if test="@com.aizuda.snailjob.template.datasource.utils.DbUtils@notOracle()">
|
2024-07-18 17:07:17 +08:00
|
|
|
VALUES
|
|
|
|
<foreach collection="list" item="item" open="(" separator="," close=")">
|
|
|
|
<include refid="insertBatch_Column_List" />
|
2024-07-18 14:52:59 +08:00
|
|
|
</foreach>
|
|
|
|
</if>
|
|
|
|
<if test="@com.aizuda.snailjob.template.datasource.utils.DbUtils@isOracle()">
|
2024-07-18 17:14:57 +08:00
|
|
|
<foreach collection="list" item="item" separator="UNION ALL">
|
|
|
|
SELECT
|
|
|
|
<include refid="insertBatch_Column_List" />
|
|
|
|
FROM DUAL
|
2024-07-18 14:52:59 +08:00
|
|
|
</foreach>
|
|
|
|
</if>
|
2024-06-20 14:34:37 +08:00
|
|
|
</insert>
|
|
|
|
|
2024-05-21 15:16:04 +08:00
|
|
|
<select id="selectActivePodCount"
|
2024-05-21 01:33:46 +08:00
|
|
|
resultType="com.aizuda.snailjob.template.datasource.persistence.dataobject.ActivePodQuantityResponseDO">
|
|
|
|
SELECT node_type AS nodeType,
|
|
|
|
COUNT(*) AS total
|
2024-05-21 12:54:48 +08:00
|
|
|
FROM sj_server_node
|
2024-05-21 01:33:46 +08:00
|
|
|
${ew.customSqlSegment}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
</mapper>
|