<?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.superdesk.uniorder.dao.mapper.sys.SysConfigMapper">
	<resultMap id="BaseResultMap" type="cn.superdesk.uniorder.dao.entity.sys.SysConfig">
		<id column="code" property="code" jdbcType="VARCHAR"/>
		<result column="description" property="description" jdbcType="VARCHAR"/>
		<result column="value_date" property="valueDate" jdbcType="TIMESTAMP"/>
		<result column="value_int" property="valueInt" jdbcType="INTEGER"/>
		<result column="value_str1" property="valueStr1" jdbcType="VARCHAR"/>
		<result column="value_str2" property="valueStr2" jdbcType="VARCHAR"/>
		<result column="value_str3" property="valueStr3" jdbcType="VARCHAR"/>
		<result column="value_double" property="valueDouble" jdbcType="DECIMAL"/>
	</resultMap>
	<sql id="Base_Column_List">
    code, description, value_date, value_int, value_str1, value_str2, value_str3, value_double
  </sql>
	<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
		select
		<include refid="Base_Column_List"/>
		from sys_config
		where code = #{code,jdbcType=VARCHAR}
	</select>
	<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from sys_config
    where code = #{code,jdbcType=VARCHAR}
  </delete>
	<insert id="insert" parameterType="cn.superdesk.uniorder.dao.entity.sys.SysConfig">
    insert into sys_config (code, description, value_date, 
      value_int, value_str1, value_str2, 
      value_str3, value_double)
    values (#{code,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{valueDate,jdbcType=TIMESTAMP}, 
      #{valueInt,jdbcType=INTEGER}, #{valueStr1,jdbcType=VARCHAR}, #{valueStr2,jdbcType=VARCHAR}, 
      #{valueStr3,jdbcType=VARCHAR}, #{valueDouble,jdbcType=DECIMAL})
  </insert>
	<insert id="insertSelective" parameterType="cn.superdesk.uniorder.dao.entity.sys.SysConfig">
		insert into sys_config
		<trim prefix="(" suffix=")" suffixOverrides=",">
			<if test="code != null">
				code,
			</if>
			<if test="description != null">
				description,
			</if>
			<if test="valueDate != null">
				value_date,
			</if>
			<if test="valueInt != null">
				value_int,
			</if>
			<if test="valueStr1 != null">
				value_str1,
			</if>
			<if test="valueStr2 != null">
				value_str2,
			</if>
			<if test="valueStr3 != null">
				value_str3,
			</if>
			<if test="valueDouble != null">
				value_double,
			</if>
		</trim>
		<trim prefix="values (" suffix=")" suffixOverrides=",">
			<if test="code != null">
				#{code,jdbcType=VARCHAR},
			</if>
			<if test="description != null">
				#{description,jdbcType=VARCHAR},
			</if>
			<if test="valueDate != null">
				#{valueDate,jdbcType=TIMESTAMP},
			</if>
			<if test="valueInt != null">
				#{valueInt,jdbcType=INTEGER},
			</if>
			<if test="valueStr1 != null">
				#{valueStr1,jdbcType=VARCHAR},
			</if>
			<if test="valueStr2 != null">
				#{valueStr2,jdbcType=VARCHAR},
			</if>
			<if test="valueStr3 != null">
				#{valueStr3,jdbcType=VARCHAR},
			</if>
			<if test="valueDouble != null">
				#{valueDouble,jdbcType=DECIMAL},
			</if>
		</trim>
	</insert>
	<update id="updateByPrimaryKeySelective" parameterType="cn.superdesk.uniorder.dao.entity.sys.SysConfig">
		update sys_config
		<set>
			<if test="description != null">
				description = #{description,jdbcType=VARCHAR},
			</if>
			<if test="valueDate != null">
				value_date = #{valueDate,jdbcType=TIMESTAMP},
			</if>
			<if test="valueInt != null">
				value_int = #{valueInt,jdbcType=INTEGER},
			</if>
			<if test="valueStr1 != null">
				value_str1 = #{valueStr1,jdbcType=VARCHAR},
			</if>
			<if test="valueStr2 != null">
				value_str2 = #{valueStr2,jdbcType=VARCHAR},
			</if>
			<if test="valueStr3 != null">
				value_str3 = #{valueStr3,jdbcType=VARCHAR},
			</if>
			<if test="valueDouble != null">
				value_double = #{valueDouble,jdbcType=DECIMAL},
			</if>
		</set>
		where code = #{code,jdbcType=VARCHAR}
	</update>
	<update id="updateByPrimaryKey" parameterType="cn.superdesk.uniorder.dao.entity.sys.SysConfig">
    update sys_config
    set description = #{description,jdbcType=VARCHAR},
      value_date = #{valueDate,jdbcType=TIMESTAMP},
      value_int = #{valueInt,jdbcType=INTEGER},
      value_str1 = #{valueStr1,jdbcType=VARCHAR},
      value_str2 = #{valueStr2,jdbcType=VARCHAR},
      value_str3 = #{valueStr3,jdbcType=VARCHAR},
      value_double = #{valueDouble,jdbcType=DECIMAL}
    where code = #{code,jdbcType=VARCHAR}
  </update>
</mapper>