<?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.task.TkCommonTaskDynamicMapper">
  <resultMap id="BaseResultMap" type="com.ruoyi.system.domain.task.TkCommonTaskDynamic">
    <id column="id" jdbcType="VARCHAR" property="id" />
    <result column="common_tk_id" jdbcType="VARCHAR" property="commonTkId" />
    <result column="address" jdbcType="VARCHAR" property="address" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="note" jdbcType="VARCHAR" property="note" />
    <result column="tk_time" jdbcType="TIMESTAMP" property="tkTime" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="create_by" jdbcType="VARCHAR" property="createBy" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="update_by" jdbcType="VARCHAR" property="updateBy" />
    <result column="return_reason" jdbcType="VARCHAR" property="returnReason" />
    <result column="cuiban_reason" jdbcType="VARCHAR" property="cuibanReason" />
    <result column="hecha_reason" jdbcType="VARCHAR" property="hechaReason" />
    <result column="reason" jdbcType="VARCHAR" property="reason" />
    <result column="type" jdbcType="INTEGER" property="type" />
  </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, common_tk_id, address, name, note, tk_time, create_time, create_by, update_time, 
    update_by, return_reason, cuiban_reason, hecha_reason, reason, type
  </sql>
  <select id="selectByExample" parameterType="com.ruoyi.system.domain.task.TkCommonTaskDynamicExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from tk_common_task_dynamic
    <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="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tk_common_task_dynamic
    where id = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from tk_common_task_dynamic
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="com.ruoyi.system.domain.task.TkCommonTaskDynamicExample">
    delete from tk_common_task_dynamic
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.ruoyi.system.domain.task.TkCommonTaskDynamic">
    insert into tk_common_task_dynamic (id, common_tk_id, address, 
      name, note, tk_time, 
      create_time, create_by, update_time, 
      update_by, return_reason, cuiban_reason, 
      hecha_reason, reason, type
      )
    values (#{id,jdbcType=VARCHAR}, #{commonTkId,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, 
      #{name,jdbcType=VARCHAR}, #{note,jdbcType=VARCHAR}, #{tkTime,jdbcType=TIMESTAMP}, 
      #{createTime,jdbcType=TIMESTAMP}, #{createBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, 
      #{updateBy,jdbcType=VARCHAR}, #{returnReason,jdbcType=VARCHAR}, #{cuibanReason,jdbcType=VARCHAR}, 
      #{hechaReason,jdbcType=VARCHAR}, #{reason,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.ruoyi.system.domain.task.TkCommonTaskDynamic">
    insert into tk_common_task_dynamic
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="commonTkId != null">
        common_tk_id,
      </if>
      <if test="address != null">
        address,
      </if>
      <if test="name != null">
        name,
      </if>
      <if test="note != null">
        note,
      </if>
      <if test="tkTime != null">
        tk_time,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="createBy != null">
        create_by,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
      <if test="updateBy != null">
        update_by,
      </if>
      <if test="returnReason != null">
        return_reason,
      </if>
      <if test="cuibanReason != null">
        cuiban_reason,
      </if>
      <if test="hechaReason != null">
        hecha_reason,
      </if>
      <if test="reason != null">
        reason,
      </if>
      <if test="type != null">
        type,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="commonTkId != null">
        #{commonTkId,jdbcType=VARCHAR},
      </if>
      <if test="address != null">
        #{address,jdbcType=VARCHAR},
      </if>
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="note != null">
        #{note,jdbcType=VARCHAR},
      </if>
      <if test="tkTime != null">
        #{tkTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createBy != null">
        #{createBy,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateBy != null">
        #{updateBy,jdbcType=VARCHAR},
      </if>
      <if test="returnReason != null">
        #{returnReason,jdbcType=VARCHAR},
      </if>
      <if test="cuibanReason != null">
        #{cuibanReason,jdbcType=VARCHAR},
      </if>
      <if test="hechaReason != null">
        #{hechaReason,jdbcType=VARCHAR},
      </if>
      <if test="reason != null">
        #{reason,jdbcType=VARCHAR},
      </if>
      <if test="type != null">
        #{type,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.ruoyi.system.domain.task.TkCommonTaskDynamicExample" resultType="java.lang.Long">
    select count(*) from tk_common_task_dynamic
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update tk_common_task_dynamic
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=VARCHAR},
      </if>
      <if test="record.commonTkId != null">
        common_tk_id = #{record.commonTkId,jdbcType=VARCHAR},
      </if>
      <if test="record.address != null">
        address = #{record.address,jdbcType=VARCHAR},
      </if>
      <if test="record.name != null">
        name = #{record.name,jdbcType=VARCHAR},
      </if>
      <if test="record.note != null">
        note = #{record.note,jdbcType=VARCHAR},
      </if>
      <if test="record.tkTime != null">
        tk_time = #{record.tkTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.createBy != null">
        create_by = #{record.createBy,jdbcType=VARCHAR},
      </if>
      <if test="record.updateTime != null">
        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.updateBy != null">
        update_by = #{record.updateBy,jdbcType=VARCHAR},
      </if>
      <if test="record.returnReason != null">
        return_reason = #{record.returnReason,jdbcType=VARCHAR},
      </if>
      <if test="record.cuibanReason != null">
        cuiban_reason = #{record.cuibanReason,jdbcType=VARCHAR},
      </if>
      <if test="record.hechaReason != null">
        hecha_reason = #{record.hechaReason,jdbcType=VARCHAR},
      </if>
      <if test="record.reason != null">
        reason = #{record.reason,jdbcType=VARCHAR},
      </if>
      <if test="record.type != null">
        type = #{record.type,jdbcType=INTEGER},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update tk_common_task_dynamic
    set id = #{record.id,jdbcType=VARCHAR},
      common_tk_id = #{record.commonTkId,jdbcType=VARCHAR},
      address = #{record.address,jdbcType=VARCHAR},
      name = #{record.name,jdbcType=VARCHAR},
      note = #{record.note,jdbcType=VARCHAR},
      tk_time = #{record.tkTime,jdbcType=TIMESTAMP},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      create_by = #{record.createBy,jdbcType=VARCHAR},
      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      update_by = #{record.updateBy,jdbcType=VARCHAR},
      return_reason = #{record.returnReason,jdbcType=VARCHAR},
      cuiban_reason = #{record.cuibanReason,jdbcType=VARCHAR},
      hecha_reason = #{record.hechaReason,jdbcType=VARCHAR},
      reason = #{record.reason,jdbcType=VARCHAR},
      type = #{record.type,jdbcType=INTEGER}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.ruoyi.system.domain.task.TkCommonTaskDynamic">
    update tk_common_task_dynamic
    <set>
      <if test="commonTkId != null">
        common_tk_id = #{commonTkId,jdbcType=VARCHAR},
      </if>
      <if test="address != null">
        address = #{address,jdbcType=VARCHAR},
      </if>
      <if test="name != null">
        name = #{name,jdbcType=VARCHAR},
      </if>
      <if test="note != null">
        note = #{note,jdbcType=VARCHAR},
      </if>
      <if test="tkTime != null">
        tk_time = #{tkTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createBy != null">
        create_by = #{createBy,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateBy != null">
        update_by = #{updateBy,jdbcType=VARCHAR},
      </if>
      <if test="returnReason != null">
        return_reason = #{returnReason,jdbcType=VARCHAR},
      </if>
      <if test="cuibanReason != null">
        cuiban_reason = #{cuibanReason,jdbcType=VARCHAR},
      </if>
      <if test="hechaReason != null">
        hecha_reason = #{hechaReason,jdbcType=VARCHAR},
      </if>
      <if test="reason != null">
        reason = #{reason,jdbcType=VARCHAR},
      </if>
      <if test="type != null">
        type = #{type,jdbcType=INTEGER},
      </if>
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.ruoyi.system.domain.task.TkCommonTaskDynamic">
    update tk_common_task_dynamic
    set common_tk_id = #{commonTkId,jdbcType=VARCHAR},
      address = #{address,jdbcType=VARCHAR},
      name = #{name,jdbcType=VARCHAR},
      note = #{note,jdbcType=VARCHAR},
      tk_time = #{tkTime,jdbcType=TIMESTAMP},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      create_by = #{createBy,jdbcType=VARCHAR},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      update_by = #{updateBy,jdbcType=VARCHAR},
      return_reason = #{returnReason,jdbcType=VARCHAR},
      cuiban_reason = #{cuibanReason,jdbcType=VARCHAR},
      hecha_reason = #{hechaReason,jdbcType=VARCHAR},
      reason = #{reason,jdbcType=VARCHAR},
      type = #{type,jdbcType=INTEGER}
    where id = #{id,jdbcType=VARCHAR}
  </update>
</mapper>