<?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.md.JbWorkUserMapper">
  <resultMap id="BaseResultMap" type="com.ruoyi.system.domain.md.JbWorkUser">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="workId" jdbcType="INTEGER" property="workid" />
    <result column="userId" jdbcType="VARCHAR" property="userid" />
    <result column="createdTime" jdbcType="TIMESTAMP" property="createdtime" />
    <result column="finishTime" jdbcType="TIMESTAMP" property="finishtime" />
    <result column="isDone" jdbcType="TINYINT" property="isdone" />
    <result column="orgId" jdbcType="VARCHAR" property="orgid" />
  </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, workId, userId, createdTime, finishTime, isDone, orgId
  </sql>
  <select id="selectByExample" parameterType="com.ruoyi.system.domain.md.JbWorkUserExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from md_jb_work_user
    <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.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from md_jb_work_user
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from md_jb_work_user
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="com.ruoyi.system.domain.md.JbWorkUserExample">
    delete from md_jb_work_user
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.ruoyi.system.domain.md.JbWorkUser">
    insert into md_jb_work_user (id, workId, userId,
      createdTime, finishTime, isDone, 
      orgId)
    values (#{id,jdbcType=INTEGER}, #{workid,jdbcType=INTEGER}, #{userid,jdbcType=VARCHAR}, 
      #{createdtime,jdbcType=TIMESTAMP}, #{finishtime,jdbcType=TIMESTAMP}, #{isdone,jdbcType=TINYINT}, 
      #{orgid,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.ruoyi.system.domain.md.JbWorkUser">
    insert into md_jb_work_user
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="workid != null">
        workId,
      </if>
      <if test="userid != null">
        userId,
      </if>
      <if test="createdtime != null">
        createdTime,
      </if>
      <if test="finishtime != null">
        finishTime,
      </if>
      <if test="isdone != null">
        isDone,
      </if>
      <if test="orgid != null">
        orgId,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="workid != null">
        #{workid,jdbcType=INTEGER},
      </if>
      <if test="userid != null">
        #{userid,jdbcType=VARCHAR},
      </if>
      <if test="createdtime != null">
        #{createdtime,jdbcType=TIMESTAMP},
      </if>
      <if test="finishtime != null">
        #{finishtime,jdbcType=TIMESTAMP},
      </if>
      <if test="isdone != null">
        #{isdone,jdbcType=TINYINT},
      </if>
      <if test="orgid != null">
        #{orgid,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.ruoyi.system.domain.md.JbWorkUserExample" resultType="java.lang.Long">
    select count(*) from md_jb_work_user
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update md_jb_work_user
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=INTEGER},
      </if>
      <if test="record.workid != null">
        workId = #{record.workid,jdbcType=INTEGER},
      </if>
      <if test="record.userid != null">
        userId = #{record.userid,jdbcType=VARCHAR},
      </if>
      <if test="record.createdtime != null">
        createdTime = #{record.createdtime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.finishtime != null">
        finishTime = #{record.finishtime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.isdone != null">
        isDone = #{record.isdone,jdbcType=TINYINT},
      </if>
      <if test="record.orgid != null">
        orgId = #{record.orgid,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update md_jb_work_user
    set id = #{record.id,jdbcType=INTEGER},
      workId = #{record.workid,jdbcType=INTEGER},
      userId = #{record.userid,jdbcType=VARCHAR},
      createdTime = #{record.createdtime,jdbcType=TIMESTAMP},
      finishTime = #{record.finishtime,jdbcType=TIMESTAMP},
      isDone = #{record.isdone,jdbcType=TINYINT},
      orgId = #{record.orgid,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.ruoyi.system.domain.md.JbWorkUser">
    update md_jb_work_user
    <set>
      <if test="workid != null">
        workId = #{workid,jdbcType=INTEGER},
      </if>
      <if test="userid != null">
        userId = #{userid,jdbcType=VARCHAR},
      </if>
      <if test="createdtime != null">
        createdTime = #{createdtime,jdbcType=TIMESTAMP},
      </if>
      <if test="finishtime != null">
        finishTime = #{finishtime,jdbcType=TIMESTAMP},
      </if>
      <if test="isdone != null">
        isDone = #{isdone,jdbcType=TINYINT},
      </if>
      <if test="orgid != null">
        orgId = #{orgid,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.ruoyi.system.domain.md.JbWorkUser">
    update md_jb_work_user
    set workId = #{workid,jdbcType=INTEGER},
      userId = #{userid,jdbcType=VARCHAR},
      createdTime = #{createdtime,jdbcType=TIMESTAMP},
      finishTime = #{finishtime,jdbcType=TIMESTAMP},
      isDone = #{isdone,jdbcType=TINYINT},
      orgId = #{orgid,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
 
</mapper>