<?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.DcBaseSkuSimpleCategoryMapper">
  <resultMap id="BaseResultMap" type="com.bailuntec.domain.entity.DcBaseSkuSimpleCategory">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="parent_id" jdbcType="INTEGER" property="parentId" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="full_name" jdbcType="VARCHAR" property="fullName" />
    <result column="level" jdbcType="INTEGER" property="level" />
    <result column="skums_id" jdbcType="INTEGER" property="skumsId" />
    <result column="bj_create" jdbcType="TIMESTAMP" property="bjCreate" />
    <result column="bj_modified" jdbcType="TIMESTAMP" property="bjModified" />
  </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, parent_id, name, full_name, level, skums_id, bj_create, bj_modified
  </sql>
  <select id="selectByExample" parameterType="com.bailuntec.domain.example.DcBaseSkuSimpleCategoryExample" 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_sku_simple_category
    <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_sku_simple_category
    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_sku_simple_category
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="com.bailuntec.domain.example.DcBaseSkuSimpleCategoryExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from dc_base_sku_simple_category
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.bailuntec.domain.entity.DcBaseSkuSimpleCategory">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into dc_base_sku_simple_category (id, parent_id, name, 
      full_name, level, skums_id, 
      bj_create, bj_modified)
    values (#{id,jdbcType=INTEGER}, #{parentId,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, 
      #{fullName,jdbcType=VARCHAR}, #{level,jdbcType=INTEGER}, #{skumsId,jdbcType=INTEGER}, 
      #{bjCreate,jdbcType=TIMESTAMP}, #{bjModified,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="com.bailuntec.domain.entity.DcBaseSkuSimpleCategory">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into dc_base_sku_simple_category
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="parentId != null">
        parent_id,
      </if>
      <if test="name != null">
        name,
      </if>
      <if test="fullName != null">
        full_name,
      </if>
      <if test="level != null">
        level,
      </if>
      <if test="skumsId != null">
        skums_id,
      </if>
      <if test="bjCreate != null">
        bj_create,
      </if>
      <if test="bjModified != null">
        bj_modified,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="parentId != null">
        #{parentId,jdbcType=INTEGER},
      </if>
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="fullName != null">
        #{fullName,jdbcType=VARCHAR},
      </if>
      <if test="level != null">
        #{level,jdbcType=INTEGER},
      </if>
      <if test="skumsId != null">
        #{skumsId,jdbcType=INTEGER},
      </if>
      <if test="bjCreate != null">
        #{bjCreate,jdbcType=TIMESTAMP},
      </if>
      <if test="bjModified != null">
        #{bjModified,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.bailuntec.domain.example.DcBaseSkuSimpleCategoryExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from dc_base_sku_simple_category
    <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_sku_simple_category
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=INTEGER},
      </if>
      <if test="record.parentId != null">
        parent_id = #{record.parentId,jdbcType=INTEGER},
      </if>
      <if test="record.name != null">
        name = #{record.name,jdbcType=VARCHAR},
      </if>
      <if test="record.fullName != null">
        full_name = #{record.fullName,jdbcType=VARCHAR},
      </if>
      <if test="record.level != null">
        level = #{record.level,jdbcType=INTEGER},
      </if>
      <if test="record.skumsId != null">
        skums_id = #{record.skumsId,jdbcType=INTEGER},
      </if>
      <if test="record.bjCreate != null">
        bj_create = #{record.bjCreate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.bjModified != null">
        bj_modified = #{record.bjModified,jdbcType=TIMESTAMP},
      </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_sku_simple_category
    set id = #{record.id,jdbcType=INTEGER},
      parent_id = #{record.parentId,jdbcType=INTEGER},
      name = #{record.name,jdbcType=VARCHAR},
      full_name = #{record.fullName,jdbcType=VARCHAR},
      level = #{record.level,jdbcType=INTEGER},
      skums_id = #{record.skumsId,jdbcType=INTEGER},
      bj_create = #{record.bjCreate,jdbcType=TIMESTAMP},
      bj_modified = #{record.bjModified,jdbcType=TIMESTAMP}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.bailuntec.domain.entity.DcBaseSkuSimpleCategory">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update dc_base_sku_simple_category
    <set>
      <if test="parentId != null">
        parent_id = #{parentId,jdbcType=INTEGER},
      </if>
      <if test="name != null">
        name = #{name,jdbcType=VARCHAR},
      </if>
      <if test="fullName != null">
        full_name = #{fullName,jdbcType=VARCHAR},
      </if>
      <if test="level != null">
        level = #{level,jdbcType=INTEGER},
      </if>
      <if test="skumsId != null">
        skums_id = #{skumsId,jdbcType=INTEGER},
      </if>
      <if test="bjCreate != null">
        bj_create = #{bjCreate,jdbcType=TIMESTAMP},
      </if>
      <if test="bjModified != null">
        bj_modified = #{bjModified,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.bailuntec.domain.entity.DcBaseSkuSimpleCategory">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update dc_base_sku_simple_category
    set parent_id = #{parentId,jdbcType=INTEGER},
      name = #{name,jdbcType=VARCHAR},
      full_name = #{fullName,jdbcType=VARCHAR},
      level = #{level,jdbcType=INTEGER},
      skums_id = #{skumsId,jdbcType=INTEGER},
      bj_create = #{bjCreate,jdbcType=TIMESTAMP},
      bj_modified = #{bjModified,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=INTEGER}
  </update>
  <insert id="upsertSelective" parameterType="com.bailuntec.domain.entity.DcBaseSkuSimpleCategory">
    <!--
      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_sku_simple_category
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="parentId != null">
        parent_id,
      </if>
      <if test="name != null">
        name,
      </if>
      <if test="fullName != null">
        full_name,
      </if>
      <if test="level != null">
        level,
      </if>
      <if test="skumsId != null">
        skums_id,
      </if>
      <if test="bjCreate != null">
        bj_create,
      </if>
      <if test="bjModified != null">
        bj_modified,
      </if>
    </trim>
    values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="parentId != null">
        #{parentId,jdbcType=INTEGER},
      </if>
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="fullName != null">
        #{fullName,jdbcType=VARCHAR},
      </if>
      <if test="level != null">
        #{level,jdbcType=INTEGER},
      </if>
      <if test="skumsId != null">
        #{skumsId,jdbcType=INTEGER},
      </if>
      <if test="bjCreate != null">
        #{bjCreate,jdbcType=TIMESTAMP},
      </if>
      <if test="bjModified != null">
        #{bjModified,jdbcType=TIMESTAMP},
      </if>
    </trim>
    on duplicate key update 
    <trim suffixOverrides=",">
      <if test="id != null">
        id = #{id,jdbcType=INTEGER},
      </if>
      <if test="parentId != null">
        parent_id = #{parentId,jdbcType=INTEGER},
      </if>
      <if test="name != null">
        name = #{name,jdbcType=VARCHAR},
      </if>
      <if test="fullName != null">
        full_name = #{fullName,jdbcType=VARCHAR},
      </if>
      <if test="level != null">
        level = #{level,jdbcType=INTEGER},
      </if>
      <if test="skumsId != null">
        skums_id = #{skumsId,jdbcType=INTEGER},
      </if>
      <if test="bjCreate != null">
        bj_create = #{bjCreate,jdbcType=TIMESTAMP},
      </if>
      <if test="bjModified != null">
        bj_modified = #{bjModified,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <insert id="upsert" parameterType="com.bailuntec.domain.entity.DcBaseSkuSimpleCategory">
    <!--
      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_sku_simple_category
    (id, parent_id, name, full_name, level, skums_id, bj_create, bj_modified)
    values
    (#{id,jdbcType=INTEGER}, #{parentId,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, 
      #{fullName,jdbcType=VARCHAR}, #{level,jdbcType=INTEGER}, #{skumsId,jdbcType=INTEGER}, 
      #{bjCreate,jdbcType=TIMESTAMP}, #{bjModified,jdbcType=TIMESTAMP})
    on duplicate key update 
    id = #{id,jdbcType=INTEGER}, 
    parent_id = #{parentId,jdbcType=INTEGER}, 
    name = #{name,jdbcType=VARCHAR}, 
    full_name = #{fullName,jdbcType=VARCHAR}, 
    level = #{level,jdbcType=INTEGER}, 
    skums_id = #{skumsId,jdbcType=INTEGER}, 
    bj_create = #{bjCreate,jdbcType=TIMESTAMP}, 
    bj_modified = #{bjModified,jdbcType=TIMESTAMP}
  </insert>
  <select id="selectOneByExample" parameterType="com.bailuntec.domain.example.DcBaseSkuSimpleCategoryExample" 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_sku_simple_category
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
    limit 1
  </select>
</mapper>