<?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.TkCommonAssignedMapper">
  <resultMap id="BaseResultMap" type="com.ruoyi.system.domain.task.TkCommonAssigned">
    <id column="id" jdbcType="VARCHAR" property="id" />
    <result column="common_tk_id" jdbcType="VARCHAR" property="commonTkId" />
    <result column="assigned_user_id" jdbcType="VARCHAR" property="assignedUserId" />
    <result column="assigned_user_name" jdbcType="VARCHAR" property="assignedUserName" />
    <result column="assigned_role" jdbcType="INTEGER" property="assignedRole" />
    <result column="beassigned_user_id" jdbcType="VARCHAR" property="beassignedUserId" />
    <result column="beassigned_user_name" jdbcType="VARCHAR" property="beassignedUserName" />
    <result column="beassigned_role" jdbcType="INTEGER" property="beassignedRole" />
    <result column="assigned_status" jdbcType="INTEGER" property="assignedStatus" />
    <result column="assigned_end_time" jdbcType="TIMESTAMP" property="assignedEndTime" />
    <result column="assigned_node" jdbcType="VARCHAR" property="assignedNode" />
    <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="perform_user_type" jdbcType="VARCHAR" property="performUserType" />
  </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, assigned_user_id, assigned_user_name, assigned_role, beassigned_user_id, 
    beassigned_user_name, beassigned_role, assigned_status, assigned_end_time, assigned_node, 
    create_time, create_by, update_time, update_by, perform_user_type
  </sql>
  <select id="selectByExample" parameterType="com.ruoyi.system.domain.task.TkCommonAssignedExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from tk_common_assigned
    <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_assigned
    where id = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from tk_common_assigned
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="com.ruoyi.system.domain.task.TkCommonAssignedExample">
    delete from tk_common_assigned
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.ruoyi.system.domain.task.TkCommonAssigned">
    insert into tk_common_assigned (id, common_tk_id, assigned_user_id, 
      assigned_user_name, assigned_role, beassigned_user_id, 
      beassigned_user_name, beassigned_role, assigned_status, 
      assigned_end_time, assigned_node, create_time, 
      create_by, update_time, update_by, 
      perform_user_type)
    values (#{id,jdbcType=VARCHAR}, #{commonTkId,jdbcType=VARCHAR}, #{assignedUserId,jdbcType=VARCHAR}, 
      #{assignedUserName,jdbcType=VARCHAR}, #{assignedRole,jdbcType=INTEGER}, #{beassignedUserId,jdbcType=VARCHAR}, 
      #{beassignedUserName,jdbcType=VARCHAR}, #{beassignedRole,jdbcType=INTEGER}, #{assignedStatus,jdbcType=INTEGER}, 
      #{assignedEndTime,jdbcType=TIMESTAMP}, #{assignedNode,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
      #{createBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, 
      #{performUserType,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.ruoyi.system.domain.task.TkCommonAssigned">
    insert into tk_common_assigned
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="commonTkId != null">
        common_tk_id,
      </if>
      <if test="assignedUserId != null">
        assigned_user_id,
      </if>
      <if test="assignedUserName != null">
        assigned_user_name,
      </if>
      <if test="assignedRole != null">
        assigned_role,
      </if>
      <if test="beassignedUserId != null">
        beassigned_user_id,
      </if>
      <if test="beassignedUserName != null">
        beassigned_user_name,
      </if>
      <if test="beassignedRole != null">
        beassigned_role,
      </if>
      <if test="assignedStatus != null">
        assigned_status,
      </if>
      <if test="assignedEndTime != null">
        assigned_end_time,
      </if>
      <if test="assignedNode != null">
        assigned_node,
      </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="performUserType != null">
        perform_user_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="assignedUserId != null">
        #{assignedUserId,jdbcType=VARCHAR},
      </if>
      <if test="assignedUserName != null">
        #{assignedUserName,jdbcType=VARCHAR},
      </if>
      <if test="assignedRole != null">
        #{assignedRole,jdbcType=INTEGER},
      </if>
      <if test="beassignedUserId != null">
        #{beassignedUserId,jdbcType=VARCHAR},
      </if>
      <if test="beassignedUserName != null">
        #{beassignedUserName,jdbcType=VARCHAR},
      </if>
      <if test="beassignedRole != null">
        #{beassignedRole,jdbcType=INTEGER},
      </if>
      <if test="assignedStatus != null">
        #{assignedStatus,jdbcType=INTEGER},
      </if>
      <if test="assignedEndTime != null">
        #{assignedEndTime,jdbcType=TIMESTAMP},
      </if>
      <if test="assignedNode != null">
        #{assignedNode,jdbcType=VARCHAR},
      </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="performUserType != null">
        #{performUserType,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.ruoyi.system.domain.task.TkCommonAssignedExample" resultType="java.lang.Long">
    select count(*) from tk_common_assigned
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update tk_common_assigned
    <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.assignedUserId != null">
        assigned_user_id = #{record.assignedUserId,jdbcType=VARCHAR},
      </if>
      <if test="record.assignedUserName != null">
        assigned_user_name = #{record.assignedUserName,jdbcType=VARCHAR},
      </if>
      <if test="record.assignedRole != null">
        assigned_role = #{record.assignedRole,jdbcType=INTEGER},
      </if>
      <if test="record.beassignedUserId != null">
        beassigned_user_id = #{record.beassignedUserId,jdbcType=VARCHAR},
      </if>
      <if test="record.beassignedUserName != null">
        beassigned_user_name = #{record.beassignedUserName,jdbcType=VARCHAR},
      </if>
      <if test="record.beassignedRole != null">
        beassigned_role = #{record.beassignedRole,jdbcType=INTEGER},
      </if>
      <if test="record.assignedStatus != null">
        assigned_status = #{record.assignedStatus,jdbcType=INTEGER},
      </if>
      <if test="record.assignedEndTime != null">
        assigned_end_time = #{record.assignedEndTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.assignedNode != null">
        assigned_node = #{record.assignedNode,jdbcType=VARCHAR},
      </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.performUserType != null">
        perform_user_type = #{record.performUserType,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update tk_common_assigned
    set id = #{record.id,jdbcType=VARCHAR},
      common_tk_id = #{record.commonTkId,jdbcType=VARCHAR},
      assigned_user_id = #{record.assignedUserId,jdbcType=VARCHAR},
      assigned_user_name = #{record.assignedUserName,jdbcType=VARCHAR},
      assigned_role = #{record.assignedRole,jdbcType=INTEGER},
      beassigned_user_id = #{record.beassignedUserId,jdbcType=VARCHAR},
      beassigned_user_name = #{record.beassignedUserName,jdbcType=VARCHAR},
      beassigned_role = #{record.beassignedRole,jdbcType=INTEGER},
      assigned_status = #{record.assignedStatus,jdbcType=INTEGER},
      assigned_end_time = #{record.assignedEndTime,jdbcType=TIMESTAMP},
      assigned_node = #{record.assignedNode,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      create_by = #{record.createBy,jdbcType=VARCHAR},
      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      update_by = #{record.updateBy,jdbcType=VARCHAR},
      perform_user_type = #{record.performUserType,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.ruoyi.system.domain.task.TkCommonAssigned">
    update tk_common_assigned
    <set>
      <if test="commonTkId != null">
        common_tk_id = #{commonTkId,jdbcType=VARCHAR},
      </if>
      <if test="assignedUserId != null">
        assigned_user_id = #{assignedUserId,jdbcType=VARCHAR},
      </if>
      <if test="assignedUserName != null">
        assigned_user_name = #{assignedUserName,jdbcType=VARCHAR},
      </if>
      <if test="assignedRole != null">
        assigned_role = #{assignedRole,jdbcType=INTEGER},
      </if>
      <if test="beassignedUserId != null">
        beassigned_user_id = #{beassignedUserId,jdbcType=VARCHAR},
      </if>
      <if test="beassignedUserName != null">
        beassigned_user_name = #{beassignedUserName,jdbcType=VARCHAR},
      </if>
      <if test="beassignedRole != null">
        beassigned_role = #{beassignedRole,jdbcType=INTEGER},
      </if>
      <if test="assignedStatus != null">
        assigned_status = #{assignedStatus,jdbcType=INTEGER},
      </if>
      <if test="assignedEndTime != null">
        assigned_end_time = #{assignedEndTime,jdbcType=TIMESTAMP},
      </if>
      <if test="assignedNode != null">
        assigned_node = #{assignedNode,jdbcType=VARCHAR},
      </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="performUserType != null">
        perform_user_type = #{performUserType,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.ruoyi.system.domain.task.TkCommonAssigned">
    update tk_common_assigned
    set common_tk_id = #{commonTkId,jdbcType=VARCHAR},
      assigned_user_id = #{assignedUserId,jdbcType=VARCHAR},
      assigned_user_name = #{assignedUserName,jdbcType=VARCHAR},
      assigned_role = #{assignedRole,jdbcType=INTEGER},
      beassigned_user_id = #{beassignedUserId,jdbcType=VARCHAR},
      beassigned_user_name = #{beassignedUserName,jdbcType=VARCHAR},
      beassigned_role = #{beassignedRole,jdbcType=INTEGER},
      assigned_status = #{assignedStatus,jdbcType=INTEGER},
      assigned_end_time = #{assignedEndTime,jdbcType=TIMESTAMP},
      assigned_node = #{assignedNode,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      create_by = #{createBy,jdbcType=VARCHAR},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      update_by = #{updateBy,jdbcType=VARCHAR},
      perform_user_type = #{performUserType,jdbcType=VARCHAR}
    where id = #{id,jdbcType=VARCHAR}
  </update>
</mapper>