<?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.TkRoundPlanMapper">
  <resultMap id="BaseResultMap" type="com.ruoyi.system.domain.task.TkRoundPlan">
    <id column="id" jdbcType="VARCHAR" property="id" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="description" jdbcType="VARCHAR" property="description" />
    <result column="user_ids" jdbcType="VARCHAR" property="userIds" />
    <result column="user_names" jdbcType="VARCHAR" property="userNames" />
    <result column="period_type" jdbcType="VARCHAR" property="periodType" />
    <result column="period_interval" jdbcType="VARCHAR" property="periodInterval" />
    <result column="period_hz" jdbcType="VARCHAR" property="periodHz" />
    <result column="start_date" jdbcType="DATE" property="startDate" />
    <result column="end_date" jdbcType="DATE" property="endDate" />
    <result column="obj_type" jdbcType="VARCHAR" property="objType" />
    <result column="obj_names" jdbcType="VARCHAR" property="objNames" />
    <result column="obj_json" jdbcType="VARCHAR" property="objJson" />
    <result column="matter_id" jdbcType="VARCHAR" property="matterId" />
    <result column="matter_name" jdbcType="VARCHAR" property="matterName" />
    <result column="status" jdbcType="VARCHAR" property="status" />
    <result column="create_by" jdbcType="VARCHAR" property="createBy" />
    <result column="create_name" jdbcType="VARCHAR" property="createName" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="update_by" jdbcType="VARCHAR" property="updateBy" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  </resultMap>
  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.ruoyi.system.domain.task.TkRoundPlan">
    <result column="obj_ids" jdbcType="LONGVARCHAR" property="objIds" />
  </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, name, description, user_ids, user_names, period_type, period_interval,
    period_hz, start_date, end_date, obj_type, obj_names, obj_json, matter_id, matter_name, 
    status, create_by, create_name, create_time, update_by, update_time
  </sql>
  <sql id="Blob_Column_List">
    obj_ids
  </sql>
  <select id="selectByExampleWithBLOBs" parameterType="com.ruoyi.system.domain.task.TkRoundPlanExample" resultMap="ResultMapWithBLOBs">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from tk_round_plan
    <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.task.TkRoundPlanExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from tk_round_plan
    <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 tk_round_plan
    where id = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from tk_round_plan
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="com.ruoyi.system.domain.task.TkRoundPlanExample">
    delete from tk_round_plan
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.ruoyi.system.domain.task.TkRoundPlan">
    insert into tk_round_plan (id,  name,
      description, user_ids, user_names, 
      period_type, period_interval, period_hz, 
      start_date, end_date, obj_type, 
      obj_names, obj_json, matter_id, 
      matter_name, status, create_by, 
      create_name, create_time, update_by, 
      update_time, obj_ids)
    values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
      #{description,jdbcType=VARCHAR}, #{userIds,jdbcType=VARCHAR}, #{userNames,jdbcType=VARCHAR}, 
      #{periodType,jdbcType=VARCHAR}, #{periodInterval,jdbcType=VARCHAR}, #{periodHz,jdbcType=VARCHAR}, 
      #{startDate,jdbcType=DATE}, #{endDate,jdbcType=DATE}, #{objType,jdbcType=VARCHAR}, 
      #{objNames,jdbcType=VARCHAR}, #{objJson,jdbcType=VARCHAR}, #{matterId,jdbcType=VARCHAR}, 
      #{matterName,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, 
      #{createName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, 
      #{updateTime,jdbcType=TIMESTAMP}, #{objIds,jdbcType=LONGVARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.ruoyi.system.domain.task.TkRoundPlan">
    insert into tk_round_plan
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="name != null">
        name,
      </if>
      <if test="description != null">
        description,
      </if>
      <if test="userIds != null">
        user_ids,
      </if>
      <if test="userNames != null">
        user_names,
      </if>
      <if test="periodType != null">
        period_type,
      </if>
      <if test="periodInterval != null">
        period_interval,
      </if>
      <if test="periodHz != null">
        period_hz,
      </if>
      <if test="startDate != null">
        start_date,
      </if>
      <if test="endDate != null">
        end_date,
      </if>
      <if test="objType != null">
        obj_type,
      </if>
      <if test="objNames != null">
        obj_names,
      </if>
      <if test="objJson != null">
        obj_json,
      </if>
      <if test="matterId != null">
        matter_id,
      </if>
      <if test="matterName != null">
        matter_name,
      </if>
      <if test="status != null">
        status,
      </if>
      <if test="createBy != null">
        create_by,
      </if>
      <if test="createName != null">
        create_name,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="updateBy != null">
        update_by,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
      <if test="objIds != null">
        obj_ids,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="description != null">
        #{description,jdbcType=VARCHAR},
      </if>
      <if test="userIds != null">
        #{userIds,jdbcType=VARCHAR},
      </if>
      <if test="userNames != null">
        #{userNames,jdbcType=VARCHAR},
      </if>
      <if test="periodType != null">
        #{periodType,jdbcType=VARCHAR},
      </if>
      <if test="periodInterval != null">
        #{periodInterval,jdbcType=VARCHAR},
      </if>
      <if test="periodHz != null">
        #{periodHz,jdbcType=VARCHAR},
      </if>
      <if test="startDate != null">
        #{startDate,jdbcType=DATE},
      </if>
      <if test="endDate != null">
        #{endDate,jdbcType=DATE},
      </if>
      <if test="objType != null">
        #{objType,jdbcType=VARCHAR},
      </if>
      <if test="objNames != null">
        #{objNames,jdbcType=VARCHAR},
      </if>
      <if test="objJson != null">
        #{objJson,jdbcType=VARCHAR},
      </if>
      <if test="matterId != null">
        #{matterId,jdbcType=VARCHAR},
      </if>
      <if test="matterName != null">
        #{matterName,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        #{status,jdbcType=VARCHAR},
      </if>
      <if test="createBy != null">
        #{createBy,jdbcType=VARCHAR},
      </if>
      <if test="createName != null">
        #{createName,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>
      <if test="objIds != null">
        #{objIds,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.ruoyi.system.domain.task.TkRoundPlanExample" resultType="java.lang.Long">
    select count(*) from tk_round_plan
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update tk_round_plan
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=VARCHAR},
      </if>
      <if test="record.name != null">
        name = #{record.name,jdbcType=VARCHAR},
      </if>
      <if test="record.description != null">
        description = #{record.description,jdbcType=VARCHAR},
      </if>
      <if test="record.userIds != null">
        user_ids = #{record.userIds,jdbcType=VARCHAR},
      </if>
      <if test="record.userNames != null">
        user_names = #{record.userNames,jdbcType=VARCHAR},
      </if>
      <if test="record.periodType != null">
        period_type = #{record.periodType,jdbcType=VARCHAR},
      </if>
      <if test="record.periodInterval != null">
        period_interval = #{record.periodInterval,jdbcType=VARCHAR},
      </if>
      <if test="record.periodHz != null">
        period_hz = #{record.periodHz,jdbcType=VARCHAR},
      </if>
      <if test="record.startDate != null">
        start_date = #{record.startDate,jdbcType=DATE},
      </if>
      <if test="record.endDate != null">
        end_date = #{record.endDate,jdbcType=DATE},
      </if>
      <if test="record.objType != null">
        obj_type = #{record.objType,jdbcType=VARCHAR},
      </if>
      <if test="record.objNames != null">
        obj_names = #{record.objNames,jdbcType=VARCHAR},
      </if>
      <if test="record.objJson != null">
        obj_json = #{record.objJson,jdbcType=VARCHAR},
      </if>
      <if test="record.matterId != null">
        matter_id = #{record.matterId,jdbcType=VARCHAR},
      </if>
      <if test="record.matterName != null">
        matter_name = #{record.matterName,jdbcType=VARCHAR},
      </if>
      <if test="record.status != null">
        status = #{record.status,jdbcType=VARCHAR},
      </if>
      <if test="record.createBy != null">
        create_by = #{record.createBy,jdbcType=VARCHAR},
      </if>
      <if test="record.createName != null">
        create_name = #{record.createName,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>
      <if test="record.objIds != null">
        obj_ids = #{record.objIds,jdbcType=LONGVARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExampleWithBLOBs" parameterType="map">
    update tk_round_plan
    set id = #{record.id,jdbcType=VARCHAR},
      name = #{record.name,jdbcType=VARCHAR},
      description = #{record.description,jdbcType=VARCHAR},
      user_ids = #{record.userIds,jdbcType=VARCHAR},
      user_names = #{record.userNames,jdbcType=VARCHAR},
      period_type = #{record.periodType,jdbcType=VARCHAR},
      period_interval = #{record.periodInterval,jdbcType=VARCHAR},
      period_hz = #{record.periodHz,jdbcType=VARCHAR},
      start_date = #{record.startDate,jdbcType=DATE},
      end_date = #{record.endDate,jdbcType=DATE},
      obj_type = #{record.objType,jdbcType=VARCHAR},
      obj_names = #{record.objNames,jdbcType=VARCHAR},
      obj_json = #{record.objJson,jdbcType=VARCHAR},
      matter_id = #{record.matterId,jdbcType=VARCHAR},
      matter_name = #{record.matterName,jdbcType=VARCHAR},
      status = #{record.status,jdbcType=VARCHAR},
      create_by = #{record.createBy,jdbcType=VARCHAR},
      create_name = #{record.createName,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      update_by = #{record.updateBy,jdbcType=VARCHAR},
      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      obj_ids = #{record.objIds,jdbcType=LONGVARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update tk_round_plan
    set id = #{record.id,jdbcType=VARCHAR},
      name = #{record.name,jdbcType=VARCHAR},
      description = #{record.description,jdbcType=VARCHAR},
      user_ids = #{record.userIds,jdbcType=VARCHAR},
      user_names = #{record.userNames,jdbcType=VARCHAR},
      period_type = #{record.periodType,jdbcType=VARCHAR},
      period_interval = #{record.periodInterval,jdbcType=VARCHAR},
      period_hz = #{record.periodHz,jdbcType=VARCHAR},
      start_date = #{record.startDate,jdbcType=DATE},
      end_date = #{record.endDate,jdbcType=DATE},
      obj_type = #{record.objType,jdbcType=VARCHAR},
      obj_names = #{record.objNames,jdbcType=VARCHAR},
      obj_json = #{record.objJson,jdbcType=VARCHAR},
      matter_id = #{record.matterId,jdbcType=VARCHAR},
      matter_name = #{record.matterName,jdbcType=VARCHAR},
      status = #{record.status,jdbcType=VARCHAR},
      create_by = #{record.createBy,jdbcType=VARCHAR},
      create_name = #{record.createName,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.ruoyi.system.domain.task.TkRoundPlan">
    update tk_round_plan
    <set>
      <if test="name != null">
        name = #{name,jdbcType=VARCHAR},
      </if>
      <if test="description != null">
        description = #{description,jdbcType=VARCHAR},
      </if>
      <if test="userIds != null">
        user_ids = #{userIds,jdbcType=VARCHAR},
      </if>
      <if test="userNames != null">
        user_names = #{userNames,jdbcType=VARCHAR},
      </if>
      <if test="periodType != null">
        period_type = #{periodType,jdbcType=VARCHAR},
      </if>
      <if test="periodInterval != null">
        period_interval = #{periodInterval,jdbcType=VARCHAR},
      </if>
      <if test="periodHz != null">
        period_hz = #{periodHz,jdbcType=VARCHAR},
      </if>
      <if test="startDate != null">
        start_date = #{startDate,jdbcType=DATE},
      </if>
      <if test="endDate != null">
        end_date = #{endDate,jdbcType=DATE},
      </if>
      <if test="objType != null">
        obj_type = #{objType,jdbcType=VARCHAR},
      </if>
      <if test="objNames != null">
        obj_names = #{objNames,jdbcType=VARCHAR},
      </if>
      <if test="objJson != null">
        obj_json = #{objJson,jdbcType=VARCHAR},
      </if>
      <if test="matterId != null">
        matter_id = #{matterId,jdbcType=VARCHAR},
      </if>
      <if test="matterName != null">
        matter_name = #{matterName,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        status = #{status,jdbcType=VARCHAR},
      </if>
      <if test="createBy != null">
        create_by = #{createBy,jdbcType=VARCHAR},
      </if>
      <if test="createName != null">
        create_name = #{createName,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>
      <if test="objIds != null">
        obj_ids = #{objIds,jdbcType=LONGVARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.ruoyi.system.domain.task.TkRoundPlan">
    update tk_round_plan
    set
      name = #{name,jdbcType=VARCHAR},
      description = #{description,jdbcType=VARCHAR},
      user_ids = #{userIds,jdbcType=VARCHAR},
      user_names = #{userNames,jdbcType=VARCHAR},
      period_type = #{periodType,jdbcType=VARCHAR},
      period_interval = #{periodInterval,jdbcType=VARCHAR},
      period_hz = #{periodHz,jdbcType=VARCHAR},
      start_date = #{startDate,jdbcType=DATE},
      end_date = #{endDate,jdbcType=DATE},
      obj_type = #{objType,jdbcType=VARCHAR},
      obj_names = #{objNames,jdbcType=VARCHAR},
      obj_json = #{objJson,jdbcType=VARCHAR},
      matter_id = #{matterId,jdbcType=VARCHAR},
      matter_name = #{matterName,jdbcType=VARCHAR},
      status = #{status,jdbcType=VARCHAR},
      create_by = #{createBy,jdbcType=VARCHAR},
      create_name = #{createName,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      update_by = #{updateBy,jdbcType=VARCHAR},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      obj_ids = #{objIds,jdbcType=LONGVARCHAR}
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.ruoyi.system.domain.task.TkRoundPlan">
    update tk_round_plan
    set
      name = #{name,jdbcType=VARCHAR},
      description = #{description,jdbcType=VARCHAR},
      user_ids = #{userIds,jdbcType=VARCHAR},
      user_names = #{userNames,jdbcType=VARCHAR},
      period_type = #{periodType,jdbcType=VARCHAR},
      period_interval = #{periodInterval,jdbcType=VARCHAR},
      period_hz = #{periodHz,jdbcType=VARCHAR},
      start_date = #{startDate,jdbcType=DATE},
      end_date = #{endDate,jdbcType=DATE},
      obj_type = #{objType,jdbcType=VARCHAR},
      obj_names = #{objNames,jdbcType=VARCHAR},
      obj_json = #{objJson,jdbcType=VARCHAR},
      matter_id = #{matterId,jdbcType=VARCHAR},
      matter_name = #{matterName,jdbcType=VARCHAR},
      status = #{status,jdbcType=VARCHAR},
      create_by = #{createBy,jdbcType=VARCHAR},
      create_name = #{createName,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      update_by = #{updateBy,jdbcType=VARCHAR},
      update_time = #{updateTime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=VARCHAR}
  </update>
</mapper>