<?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.JbWorkMapper">
  <resultMap id="BaseResultMap" type="com.ruoyi.system.domain.md.JbWork">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="level" jdbcType="INTEGER" property="level" />
    <result column="createdTime" jdbcType="TIMESTAMP" property="createdtime" />
    <result column="createdBy" jdbcType="VARCHAR" property="createdby" />
    <result column="status" jdbcType="TINYINT" property="status" />
    <result column="finishTime" jdbcType="TIMESTAMP" property="finishtime" />
    <result column="clientId" jdbcType="VARCHAR" property="clientid" />
    <result column="url" jdbcType="VARCHAR" property="url" />
    <result column="pcurl" jdbcType="VARCHAR" property="pcurl" />
    <result column="orgId" jdbcType="VARCHAR" property="orgid" />
    <result column="appName" jdbcType="VARCHAR" property="appname" />
    <result column="create_name" jdbcType="VARCHAR" property="createName" />
  </resultMap>
  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.ruoyi.system.domain.md.JbWork">
    <result column="content" jdbcType="LONGVARCHAR" property="content" />
  </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, level, createdTime, createdBy, status, finishTime, clientId, url, pcurl, 
    orgId,appName,create_name
  </sql>
  <sql id="Blob_Column_List">
    content
  </sql>
  <select id="selectByExampleWithBLOBs" parameterType="com.ruoyi.system.domain.md.JbWorkExample" resultMap="ResultMapWithBLOBs">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from md_jb_work
    <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.md.JbWorkExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from md_jb_work
    <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="ResultMapWithBLOBs">
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from md_jb_work
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from md_jb_work
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="com.ruoyi.system.domain.md.JbWorkExample">
    delete from md_jb_work
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.ruoyi.system.domain.md.JbWork">
    insert into md_jb_work (id, name, level,
    createdTime, createdBy, status,
    finishTime, clientId, url,
    pcurl, orgId,appName,create_name,content
    )
    values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{level,jdbcType=INTEGER},
    #{createdtime,jdbcType=TIMESTAMP}, #{createdby,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT},
    #{finishtime,jdbcType=TIMESTAMP}, #{clientid,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR},
    #{pcurl,jdbcType=VARCHAR}, #{orgid,jdbcType=VARCHAR},#{appname,jdbcType=VARCHAR},#{createName,jdbcType=VARCHAR}, #{content,jdbcType=LONGVARCHAR}
    )
  </insert>
  <insert id="insertSelective" parameterType="com.ruoyi.system.domain.md.JbWork">
    insert into md_jb_work
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="name != null">
        name,
      </if>
      <if test="level != null">
        level,
      </if>
      <if test="createdtime != null">
        createdTime,
      </if>
      <if test="createdby != null">
        createdBy,
      </if>
      <if test="status != null">
        status,
      </if>
      <if test="finishtime != null">
        finishTime,
      </if>
      <if test="clientid != null">
        clientId,
      </if>
      <if test="url != null">
        url,
      </if>
      <if test="pcurl != null">
        pcurl,
      </if>
      <if test="orgid != null">
        orgId,
      </if>
      <if test="appname != null">
        appName,
      </if>
      <if test="createName != null">
        create_name,
      </if>
      <if test="content != null">
        content,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="level != null">
        #{level,jdbcType=INTEGER},
      </if>
      <if test="createdtime != null">
        #{createdtime,jdbcType=TIMESTAMP},
      </if>
      <if test="createdby != null">
        #{createdby,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        #{status,jdbcType=TINYINT},
      </if>
      <if test="finishtime != null">
        #{finishtime,jdbcType=TIMESTAMP},
      </if>
      <if test="clientid != null">
        #{clientid,jdbcType=VARCHAR},
      </if>
      <if test="url != null">
        #{url,jdbcType=VARCHAR},
      </if>
      <if test="pcurl != null">
        #{pcurl,jdbcType=VARCHAR},
      </if>
      <if test="orgid != null">
        #{orgid,jdbcType=VARCHAR},
      </if>
      <if test="appname != null">
        #{appname,jdbcType=VARCHAR},
      </if>
      <if test="createName != null">
        #{createName,jdbcType=VARCHAR},
      </if>
      <if test="content != null">
        #{content,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.ruoyi.system.domain.md.JbWorkExample" resultType="java.lang.Long">
    select count(*) from md_jb_work
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update md_jb_work
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=INTEGER},
      </if>
      <if test="record.name != null">
        name = #{record.name,jdbcType=VARCHAR},
      </if>
      <if test="record.level != null">
        level = #{record.level,jdbcType=INTEGER},
      </if>
      <if test="record.createdtime != null">
        createdTime = #{record.createdtime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.createdby != null">
        createdBy = #{record.createdby,jdbcType=VARCHAR},
      </if>
      <if test="record.status != null">
        status = #{record.status,jdbcType=TINYINT},
      </if>
      <if test="record.finishtime != null">
        finishTime = #{record.finishtime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.clientid != null">
        clientId = #{record.clientid,jdbcType=VARCHAR},
      </if>
      <if test="record.url != null">
        url = #{record.url,jdbcType=VARCHAR},
      </if>
      <if test="record.pcurl != null">
        pcurl = #{record.pcurl,jdbcType=VARCHAR},
      </if>
      <if test="record.orgid != null">
        orgId = #{record.orgid,jdbcType=VARCHAR},
      </if>
      <if test="record.appname != null">
        appName = #{record.appname,jdbcType=VARCHAR},
      </if>
      <if test="record.createName != null">
        create_name = #{record.createName,jdbcType=VARCHAR},
      </if>
      <if test="record.content != null">
        content = #{record.content,jdbcType=LONGVARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExampleWithBLOBs" parameterType="map">
    update md_jb_work
    set id = #{record.id,jdbcType=INTEGER},
      name = #{record.name,jdbcType=VARCHAR},
      level = #{record.level,jdbcType=INTEGER},
      createdTime = #{record.createdtime,jdbcType=TIMESTAMP},
      createdBy = #{record.createdby,jdbcType=VARCHAR},
      status = #{record.status,jdbcType=TINYINT},
      finishTime = #{record.finishtime,jdbcType=TIMESTAMP},
      clientId = #{record.clientid,jdbcType=VARCHAR},
      url = #{record.url,jdbcType=VARCHAR},
      pcurl = #{record.pcurl,jdbcType=VARCHAR},
      orgId = #{record.orgid,jdbcType=VARCHAR},
      appName = #{record.appname,jdbcType=VARCHAR},
      create_name = #{record.createName,jdbcType=VARCHAR},
    content = #{record.content,jdbcType=LONGVARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update md_jb_work
    set id = #{record.id,jdbcType=INTEGER},
      name = #{record.name,jdbcType=VARCHAR},
      level = #{record.level,jdbcType=INTEGER},
      createdTime = #{record.createdtime,jdbcType=TIMESTAMP},
      createdBy = #{record.createdby,jdbcType=VARCHAR},
      status = #{record.status,jdbcType=TINYINT},
      finishTime = #{record.finishtime,jdbcType=TIMESTAMP},
      clientId = #{record.clientid,jdbcType=VARCHAR},
      url = #{record.url,jdbcType=VARCHAR},
      pcurl = #{record.pcurl,jdbcType=VARCHAR},
      orgId = #{record.orgid,jdbcType=VARCHAR},
      appName = #{record.appname,jdbcType=VARCHAR},
      create_name = #{record.createName,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.ruoyi.system.domain.md.JbWork">
    update md_jb_work
    <set>
      <if test="name != null">
        name = #{name,jdbcType=VARCHAR},
      </if>
      <if test="level != null">
        level = #{level,jdbcType=INTEGER},
      </if>
      <if test="createdtime != null">
        createdTime = #{createdtime,jdbcType=TIMESTAMP},
      </if>
      <if test="createdby != null">
        createdBy = #{createdby,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        status = #{status,jdbcType=TINYINT},
      </if>
      <if test="finishtime != null">
        finishTime = #{finishtime,jdbcType=TIMESTAMP},
      </if>
      <if test="clientid != null">
        clientId = #{clientid,jdbcType=VARCHAR},
      </if>
      <if test="url != null">
        url = #{url,jdbcType=VARCHAR},
      </if>
      <if test="pcurl != null">
        pcurl = #{pcurl,jdbcType=VARCHAR},
      </if>
      <if test="orgid != null">
        orgId = #{orgid,jdbcType=VARCHAR},
      </if>
      <if test="appname != null">
        appName = #{appname,jdbcType=VARCHAR},
      </if>
      <if test="createName != null">
        create_name = #{createName,jdbcType=VARCHAR},
      </if>
      <if test="content != null">
        content = #{content,jdbcType=LONGVARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.ruoyi.system.domain.md.JbWork">
    update md_jb_work
    set name = #{name,jdbcType=VARCHAR},
      level = #{level,jdbcType=INTEGER},
      createdTime = #{createdtime,jdbcType=TIMESTAMP},
      createdBy = #{createdby,jdbcType=VARCHAR},
      status = #{status,jdbcType=TINYINT},
      finishTime = #{finishtime,jdbcType=TIMESTAMP},
      clientId = #{clientid,jdbcType=VARCHAR},
      url = #{url,jdbcType=VARCHAR},
      pcurl = #{pcurl,jdbcType=VARCHAR},
      orgId = #{orgid,jdbcType=VARCHAR},
      appName = #{appname,jdbcType=VARCHAR},
      create_name = #{createName,jdbcType=VARCHAR},
      content = #{content,jdbcType=LONGVARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.ruoyi.system.domain.md.JbWork">
    update md_jb_work
    set name = #{name,jdbcType=VARCHAR},
      level = #{level,jdbcType=INTEGER},
      createdTime = #{createdtime,jdbcType=TIMESTAMP},
      createdBy = #{createdby,jdbcType=VARCHAR},
      status = #{status,jdbcType=TINYINT},
      finishTime = #{finishtime,jdbcType=TIMESTAMP},
      clientId = #{clientid,jdbcType=VARCHAR},
      url = #{url,jdbcType=VARCHAR},
      pcurl = #{pcurl,jdbcType=VARCHAR},
      orgId = #{orgid,jdbcType=VARCHAR},
      appName = #{appname,jdbcType=VARCHAR},
      create_name = #{createName,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>