<?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.bailuntec.mapper.DcBaseBailuncategoryMapper">
  <resultMap id="BaseResultMap" type="com.bailuntec.domain.entity.DcBaseBailuncategory">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="c_id" jdbcType="INTEGER" property="cId" />
    <result column="c_parentid" jdbcType="INTEGER" property="cParentid" />
    <result column="c_ename" jdbcType="VARCHAR" property="cEname" />
    <result column="c_cname" jdbcType="VARCHAR" property="cCname" />
    <result column="c_sort" jdbcType="INTEGER" property="cSort" />
    <result column="c_level" jdbcType="INTEGER" property="cLevel" />
    <result column="path" jdbcType="VARCHAR" property="path" />
    <result column="c_name" jdbcType="VARCHAR" property="cName" />
    <result column="gmt_create" jdbcType="TIMESTAMP" property="gmtCreate" />
    <result column="gmt_modified" jdbcType="TIMESTAMP" property="gmtModified" />
    <result column="has_delete" jdbcType="INTEGER" property="hasDelete" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <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">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <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">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    id, c_id, c_parentid, c_ename, c_cname, c_sort, c_level, path, c_name, gmt_create, 
    gmt_modified, has_delete
  </sql>
  <select id="selectByExample" parameterType="com.bailuntec.domain.example.DcBaseBailuncategoryExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from dc_base_bailuncategory
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
    <if test="rows != null">
      <if test="offset != null">
        limit ${offset}, ${rows}
      </if>
      <if test="offset == null">
        limit ${rows}
      </if>
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select 
    <include refid="Base_Column_List" />
    from dc_base_bailuncategory
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from dc_base_bailuncategory
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="com.bailuntec.domain.example.DcBaseBailuncategoryExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from dc_base_bailuncategory
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.bailuntec.domain.entity.DcBaseBailuncategory">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into dc_base_bailuncategory (id, c_id, c_parentid, 
      c_ename, c_cname, c_sort, 
      c_level, path, c_name, 
      gmt_create, gmt_modified, has_delete
      )
    values (#{id,jdbcType=INTEGER}, #{cId,jdbcType=INTEGER}, #{cParentid,jdbcType=INTEGER}, 
      #{cEname,jdbcType=VARCHAR}, #{cCname,jdbcType=VARCHAR}, #{cSort,jdbcType=INTEGER}, 
      #{cLevel,jdbcType=INTEGER}, #{path,jdbcType=VARCHAR}, #{cName,jdbcType=VARCHAR}, 
      #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP}, #{hasDelete,jdbcType=INTEGER}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.bailuntec.domain.entity.DcBaseBailuncategory">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into dc_base_bailuncategory
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="cId != null">
        c_id,
      </if>
      <if test="cParentid != null">
        c_parentid,
      </if>
      <if test="cEname != null">
        c_ename,
      </if>
      <if test="cCname != null">
        c_cname,
      </if>
      <if test="cSort != null">
        c_sort,
      </if>
      <if test="cLevel != null">
        c_level,
      </if>
      <if test="path != null">
        path,
      </if>
      <if test="cName != null">
        c_name,
      </if>
      <if test="gmtCreate != null">
        gmt_create,
      </if>
      <if test="gmtModified != null">
        gmt_modified,
      </if>
      <if test="hasDelete != null">
        has_delete,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="cId != null">
        #{cId,jdbcType=INTEGER},
      </if>
      <if test="cParentid != null">
        #{cParentid,jdbcType=INTEGER},
      </if>
      <if test="cEname != null">
        #{cEname,jdbcType=VARCHAR},
      </if>
      <if test="cCname != null">
        #{cCname,jdbcType=VARCHAR},
      </if>
      <if test="cSort != null">
        #{cSort,jdbcType=INTEGER},
      </if>
      <if test="cLevel != null">
        #{cLevel,jdbcType=INTEGER},
      </if>
      <if test="path != null">
        #{path,jdbcType=VARCHAR},
      </if>
      <if test="cName != null">
        #{cName,jdbcType=VARCHAR},
      </if>
      <if test="gmtCreate != null">
        #{gmtCreate,jdbcType=TIMESTAMP},
      </if>
      <if test="gmtModified != null">
        #{gmtModified,jdbcType=TIMESTAMP},
      </if>
      <if test="hasDelete != null">
        #{hasDelete,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.bailuntec.domain.example.DcBaseBailuncategoryExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from dc_base_bailuncategory
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update dc_base_bailuncategory
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=INTEGER},
      </if>
      <if test="record.cId != null">
        c_id = #{record.cId,jdbcType=INTEGER},
      </if>
      <if test="record.cParentid != null">
        c_parentid = #{record.cParentid,jdbcType=INTEGER},
      </if>
      <if test="record.cEname != null">
        c_ename = #{record.cEname,jdbcType=VARCHAR},
      </if>
      <if test="record.cCname != null">
        c_cname = #{record.cCname,jdbcType=VARCHAR},
      </if>
      <if test="record.cSort != null">
        c_sort = #{record.cSort,jdbcType=INTEGER},
      </if>
      <if test="record.cLevel != null">
        c_level = #{record.cLevel,jdbcType=INTEGER},
      </if>
      <if test="record.path != null">
        path = #{record.path,jdbcType=VARCHAR},
      </if>
      <if test="record.cName != null">
        c_name = #{record.cName,jdbcType=VARCHAR},
      </if>
      <if test="record.gmtCreate != null">
        gmt_create = #{record.gmtCreate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.gmtModified != null">
        gmt_modified = #{record.gmtModified,jdbcType=TIMESTAMP},
      </if>
      <if test="record.hasDelete != null">
        has_delete = #{record.hasDelete,jdbcType=INTEGER},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update dc_base_bailuncategory
    set id = #{record.id,jdbcType=INTEGER},
      c_id = #{record.cId,jdbcType=INTEGER},
      c_parentid = #{record.cParentid,jdbcType=INTEGER},
      c_ename = #{record.cEname,jdbcType=VARCHAR},
      c_cname = #{record.cCname,jdbcType=VARCHAR},
      c_sort = #{record.cSort,jdbcType=INTEGER},
      c_level = #{record.cLevel,jdbcType=INTEGER},
      path = #{record.path,jdbcType=VARCHAR},
      c_name = #{record.cName,jdbcType=VARCHAR},
      gmt_create = #{record.gmtCreate,jdbcType=TIMESTAMP},
      gmt_modified = #{record.gmtModified,jdbcType=TIMESTAMP},
      has_delete = #{record.hasDelete,jdbcType=INTEGER}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.bailuntec.domain.entity.DcBaseBailuncategory">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update dc_base_bailuncategory
    <set>
      <if test="cId != null">
        c_id = #{cId,jdbcType=INTEGER},
      </if>
      <if test="cParentid != null">
        c_parentid = #{cParentid,jdbcType=INTEGER},
      </if>
      <if test="cEname != null">
        c_ename = #{cEname,jdbcType=VARCHAR},
      </if>
      <if test="cCname != null">
        c_cname = #{cCname,jdbcType=VARCHAR},
      </if>
      <if test="cSort != null">
        c_sort = #{cSort,jdbcType=INTEGER},
      </if>
      <if test="cLevel != null">
        c_level = #{cLevel,jdbcType=INTEGER},
      </if>
      <if test="path != null">
        path = #{path,jdbcType=VARCHAR},
      </if>
      <if test="cName != null">
        c_name = #{cName,jdbcType=VARCHAR},
      </if>
      <if test="gmtCreate != null">
        gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
      </if>
      <if test="gmtModified != null">
        gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
      </if>
      <if test="hasDelete != null">
        has_delete = #{hasDelete,jdbcType=INTEGER},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.bailuntec.domain.entity.DcBaseBailuncategory">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update dc_base_bailuncategory
    set c_id = #{cId,jdbcType=INTEGER},
      c_parentid = #{cParentid,jdbcType=INTEGER},
      c_ename = #{cEname,jdbcType=VARCHAR},
      c_cname = #{cCname,jdbcType=VARCHAR},
      c_sort = #{cSort,jdbcType=INTEGER},
      c_level = #{cLevel,jdbcType=INTEGER},
      path = #{path,jdbcType=VARCHAR},
      c_name = #{cName,jdbcType=VARCHAR},
      gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
      gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
      has_delete = #{hasDelete,jdbcType=INTEGER}
    where id = #{id,jdbcType=INTEGER}
  </update>
  <insert id="upsertSelective" parameterType="com.bailuntec.domain.entity.DcBaseBailuncategory">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      @project https://github.com/itfsw/mybatis-generator-plugin
    -->
    insert into dc_base_bailuncategory
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="cId != null">
        c_id,
      </if>
      <if test="cParentid != null">
        c_parentid,
      </if>
      <if test="cEname != null">
        c_ename,
      </if>
      <if test="cCname != null">
        c_cname,
      </if>
      <if test="cSort != null">
        c_sort,
      </if>
      <if test="cLevel != null">
        c_level,
      </if>
      <if test="path != null">
        path,
      </if>
      <if test="cName != null">
        c_name,
      </if>
      <if test="gmtCreate != null">
        gmt_create,
      </if>
      <if test="gmtModified != null">
        gmt_modified,
      </if>
      <if test="hasDelete != null">
        has_delete,
      </if>
    </trim>
    values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="cId != null">
        #{cId,jdbcType=INTEGER},
      </if>
      <if test="cParentid != null">
        #{cParentid,jdbcType=INTEGER},
      </if>
      <if test="cEname != null">
        #{cEname,jdbcType=VARCHAR},
      </if>
      <if test="cCname != null">
        #{cCname,jdbcType=VARCHAR},
      </if>
      <if test="cSort != null">
        #{cSort,jdbcType=INTEGER},
      </if>
      <if test="cLevel != null">
        #{cLevel,jdbcType=INTEGER},
      </if>
      <if test="path != null">
        #{path,jdbcType=VARCHAR},
      </if>
      <if test="cName != null">
        #{cName,jdbcType=VARCHAR},
      </if>
      <if test="gmtCreate != null">
        #{gmtCreate,jdbcType=TIMESTAMP},
      </if>
      <if test="gmtModified != null">
        #{gmtModified,jdbcType=TIMESTAMP},
      </if>
      <if test="hasDelete != null">
        #{hasDelete,jdbcType=INTEGER},
      </if>
    </trim>
    on duplicate key update 
    <trim suffixOverrides=",">
      <if test="id != null">
        id = #{id,jdbcType=INTEGER},
      </if>
      <if test="cId != null">
        c_id = #{cId,jdbcType=INTEGER},
      </if>
      <if test="cParentid != null">
        c_parentid = #{cParentid,jdbcType=INTEGER},
      </if>
      <if test="cEname != null">
        c_ename = #{cEname,jdbcType=VARCHAR},
      </if>
      <if test="cCname != null">
        c_cname = #{cCname,jdbcType=VARCHAR},
      </if>
      <if test="cSort != null">
        c_sort = #{cSort,jdbcType=INTEGER},
      </if>
      <if test="cLevel != null">
        c_level = #{cLevel,jdbcType=INTEGER},
      </if>
      <if test="path != null">
        path = #{path,jdbcType=VARCHAR},
      </if>
      <if test="cName != null">
        c_name = #{cName,jdbcType=VARCHAR},
      </if>
      <if test="gmtCreate != null">
        gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
      </if>
      <if test="gmtModified != null">
        gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
      </if>
      <if test="hasDelete != null">
        has_delete = #{hasDelete,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <insert id="upsert" parameterType="com.bailuntec.domain.entity.DcBaseBailuncategory">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      @project https://github.com/itfsw/mybatis-generator-plugin
    -->
    insert into dc_base_bailuncategory
    (id, c_id, c_parentid, c_ename, c_cname, c_sort, c_level, path, c_name, gmt_create, 
      gmt_modified, has_delete)
    values
    (#{id,jdbcType=INTEGER}, #{cId,jdbcType=INTEGER}, #{cParentid,jdbcType=INTEGER}, 
      #{cEname,jdbcType=VARCHAR}, #{cCname,jdbcType=VARCHAR}, #{cSort,jdbcType=INTEGER}, 
      #{cLevel,jdbcType=INTEGER}, #{path,jdbcType=VARCHAR}, #{cName,jdbcType=VARCHAR}, 
      #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP}, #{hasDelete,jdbcType=INTEGER}
      )
    on duplicate key update 
    id = #{id,jdbcType=INTEGER}, 
    c_id = #{cId,jdbcType=INTEGER}, 
    c_parentid = #{cParentid,jdbcType=INTEGER}, 
    c_ename = #{cEname,jdbcType=VARCHAR}, 
    c_cname = #{cCname,jdbcType=VARCHAR}, 
    c_sort = #{cSort,jdbcType=INTEGER}, 
    c_level = #{cLevel,jdbcType=INTEGER}, 
    path = #{path,jdbcType=VARCHAR}, 
    c_name = #{cName,jdbcType=VARCHAR}, 
    gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, 
    gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, 
    has_delete = #{hasDelete,jdbcType=INTEGER}
  </insert>
  <select id="selectOneByExample" parameterType="com.bailuntec.domain.example.DcBaseBailuncategoryExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      @project https://github.com/itfsw/mybatis-generator-plugin
    -->
    select
    <include refid="Base_Column_List" />
    from dc_base_bailuncategory
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
    limit 1
  </select>
</mapper>