<?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="cn.com.victorysoft.business.sys.dao.SysDataTypeDao">
  <resultMap id="BaseResultMap" type="SysDataType">
    <id column="ID" jdbcType="VARCHAR" property="id" />
    <result column="NAME" jdbcType="VARCHAR" property="name" />
    <result column="ORDER_NO" jdbcType="NUMERIC" property="orderNo" />
  </resultMap>
  <sql id="Base_Column_List">
    ID, "NAME", ORDER_NO
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from SYS_DATA_TYPE
    where ID = #{id,jdbcType=VARCHAR}
  </select>
  <select id="selectList" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from SYS_DATA_TYPE
    order by ORDER_NO
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from SYS_DATA_TYPE
    where ID = #{id,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="SysDataType">
    insert into SYS_DATA_TYPE (ID, "NAME", ORDER_NO
      )
    values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{orderNo,jdbcType=NUMERIC}
      )
  </insert>
  <insert id="insertSelective" parameterType="SysDataType">
    insert into SYS_DATA_TYPE
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        ID,
      </if>
      <if test="name != null">
        "NAME",
      </if>
      <if test="orderNo != null">
        ORDER_NO,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="orderNo != null">
        #{orderNo,jdbcType=NUMERIC},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="SysDataType">
    update SYS_DATA_TYPE
    <set>
      <if test="name != null">
        "NAME" = #{name,jdbcType=VARCHAR},
      </if>
      <if test="orderNo != null">
        ORDER_NO = #{orderNo,jdbcType=NUMERIC},
      </if>
    </set>
    where ID = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="SysDataType">
    update SYS_DATA_TYPE
    set "NAME" = #{name,jdbcType=VARCHAR},
      ORDER_NO = #{orderNo,jdbcType=NUMERIC}
    where ID = #{id,jdbcType=VARCHAR}
  </update>
</mapper>