123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453 |
- <?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.xinxin.topro.inpnurseservice.mysqlmapper.InpChildInfoMapper" >
- <resultMap id="BaseResultMap" type="com.xinxin.topro.inpnurseservice.mysqlmodel.InpChildInfo" >
- <id column="ICI_ID" property="iciId" jdbcType="INTEGER" />
- <result column="HI_ID" property="hiId" jdbcType="INTEGER" />
- <result column="ICI_IsInfant" property="iciIsinfant" jdbcType="INTEGER" />
- <result column="ICI_PatientNO" property="iciPatientno" jdbcType="VARCHAR" />
- <result column="ICI_MotherNo" property="iciMotherno" jdbcType="VARCHAR" />
- <result column="ICI_Med_Rec" property="iciMedRec" jdbcType="VARCHAR" />
- <result column="ICI_Name" property="iciName" jdbcType="VARCHAR" />
- <result column="ICI_Gender" property="iciGender" jdbcType="INTEGER" />
- <result column="ICI_Birth" property="iciBirth" jdbcType="TIMESTAMP" />
- <result column="ICI_GravidaWeek" property="iciGravidaweek" jdbcType="INTEGER" />
- <result column="ICI_Gravida" property="iciGravida" jdbcType="INTEGER" />
- <result column="ICI_Para" property="iciPara" jdbcType="INTEGER" />
- <result column="ICI_BodyLength" property="iciBodylength" jdbcType="INTEGER" />
- <result column="ICI_Weight" property="iciWeight" jdbcType="INTEGER" />
- <result column="ICI_EDC" property="iciEdc" jdbcType="TIMESTAMP" />
- <result column="ICI_FatherName" property="iciFathername" jdbcType="VARCHAR" />
- <result column="ICI_Health" property="iciHealth" jdbcType="VARCHAR" />
- <result column="ICI_DeliveryMode" property="iciDeliverymode" jdbcType="VARCHAR" />
- <result column="ICI_DeliverDoctor" property="iciDeliverdoctor" jdbcType="VARCHAR" />
- <result column="ICI_DeliverNurse" property="iciDelivernurse" jdbcType="VARCHAR" />
- <result column="ICI_Placenta" property="iciPlacenta" jdbcType="VARCHAR" />
- <result column="ICI_Recorder" property="iciRecorder" jdbcType="VARCHAR" />
- <result column="ICI_RecorderTime" property="iciRecordertime" jdbcType="TIMESTAMP" />
- <result column="ICI_Alteror" property="iciAlteror" jdbcType="VARCHAR" />
- <result column="ICI_AlterorTime" property="iciAlterortime" jdbcType="TIMESTAMP" />
- <result column="ICI_isDel" property="iciIsdel" jdbcType="INTEGER" />
- <result column="ICI_Reamrk" property="iciReamrk" jdbcType="VARCHAR" />
- <result column="ICI_AdmitId" property="iciAdmitid" jdbcType="VARCHAR" />
- <result column="ICI_Admit_Time" property="iciAdmitTime" jdbcType="TIMESTAMP" />
- <result column="ICI_Admit_Dep" property="iciAdmitDep" jdbcType="VARCHAR" />
- <result column="ICI_Admit_Ward" property="iciAdmitWard" jdbcType="VARCHAR" />
- </resultMap>
- <sql id="Base_Column_List" >
- ICI_ID, HI_ID, ICI_IsInfant, ICI_PatientNO, ICI_MotherNo, ICI_Med_Rec, ICI_Name,
- ICI_Gender, ICI_Birth, ICI_GravidaWeek, ICI_Gravida, ICI_Para, ICI_BodyLength, ICI_Weight,
- ICI_EDC, ICI_FatherName, ICI_Health, ICI_DeliveryMode, ICI_DeliverDoctor, ICI_DeliverNurse,
- ICI_Placenta, ICI_Recorder, ICI_RecorderTime, ICI_Alteror, ICI_AlterorTime, ICI_isDel,
- ICI_Reamrk, ICI_AdmitId, ICI_Admit_Time, ICI_Admit_Dep, ICI_Admit_Ward
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
- select
- <include refid="Base_Column_List" />
- from inp_child_info
- where ICI_ID = #{iciId,jdbcType=INTEGER}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
- delete from inp_child_info
- where ICI_ID = #{iciId,jdbcType=INTEGER}
- </delete>
- <insert id="insert" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpChildInfo" >
- insert into inp_child_info (ICI_ID, HI_ID, ICI_IsInfant,
- ICI_PatientNO, ICI_MotherNo, ICI_Med_Rec,
- ICI_Name, ICI_Gender, ICI_Birth,
- ICI_GravidaWeek, ICI_Gravida, ICI_Para,
- ICI_BodyLength, ICI_Weight, ICI_EDC,
- ICI_FatherName, ICI_Health, ICI_DeliveryMode,
- ICI_DeliverDoctor, ICI_DeliverNurse, ICI_Placenta,
- ICI_Recorder, ICI_RecorderTime, ICI_Alteror,
- ICI_AlterorTime, ICI_isDel, ICI_Reamrk,
- ICI_AdmitId, ICI_Admit_Time, ICI_Admit_Dep,
- ICI_Admit_Ward)
- values (#{iciId,jdbcType=INTEGER}, #{hiId,jdbcType=INTEGER}, #{iciIsinfant,jdbcType=INTEGER},
- #{iciPatientno,jdbcType=VARCHAR}, #{iciMotherno,jdbcType=VARCHAR}, #{iciMedRec,jdbcType=VARCHAR},
- #{iciName,jdbcType=VARCHAR}, #{iciGender,jdbcType=INTEGER}, #{iciBirth,jdbcType=TIMESTAMP},
- #{iciGravidaweek,jdbcType=INTEGER}, #{iciGravida,jdbcType=INTEGER}, #{iciPara,jdbcType=INTEGER},
- #{iciBodylength,jdbcType=INTEGER}, #{iciWeight,jdbcType=INTEGER}, #{iciEdc,jdbcType=TIMESTAMP},
- #{iciFathername,jdbcType=VARCHAR}, #{iciHealth,jdbcType=VARCHAR}, #{iciDeliverymode,jdbcType=VARCHAR},
- #{iciDeliverdoctor,jdbcType=VARCHAR}, #{iciDelivernurse,jdbcType=VARCHAR}, #{iciPlacenta,jdbcType=VARCHAR},
- #{iciRecorder,jdbcType=VARCHAR}, #{iciRecordertime,jdbcType=TIMESTAMP}, #{iciAlteror,jdbcType=VARCHAR},
- #{iciAlterortime,jdbcType=TIMESTAMP}, #{iciIsdel,jdbcType=INTEGER}, #{iciReamrk,jdbcType=VARCHAR},
- #{iciAdmitid,jdbcType=VARCHAR}, #{iciAdmitTime,jdbcType=TIMESTAMP}, #{iciAdmitDep,jdbcType=VARCHAR},
- #{iciAdmitWard,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpChildInfo" >
- insert into inp_child_info
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="iciId != null" >
- ICI_ID,
- </if>
- <if test="hiId != null" >
- HI_ID,
- </if>
- <if test="iciIsinfant != null" >
- ICI_IsInfant,
- </if>
- <if test="iciPatientno != null" >
- ICI_PatientNO,
- </if>
- <if test="iciMotherno != null" >
- ICI_MotherNo,
- </if>
- <if test="iciMedRec != null" >
- ICI_Med_Rec,
- </if>
- <if test="iciName != null" >
- ICI_Name,
- </if>
- <if test="iciGender != null" >
- ICI_Gender,
- </if>
- <if test="iciBirth != null" >
- ICI_Birth,
- </if>
- <if test="iciGravidaweek != null" >
- ICI_GravidaWeek,
- </if>
- <if test="iciGravida != null" >
- ICI_Gravida,
- </if>
- <if test="iciPara != null" >
- ICI_Para,
- </if>
- <if test="iciBodylength != null" >
- ICI_BodyLength,
- </if>
- <if test="iciWeight != null" >
- ICI_Weight,
- </if>
- <if test="iciEdc != null" >
- ICI_EDC,
- </if>
- <if test="iciFathername != null" >
- ICI_FatherName,
- </if>
- <if test="iciHealth != null" >
- ICI_Health,
- </if>
- <if test="iciDeliverymode != null" >
- ICI_DeliveryMode,
- </if>
- <if test="iciDeliverdoctor != null" >
- ICI_DeliverDoctor,
- </if>
- <if test="iciDelivernurse != null" >
- ICI_DeliverNurse,
- </if>
- <if test="iciPlacenta != null" >
- ICI_Placenta,
- </if>
- <if test="iciRecorder != null" >
- ICI_Recorder,
- </if>
- <if test="iciRecordertime != null" >
- ICI_RecorderTime,
- </if>
- <if test="iciAlteror != null" >
- ICI_Alteror,
- </if>
- <if test="iciAlterortime != null" >
- ICI_AlterorTime,
- </if>
- <if test="iciIsdel != null" >
- ICI_isDel,
- </if>
- <if test="iciReamrk != null" >
- ICI_Reamrk,
- </if>
- <if test="iciAdmitid != null" >
- ICI_AdmitId,
- </if>
- <if test="iciAdmitTime != null" >
- ICI_Admit_Time,
- </if>
- <if test="iciAdmitDep != null" >
- ICI_Admit_Dep,
- </if>
- <if test="iciAdmitWard != null" >
- ICI_Admit_Ward,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="iciId != null" >
- #{iciId,jdbcType=INTEGER},
- </if>
- <if test="hiId != null" >
- #{hiId,jdbcType=INTEGER},
- </if>
- <if test="iciIsinfant != null" >
- #{iciIsinfant,jdbcType=INTEGER},
- </if>
- <if test="iciPatientno != null" >
- #{iciPatientno,jdbcType=VARCHAR},
- </if>
- <if test="iciMotherno != null" >
- #{iciMotherno,jdbcType=VARCHAR},
- </if>
- <if test="iciMedRec != null" >
- #{iciMedRec,jdbcType=VARCHAR},
- </if>
- <if test="iciName != null" >
- #{iciName,jdbcType=VARCHAR},
- </if>
- <if test="iciGender != null" >
- #{iciGender,jdbcType=INTEGER},
- </if>
- <if test="iciBirth != null" >
- #{iciBirth,jdbcType=TIMESTAMP},
- </if>
- <if test="iciGravidaweek != null" >
- #{iciGravidaweek,jdbcType=INTEGER},
- </if>
- <if test="iciGravida != null" >
- #{iciGravida,jdbcType=INTEGER},
- </if>
- <if test="iciPara != null" >
- #{iciPara,jdbcType=INTEGER},
- </if>
- <if test="iciBodylength != null" >
- #{iciBodylength,jdbcType=INTEGER},
- </if>
- <if test="iciWeight != null" >
- #{iciWeight,jdbcType=INTEGER},
- </if>
- <if test="iciEdc != null" >
- #{iciEdc,jdbcType=TIMESTAMP},
- </if>
- <if test="iciFathername != null" >
- #{iciFathername,jdbcType=VARCHAR},
- </if>
- <if test="iciHealth != null" >
- #{iciHealth,jdbcType=VARCHAR},
- </if>
- <if test="iciDeliverymode != null" >
- #{iciDeliverymode,jdbcType=VARCHAR},
- </if>
- <if test="iciDeliverdoctor != null" >
- #{iciDeliverdoctor,jdbcType=VARCHAR},
- </if>
- <if test="iciDelivernurse != null" >
- #{iciDelivernurse,jdbcType=VARCHAR},
- </if>
- <if test="iciPlacenta != null" >
- #{iciPlacenta,jdbcType=VARCHAR},
- </if>
- <if test="iciRecorder != null" >
- #{iciRecorder,jdbcType=VARCHAR},
- </if>
- <if test="iciRecordertime != null" >
- #{iciRecordertime,jdbcType=TIMESTAMP},
- </if>
- <if test="iciAlteror != null" >
- #{iciAlteror,jdbcType=VARCHAR},
- </if>
- <if test="iciAlterortime != null" >
- #{iciAlterortime,jdbcType=TIMESTAMP},
- </if>
- <if test="iciIsdel != null" >
- #{iciIsdel,jdbcType=INTEGER},
- </if>
- <if test="iciReamrk != null" >
- #{iciReamrk,jdbcType=VARCHAR},
- </if>
- <if test="iciAdmitid != null" >
- #{iciAdmitid,jdbcType=VARCHAR},
- </if>
- <if test="iciAdmitTime != null" >
- #{iciAdmitTime,jdbcType=TIMESTAMP},
- </if>
- <if test="iciAdmitDep != null" >
- #{iciAdmitDep,jdbcType=VARCHAR},
- </if>
- <if test="iciAdmitWard != null" >
- #{iciAdmitWard,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpChildInfo" >
- update inp_child_info
- <set >
- <if test="hiId != null" >
- HI_ID = #{hiId,jdbcType=INTEGER},
- </if>
- <if test="iciIsinfant != null" >
- ICI_IsInfant = #{iciIsinfant,jdbcType=INTEGER},
- </if>
- <if test="iciPatientno != null" >
- ICI_PatientNO = #{iciPatientno,jdbcType=VARCHAR},
- </if>
- <if test="iciMotherno != null" >
- ICI_MotherNo = #{iciMotherno,jdbcType=VARCHAR},
- </if>
- <if test="iciMedRec != null" >
- ICI_Med_Rec = #{iciMedRec,jdbcType=VARCHAR},
- </if>
- <if test="iciName != null" >
- ICI_Name = #{iciName,jdbcType=VARCHAR},
- </if>
- <if test="iciGender != null" >
- ICI_Gender = #{iciGender,jdbcType=INTEGER},
- </if>
- <if test="iciBirth != null" >
- ICI_Birth = #{iciBirth,jdbcType=TIMESTAMP},
- </if>
- <if test="iciGravidaweek != null" >
- ICI_GravidaWeek = #{iciGravidaweek,jdbcType=INTEGER},
- </if>
- <if test="iciGravida != null" >
- ICI_Gravida = #{iciGravida,jdbcType=INTEGER},
- </if>
- <if test="iciPara != null" >
- ICI_Para = #{iciPara,jdbcType=INTEGER},
- </if>
- <if test="iciBodylength != null" >
- ICI_BodyLength = #{iciBodylength,jdbcType=INTEGER},
- </if>
- <if test="iciWeight != null" >
- ICI_Weight = #{iciWeight,jdbcType=INTEGER},
- </if>
- <if test="iciEdc != null" >
- ICI_EDC = #{iciEdc,jdbcType=TIMESTAMP},
- </if>
- <if test="iciFathername != null" >
- ICI_FatherName = #{iciFathername,jdbcType=VARCHAR},
- </if>
- <if test="iciHealth != null" >
- ICI_Health = #{iciHealth,jdbcType=VARCHAR},
- </if>
- <if test="iciDeliverymode != null" >
- ICI_DeliveryMode = #{iciDeliverymode,jdbcType=VARCHAR},
- </if>
- <if test="iciDeliverdoctor != null" >
- ICI_DeliverDoctor = #{iciDeliverdoctor,jdbcType=VARCHAR},
- </if>
- <if test="iciDelivernurse != null" >
- ICI_DeliverNurse = #{iciDelivernurse,jdbcType=VARCHAR},
- </if>
- <if test="iciPlacenta != null" >
- ICI_Placenta = #{iciPlacenta,jdbcType=VARCHAR},
- </if>
- <if test="iciRecorder != null" >
- ICI_Recorder = #{iciRecorder,jdbcType=VARCHAR},
- </if>
- <if test="iciRecordertime != null" >
- ICI_RecorderTime = #{iciRecordertime,jdbcType=TIMESTAMP},
- </if>
- <if test="iciAlteror != null" >
- ICI_Alteror = #{iciAlteror,jdbcType=VARCHAR},
- </if>
- <if test="iciAlterortime != null" >
- ICI_AlterorTime = #{iciAlterortime,jdbcType=TIMESTAMP},
- </if>
- <if test="iciIsdel != null" >
- ICI_isDel = #{iciIsdel,jdbcType=INTEGER},
- </if>
- <if test="iciReamrk != null" >
- ICI_Reamrk = #{iciReamrk,jdbcType=VARCHAR},
- </if>
- <if test="iciAdmitid != null" >
- ICI_AdmitId = #{iciAdmitid,jdbcType=VARCHAR},
- </if>
- <if test="iciAdmitTime != null" >
- ICI_Admit_Time = #{iciAdmitTime,jdbcType=TIMESTAMP},
- </if>
- <if test="iciAdmitDep != null" >
- ICI_Admit_Dep = #{iciAdmitDep,jdbcType=VARCHAR},
- </if>
- <if test="iciAdmitWard != null" >
- ICI_Admit_Ward = #{iciAdmitWard,jdbcType=VARCHAR},
- </if>
- </set>
- where ICI_ID = #{iciId,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpChildInfo" >
- update inp_child_info
- set HI_ID = #{hiId,jdbcType=INTEGER},
- ICI_IsInfant = #{iciIsinfant,jdbcType=INTEGER},
- ICI_PatientNO = #{iciPatientno,jdbcType=VARCHAR},
- ICI_MotherNo = #{iciMotherno,jdbcType=VARCHAR},
- ICI_Med_Rec = #{iciMedRec,jdbcType=VARCHAR},
- ICI_Name = #{iciName,jdbcType=VARCHAR},
- ICI_Gender = #{iciGender,jdbcType=INTEGER},
- ICI_Birth = #{iciBirth,jdbcType=TIMESTAMP},
- ICI_GravidaWeek = #{iciGravidaweek,jdbcType=INTEGER},
- ICI_Gravida = #{iciGravida,jdbcType=INTEGER},
- ICI_Para = #{iciPara,jdbcType=INTEGER},
- ICI_BodyLength = #{iciBodylength,jdbcType=INTEGER},
- ICI_Weight = #{iciWeight,jdbcType=INTEGER},
- ICI_EDC = #{iciEdc,jdbcType=TIMESTAMP},
- ICI_FatherName = #{iciFathername,jdbcType=VARCHAR},
- ICI_Health = #{iciHealth,jdbcType=VARCHAR},
- ICI_DeliveryMode = #{iciDeliverymode,jdbcType=VARCHAR},
- ICI_DeliverDoctor = #{iciDeliverdoctor,jdbcType=VARCHAR},
- ICI_DeliverNurse = #{iciDelivernurse,jdbcType=VARCHAR},
- ICI_Placenta = #{iciPlacenta,jdbcType=VARCHAR},
- ICI_Recorder = #{iciRecorder,jdbcType=VARCHAR},
- ICI_RecorderTime = #{iciRecordertime,jdbcType=TIMESTAMP},
- ICI_Alteror = #{iciAlteror,jdbcType=VARCHAR},
- ICI_AlterorTime = #{iciAlterortime,jdbcType=TIMESTAMP},
- ICI_isDel = #{iciIsdel,jdbcType=INTEGER},
- ICI_Reamrk = #{iciReamrk,jdbcType=VARCHAR},
- ICI_AdmitId = #{iciAdmitid,jdbcType=VARCHAR},
- ICI_Admit_Time = #{iciAdmitTime,jdbcType=TIMESTAMP},
- ICI_Admit_Dep = #{iciAdmitDep,jdbcType=VARCHAR},
- ICI_Admit_Ward = #{iciAdmitWard,jdbcType=VARCHAR}
- where ICI_ID = #{iciId,jdbcType=INTEGER}
- </update>
- <select id="getByPatientNo" resultMap="BaseResultMap">
- select <include refid="Base_Column_List"/>
- from inp_child_info
- where ICI_isDel = 0
- and ICI_PatientNO = #{patientNo,jdbcType=VARCHAR}
- and HI_ID = #{hiId,jdbcType=INTEGER}
- limit 1
- </select>
- <select id="getNewbornInfoList" resultType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpPatient">
- select
- b.IP_Name ipName,
- b.IP_Med_Rec ipMedRec,
- b.IP_PatientNo ipPatientno,
- b.DB_BedNo dbBedno,
- b.DD_DepDm ddDepdm
- from
- (select
- IP.IP_Name,
- IP.IP_PatientNo,
- IP.IP_Med_Rec,
- ip.DB_BedNo,
- ici.ICI_Birth,
- ip.DD_DepDm
- from inp_child_info ici,inp_patient ip
- where ici.ICI_PatientNO = ip.IP_PatientNo
- and ip.DW_WardDm = #{ddWardDm,jdbcType=VARCHAR}
- and ip.IP_Status != 2
- and ip.IP_IsDel = 0
- and ici.ICI_isDel = 0
- and ici.ICI_IsInfant = 1
- and ip.IP_IsInfant = 1
- and ici.HI_ID = #{hiId,jdbcType=INTEGER}
- and ip.HI_ID = #{hiId,jdbcType=INTEGER}
- having #{measureTime,jdbcType=TIMESTAMP} >= DATE_ADD(ici.ICI_Birth,INTERVAL 1 DAY)) b
- left join dic_bed db on db.HI_ID = #{hiId,jdbcType=INTEGER} and db.DW_WardDm = #{ddWardDm,jdbcType=VARCHAR}
- and db.DB_BedNo = b.DB_BedNo
- order by db.DB_Sort
- </select>
- <select id="getByPatientNoList" resultMap="BaseResultMap">
- select <include refid="Base_Column_List"/>
- from inp_child_info
- where ICI_isDel = 0
- and HI_ID = #{hiId,jdbcType=INTEGER}
- and ICI_PatientNO in
- <foreach collection="list" close=")" open="(" separator="," index="index" item="item">
- #{item,jdbcType=VARCHAR}
- </foreach>
- </select>
- </mapper>
|