<?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.unified.UnifiedOrderGoodsAppraiseMapper">
	<resultMap id="BaseResultMap" type="cn.superdesk.uniorder.dao.entity.unified.UnifiedOrderGoodsAppraise">
		<id column="id" property="id" jdbcType="BIGINT"/>
		<result column="sn" property="sn" jdbcType="VARCHAR"/>
		<result column="goods_id" property="goodsId" jdbcType="BIGINT"/>
		<result column="appraise_level" property="appraiseLevel" jdbcType="TINYINT"/>
		<result column="appraise_content" property="appraiseContent" jdbcType="VARCHAR"/>
		<result column="pics" property="pics" jdbcType="VARCHAR"/>
		<result column="append_state" property="appendState" jdbcType="TINYINT"/>
		<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
		<result column="create_user_id" property="createUserId" jdbcType="BIGINT"/>
		<result column="sys_state" property="sysState" jdbcType="TINYINT"/>
		<result column="user_name" property="userName" jdbcType="VARCHAR"/>
	</resultMap>
	<sql id="Base_Column_List">
    id, sn, goods_id, appraise_level, appraise_content, pics, append_state, create_time, 
    create_user_id, sys_state, user_name
  </sql>
	<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">
		select
		<include refid="Base_Column_List"/>
		from unified_order_goods_appraise
		where id = #{id,jdbcType=BIGINT}
	</select>
	<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from unified_order_goods_appraise
    where id = #{id,jdbcType=BIGINT}
  </delete>
	<insert id="insert" parameterType="cn.superdesk.uniorder.dao.entity.unified.UnifiedOrderGoodsAppraise">
		<selectKey resultType="java.lang.Long" keyProperty="id" order="AFTER">
			SELECT LAST_INSERT_ID()
		</selectKey>
		insert into unified_order_goods_appraise (sn, goods_id, appraise_level,
		appraise_content, pics, append_state,
		create_time, create_user_id, sys_state,
		user_name)
		values (#{sn,jdbcType=VARCHAR}, #{goodsId,jdbcType=BIGINT}, #{appraiseLevel,jdbcType=TINYINT},
		#{appraiseContent,jdbcType=VARCHAR}, #{pics,jdbcType=VARCHAR}, #{appendState,jdbcType=TINYINT},
		#{createTime,jdbcType=TIMESTAMP}, #{createUserId,jdbcType=BIGINT}, #{sysState,jdbcType=TINYINT},
		#{userName,jdbcType=VARCHAR})
	</insert>
	<insert id="insertSelective" parameterType="cn.superdesk.uniorder.dao.entity.unified.UnifiedOrderGoodsAppraise">
		<selectKey resultType="java.lang.Long" keyProperty="id" order="AFTER">
			SELECT LAST_INSERT_ID()
		</selectKey>
		insert into unified_order_goods_appraise
		<trim prefix="(" suffix=")" suffixOverrides=",">
			<if test="sn != null">
				sn,
			</if>
			<if test="goodsId != null">
				goods_id,
			</if>
			<if test="appraiseLevel != null">
				appraise_level,
			</if>
			<if test="appraiseContent != null">
				appraise_content,
			</if>
			<if test="pics != null">
				pics,
			</if>
			<if test="appendState != null">
				append_state,
			</if>
			<if test="createTime != null">
				create_time,
			</if>
			<if test="createUserId != null">
				create_user_id,
			</if>
			<if test="sysState != null">
				sys_state,
			</if>
			<if test="userName != null">
				user_name,
			</if>
		</trim>
		<trim prefix="values (" suffix=")" suffixOverrides=",">
			<if test="sn != null">
				#{sn,jdbcType=VARCHAR},
			</if>
			<if test="goodsId != null">
				#{goodsId,jdbcType=BIGINT},
			</if>
			<if test="appraiseLevel != null">
				#{appraiseLevel,jdbcType=TINYINT},
			</if>
			<if test="appraiseContent != null">
				#{appraiseContent,jdbcType=VARCHAR},
			</if>
			<if test="pics != null">
				#{pics,jdbcType=VARCHAR},
			</if>
			<if test="appendState != null">
				#{appendState,jdbcType=TINYINT},
			</if>
			<if test="createTime != null">
				#{createTime,jdbcType=TIMESTAMP},
			</if>
			<if test="createUserId != null">
				#{createUserId,jdbcType=BIGINT},
			</if>
			<if test="sysState != null">
				#{sysState,jdbcType=TINYINT},
			</if>
			<if test="userName != null">
				#{userName,jdbcType=VARCHAR},
			</if>
		</trim>
	</insert>
	<update id="updateByPrimaryKeySelective"
	        parameterType="cn.superdesk.uniorder.dao.entity.unified.UnifiedOrderGoodsAppraise">
		update unified_order_goods_appraise
		<set>
			<if test="sn != null">
				sn = #{sn,jdbcType=VARCHAR},
			</if>
			<if test="goodsId != null">
				goods_id = #{goodsId,jdbcType=BIGINT},
			</if>
			<if test="appraiseLevel != null">
				appraise_level = #{appraiseLevel,jdbcType=TINYINT},
			</if>
			<if test="appraiseContent != null">
				appraise_content = #{appraiseContent,jdbcType=VARCHAR},
			</if>
			<if test="pics != null">
				pics = #{pics,jdbcType=VARCHAR},
			</if>
			<if test="appendState != null">
				append_state = #{appendState,jdbcType=TINYINT},
			</if>
			<if test="createTime != null">
				create_time = #{createTime,jdbcType=TIMESTAMP},
			</if>
			<if test="createUserId != null">
				create_user_id = #{createUserId,jdbcType=BIGINT},
			</if>
			<if test="sysState != null">
				sys_state = #{sysState,jdbcType=TINYINT},
			</if>
			<if test="userName != null">
				user_name = #{userName,jdbcType=VARCHAR},
			</if>
		</set>
		where id = #{id,jdbcType=BIGINT}
	</update>
	<update id="updateByPrimaryKey" parameterType="cn.superdesk.uniorder.dao.entity.unified.UnifiedOrderGoodsAppraise">
    update unified_order_goods_appraise
    set sn = #{sn,jdbcType=VARCHAR},
      goods_id = #{goodsId,jdbcType=BIGINT},
      appraise_level = #{appraiseLevel,jdbcType=TINYINT},
      appraise_content = #{appraiseContent,jdbcType=VARCHAR},
      pics = #{pics,jdbcType=VARCHAR},
      append_state = #{appendState,jdbcType=TINYINT},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      create_user_id = #{createUserId,jdbcType=BIGINT},
      sys_state = #{sysState,jdbcType=TINYINT},
      user_name = #{userName,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>