<?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.his.HISBA6Mapper" >
  <resultMap id="BaseResultMap" type="com.emr.entity.his.HISBA6" >
    <id column="FID" property="fid" jdbcType="BIGINT" />
    <result column="FPRN" property="fprn" jdbcType="VARCHAR" />
    <result column="FTIMES" property="ftimes" jdbcType="INTEGER" />
    <result column="FFLFSBH" property="fflfsbh" jdbcType="VARCHAR" />
    <result column="FFLFS" property="fflfs" jdbcType="VARCHAR" />
    <result column="FFLCXBH" property="fflcxbh" jdbcType="VARCHAR" />
    <result column="FFLCX" property="fflcx" jdbcType="VARCHAR" />
    <result column="FFLZZBH" property="fflzzbh" jdbcType="VARCHAR" />
    <result column="FFLZZ" property="fflzz" jdbcType="VARCHAR" />
    <result column="FYJY" property="fyjy" jdbcType="INTEGER" />
    <result column="FYCS" property="fycs" jdbcType="INTEGER" />
    <result column="FYTS" property="fyts" jdbcType="INTEGER" />
    <result column="FYRQ1" property="fyrq1" jdbcType="TIMESTAMP" />
    <result column="FYRQ2" property="fyrq2" jdbcType="TIMESTAMP" />
    <result column="FQJY" property="fqjy" jdbcType="INTEGER" />
    <result column="FQCS" property="fqcs" jdbcType="INTEGER" />
    <result column="FQTS" property="fqts" jdbcType="INTEGER" />
    <result column="FQRQ1" property="fqrq1" jdbcType="TIMESTAMP" />
    <result column="FQRQ2" property="fqrq2" jdbcType="TIMESTAMP" />
    <result column="FZNAME" property="fzname" jdbcType="VARCHAR" />
    <result column="FZJY" property="fzjy" jdbcType="INTEGER" />
    <result column="FZCS" property="fzcs" jdbcType="INTEGER" />
    <result column="FZTS" property="fzts" jdbcType="INTEGER" />
    <result column="FZRQ1" property="fzrq1" jdbcType="TIMESTAMP" />
    <result column="FZRQ2" property="fzrq2" jdbcType="TIMESTAMP" />
    <result column="FHLFSBH" property="fhlfsbh" jdbcType="VARCHAR" />
    <result column="FHLFS" property="fhlfs" jdbcType="VARCHAR" />
    <result column="FHLFFBH" property="fhlffbh" jdbcType="VARCHAR" />
    <result column="FHLFF" property="fhlff" jdbcType="VARCHAR" />
    <result column="FQTYPE" property="fqtype" jdbcType="VARCHAR" />
    <result column="FQT" property="fqt" jdbcType="VARCHAR" />
    <result column="FQN" property="fqn" jdbcType="VARCHAR" />
    <result column="FQM" property="fqm" jdbcType="VARCHAR" />
    <result column="FQALL" property="fqall" jdbcType="VARCHAR" />
    <result column="FQALLBH" property="fqallbh" jdbcType="VARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    FID, FPRN, FTIMES, FFLFSBH, FFLFS, FFLCXBH, FFLCX, FFLZZBH, FFLZZ, FYJY, FYCS, FYTS, 
    FYRQ1, FYRQ2, FQJY, FQCS, FQTS, FQRQ1, FQRQ2, FZNAME, FZJY, FZCS, FZTS, FZRQ1, FZRQ2, 
    FHLFSBH, FHLFS, FHLFFBH, FHLFF, FQTYPE, FQT, FQN, FQM, FQALL, FQALLBH
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
    select 
    <include refid="Base_Column_List" />
    from HIS_BA6
    where FID = #{fid,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
    delete from HIS_BA6
    where FID = #{fid,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.emr.entity.his.HISBA6" >
    insert into HIS_BA6 (FPRN, FTIMES,
      FFLFSBH, FFLFS, FFLCXBH, 
      FFLCX, FFLZZBH, FFLZZ, 
      FYJY, FYCS, FYTS, FYRQ1, 
      FYRQ2, FQJY, FQCS, 
      FQTS, FQRQ1, FQRQ2, 
      FZNAME, FZJY, FZCS, 
      FZTS, FZRQ1, FZRQ2, 
      FHLFSBH, FHLFS, FHLFFBH, 
      FHLFF, FQTYPE, FQT, 
      FQN, FQM, FQALL, FQALLBH
      )
    values (#{fprn,jdbcType=VARCHAR}, #{ftimes,jdbcType=INTEGER},
      #{fflfsbh,jdbcType=VARCHAR}, #{fflfs,jdbcType=VARCHAR}, #{fflcxbh,jdbcType=VARCHAR}, 
      #{fflcx,jdbcType=VARCHAR}, #{fflzzbh,jdbcType=VARCHAR}, #{fflzz,jdbcType=VARCHAR}, 
      #{fyjy,jdbcType=INTEGER}, #{fycs,jdbcType=INTEGER}, #{fyts,jdbcType=INTEGER}, #{fyrq1,jdbcType=TIMESTAMP}, 
      #{fyrq2,jdbcType=TIMESTAMP}, #{fqjy,jdbcType=INTEGER}, #{fqcs,jdbcType=INTEGER}, 
      #{fqts,jdbcType=INTEGER}, #{fqrq1,jdbcType=TIMESTAMP}, #{fqrq2,jdbcType=TIMESTAMP}, 
      #{fzname,jdbcType=VARCHAR}, #{fzjy,jdbcType=INTEGER}, #{fzcs,jdbcType=INTEGER}, 
      #{fzts,jdbcType=INTEGER}, #{fzrq1,jdbcType=TIMESTAMP}, #{fzrq2,jdbcType=TIMESTAMP}, 
      #{fhlfsbh,jdbcType=VARCHAR}, #{fhlfs,jdbcType=VARCHAR}, #{fhlffbh,jdbcType=VARCHAR}, 
      #{fhlff,jdbcType=VARCHAR}, #{fqtype,jdbcType=VARCHAR}, #{fqt,jdbcType=VARCHAR}, 
      #{fqn,jdbcType=VARCHAR}, #{fqm,jdbcType=VARCHAR}, #{fqall,jdbcType=VARCHAR}, #{fqallbh,jdbcType=VARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.emr.entity.his.HISBA6" >
    insert into HIS_BA6
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="fid != null" >
        FID,
      </if>
      <if test="fprn != null" >
        FPRN,
      </if>
      <if test="ftimes != null" >
        FTIMES,
      </if>
      <if test="fflfsbh != null" >
        FFLFSBH,
      </if>
      <if test="fflfs != null" >
        FFLFS,
      </if>
      <if test="fflcxbh != null" >
        FFLCXBH,
      </if>
      <if test="fflcx != null" >
        FFLCX,
      </if>
      <if test="fflzzbh != null" >
        FFLZZBH,
      </if>
      <if test="fflzz != null" >
        FFLZZ,
      </if>
      <if test="fyjy != null" >
        FYJY,
      </if>
      <if test="fycs != null" >
        FYCS,
      </if>
      <if test="fyts != null" >
        FYTS,
      </if>
      <if test="fyrq1 != null" >
        FYRQ1,
      </if>
      <if test="fyrq2 != null" >
        FYRQ2,
      </if>
      <if test="fqjy != null" >
        FQJY,
      </if>
      <if test="fqcs != null" >
        FQCS,
      </if>
      <if test="fqts != null" >
        FQTS,
      </if>
      <if test="fqrq1 != null" >
        FQRQ1,
      </if>
      <if test="fqrq2 != null" >
        FQRQ2,
      </if>
      <if test="fzname != null" >
        FZNAME,
      </if>
      <if test="fzjy != null" >
        FZJY,
      </if>
      <if test="fzcs != null" >
        FZCS,
      </if>
      <if test="fzts != null" >
        FZTS,
      </if>
      <if test="fzrq1 != null" >
        FZRQ1,
      </if>
      <if test="fzrq2 != null" >
        FZRQ2,
      </if>
      <if test="fhlfsbh != null" >
        FHLFSBH,
      </if>
      <if test="fhlfs != null" >
        FHLFS,
      </if>
      <if test="fhlffbh != null" >
        FHLFFBH,
      </if>
      <if test="fhlff != null" >
        FHLFF,
      </if>
      <if test="fqtype != null" >
        FQTYPE,
      </if>
      <if test="fqt != null" >
        FQT,
      </if>
      <if test="fqn != null" >
        FQN,
      </if>
      <if test="fqm != null" >
        FQM,
      </if>
      <if test="fqall != null" >
        FQALL,
      </if>
      <if test="fqallbh != null" >
        FQALLBH,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="fid != null" >
        #{fid,jdbcType=BIGINT},
      </if>
      <if test="fprn != null" >
        #{fprn,jdbcType=VARCHAR},
      </if>
      <if test="ftimes != null" >
        #{ftimes,jdbcType=INTEGER},
      </if>
      <if test="fflfsbh != null" >
        #{fflfsbh,jdbcType=VARCHAR},
      </if>
      <if test="fflfs != null" >
        #{fflfs,jdbcType=VARCHAR},
      </if>
      <if test="fflcxbh != null" >
        #{fflcxbh,jdbcType=VARCHAR},
      </if>
      <if test="fflcx != null" >
        #{fflcx,jdbcType=VARCHAR},
      </if>
      <if test="fflzzbh != null" >
        #{fflzzbh,jdbcType=VARCHAR},
      </if>
      <if test="fflzz != null" >
        #{fflzz,jdbcType=VARCHAR},
      </if>
      <if test="fyjy != null" >
        #{fyjy,jdbcType=INTEGER},
      </if>
      <if test="fycs != null" >
        #{fycs,jdbcType=INTEGER},
      </if>
      <if test="fyts != null" >
        #{fyts,jdbcType=INTEGER},
      </if>
      <if test="fyrq1 != null" >
        #{fyrq1,jdbcType=TIMESTAMP},
      </if>
      <if test="fyrq2 != null" >
        #{fyrq2,jdbcType=TIMESTAMP},
      </if>
      <if test="fqjy != null" >
        #{fqjy,jdbcType=INTEGER},
      </if>
      <if test="fqcs != null" >
        #{fqcs,jdbcType=INTEGER},
      </if>
      <if test="fqts != null" >
        #{fqts,jdbcType=INTEGER},
      </if>
      <if test="fqrq1 != null" >
        #{fqrq1,jdbcType=TIMESTAMP},
      </if>
      <if test="fqrq2 != null" >
        #{fqrq2,jdbcType=TIMESTAMP},
      </if>
      <if test="fzname != null" >
        #{fzname,jdbcType=VARCHAR},
      </if>
      <if test="fzjy != null" >
        #{fzjy,jdbcType=INTEGER},
      </if>
      <if test="fzcs != null" >
        #{fzcs,jdbcType=INTEGER},
      </if>
      <if test="fzts != null" >
        #{fzts,jdbcType=INTEGER},
      </if>
      <if test="fzrq1 != null" >
        #{fzrq1,jdbcType=TIMESTAMP},
      </if>
      <if test="fzrq2 != null" >
        #{fzrq2,jdbcType=TIMESTAMP},
      </if>
      <if test="fhlfsbh != null" >
        #{fhlfsbh,jdbcType=VARCHAR},
      </if>
      <if test="fhlfs != null" >
        #{fhlfs,jdbcType=VARCHAR},
      </if>
      <if test="fhlffbh != null" >
        #{fhlffbh,jdbcType=VARCHAR},
      </if>
      <if test="fhlff != null" >
        #{fhlff,jdbcType=VARCHAR},
      </if>
      <if test="fqtype != null" >
        #{fqtype,jdbcType=VARCHAR},
      </if>
      <if test="fqt != null" >
        #{fqt,jdbcType=VARCHAR},
      </if>
      <if test="fqn != null" >
        #{fqn,jdbcType=VARCHAR},
      </if>
      <if test="fqm != null" >
        #{fqm,jdbcType=VARCHAR},
      </if>
      <if test="fqall != null" >
        #{fqall,jdbcType=VARCHAR},
      </if>
      <if test="fqallbh != null" >
        #{fqallbh,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.emr.entity.his.HISBA6" >
    update HIS_BA6
    <set >
      <if test="fprn != null" >
        FPRN = #{fprn,jdbcType=VARCHAR},
      </if>
      <if test="ftimes != null" >
        FTIMES = #{ftimes,jdbcType=INTEGER},
      </if>
      <if test="fflfsbh != null" >
        FFLFSBH = #{fflfsbh,jdbcType=VARCHAR},
      </if>
      <if test="fflfs != null" >
        FFLFS = #{fflfs,jdbcType=VARCHAR},
      </if>
      <if test="fflcxbh != null" >
        FFLCXBH = #{fflcxbh,jdbcType=VARCHAR},
      </if>
      <if test="fflcx != null" >
        FFLCX = #{fflcx,jdbcType=VARCHAR},
      </if>
      <if test="fflzzbh != null" >
        FFLZZBH = #{fflzzbh,jdbcType=VARCHAR},
      </if>
      <if test="fflzz != null" >
        FFLZZ = #{fflzz,jdbcType=VARCHAR},
      </if>
      <if test="fyjy != null" >
        FYJY = #{fyjy,jdbcType=INTEGER},
      </if>
      <if test="fycs != null" >
        FYCS = #{fycs,jdbcType=INTEGER},
      </if>
      <if test="fyts != null" >
        FYTS = #{fyts,jdbcType=INTEGER},
      </if>
      <if test="fyrq1 != null" >
        FYRQ1 = #{fyrq1,jdbcType=TIMESTAMP},
      </if>
      <if test="fyrq2 != null" >
        FYRQ2 = #{fyrq2,jdbcType=TIMESTAMP},
      </if>
      <if test="fqjy != null" >
        FQJY = #{fqjy,jdbcType=INTEGER},
      </if>
      <if test="fqcs != null" >
        FQCS = #{fqcs,jdbcType=INTEGER},
      </if>
      <if test="fqts != null" >
        FQTS = #{fqts,jdbcType=INTEGER},
      </if>
      <if test="fqrq1 != null" >
        FQRQ1 = #{fqrq1,jdbcType=TIMESTAMP},
      </if>
      <if test="fqrq2 != null" >
        FQRQ2 = #{fqrq2,jdbcType=TIMESTAMP},
      </if>
      <if test="fzname != null" >
        FZNAME = #{fzname,jdbcType=VARCHAR},
      </if>
      <if test="fzjy != null" >
        FZJY = #{fzjy,jdbcType=INTEGER},
      </if>
      <if test="fzcs != null" >
        FZCS = #{fzcs,jdbcType=INTEGER},
      </if>
      <if test="fzts != null" >
        FZTS = #{fzts,jdbcType=INTEGER},
      </if>
      <if test="fzrq1 != null" >
        FZRQ1 = #{fzrq1,jdbcType=TIMESTAMP},
      </if>
      <if test="fzrq2 != null" >
        FZRQ2 = #{fzrq2,jdbcType=TIMESTAMP},
      </if>
      <if test="fhlfsbh != null" >
        FHLFSBH = #{fhlfsbh,jdbcType=VARCHAR},
      </if>
      <if test="fhlfs != null" >
        FHLFS = #{fhlfs,jdbcType=VARCHAR},
      </if>
      <if test="fhlffbh != null" >
        FHLFFBH = #{fhlffbh,jdbcType=VARCHAR},
      </if>
      <if test="fhlff != null" >
        FHLFF = #{fhlff,jdbcType=VARCHAR},
      </if>
      <if test="fqtype != null" >
        FQTYPE = #{fqtype,jdbcType=VARCHAR},
      </if>
      <if test="fqt != null" >
        FQT = #{fqt,jdbcType=VARCHAR},
      </if>
      <if test="fqn != null" >
        FQN = #{fqn,jdbcType=VARCHAR},
      </if>
      <if test="fqm != null" >
        FQM = #{fqm,jdbcType=VARCHAR},
      </if>
      <if test="fqall != null" >
        FQALL = #{fqall,jdbcType=VARCHAR},
      </if>
      <if test="fqallbh != null" >
        FQALLBH = #{fqallbh,jdbcType=VARCHAR},
      </if>
    </set>
    where FID = #{fid,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.emr.entity.his.HISBA6" >
    update HIS_BA6
    set FPRN = #{fprn,jdbcType=VARCHAR},
      FTIMES = #{ftimes,jdbcType=INTEGER},
      FFLFSBH = #{fflfsbh,jdbcType=VARCHAR},
      FFLFS = #{fflfs,jdbcType=VARCHAR},
      FFLCXBH = #{fflcxbh,jdbcType=VARCHAR},
      FFLCX = #{fflcx,jdbcType=VARCHAR},
      FFLZZBH = #{fflzzbh,jdbcType=VARCHAR},
      FFLZZ = #{fflzz,jdbcType=VARCHAR},
      FYJY = #{fyjy,jdbcType=INTEGER},
      FYCS = #{fycs,jdbcType=INTEGER},
      FYTS = #{fyts,jdbcType=INTEGER},
      FYRQ1 = #{fyrq1,jdbcType=TIMESTAMP},
      FYRQ2 = #{fyrq2,jdbcType=TIMESTAMP},
      FQJY = #{fqjy,jdbcType=INTEGER},
      FQCS = #{fqcs,jdbcType=INTEGER},
      FQTS = #{fqts,jdbcType=INTEGER},
      FQRQ1 = #{fqrq1,jdbcType=TIMESTAMP},
      FQRQ2 = #{fqrq2,jdbcType=TIMESTAMP},
      FZNAME = #{fzname,jdbcType=VARCHAR},
      FZJY = #{fzjy,jdbcType=INTEGER},
      FZCS = #{fzcs,jdbcType=INTEGER},
      FZTS = #{fzts,jdbcType=INTEGER},
      FZRQ1 = #{fzrq1,jdbcType=TIMESTAMP},
      FZRQ2 = #{fzrq2,jdbcType=TIMESTAMP},
      FHLFSBH = #{fhlfsbh,jdbcType=VARCHAR},
      FHLFS = #{fhlfs,jdbcType=VARCHAR},
      FHLFFBH = #{fhlffbh,jdbcType=VARCHAR},
      FHLFF = #{fhlff,jdbcType=VARCHAR},
      FQTYPE = #{fqtype,jdbcType=VARCHAR},
      FQT = #{fqt,jdbcType=VARCHAR},
      FQN = #{fqn,jdbcType=VARCHAR},
      FQM = #{fqm,jdbcType=VARCHAR},
      FQALL = #{fqall,jdbcType=VARCHAR},
      FQALLBH = #{fqallbh,jdbcType=VARCHAR}
    where FID = #{fid,jdbcType=BIGINT}
  </update>
  <!--按病案号、住院次数查询记录-->
  <select id="selectAllByParam" resultMap="BaseResultMap">
      SELECT * FROM HIS_BA6 WHERE FPRN = #{fprn,jdbcType=VARCHAR} AND FTIMES = #{ftimes,jdbcType=INTEGER}
  </select>
</mapper>