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-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)
|
|
|
|
VALUES
|
|
|
|
<foreach collection="list" item="item" index="index" separator=",">
|
|
|
|
(
|
|
|
|
#{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}
|
|
|
|
)
|
|
|
|
</foreach>
|
|
|
|
</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>
|