<?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.activiti6.mapper.MyFormDataMapper">
    <resultMap id="BaseResultMap" type="com.activiti6.entity.MyFormData">
        <id column="f_id" property="fId" jdbcType="BIGINT"/>
        <result column="model_key" property="modelKey" jdbcType="VARCHAR"/>
        <result column="model_version" property="modelVersion" jdbcType="INTEGER"/>
        <result column="modul_id" property="modulId" jdbcType="VARCHAR"/>
        <result column="f_name" property="fName" jdbcType="VARCHAR"/>
        <result column="f_key" property="fKey" jdbcType="VARCHAR"/>
        <result column="f_version" property="fVersion" jdbcType="BIGINT"/>
        <result column="json_data" property="jsonData" jdbcType="VARCHAR"/>
        <result column="status" property="status" jdbcType="INTEGER"/>
        <result column="create_by" property="createBy" jdbcType="VARCHAR"/>
        <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
        <result column="update_by" property="updateBy" jdbcType="VARCHAR"/>
        <result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
    </resultMap>
    <sql id="Example_Where_Clause">
        <where>
            <foreach collection="oredCriteria" item="criteria" separator="or">
                <if test="criteria.valid">
                    <trim prefix="(" suffix=")" prefixOverrides="and">
                        <foreach collection="criteria.criteria" item="criterion">
                            <choose>
                                <when test="criterion.noValue">
                                    and ${criterion.condition}
                                </when>
                                <when test="criterion.singleValue">
                                    and ${criterion.condition} #{criterion.value}
                                </when>
                                <when test="criterion.betweenValue">
                                    and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                                </when>
                                <when test="criterion.listValue">
                                    and ${criterion.condition}
                                    <foreach collection="criterion.value" item="listItem" open="(" close=")"
                                             separator=",">
                                        #{listItem}
                                    </foreach>
                                </when>
                            </choose>
                        </foreach>
                    </trim>
                </if>
            </foreach>
        </where>
    </sql>
    <sql id="Update_By_Example_Where_Clause">
        <where>
            <foreach collection="example.oredCriteria" item="criteria" separator="or">
                <if test="criteria.valid">
                    <trim prefix="(" suffix=")" prefixOverrides="and">
                        <foreach collection="criteria.criteria" item="criterion">
                            <choose>
                                <when test="criterion.noValue">
                                    and ${criterion.condition}
                                </when>
                                <when test="criterion.singleValue">
                                    and ${criterion.condition} #{criterion.value}
                                </when>
                                <when test="criterion.betweenValue">
                                    and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                                </when>
                                <when test="criterion.listValue">
                                    and ${criterion.condition}
                                    <foreach collection="criterion.value" item="listItem" open="(" close=")"
                                             separator=",">
                                        #{listItem}
                                    </foreach>
                                </when>
                            </choose>
                        </foreach>
                    </trim>
                </if>
            </foreach>
        </where>
    </sql>
    <sql id="Base_Column_List">
    f_id, model_key, model_version, modul_id, f_name, f_key, f_version, json_data, status, 
    create_by, create_time, update_by, update_time
  </sql>
    <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.activiti6.entity.MyFormDataExample">
        select
        <if test="distinct">
            distinct
        </if>
        <include refid="Base_Column_List"/>
        from form_data
        <if test="_parameter != null">
            <include refid="Example_Where_Clause"/>
        </if>
        <if test="orderByClause != null">
            order by ${orderByClause}
        </if>
    </select>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List"/>
        from form_data
        where f_id = #{fId,jdbcType=BIGINT}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from form_data
    where f_id = #{fId,jdbcType=BIGINT}
  </delete>
    <delete id="deleteByExample" parameterType="com.activiti6.entity.MyFormDataExample">
        delete from form_data
        <if test="_parameter != null">
            <include refid="Example_Where_Clause"/>
        </if>
    </delete>
    <insert id="insert" parameterType="com.activiti6.entity.MyFormData">
    insert into form_data (f_id, model_key, model_version, 
      modul_id, f_name, f_key, 
      f_version, json_data, status, 
      create_by, create_time, update_by, 
      update_time)
    values (#{fId,jdbcType=BIGINT}, #{modelKey,jdbcType=VARCHAR}, #{modelVersion,jdbcType=INTEGER}, 
      #{modulId,jdbcType=VARCHAR}, #{fName,jdbcType=VARCHAR}, #{fKey,jdbcType=VARCHAR}, 
      #{fVersion,jdbcType=BIGINT}, #{jsonData,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, 
      #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, 
      #{updateTime,jdbcType=TIMESTAMP})
  </insert>
    <insert id="insertSelective" parameterType="com.activiti6.entity.MyFormData">
        insert into form_data
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="fId != null">
                f_id,
            </if>
            <if test="modelKey != null">
                model_key,
            </if>
            <if test="modelVersion != null">
                model_version,
            </if>
            <if test="modulId != null">
                modul_id,
            </if>
            <if test="fName != null">
                f_name,
            </if>
            <if test="fKey != null">
                f_key,
            </if>
            <if test="fVersion != null">
                f_version,
            </if>
            <if test="jsonData != null">
                json_data,
            </if>
            <if test="status != null">
                status,
            </if>
            <if test="createBy != null">
                create_by,
            </if>
            <if test="createTime != null">
                create_time,
            </if>
            <if test="updateBy != null">
                update_by,
            </if>
            <if test="updateTime != null">
                update_time,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="fId != null">
                #{fId,jdbcType=BIGINT},
            </if>
            <if test="modelKey != null">
                #{modelKey,jdbcType=VARCHAR},
            </if>
            <if test="modelVersion != null">
                #{modelVersion,jdbcType=INTEGER},
            </if>
            <if test="modulId != null">
                #{modulId,jdbcType=VARCHAR},
            </if>
            <if test="fName != null">
                #{fName,jdbcType=VARCHAR},
            </if>
            <if test="fKey != null">
                #{fKey,jdbcType=VARCHAR},
            </if>
            <if test="fVersion != null">
                #{fVersion,jdbcType=BIGINT},
            </if>
            <if test="jsonData != null">
                #{jsonData,jdbcType=VARCHAR},
            </if>
            <if test="status != null">
                #{status,jdbcType=INTEGER},
            </if>
            <if test="createBy != null">
                #{createBy,jdbcType=VARCHAR},
            </if>
            <if test="createTime != null">
                #{createTime,jdbcType=TIMESTAMP},
            </if>
            <if test="updateBy != null">
                #{updateBy,jdbcType=VARCHAR},
            </if>
            <if test="updateTime != null">
                #{updateTime,jdbcType=TIMESTAMP},
            </if>
        </trim>
    </insert>

    <select id="countByExample" parameterType="com.activiti6.entity.MyFormDataExample" resultType="java.lang.Integer">
        select count(*) from form_data
        <if test="_parameter != null">
            <include refid="Example_Where_Clause"/>
        </if>
    </select>
    <update id="updateByExampleSelective" parameterType="map">
        update form_data
        <set>
            <if test="record.fId != null">
                f_id = #{record.fId,jdbcType=BIGINT},
            </if>
            <if test="record.modelKey != null">
                model_key = #{record.modelKey,jdbcType=VARCHAR},
            </if>
            <if test="record.modelVersion != null">
                model_version = #{record.modelVersion,jdbcType=INTEGER},
            </if>
            <if test="record.modulId != null">
                modul_id = #{record.modulId,jdbcType=VARCHAR},
            </if>
            <if test="record.fName != null">
                f_name = #{record.fName,jdbcType=VARCHAR},
            </if>
            <if test="record.fKey != null">
                f_key = #{record.fKey,jdbcType=VARCHAR},
            </if>
            <if test="record.fVersion != null">
                f_version = #{record.fVersion,jdbcType=BIGINT},
            </if>
            <if test="record.jsonData != null">
                json_data = #{record.jsonData,jdbcType=VARCHAR},
            </if>
            <if test="record.status != null">
                status = #{record.status,jdbcType=INTEGER},
            </if>
            <if test="record.createBy != null">
                create_by = #{record.createBy,jdbcType=VARCHAR},
            </if>
            <if test="record.createTime != null">
                create_time = #{record.createTime,jdbcType=TIMESTAMP},
            </if>
            <if test="record.updateBy != null">
                update_by = #{record.updateBy,jdbcType=VARCHAR},
            </if>
            <if test="record.updateTime != null">
                update_time = #{record.updateTime,jdbcType=TIMESTAMP},
            </if>
        </set>
        <if test="_parameter != null">
            <include refid="Update_By_Example_Where_Clause"/>
        </if>
    </update>
    <update id="updateByExample" parameterType="map">
        update form_data
        set f_id = #{record.fId,jdbcType=BIGINT},
        model_key = #{record.modelKey,jdbcType=VARCHAR},
        model_version = #{record.modelVersion,jdbcType=INTEGER},
        modul_id = #{record.modulId,jdbcType=VARCHAR},
        f_name = #{record.fName,jdbcType=VARCHAR},
        f_key = #{record.fKey,jdbcType=VARCHAR},
        f_version = #{record.fVersion,jdbcType=BIGINT},
        json_data = #{record.jsonData,jdbcType=VARCHAR},
        status = #{record.status,jdbcType=INTEGER},
        create_by = #{record.createBy,jdbcType=VARCHAR},
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
        update_by = #{record.updateBy,jdbcType=VARCHAR},
        update_time = #{record.updateTime,jdbcType=TIMESTAMP}
        <if test="_parameter != null">
            <include refid="Update_By_Example_Where_Clause"/>
        </if>
    </update>
    <update id="updateByPrimaryKeySelective" parameterType="com.activiti6.entity.MyFormData">
        update form_data
        <set>
            <if test="modelKey != null">
                model_key = #{modelKey,jdbcType=VARCHAR},
            </if>
            <if test="modelVersion != null">
                model_version = #{modelVersion,jdbcType=INTEGER},
            </if>
            <if test="modulId != null">
                modul_id = #{modulId,jdbcType=VARCHAR},
            </if>
            <if test="fName != null">
                f_name = #{fName,jdbcType=VARCHAR},
            </if>
            <if test="fKey != null">
                f_key = #{fKey,jdbcType=VARCHAR},
            </if>
            <if test="fVersion != null">
                f_version = #{fVersion,jdbcType=BIGINT},
            </if>
            <if test="jsonData != null">
                json_data = #{jsonData,jdbcType=VARCHAR},
            </if>
            <if test="status != null">
                status = #{status,jdbcType=INTEGER},
            </if>
            <if test="createBy != null">
                create_by = #{createBy,jdbcType=VARCHAR},
            </if>
            <if test="createTime != null">
                create_time = #{createTime,jdbcType=TIMESTAMP},
            </if>
            <if test="updateBy != null">
                update_by = #{updateBy,jdbcType=VARCHAR},
            </if>
            <if test="updateTime != null">
                update_time = #{updateTime,jdbcType=TIMESTAMP},
            </if>
        </set>
        where f_id = #{fId,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKey" parameterType="com.activiti6.entity.MyFormData">
    update form_data
    set model_key = #{modelKey,jdbcType=VARCHAR},
      model_version = #{modelVersion,jdbcType=INTEGER},
      modul_id = #{modulId,jdbcType=VARCHAR},
      f_name = #{fName,jdbcType=VARCHAR},
      f_key = #{fKey,jdbcType=VARCHAR},
      f_version = #{fVersion,jdbcType=BIGINT},
      json_data = #{jsonData,jdbcType=VARCHAR},
      status = #{status,jdbcType=INTEGER},
      create_by = #{createBy,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      update_by = #{updateBy,jdbcType=VARCHAR},
      update_time = #{updateTime,jdbcType=TIMESTAMP}
    where f_id = #{fId,jdbcType=BIGINT}
  </update>
    <insert id="insertList" parameterType="list">
       insert into form_data
       (
        f_id,
        model_key,
        model_version,
        modul_id,
        f_name,
        f_key,
        f_version,
        json_data,
        status,
        create_by,
        create_time,
        update_by,
        update_time
      )
        values
            <foreach collection="list" item="item"  separator=",">
                (
                #{item.fId,jdbcType=BIGINT},
                #{item.modelKey,jdbcType=VARCHAR},
                #{item.modelVersion,jdbcType=INTEGER},
                #{item.modulId,jdbcType=VARCHAR},
                #{item.fName,jdbcType=VARCHAR},
                #{item.fKey,jdbcType=VARCHAR},
                #{item.fVersion,jdbcType=BIGINT},
                #{item.jsonData,jdbcType=VARCHAR},
                #{item.status,jdbcType=INTEGER},
                #{item.createBy,jdbcType=VARCHAR},
                #{item.createTime,jdbcType=TIMESTAMP},
                #{item.updateBy,jdbcType=VARCHAR},
                #{item.updateTime,jdbcType=TIMESTAMP}
                )
            </foreach>

    </insert>

</mapper>