mappers.SortConfigEntityMapper.xml Maven / Gradle / Ivy
The newest version!
<?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.SortConfigEntityMapper"> <resultMap id="BaseResultMap" type="org.apache.inlong.manager.dao.entity.SortConfigEntity"> <id column="id" jdbcType="INTEGER" property="id"/> <result column="sink_id" jdbcType="INTEGER" property="sinkId"/> <result column="sink_type" jdbcType="VARCHAR" property="sinkType"/> <result column="inlong_cluster_tag" jdbcType="VARCHAR" property="inlongClusterTag"/> <result column="inlong_cluster_name" jdbcType="VARCHAR" property="inlongClusterName"/> <result column="sort_task_name" jdbcType="VARCHAR" property="sortTaskName"/> <result column="data_node_name" jdbcType="VARCHAR" property="dataNodeName"/> <result column="config_params" jdbcType="VARCHAR" property="configParams"/> <result column="is_deleted" jdbcType="INTEGER" property="isDeleted"/> <result column="creator" jdbcType="VARCHAR" property="creator"/> <result column="modifier" jdbcType="VARCHAR" property="modifier"/> <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> <result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime"/> <result column="version" jdbcType="INTEGER" property="version"/> </resultMap> <sql id="Base_Column_List"> id, sink_id, sink_type, inlong_cluster_tag, inlong_cluster_name, sort_task_name, data_node_name, config_params, is_deleted, creator, modifier, create_time, modify_time, version </sql> <insert id="insert" useGeneratedKeys="true" keyProperty="id" parameterType="org.apache.inlong.manager.dao.entity.SortConfigEntity"> insert into sort_config (id, sink_id, sink_type, inlong_cluster_tag, inlong_cluster_name, sort_task_name, data_node_name, config_params, creator, modifier) values (#{id, jdbcType=INTEGER}, #{sinkId, jdbcType=INTEGER}, #{sinkType, jdbcType=VARCHAR}, #{inlongClusterTag, jdbcType=VARCHAR}, #{inlongClusterName, jdbcType=VARCHAR},#{sortTaskName, jdbcType=VARCHAR}, #{dataNodeName, jdbcType=VARCHAR}, #{configParams, jdbcType=VARCHAR}, #{creator, jdbcType=VARCHAR}, #{modifier, jdbcType=VARCHAR}) </insert> <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> select <include refid="Base_Column_List"/> from sort_config where id = #{id,jdbcType=INTEGER} and is_deleted = 0 </select> <select id="selectBySinkId" parameterType="java.lang.Integer" resultMap="BaseResultMap"> select <include refid="Base_Column_List"/> from sort_config where sink_id = #{sinkId,jdbcType=INTEGER} and is_deleted = 0 </select> <select id="selectAllSortConfigs" resultType="org.apache.inlong.manager.dao.entity.SortConfigEntity"> select <include refid="Base_Column_List"/> from sort_config <where> and is_deleted = 0 </where> </select> <update id="updateByIdSelective" parameterType="org.apache.inlong.manager.dao.entity.SortConfigEntity"> update sort_config <set> <if test="sinkId != null"> sink_id = #{sinkId,jdbcType=VARCHAR}, </if> <if test="sinkType != null"> sink_type = #{sinkType,jdbcType=VARCHAR}, </if> <if test="inlongClusterTag != null"> inlong_cluster_tag = #{inlongClusterTag,jdbcType=VARCHAR}, </if> <if test="inlongClusterName != null"> inlong_cluster_name = #{inlongClusterName,jdbcType=VARCHAR}, </if> <if test="sortTaskName != null"> sort_task_name = #{sortTaskName,jdbcType=VARCHAR}, </if> <if test="dataNodeName != null"> data_node_name = #{dataNodeName,jdbcType=VARCHAR}, </if> <if test="configParams != null"> config_params = #{configParams,jdbcType=VARCHAR}, </if> <if test="isDeleted != null"> is_deleted = #{isDeleted,jdbcType=INTEGER}, </if> <if test="modifier != null"> modifier = #{modifier,jdbcType=VARCHAR}, </if> version = #{version,jdbcType=INTEGER} + 1 </set> where id = #{id,jdbcType=INTEGER} and version = #{version,jdbcType=INTEGER} </update> <update id="logicDeleteBySinkId" parameterType="java.lang.Integer"> update sort_config set is_deleted = id where sink_id = #{sinkId,jdbcType=INTEGER} and is_deleted = 0 </update> </mapper>