Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
<?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.TemplateFieldEntityMapper">
<resultMap id="BaseResultMap" type="org.apache.inlong.manager.dao.entity.TemplateFieldEntity">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="template_id" jdbcType="INTEGER" property="templateId"/>
<result column="is_predefined_field" jdbcType="INTEGER" property="isPredefinedField"/>
<result column="field_name" jdbcType="VARCHAR" property="fieldName"/>
<result column="field_value" jdbcType="VARCHAR" property="fieldValue"/>
<result column="pre_expression" jdbcType="VARCHAR" property="preExpression"/>
<result column="field_type" jdbcType="VARCHAR" property="fieldType"/>
<result column="field_comment" jdbcType="VARCHAR" property="fieldComment"/>
<result column="is_meta_field" jdbcType="SMALLINT" property="isMetaField"/>
<result column="meta_field_name" jdbcType="VARCHAR" property="metaFieldName"/>
<result column="field_format" jdbcType="VARCHAR" property="fieldFormat"/>
<result column="rank_num" jdbcType="INTEGER" property="rankNum"/>
<result column="is_deleted" jdbcType="INTEGER" property="isDeleted"/>
</resultMap>
<sql id="Base_Column_List">
id, template_id, is_predefined_field, field_name, field_value, pre_expression,
field_type, field_comment, is_meta_field, meta_field_name, field_format, rank_num, is_deleted
</sql>
<insert id="insert" useGeneratedKeys="true" keyProperty="id"
parameterType="org.apache.inlong.manager.dao.entity.TemplateFieldEntity">
insert into template_field (id, template_id,
is_predefined_field, field_name, field_value,
pre_expression, field_type, field_comment,
is_meta_field, meta_field_name, field_format,
rank_num, is_deleted)
values (#{id,jdbcType=INTEGER}, #{templateId,jdbcType=INTEGER},
#{isPredefinedField,jdbcType=INTEGER}, #{fieldName,jdbcType=VARCHAR}, #{fieldValue,jdbcType=VARCHAR},
#{preExpression,jdbcType=VARCHAR}, #{fieldType,jdbcType=VARCHAR}, #{fieldComment,jdbcType=VARCHAR},
#{isMetaField,jdbcType=SMALLINT}, #{metaFieldName,jdbcType=VARCHAR}, #{fieldFormat,jdbcType=VARCHAR},
#{rankNum,jdbcType=SMALLINT}, #{isDeleted,jdbcType=INTEGER})
</insert>
<!-- Bulk insert, update if it exists -->
<insert id="insertAll" parameterType="java.util.List">
insert into template_field (
id, template_id, is_predefined_field,
field_name, field_value, pre_expression, field_type,
field_comment, is_meta_field, meta_field_name, field_format,
rank_num, is_deleted
)
values
<foreach collection="fieldList" index="index" item="item" separator=",">
(
#{item.id}, #{item.templateId}, #{item.isPredefinedField},
#{item.fieldName}, #{item.fieldValue}, #{item.preExpression}, #{item.fieldType},
#{item.fieldComment}, #{item.isMetaField}, #{item.metaFieldName}, #{item.fieldFormat},
#{item.rankNum}, #{item.isDeleted}
)
</foreach>
ON DUPLICATE KEY UPDATE
id = values(id),
template_id = values(template_id),
is_predefined_field = values(is_predefined_field),
field_name = values(field_name),
field_value = values(field_value),
pre_expression = values(pre_expression),
field_type = values(field_type),
is_meta_field = values(is_meta_field),
meta_field_name = values(meta_field_name),
field_format = values(field_format),
field_comment = values(field_comment),
rank_num = values(rank_num),
is_deleted = values(is_deleted)
</insert>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from template_field
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectByTemplateId" resultType="org.apache.inlong.manager.dao.entity.TemplateFieldEntity">
select
<include refid="Base_Column_List"/>
from template_field
where template_id = #{templateId, jdbcType=INTEGER}
and is_deleted = 0
order by id asc
</select>
<update id="logicDeleteAllByTemplateId">
update template_field
set is_deleted = id
where template_id = #{templateId, jdbcType=INTEGER}
and is_deleted = 0
</update>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete
from template_field
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteAllByTemplateId">
delete
from template_field
where template_id = #{templateId, jdbcType=INTEGER}
and is_deleted = 0
</delete>
</mapper>