<?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.project.system.mapper.TabBlogMapper" >
  <resultMap id="BaseResultMap" type="com.ruoyi.project.system.domain.TabBlog" >
    <id column="b_id" property="bId" jdbcType="INTEGER" />
    <result column="title" property="title" jdbcType="VARCHAR" />
    <result column="title_img" property="titleImg" jdbcType="VARCHAR" />
    <result column="user" property="user" jdbcType="VARCHAR" />
    <result column="type" property="type" jdbcType="CHAR" />
    <result column="label" property="label" jdbcType="VARCHAR" />
    <result column="status" property="status" jdbcType="INTEGER" />
    <result column="create_by" property="createBy" jdbcType="VARCHAR" />
    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
    <result column="update_by" property="updateBy" jdbcType="VARCHAR" />
    <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
  </resultMap>
  <resultMap id="ResultMapWithBLOBs" type="com.ruoyi.project.system.domain.TabBlog" extends="BaseResultMap" >
    <result column="content" property="content" jdbcType="LONGVARCHAR" />
  </resultMap>
  <sql id="Example_Where_Clause" >
    <where >
      <foreach collection="oredCriteria" item="criteria" separator="or" >
        <if test="criteria.valid" >
          <trim prefix="(" suffix=")" prefixOverrides="and" >
            <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 collection="criterion.value" item="listItem" open="(" close=")" 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="(" suffix=")" prefixOverrides="and" >
            <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 collection="criterion.value" item="listItem" open="(" close=")" separator="," >
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List" >
    b_id, title, title_img, user, type, label, status, create_by, create_time, update_by, 
    update_time
  </sql>
  <sql id="Blob_Column_List" >
    content
  </sql>
  <select id="selectByExampleWithBLOBs" resultMap="ResultMapWithBLOBs" parameterType="com.ruoyi.project.system.domain.TabBlogExample" >
    select
    <if test="distinct" >
      distinct
    </if>
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from tab_blog
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null" >
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.ruoyi.project.system.domain.TabBlogExample" >
    select
    <if test="distinct" >
      distinct
    </if>
    <include refid="Base_Column_List" />
    from tab_blog
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null" >
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Integer" >
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from tab_blog
    where b_id = #{bId,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
    delete from tab_blog
    where b_id = #{bId,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="com.ruoyi.project.system.domain.TabBlogExample" >
    delete from tab_blog
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.ruoyi.project.system.domain.TabBlog" >
    insert into tab_blog (b_id, title, title_img, 
      user, type, label, status, 
      create_by, create_time, update_by, 
      update_time, content)
    values (#{bId,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR}, #{titleImg,jdbcType=VARCHAR}, 
      #{user,jdbcType=VARCHAR}, #{type,jdbcType=CHAR}, #{label,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, 
      #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, 
      #{updateTime,jdbcType=TIMESTAMP}, #{content,jdbcType=LONGVARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.ruoyi.project.system.domain.TabBlog" >
    insert into tab_blog
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="bId != null" >
        b_id,
      </if>
      <if test="title != null" >
        title,
      </if>
      <if test="titleImg != null" >
        title_img,
      </if>
      <if test="user != null" >
        user,
      </if>
      <if test="type != null" >
        type,
      </if>
      <if test="label != null" >
        label,
      </if>
      <if test="status != null" >
        status,
      </if>
      <if test="createBy != null" >
        create_by,
      </if>
      <if test="createTime != null" >
        create_time,
      </if>
      <if test="updateBy != null" >
        update_by,
      </if>
      <if test="updateTime != null" >
        update_time,
      </if>
      <if test="content != null" >
        content,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="bId != null" >
        #{bId,jdbcType=INTEGER},
      </if>
      <if test="title != null" >
        #{title,jdbcType=VARCHAR},
      </if>
      <if test="titleImg != null" >
        #{titleImg,jdbcType=VARCHAR},
      </if>
      <if test="user != null" >
        #{user,jdbcType=VARCHAR},
      </if>
      <if test="type != null" >
        #{type,jdbcType=CHAR},
      </if>
      <if test="label != null" >
        #{label,jdbcType=VARCHAR},
      </if>
      <if test="status != null" >
        #{status,jdbcType=INTEGER},
      </if>
      <if test="createBy != null" >
        #{createBy,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="content != null" >
        #{content,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.ruoyi.project.system.domain.TabBlogExample" resultType="java.lang.Integer" >
    select count(*) from tab_blog
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map" >
    update tab_blog
    <set >
      <if test="record.bId != null" >
        b_id = #{record.bId,jdbcType=INTEGER},
      </if>
      <if test="record.title != null" >
        title = #{record.title,jdbcType=VARCHAR},
      </if>
      <if test="record.titleImg != null" >
        title_img = #{record.titleImg,jdbcType=VARCHAR},
      </if>
      <if test="record.user != null" >
        user = #{record.user,jdbcType=VARCHAR},
      </if>
      <if test="record.type != null" >
        type = #{record.type,jdbcType=CHAR},
      </if>
      <if test="record.label != null" >
        label = #{record.label,jdbcType=VARCHAR},
      </if>
      <if test="record.status != null" >
        status = #{record.status,jdbcType=INTEGER},
      </if>
      <if test="record.createBy != null" >
        create_by = #{record.createBy,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.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 tab_blog
    set b_id = #{record.bId,jdbcType=INTEGER},
      title = #{record.title,jdbcType=VARCHAR},
      title_img = #{record.titleImg,jdbcType=VARCHAR},
      user = #{record.user,jdbcType=VARCHAR},
      type = #{record.type,jdbcType=CHAR},
      label = #{record.label,jdbcType=VARCHAR},
      status = #{record.status,jdbcType=INTEGER},
      create_by = #{record.createBy,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      update_by = #{record.updateBy,jdbcType=VARCHAR},
      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      content = #{record.content,jdbcType=LONGVARCHAR}
    <if test="_parameter != null" >
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map" >
    update tab_blog
    set b_id = #{record.bId,jdbcType=INTEGER},
      title = #{record.title,jdbcType=VARCHAR},
      title_img = #{record.titleImg,jdbcType=VARCHAR},
      user = #{record.user,jdbcType=VARCHAR},
      type = #{record.type,jdbcType=CHAR},
      label = #{record.label,jdbcType=VARCHAR},
      status = #{record.status,jdbcType=INTEGER},
      create_by = #{record.createBy,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.project.system.domain.TabBlog" >
    update tab_blog
    <set >
      <if test="title != null" >
        title = #{title,jdbcType=VARCHAR},
      </if>
      <if test="titleImg != null" >
        title_img = #{titleImg,jdbcType=VARCHAR},
      </if>
      <if test="user != null" >
        user = #{user,jdbcType=VARCHAR},
      </if>
      <if test="type != null" >
        type = #{type,jdbcType=CHAR},
      </if>
      <if test="label != null" >
        label = #{label,jdbcType=VARCHAR},
      </if>
      <if test="status != null" >
        status = #{status,jdbcType=INTEGER},
      </if>
      <if test="createBy != null" >
        create_by = #{createBy,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="content != null" >
        content = #{content,jdbcType=LONGVARCHAR},
      </if>
    </set>
    where b_id = #{bId,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.ruoyi.project.system.domain.TabBlog" >
    update tab_blog
    set title = #{title,jdbcType=VARCHAR},
      title_img = #{titleImg,jdbcType=VARCHAR},
      user = #{user,jdbcType=VARCHAR},
      type = #{type,jdbcType=CHAR},
      label = #{label,jdbcType=VARCHAR},
      status = #{status,jdbcType=INTEGER},
      create_by = #{createBy,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      update_by = #{updateBy,jdbcType=VARCHAR},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      content = #{content,jdbcType=LONGVARCHAR}
    where b_id = #{bId,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.ruoyi.project.system.domain.TabBlog" >
    update tab_blog
    set title = #{title,jdbcType=VARCHAR},
      title_img = #{titleImg,jdbcType=VARCHAR},
      user = #{user,jdbcType=VARCHAR},
      type = #{type,jdbcType=CHAR},
      label = #{label,jdbcType=VARCHAR},
      status = #{status,jdbcType=INTEGER},
      create_by = #{createBy,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      update_by = #{updateBy,jdbcType=VARCHAR},
      update_time = #{updateTime,jdbcType=TIMESTAMP}
    where b_id = #{bId,jdbcType=INTEGER}
  </update>
</mapper>