<?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.ruoyi.system.mapper.form.MdFormRecordMapper">
  <resultMap id="BaseResultMap" type="com.ruoyi.system.domain.form.MdFormRecord">
    <id column="id" jdbcType="VARCHAR" property="id" />
    <result column="form_id" jdbcType="VARCHAR" property="formId" />
    <result column="status" jdbcType="TINYINT" property="status" />
    <result column="commit_status" jdbcType="TINYINT" property="commitStatus" />
    <result column="commit_cycle" jdbcType="VARCHAR" property="commitCycle" />
    <result column="create_time" jdbcType="BIGINT" property="createTime" />
    <result column="own_user" jdbcType="VARCHAR" property="ownUser" />
    <result column="own_dept" jdbcType="VARCHAR" property="ownDept" />
    <result column="source" jdbcType="VARCHAR" property="source" />
    <result column="commit_name" jdbcType="VARCHAR" property="commitName" />
  </resultMap>
  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.ruoyi.system.domain.form.MdFormRecord">
    <result column="records" jdbcType="LONGVARCHAR" property="records" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <where>
      <foreach collection="oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <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 close=")" collection="criterion.value" item="listItem" open="(" 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="(" prefixOverrides="and" suffix=")">
            <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 close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List">
    id, form_id, status, commit_status, commit_cycle, create_time, own_user, own_dept, source, commit_name
  </sql>
  <sql id="Blob_Column_List">
    records
  </sql>
  <select id="selectByExampleWithBLOBs" parameterType="com.ruoyi.system.domain.form.MdFormRecordExample" resultMap="ResultMapWithBLOBs">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from md_form_record
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByExample" parameterType="com.ruoyi.system.domain.form.MdFormRecordExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from md_form_record
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from md_form_record
    where id = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from md_form_record
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="com.ruoyi.system.domain.form.MdFormRecordExample">
    delete from md_form_record
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.ruoyi.system.domain.form.MdFormRecord">
    insert into md_form_record (id, form_id, status, 
      commit_status, commit_cycle, create_time, 
      own_user, own_dept, source, commit_name,
      records)
    values (#{id,jdbcType=VARCHAR}, #{formId,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT}, 
      #{commitStatus,jdbcType=TINYINT}, #{commitCycle,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, 
      #{ownUser,jdbcType=VARCHAR}, #{ownDept,jdbcType=VARCHAR}, #{source,jdbcType=VARCHAR}, #{commitName,jdbcType=VARCHAR},
      #{records,jdbcType=LONGVARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.ruoyi.system.domain.form.MdFormRecord">
    insert into md_form_record
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="formId != null">
        form_id,
      </if>
      <if test="status != null">
        status,
      </if>
      <if test="commitStatus != null">
        commit_status,
      </if>
      <if test="commitCycle != null">
        commit_cycle,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="ownUser != null">
        own_user,
      </if>
      <if test="ownDept != null">
        own_dept,
      </if>
      <if test="source != null">
        source,
      </if>
      <if test="commitName != null">
        commit_name,
      </if>
      <if test="records != null">
        records,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="formId != null">
        #{formId,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        #{status,jdbcType=TINYINT},
      </if>
      <if test="commitStatus != null">
        #{commitStatus,jdbcType=TINYINT},
      </if>
      <if test="commitCycle != null">
        #{commitCycle,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=BIGINT},
      </if>
      <if test="ownUser != null">
        #{ownUser,jdbcType=VARCHAR},
      </if>
      <if test="ownDept != null">
        #{ownDept,jdbcType=VARCHAR},
      </if>
      <if test="source != null">
        #{source,jdbcType=VARCHAR},
      </if>
      <if test="commitName != null">
        #{commitName,jdbcType=VARCHAR},
      </if>
      <if test="records != null">
        #{records,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.ruoyi.system.domain.form.MdFormRecordExample" resultType="java.lang.Long">
    select count(*) from md_form_record
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update md_form_record
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=VARCHAR},
      </if>
      <if test="record.formId != null">
        form_id = #{record.formId,jdbcType=VARCHAR},
      </if>
      <if test="record.status != null">
        status = #{record.status,jdbcType=TINYINT},
      </if>
      <if test="record.commitStatus != null">
        commit_status = #{record.commitStatus,jdbcType=TINYINT},
      </if>
      <if test="record.commitCycle != null">
        commit_cycle = #{record.commitCycle,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=BIGINT},
      </if>
      <if test="record.ownUser != null">
        own_user = #{record.ownUser,jdbcType=VARCHAR},
      </if>
      <if test="record.ownDept != null">
        own_dept = #{record.ownDept,jdbcType=VARCHAR},
      </if>
      <if test="record.source != null">
        source = #{record.source,jdbcType=VARCHAR},
      </if>
      <if test="record.commitName != null">
        commit_name = #{record.commitName,jdbcType=VARCHAR},
      </if>
      <if test="record.records != null">
        records = #{record.records,jdbcType=LONGVARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExampleWithBLOBs" parameterType="map">
    update md_form_record
    set id = #{record.id,jdbcType=VARCHAR},
      form_id = #{record.formId,jdbcType=VARCHAR},
      status = #{record.status,jdbcType=TINYINT},
      commit_status = #{record.commitStatus,jdbcType=TINYINT},
      commit_cycle = #{record.commitCycle,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=BIGINT},
      own_user = #{record.ownUser,jdbcType=VARCHAR},
      own_dept = #{record.ownDept,jdbcType=VARCHAR},
      source = #{record.source,jdbcType=VARCHAR},
      commit_name = #{record.commitName,jdbcType=VARCHAR},
      records = #{record.records,jdbcType=LONGVARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update md_form_record
    set id = #{record.id,jdbcType=VARCHAR},
      form_id = #{record.formId,jdbcType=VARCHAR},
      status = #{record.status,jdbcType=TINYINT},
      commit_status = #{record.commitStatus,jdbcType=TINYINT},
      commit_cycle = #{record.commitCycle,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=BIGINT},
      own_user = #{record.ownUser,jdbcType=VARCHAR},
      own_dept = #{record.ownDept,jdbcType=VARCHAR},
      source = #{record.source,jdbcType=VARCHAR},
      commit_name = #{record.commitName,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.ruoyi.system.domain.form.MdFormRecord">
    update md_form_record
    <set>
      <if test="formId != null">
        form_id = #{formId,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        status = #{status,jdbcType=TINYINT},
      </if>
      <if test="commitStatus != null">
        commit_status = #{commitStatus,jdbcType=TINYINT},
      </if>
      <if test="commitCycle != null">
        commit_cycle = #{commitCycle,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=BIGINT},
      </if>
      <if test="ownUser != null">
        own_user = #{ownUser,jdbcType=VARCHAR},
      </if>
      <if test="ownDept != null">
        own_dept = #{ownDept,jdbcType=VARCHAR},
      </if>
      <if test="source != null">
        source = #{source,jdbcType=VARCHAR},
      </if>
      <if test="commitName != null">
        commit_name = #{commitName,jdbcType=VARCHAR},
      </if>
      <if test="records != null">
        records = #{records,jdbcType=LONGVARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.ruoyi.system.domain.form.MdFormRecord">
    update md_form_record
    set form_id = #{formId,jdbcType=VARCHAR},
      status = #{status,jdbcType=TINYINT},
      commit_status = #{commitStatus,jdbcType=TINYINT},
      commit_cycle = #{commitCycle,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=BIGINT},
      own_user = #{ownUser,jdbcType=VARCHAR},
      own_dept = #{ownDept,jdbcType=VARCHAR},
      source = #{source,jdbcType=VARCHAR},
      commit_name = #{commitName,jdbcType=VARCHAR},
      records = #{records,jdbcType=LONGVARCHAR}
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.ruoyi.system.domain.form.MdFormRecord">
    update md_form_record
    set form_id = #{formId,jdbcType=VARCHAR},
      status = #{status,jdbcType=TINYINT},
      commit_status = #{commitStatus,jdbcType=TINYINT},
      commit_cycle = #{commitCycle,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=BIGINT},
      own_user = #{ownUser,jdbcType=VARCHAR},
      own_dept = #{ownDept,jdbcType=VARCHAR},
      source = #{source,jdbcType=VARCHAR},
      commit_name = #{commitName,jdbcType=VARCHAR}
    where id = #{id,jdbcType=VARCHAR}
  </update>
</mapper>