<?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.emr.dao.TBasicBrowseHistoryMapper" >
  <resultMap id="BaseResultMap" type="com.emr.entity.TBasicBrowseHistory" >
    <id column="id" property="id" jdbcType="BIGINT" />
    <result column="patient_id" property="patientId" jdbcType="NVARCHAR" />
    <result column="visit_id" property="visitId" jdbcType="VARCHAR" />
    <result column="classify" property="classify" jdbcType="NVARCHAR" />
    <result column="classify_name" property="classifyName" jdbcType="NVARCHAR" />
    <result column="ip" property="ip" jdbcType="NVARCHAR" />
    <result column="creater" property="creater" jdbcType="NVARCHAR" />
    <result column="creater_name" property="createrName" jdbcType="NVARCHAR" />
    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, patient_id, visit_id, classify, classify_name, ip, creater, creater_name, create_time
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
    select 
    <include refid="Base_Column_List" />
    from t_basic_browse_history
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
    delete from t_basic_browse_history
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.emr.entity.TBasicBrowseHistory" >
    insert into t_basic_browse_history (id, patient_id, visit_id, 
      classify, classify_name, ip, 
      creater, creater_name, create_time
      )
    values (#{id,jdbcType=BIGINT}, #{patientId,jdbcType=NVARCHAR}, #{visitId,jdbcType=VARCHAR}, 
      #{classify,jdbcType=NVARCHAR}, #{classifyName,jdbcType=NVARCHAR}, #{ip,jdbcType=NVARCHAR}, 
      #{creater,jdbcType=NVARCHAR}, #{createrName,jdbcType=NVARCHAR}, #{createTime,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.emr.entity.TBasicBrowseHistory" >
    insert into t_basic_browse_history
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        id,
      </if>
      <if test="patientId != null" >
        patient_id,
      </if>
      <if test="visitId != null" >
        visit_id,
      </if>
      <if test="classify != null" >
        classify,
      </if>
      <if test="classifyName != null" >
        classify_name,
      </if>
      <if test="ip != null" >
        ip,
      </if>
      <if test="creater != null" >
        creater,
      </if>
      <if test="createrName != null" >
        creater_name,
      </if>
      <if test="createTime != null" >
        create_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=BIGINT},
      </if>
      <if test="patientId != null" >
        #{patientId,jdbcType=NVARCHAR},
      </if>
      <if test="visitId != null" >
        #{visitId,jdbcType=VARCHAR},
      </if>
      <if test="classify != null" >
        #{classify,jdbcType=NVARCHAR},
      </if>
      <if test="classifyName != null" >
        #{classifyName,jdbcType=NVARCHAR},
      </if>
      <if test="ip != null" >
        #{ip,jdbcType=NVARCHAR},
      </if>
      <if test="creater != null" >
        #{creater,jdbcType=NVARCHAR},
      </if>
      <if test="createrName != null" >
        #{createrName,jdbcType=NVARCHAR},
      </if>
      <if test="createTime != null" >
        #{createTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.emr.entity.TBasicBrowseHistory" >
    update t_basic_browse_history
    <set >
      <if test="patientId != null" >
        patient_id = #{patientId,jdbcType=NVARCHAR},
      </if>
      <if test="visitId != null" >
        visit_id = #{visitId,jdbcType=VARCHAR},
      </if>
      <if test="classify != null" >
        classify = #{classify,jdbcType=NVARCHAR},
      </if>
      <if test="classifyName != null" >
        classify_name = #{classifyName,jdbcType=NVARCHAR},
      </if>
      <if test="ip != null" >
        ip = #{ip,jdbcType=NVARCHAR},
      </if>
      <if test="creater != null" >
        creater = #{creater,jdbcType=NVARCHAR},
      </if>
      <if test="createrName != null" >
        creater_name = #{createrName,jdbcType=NVARCHAR},
      </if>
      <if test="createTime != null" >
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.emr.entity.TBasicBrowseHistory" >
    update t_basic_browse_history
    set patient_id = #{patientId,jdbcType=NVARCHAR},
      visit_id = #{visitId,jdbcType=VARCHAR},
      classify = #{classify,jdbcType=NVARCHAR},
      classify_name = #{classifyName,jdbcType=NVARCHAR},
      ip = #{ip,jdbcType=NVARCHAR},
      creater = #{creater,jdbcType=NVARCHAR},
      creater_name = #{createrName,jdbcType=NVARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>