<?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="org.linlinjava.jz.db.dao.JzDmLabelMapper">
  <resultMap id="BaseResultMap" type="org.linlinjava.jz.db.domain.JzDmLabel">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="label_name" jdbcType="VARCHAR" property="labelName" />
    <result column="label_type" jdbcType="SMALLINT" property="labelType" />
    <result column="label_tb" jdbcType="VARCHAR" property="labelTb" />
    <result column="label_column" jdbcType="VARCHAR" property="labelColumn" />
    <result column="label_column_name" jdbcType="VARCHAR" property="labelColumnName" />
    <result column="label_column_property" jdbcType="VARCHAR" property="labelColumnProperty" />
    <result column="label_sql" jdbcType="VARCHAR" property="labelSql" />
    <result column="label_value_start" jdbcType="VARCHAR" property="labelValueStart" />
    <result column="label_value_end" jdbcType="VARCHAR" property="labelValueEnd" />
    <result column="deleted" jdbcType="BIT" property="deleted" />
    <result column="create_user" jdbcType="INTEGER" property="createUser" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="update_user" jdbcType="INTEGER" property="updateUser" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
  </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, label_name, label_type, label_tb, label_column, label_column_name, label_column_property, 
    label_sql, label_value_start, label_value_end, deleted, create_user, create_time, 
    update_user, update_time, remark
  </sql>
  <select id="selectByExample" parameterType="org.linlinjava.jz.db.domain.JzDmLabelExample" 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 jz_dm_label
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByExampleSelective" parameterType="map" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select
    <if test="example != null and example.distinct">
      distinct
    </if>
    <choose>
      <when test="selective != null and selective.length &gt; 0">
        <foreach collection="selective" item="column" separator=",">
          ${column.aliasedEscapedColumnName}
        </foreach>
      </when>
      <otherwise>
        <include refid="Base_Column_List" />
      </otherwise>
    </choose>
    from jz_dm_label
    <if test="example != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
    <if test="example != null and example.orderByClause != null">
      order by ${example.orderByClause}
    </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 jz_dm_label
    where id = #{id,jdbcType=INTEGER}
  </select>
  <select id="selectByPrimaryKeyWithLogicalDelete" parameterType="map" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select 
    <include refid="Base_Column_List" />
    from jz_dm_label
    where id = #{id,jdbcType=INTEGER}
      and deleted = 
    <choose>
      <when test="andLogicalDeleted">
        1
      </when>
      <otherwise>
        0
      </otherwise>
    </choose>
  </select>
  <select id="selectByPrimaryKeySelective" parameterType="map" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select
    <choose>
      <when test="selective != null and selective.length &gt; 0">
        <foreach collection="selective" item="column" separator=",">
          ${column.aliasedEscapedColumnName}
        </foreach>
      </when>
      <otherwise>
        <include refid="Base_Column_List" />
      </otherwise>
    </choose>
    from jz_dm_label
    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 jz_dm_label
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="org.linlinjava.jz.db.domain.JzDmLabelExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from jz_dm_label
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="org.linlinjava.jz.db.domain.JzDmLabel">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into jz_dm_label (label_name, label_type, label_tb, 
      label_column, label_column_name, label_column_property, 
      label_sql, label_value_start, label_value_end, 
      deleted, create_user, create_time, 
      update_user, update_time, remark
      )
    values (#{labelName,jdbcType=VARCHAR}, #{labelType,jdbcType=SMALLINT}, #{labelTb,jdbcType=VARCHAR}, 
      #{labelColumn,jdbcType=VARCHAR}, #{labelColumnName,jdbcType=VARCHAR}, #{labelColumnProperty,jdbcType=VARCHAR}, 
      #{labelSql,jdbcType=VARCHAR}, #{labelValueStart,jdbcType=VARCHAR}, #{labelValueEnd,jdbcType=VARCHAR}, 
      #{deleted,jdbcType=BIT}, #{createUser,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, 
      #{updateUser,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="org.linlinjava.jz.db.domain.JzDmLabel">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into jz_dm_label
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="labelName != null">
        label_name,
      </if>
      <if test="labelType != null">
        label_type,
      </if>
      <if test="labelTb != null">
        label_tb,
      </if>
      <if test="labelColumn != null">
        label_column,
      </if>
      <if test="labelColumnName != null">
        label_column_name,
      </if>
      <if test="labelColumnProperty != null">
        label_column_property,
      </if>
      <if test="labelSql != null">
        label_sql,
      </if>
      <if test="labelValueStart != null">
        label_value_start,
      </if>
      <if test="labelValueEnd != null">
        label_value_end,
      </if>
      <if test="deleted != null">
        deleted,
      </if>
      <if test="createUser != null">
        create_user,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="updateUser != null">
        update_user,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
      <if test="remark != null">
        remark,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="labelName != null">
        #{labelName,jdbcType=VARCHAR},
      </if>
      <if test="labelType != null">
        #{labelType,jdbcType=SMALLINT},
      </if>
      <if test="labelTb != null">
        #{labelTb,jdbcType=VARCHAR},
      </if>
      <if test="labelColumn != null">
        #{labelColumn,jdbcType=VARCHAR},
      </if>
      <if test="labelColumnName != null">
        #{labelColumnName,jdbcType=VARCHAR},
      </if>
      <if test="labelColumnProperty != null">
        #{labelColumnProperty,jdbcType=VARCHAR},
      </if>
      <if test="labelSql != null">
        #{labelSql,jdbcType=VARCHAR},
      </if>
      <if test="labelValueStart != null">
        #{labelValueStart,jdbcType=VARCHAR},
      </if>
      <if test="labelValueEnd != null">
        #{labelValueEnd,jdbcType=VARCHAR},
      </if>
      <if test="deleted != null">
        #{deleted,jdbcType=BIT},
      </if>
      <if test="createUser != null">
        #{createUser,jdbcType=INTEGER},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateUser != null">
        #{updateUser,jdbcType=INTEGER},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="org.linlinjava.jz.db.domain.JzDmLabelExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from jz_dm_label
    <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 jz_dm_label
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=INTEGER},
      </if>
      <if test="record.labelName != null">
        label_name = #{record.labelName,jdbcType=VARCHAR},
      </if>
      <if test="record.labelType != null">
        label_type = #{record.labelType,jdbcType=SMALLINT},
      </if>
      <if test="record.labelTb != null">
        label_tb = #{record.labelTb,jdbcType=VARCHAR},
      </if>
      <if test="record.labelColumn != null">
        label_column = #{record.labelColumn,jdbcType=VARCHAR},
      </if>
      <if test="record.labelColumnName != null">
        label_column_name = #{record.labelColumnName,jdbcType=VARCHAR},
      </if>
      <if test="record.labelColumnProperty != null">
        label_column_property = #{record.labelColumnProperty,jdbcType=VARCHAR},
      </if>
      <if test="record.labelSql != null">
        label_sql = #{record.labelSql,jdbcType=VARCHAR},
      </if>
      <if test="record.labelValueStart != null">
        label_value_start = #{record.labelValueStart,jdbcType=VARCHAR},
      </if>
      <if test="record.labelValueEnd != null">
        label_value_end = #{record.labelValueEnd,jdbcType=VARCHAR},
      </if>
      <if test="record.deleted != null">
        deleted = #{record.deleted,jdbcType=BIT},
      </if>
      <if test="record.createUser != null">
        create_user = #{record.createUser,jdbcType=INTEGER},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.updateUser != null">
        update_user = #{record.updateUser,jdbcType=INTEGER},
      </if>
      <if test="record.updateTime != null">
        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.remark != null">
        remark = #{record.remark,jdbcType=VARCHAR},
      </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 jz_dm_label
    set id = #{record.id,jdbcType=INTEGER},
      label_name = #{record.labelName,jdbcType=VARCHAR},
      label_type = #{record.labelType,jdbcType=SMALLINT},
      label_tb = #{record.labelTb,jdbcType=VARCHAR},
      label_column = #{record.labelColumn,jdbcType=VARCHAR},
      label_column_name = #{record.labelColumnName,jdbcType=VARCHAR},
      label_column_property = #{record.labelColumnProperty,jdbcType=VARCHAR},
      label_sql = #{record.labelSql,jdbcType=VARCHAR},
      label_value_start = #{record.labelValueStart,jdbcType=VARCHAR},
      label_value_end = #{record.labelValueEnd,jdbcType=VARCHAR},
      deleted = #{record.deleted,jdbcType=BIT},
      create_user = #{record.createUser,jdbcType=INTEGER},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      update_user = #{record.updateUser,jdbcType=INTEGER},
      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      remark = #{record.remark,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="org.linlinjava.jz.db.domain.JzDmLabel">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update jz_dm_label
    <set>
      <if test="labelName != null">
        label_name = #{labelName,jdbcType=VARCHAR},
      </if>
      <if test="labelType != null">
        label_type = #{labelType,jdbcType=SMALLINT},
      </if>
      <if test="labelTb != null">
        label_tb = #{labelTb,jdbcType=VARCHAR},
      </if>
      <if test="labelColumn != null">
        label_column = #{labelColumn,jdbcType=VARCHAR},
      </if>
      <if test="labelColumnName != null">
        label_column_name = #{labelColumnName,jdbcType=VARCHAR},
      </if>
      <if test="labelColumnProperty != null">
        label_column_property = #{labelColumnProperty,jdbcType=VARCHAR},
      </if>
      <if test="labelSql != null">
        label_sql = #{labelSql,jdbcType=VARCHAR},
      </if>
      <if test="labelValueStart != null">
        label_value_start = #{labelValueStart,jdbcType=VARCHAR},
      </if>
      <if test="labelValueEnd != null">
        label_value_end = #{labelValueEnd,jdbcType=VARCHAR},
      </if>
      <if test="deleted != null">
        deleted = #{deleted,jdbcType=BIT},
      </if>
      <if test="createUser != null">
        create_user = #{createUser,jdbcType=INTEGER},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateUser != null">
        update_user = #{updateUser,jdbcType=INTEGER},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="remark != null">
        remark = #{remark,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="org.linlinjava.jz.db.domain.JzDmLabel">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update jz_dm_label
    set label_name = #{labelName,jdbcType=VARCHAR},
      label_type = #{labelType,jdbcType=SMALLINT},
      label_tb = #{labelTb,jdbcType=VARCHAR},
      label_column = #{labelColumn,jdbcType=VARCHAR},
      label_column_name = #{labelColumnName,jdbcType=VARCHAR},
      label_column_property = #{labelColumnProperty,jdbcType=VARCHAR},
      label_sql = #{labelSql,jdbcType=VARCHAR},
      label_value_start = #{labelValueStart,jdbcType=VARCHAR},
      label_value_end = #{labelValueEnd,jdbcType=VARCHAR},
      deleted = #{deleted,jdbcType=BIT},
      create_user = #{createUser,jdbcType=INTEGER},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      update_user = #{updateUser,jdbcType=INTEGER},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      remark = #{remark,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
  <select id="selectOneByExample" parameterType="org.linlinjava.jz.db.domain.JzDmLabelExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select
    <include refid="Base_Column_List" />
    from jz_dm_label
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
    limit 1
  </select>
  <select id="selectOneByExampleSelective" parameterType="map" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select
    <choose>
      <when test="selective != null and selective.length &gt; 0">
        <foreach collection="selective" item="column" separator=",">
          ${column.aliasedEscapedColumnName}
        </foreach>
      </when>
      <otherwise>
        <include refid="Base_Column_List" />
      </otherwise>
    </choose>
    from jz_dm_label
    <if test="example != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
    <if test="example != null and example.orderByClause != null">
      order by ${example.orderByClause}
    </if>
    limit 1
  </select>
  <update id="logicalDeleteByExample" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update jz_dm_label set deleted = 1
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="logicalDeleteByPrimaryKey" parameterType="java.lang.Integer">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update jz_dm_label set deleted = 1
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>