<?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.platform.dao.SectiontypeDictionaryMapper" >
  <resultMap id="BaseResultMap" type="com.platform.pojo.SectiontypeDictionary" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="TYPE_CODE" property="typeCode" jdbcType="VARCHAR" />
    <result column="TYPE_NAME" property="typeName" jdbcType="VARCHAR" />
    <result column="ADD_USER_ID" property="addUserId" jdbcType="VARCHAR" />
    <result column="ADD_USER_NAME" property="addUserName" jdbcType="VARCHAR" />
    <result column="ADD_DATETIME" property="addDatetime" jdbcType="TIMESTAMP" />
    <result column="EDIT_USER_ID" property="editUserId" jdbcType="VARCHAR" />
    <result column="EDIT_USER_NAME" property="editUserName" jdbcType="VARCHAR" />
    <result column="EDIT_DATETIME" property="editDatetime" jdbcType="TIMESTAMP" />
    <result column="DELETE_USER_ID" property="deleteUserId" jdbcType="VARCHAR" />
    <result column="DELETE_USER_NAME" property="deleteUserName" jdbcType="VARCHAR" />
    <result column="DELETE_DATETIME" property="deleteDatetime" jdbcType="TIMESTAMP" />
    <result column="DELETE_FLAG" property="deleteFlag" jdbcType="DECIMAL" />
  </resultMap>
  <sql id="Example_Where_Clause" >
    <!--
      WARNING - @mbggenerated
      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="(" 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" >
    <!--
      WARNING - @mbggenerated
      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="(" 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" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    TYPE_CODE, TYPE_NAME, ADD_USER_ID, ADD_USER_NAME, ADD_DATETIME, EDIT_USER_ID, EDIT_USER_NAME, 
    EDIT_DATETIME, DELETE_USER_ID, DELETE_USER_NAME, DELETE_DATETIME, DELETE_FLAG
  </sql>
  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.platform.pojo.SectiontypeDictionaryExample" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select
    <if test="distinct" >
      distinct
    </if>
    <include refid="Base_Column_List" />
    from SECTIONTYPE_DICTIONARY
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null" >
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select 
    <include refid="Base_Column_List" />
    from SECTIONTYPE_DICTIONARY
    where TYPE_CODE = #{typeCode,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from SECTIONTYPE_DICTIONARY
    where TYPE_CODE = #{typeCode,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="com.platform.pojo.SectiontypeDictionaryExample" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from SECTIONTYPE_DICTIONARY
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.platform.pojo.SectiontypeDictionary" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into SECTIONTYPE_DICTIONARY (TYPE_CODE, TYPE_NAME, ADD_USER_ID, 
      ADD_USER_NAME, ADD_DATETIME, EDIT_USER_ID, 
      EDIT_USER_NAME, EDIT_DATETIME, DELETE_USER_ID, 
      DELETE_USER_NAME, DELETE_DATETIME, DELETE_FLAG
      )
    values (#{typeCode,jdbcType=VARCHAR}, #{typeName,jdbcType=VARCHAR}, #{addUserId,jdbcType=VARCHAR}, 
      #{addUserName,jdbcType=VARCHAR}, #{addDatetime,jdbcType=TIMESTAMP}, #{editUserId,jdbcType=VARCHAR}, 
      #{editUserName,jdbcType=VARCHAR}, #{editDatetime,jdbcType=TIMESTAMP}, #{deleteUserId,jdbcType=VARCHAR}, 
      #{deleteUserName,jdbcType=VARCHAR}, #{deleteDatetime,jdbcType=TIMESTAMP}, #{deleteFlag,jdbcType=DECIMAL}
      )
  </insert>
  <insert id="insertSelective" useGeneratedKeys="true" keyProperty="id" parameterType="com.platform.pojo.SectiontypeDictionary" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into SECTIONTYPE_DICTIONARY
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="typeCode != null" >
        TYPE_CODE,
      </if>
      <if test="typeName != null" >
        TYPE_NAME,
      </if>
      <if test="addUserId != null" >
        ADD_USER_ID,
      </if>
      <if test="addUserName != null" >
        ADD_USER_NAME,
      </if>
      <if test="addDatetime != null" >
        ADD_DATETIME,
      </if>
      <if test="editUserId != null" >
        EDIT_USER_ID,
      </if>
      <if test="editUserName != null" >
        EDIT_USER_NAME,
      </if>
      <if test="editDatetime != null" >
        EDIT_DATETIME,
      </if>
      <if test="deleteUserId != null" >
        DELETE_USER_ID,
      </if>
      <if test="deleteUserName != null" >
        DELETE_USER_NAME,
      </if>
      <if test="deleteDatetime != null" >
        DELETE_DATETIME,
      </if>
      <if test="deleteFlag != null" >
        DELETE_FLAG,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="typeCode != null" >
        #{typeCode,jdbcType=VARCHAR},
      </if>
      <if test="typeName != null" >
        #{typeName,jdbcType=VARCHAR},
      </if>
      <if test="addUserId != null" >
        #{addUserId,jdbcType=VARCHAR},
      </if>
      <if test="addUserName != null" >
        #{addUserName,jdbcType=VARCHAR},
      </if>
      <if test="addDatetime != null" >
        #{addDatetime,jdbcType=TIMESTAMP},
      </if>
      <if test="editUserId != null" >
        #{editUserId,jdbcType=VARCHAR},
      </if>
      <if test="editUserName != null" >
        #{editUserName,jdbcType=VARCHAR},
      </if>
      <if test="editDatetime != null" >
        #{editDatetime,jdbcType=TIMESTAMP},
      </if>
      <if test="deleteUserId != null" >
        #{deleteUserId,jdbcType=VARCHAR},
      </if>
      <if test="deleteUserName != null" >
        #{deleteUserName,jdbcType=VARCHAR},
      </if>
      <if test="deleteDatetime != null" >
        #{deleteDatetime,jdbcType=TIMESTAMP},
      </if>
      <if test="deleteFlag != null" >
        #{deleteFlag,jdbcType=DECIMAL},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.platform.pojo.SectiontypeDictionaryExample" resultType="java.lang.Integer" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from SECTIONTYPE_DICTIONARY
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update SECTIONTYPE_DICTIONARY
    <set >
      <if test="record.typeCode != null" >
        TYPE_CODE = #{record.typeCode,jdbcType=VARCHAR},
      </if>
      <if test="record.typeName != null" >
        TYPE_NAME = #{record.typeName,jdbcType=VARCHAR},
      </if>
      <if test="record.addUserId != null" >
        ADD_USER_ID = #{record.addUserId,jdbcType=VARCHAR},
      </if>
      <if test="record.addUserName != null" >
        ADD_USER_NAME = #{record.addUserName,jdbcType=VARCHAR},
      </if>
      <if test="record.addDatetime != null" >
        ADD_DATETIME = #{record.addDatetime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.editUserId != null" >
        EDIT_USER_ID = #{record.editUserId,jdbcType=VARCHAR},
      </if>
      <if test="record.editUserName != null" >
        EDIT_USER_NAME = #{record.editUserName,jdbcType=VARCHAR},
      </if>
      <if test="record.editDatetime != null" >
        EDIT_DATETIME = #{record.editDatetime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.deleteUserId != null" >
        DELETE_USER_ID = #{record.deleteUserId,jdbcType=VARCHAR},
      </if>
      <if test="record.deleteUserName != null" >
        DELETE_USER_NAME = #{record.deleteUserName,jdbcType=VARCHAR},
      </if>
      <if test="record.deleteDatetime != null" >
        DELETE_DATETIME = #{record.deleteDatetime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.deleteFlag != null" >
        DELETE_FLAG = #{record.deleteFlag,jdbcType=DECIMAL},
      </if>
    </set>
    <if test="_parameter != null" >
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update SECTIONTYPE_DICTIONARY
    set TYPE_CODE = #{record.typeCode,jdbcType=VARCHAR},
      TYPE_NAME = #{record.typeName,jdbcType=VARCHAR},
      ADD_USER_ID = #{record.addUserId,jdbcType=VARCHAR},
      ADD_USER_NAME = #{record.addUserName,jdbcType=VARCHAR},
      ADD_DATETIME = #{record.addDatetime,jdbcType=TIMESTAMP},
      EDIT_USER_ID = #{record.editUserId,jdbcType=VARCHAR},
      EDIT_USER_NAME = #{record.editUserName,jdbcType=VARCHAR},
      EDIT_DATETIME = #{record.editDatetime,jdbcType=TIMESTAMP},
      DELETE_USER_ID = #{record.deleteUserId,jdbcType=VARCHAR},
      DELETE_USER_NAME = #{record.deleteUserName,jdbcType=VARCHAR},
      DELETE_DATETIME = #{record.deleteDatetime,jdbcType=TIMESTAMP},
      DELETE_FLAG = #{record.deleteFlag,jdbcType=DECIMAL}
    <if test="_parameter != null" >
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.platform.pojo.SectiontypeDictionary" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update SECTIONTYPE_DICTIONARY
    <set >
      <if test="typeName != null" >
        TYPE_NAME = #{typeName,jdbcType=VARCHAR},
      </if>
      <if test="addUserId != null" >
        ADD_USER_ID = #{addUserId,jdbcType=VARCHAR},
      </if>
      <if test="addUserName != null" >
        ADD_USER_NAME = #{addUserName,jdbcType=VARCHAR},
      </if>
      <if test="addDatetime != null" >
        ADD_DATETIME = #{addDatetime,jdbcType=TIMESTAMP},
      </if>
      <if test="editUserId != null" >
        EDIT_USER_ID = #{editUserId,jdbcType=VARCHAR},
      </if>
      <if test="editUserName != null" >
        EDIT_USER_NAME = #{editUserName,jdbcType=VARCHAR},
      </if>
      <if test="editDatetime != null" >
        EDIT_DATETIME = #{editDatetime,jdbcType=TIMESTAMP},
      </if>
      <if test="deleteUserId != null" >
        DELETE_USER_ID = #{deleteUserId,jdbcType=VARCHAR},
      </if>
      <if test="deleteUserName != null" >
        DELETE_USER_NAME = #{deleteUserName,jdbcType=VARCHAR},
      </if>
      <if test="deleteDatetime != null" >
        DELETE_DATETIME = #{deleteDatetime,jdbcType=TIMESTAMP},
      </if>
      <if test="deleteFlag != null" >
        DELETE_FLAG = #{deleteFlag,jdbcType=DECIMAL},
      </if>
    </set>
    where TYPE_CODE = #{typeCode,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.platform.pojo.SectiontypeDictionary" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update SECTIONTYPE_DICTIONARY
    set TYPE_NAME = #{typeName,jdbcType=VARCHAR},
      ADD_USER_ID = #{addUserId,jdbcType=VARCHAR},
      ADD_USER_NAME = #{addUserName,jdbcType=VARCHAR},
      ADD_DATETIME = #{addDatetime,jdbcType=TIMESTAMP},
      EDIT_USER_ID = #{editUserId,jdbcType=VARCHAR},
      EDIT_USER_NAME = #{editUserName,jdbcType=VARCHAR},
      EDIT_DATETIME = #{editDatetime,jdbcType=TIMESTAMP},
      DELETE_USER_ID = #{deleteUserId,jdbcType=VARCHAR},
      DELETE_USER_NAME = #{deleteUserName,jdbcType=VARCHAR},
      DELETE_DATETIME = #{deleteDatetime,jdbcType=TIMESTAMP},
      DELETE_FLAG = #{deleteFlag,jdbcType=DECIMAL}
    where TYPE_CODE = #{typeCode,jdbcType=VARCHAR}
  </update>
  
  <select id="selectAllSectionTypes" resultType="com.platform.pojo.SectionType">
  	select
	    DISTINCT
	    sd.TYPE_CODE as typeCode
	    ,sd.TYPE_NAME as typeName
	from
	    sectiontype_dictionary sd
	where
	    sd.DELETE_FLAG=1
  </select>
</mapper>