mappers.DBCollectorDetailTaskEntityMapper.xml Maven / Gradle / Ivy
<?xml version="1.0" encoding="UTF-8"?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="org.apache.inlong.manager.dao.mapper.DBCollectorDetailTaskMapper"> <resultMap id="BaseResultMap" type="org.apache.inlong.manager.dao.entity.DBCollectorDetailTaskEntity"> <id column="id" jdbcType="INTEGER" property="id"/> <result column="main_id" jdbcType="VARCHAR" property="mainId"/> <result column="type" jdbcType="INTEGER" property="type"/> <result column="time_var" jdbcType="VARCHAR" property="timeVar"/> <result column="db_type" jdbcType="INTEGER" property="dbType"/> <result column="ip" jdbcType="VARCHAR" property="ip"/> <result column="port" jdbcType="INTEGER" property="port"/> <result column="db_name" jdbcType="VARCHAR" property="dbName"/> <result column="user" jdbcType="VARCHAR" property="user"/> <result column="password" jdbcType="VARCHAR" property="password"/> <result column="sql_statement" jdbcType="VARCHAR" property="sqlStatement"/> <result column="offset" jdbcType="INTEGER" property="offset"/> <result column="total_limit" jdbcType="INTEGER" property="totalLimit"/> <result column="once_limit" jdbcType="INTEGER" property="onceLimit"/> <result column="time_limit" jdbcType="INTEGER" property="timeLimit"/> <result column="retry_times" jdbcType="INTEGER" property="retryTimes"/> <result column="group_id" jdbcType="VARCHAR" property="groupId"/> <result column="stream_id" jdbcType="VARCHAR" property="streamId"/> <result column="state" jdbcType="INTEGER" property="state"/> <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> <result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime"/> </resultMap> <sql id="Base_Column_List"> id, main_id, type, time_var, db_type, ip, port, db_name, user, password, sql_statement, offset, total_limit, once_limit, time_limit, retry_times, group_id, stream_id, state </sql> <select id="selectOneByState" parameterType="java.lang.Integer" resultMap="BaseResultMap"> select <include refid="Base_Column_List"/> from db_collector_detail_task where state = #{state,jdbcType=INTEGER} limit 1 </select> <select id="selectByTaskId" parameterType="java.lang.Integer" resultMap="BaseResultMap"> select <include refid="Base_Column_List"/> from db_collector_detail_task where id = #{id,jdbcType=INTEGER} </select> <update id="changeState"> update db_collector_detail_task set offset = #{offset, jdbcType=INTEGER}, state = #{newState, jdbcType=INTEGER} where id = #{id, jdbcType=INTEGER} and state = #{oldState, jdbcType=INTEGER} </update> </mapper>