123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460 |
- <?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.InpSpecialEventMapper" >
- <resultMap id="BaseResultMap" type="com.xinxin.topro.inpnurseservice.mysqlmodel.InpSpecialEvent" >
- <id column="ISE_ID" property="iseId" jdbcType="INTEGER" />
- <result column="PatientNo" property="patientno" jdbcType="VARCHAR" />
- <result column="HI_ID" property="hiId" jdbcType="INTEGER" />
- <result column="DD_DepDm" property="ddDepdm" jdbcType="VARCHAR" />
- <result column="DW_WardDm" property="dwWarddm" jdbcType="VARCHAR" />
- <result column="DB_BedNo" property="dbBedno" jdbcType="VARCHAR" />
- <result column="ISE_Measure_Time" property="iseMeasureTime" jdbcType="TIMESTAMP" />
- <result column="ISE_Recordor" property="iseRecordor" jdbcType="VARCHAR" />
- <result column="ISE_Record_Time" property="iseRecordTime" jdbcType="TIMESTAMP" />
- <result column="ISE_Item_Code" property="iseItemCode" jdbcType="VARCHAR" />
- <result column="ISE_Item_Name" property="iseItemName" jdbcType="VARCHAR" />
- <result column="ISE_Item_Value" property="iseItemValue" jdbcType="VARCHAR" />
- <result column="ISE_Remark" property="iseRemark" jdbcType="VARCHAR" />
- <result column="ISE_Original" property="iseOriginal" jdbcType="VARCHAR" />
- <result column="ISE_Original_ID" property="iseOriginalId" jdbcType="INTEGER" />
- <result column="ISE_IsDel" property="iseIsdel" jdbcType="INTEGER" />
- <result column="ISE_Operation_Time" property="iseOperationTime" jdbcType="TIMESTAMP" />
- <result column="ISE_Operator" property="iseOperator" jdbcType="VARCHAR" />
- <result column="ISE_Time_Point" property="iseTimePoint" jdbcType="VARCHAR"/>
- </resultMap>
- <resultMap id="ResultMap" type="com.xinxin.topro.inpnurseservice.response.InpSpecialEventResponse" >
- <result column="operateTime" property="operateTime" jdbcType="TIMESTAMP" />
- <result column="operateName" property="operateName" jdbcType="VARCHAR" />
- <result column="doctorName" property="doctorName" jdbcType="VARCHAR" />
- </resultMap>
- <sql id="Base_Column_List" >
- ISE_ID, PatientNo, HI_ID, DD_DepDm, DW_WardDm, DB_BedNo, ISE_Measure_Time, ISE_Recordor,
- ISE_Record_Time, ISE_Item_Code, ISE_Item_Name, ISE_Item_Value, ISE_Remark, ISE_Original,
- ISE_Original_ID, ISE_IsDel, ISE_Operation_Time, ISE_Operator,ISE_Time_Point
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
- select
- <include refid="Base_Column_List" />
- from inp_special_event
- where ISE_IsDel = 0 and ISE_ID = #{iseId,jdbcType=INTEGER}
- </select>
- <select id="selectByIds" resultMap="BaseResultMap" parameterType="java.util.List" >
- select
- <include refid="Base_Column_List" />
- from inp_special_event
- where ISE_IsDel = 0
- and ISE_ID in <foreach item='item' index='index' collection='list' open='(' separator=',' close=')'> #{item} </foreach>
- </select>
- <select id="selectByPatientNos" resultMap="BaseResultMap" parameterType="java.util.List" >
- select
- <include refid="Base_Column_List" />
- from inp_special_event
- where PatientNo in <foreach item='item' index='index' collection='list' open='(' separator=',' close=')'> #{item} </foreach>
- and ISE_IsDel = 0
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
- delete from inp_special_event
- where ISE_ID = #{iseId,jdbcType=INTEGER}
- </delete>
- <insert id="insert" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpSpecialEvent" useGeneratedKeys="true"
- keyColumn="ISE_ID" keyProperty="iseId">
- insert into inp_special_event (ISE_ID, PatientNo, HI_ID,
- DD_DepDm, DW_WardDm, DB_BedNo,
- ISE_Measure_Time, ISE_Recordor, ISE_Record_Time,
- ISE_Item_Code, ISE_Item_Name, ISE_Item_Value,
- ISE_Remark, ISE_Original, ISE_Original_ID,
- ISE_IsDel, ISE_Operation_Time, ISE_Operator,ISE_Time_Point
- )
- values (#{iseId,jdbcType=INTEGER}, #{patientno,jdbcType=VARCHAR}, #{hiId,jdbcType=INTEGER},
- #{ddDepdm,jdbcType=VARCHAR}, #{dwWarddm,jdbcType=VARCHAR}, #{dbBedno,jdbcType=VARCHAR},
- #{iseMeasureTime,jdbcType=TIMESTAMP}, #{iseRecordor,jdbcType=VARCHAR}, #{iseRecordTime,jdbcType=TIMESTAMP},
- #{iseItemCode,jdbcType=VARCHAR}, #{iseItemName,jdbcType=VARCHAR}, #{iseItemValue,jdbcType=VARCHAR},
- #{iseRemark,jdbcType=VARCHAR}, #{iseOriginal,jdbcType=VARCHAR}, #{iseOriginalId,jdbcType=INTEGER},
- #{iseIsdel,jdbcType=INTEGER}, #{iseOperationTime,jdbcType=TIMESTAMP}, #{iseOperator,jdbcType=VARCHAR},
- #{iseTimePoint,jdbcType=VARCHAR}
- )
- </insert>
- <insert id="insertSelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpSpecialEvent" >
- insert into inp_special_event
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="iseId != null" >
- ISE_ID,
- </if>
- <if test="patientno != null" >
- PatientNo,
- </if>
- <if test="hiId != null" >
- HI_ID,
- </if>
- <if test="ddDepdm != null" >
- DD_DepDm,
- </if>
- <if test="dwWarddm != null" >
- DW_WardDm,
- </if>
- <if test="dbBedno != null" >
- DB_BedNo,
- </if>
- <if test="iseMeasureTime != null" >
- ISE_Measure_Time,
- </if>
- <if test="iseRecordor != null" >
- ISE_Recordor,
- </if>
- <if test="iseRecordTime != null" >
- ISE_Record_Time,
- </if>
- <if test="iseItemCode != null" >
- ISE_Item_Code,
- </if>
- <if test="iseItemName != null" >
- ISE_Item_Name,
- </if>
- <if test="iseItemValue != null" >
- ISE_Item_Value,
- </if>
- <if test="iseRemark != null" >
- ISE_Remark,
- </if>
- <if test="iseOriginal != null" >
- ISE_Original,
- </if>
- <if test="iseOriginalId != null" >
- ISE_Original_ID,
- </if>
- <if test="iseIsdel != null" >
- ISE_IsDel,
- </if>
- <if test="iseOperationTime != null" >
- ISE_Operation_Time,
- </if>
- <if test="iseOperator != null" >
- ISE_Operator,
- </if>
- <if test="iseTimePoint != null">
- ISE_Time_Point,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="iseId != null" >
- #{iseId,jdbcType=INTEGER},
- </if>
- <if test="patientno != null" >
- #{patientno,jdbcType=VARCHAR},
- </if>
- <if test="hiId != null" >
- #{hiId,jdbcType=INTEGER},
- </if>
- <if test="ddDepdm != null" >
- #{ddDepdm,jdbcType=VARCHAR},
- </if>
- <if test="dwWarddm != null" >
- #{dwWarddm,jdbcType=VARCHAR},
- </if>
- <if test="dbBedno != null" >
- #{dbBedno,jdbcType=VARCHAR},
- </if>
- <if test="iseMeasureTime != null" >
- #{iseMeasureTime,jdbcType=TIMESTAMP},
- </if>
- <if test="iseRecordor != null" >
- #{iseRecordor,jdbcType=VARCHAR},
- </if>
- <if test="iseRecordTime != null" >
- #{iseRecordTime,jdbcType=TIMESTAMP},
- </if>
- <if test="iseItemCode != null" >
- #{iseItemCode,jdbcType=VARCHAR},
- </if>
- <if test="iseItemName != null" >
- #{iseItemName,jdbcType=VARCHAR},
- </if>
- <if test="iseItemValue != null" >
- #{iseItemValue,jdbcType=VARCHAR},
- </if>
- <if test="iseRemark != null" >
- #{iseRemark,jdbcType=VARCHAR},
- </if>
- <if test="iseOriginal != null" >
- #{iseOriginal,jdbcType=VARCHAR},
- </if>
- <if test="iseOriginalId != null" >
- #{iseOriginalId,jdbcType=INTEGER},
- </if>
- <if test="iseIsdel != null" >
- #{iseIsdel,jdbcType=INTEGER},
- </if>
- <if test="iseOperationTime != null" >
- #{iseOperationTime,jdbcType=TIMESTAMP},
- </if>
- <if test="iseOperator != null" >
- #{iseOperator,jdbcType=VARCHAR},
- </if>
- <if test="iseTimePoint != null">
- #{iseTimePoint,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpSpecialEvent" >
- update inp_special_event
- <set >
- <if test="patientno != null" >
- PatientNo = #{patientno,jdbcType=VARCHAR},
- </if>
- <if test="hiId != null" >
- HI_ID = #{hiId,jdbcType=INTEGER},
- </if>
- <if test="ddDepdm != null" >
- DD_DepDm = #{ddDepdm,jdbcType=VARCHAR},
- </if>
- <if test="dwWarddm != null" >
- DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
- </if>
- <if test="dbBedno != null" >
- DB_BedNo = #{dbBedno,jdbcType=VARCHAR},
- </if>
- <if test="iseMeasureTime != null" >
- ISE_Measure_Time = #{iseMeasureTime,jdbcType=TIMESTAMP},
- </if>
- <if test="iseRecordor != null" >
- ISE_Recordor = #{iseRecordor,jdbcType=VARCHAR},
- </if>
- <if test="iseRecordTime != null" >
- ISE_Record_Time = #{iseRecordTime,jdbcType=TIMESTAMP},
- </if>
- <if test="iseItemCode != null" >
- ISE_Item_Code = #{iseItemCode,jdbcType=VARCHAR},
- </if>
- <if test="iseItemName != null" >
- ISE_Item_Name = #{iseItemName,jdbcType=VARCHAR},
- </if>
- <if test="iseItemValue != null" >
- ISE_Item_Value = #{iseItemValue,jdbcType=VARCHAR},
- </if>
- <if test="iseRemark != null" >
- ISE_Remark = #{iseRemark,jdbcType=VARCHAR},
- </if>
- <if test="iseOriginal != null" >
- ISE_Original = #{iseOriginal,jdbcType=VARCHAR},
- </if>
- <if test="iseOriginalId != null" >
- ISE_Original_ID = #{iseOriginalId,jdbcType=INTEGER},
- </if>
- <if test="iseIsdel != null" >
- ISE_IsDel = #{iseIsdel,jdbcType=INTEGER},
- </if>
- <if test="iseOperationTime != null" >
- ISE_Operation_Time = #{iseOperationTime,jdbcType=TIMESTAMP},
- </if>
- <if test="iseOperator != null" >
- ISE_Operator = #{iseOperator,jdbcType=VARCHAR},
- </if>
- <if test="iseTimePoint != null">
- ISE_Time_Point = #{iseTimePoint,jdbcType=VARCHAR},
- </if>
- </set>
- where ISE_ID = #{iseId,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpSpecialEvent" >
- update inp_special_event
- set PatientNo = #{patientno,jdbcType=VARCHAR},
- HI_ID = #{hiId,jdbcType=INTEGER},
- DD_DepDm = #{ddDepdm,jdbcType=VARCHAR},
- DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
- DB_BedNo = #{dbBedno,jdbcType=VARCHAR},
- ISE_Measure_Time = #{iseMeasureTime,jdbcType=TIMESTAMP},
- ISE_Recordor = #{iseRecordor,jdbcType=VARCHAR},
- ISE_Record_Time = #{iseRecordTime,jdbcType=TIMESTAMP},
- ISE_Item_Code = #{iseItemCode,jdbcType=VARCHAR},
- ISE_Item_Name = #{iseItemName,jdbcType=VARCHAR},
- ISE_Item_Value = #{iseItemValue,jdbcType=VARCHAR},
- ISE_Remark = #{iseRemark,jdbcType=VARCHAR},
- ISE_Original = #{iseOriginal,jdbcType=VARCHAR},
- ISE_Original_ID = #{iseOriginalId,jdbcType=INTEGER},
- ISE_IsDel = #{iseIsdel,jdbcType=INTEGER},
- ISE_Operation_Time = #{iseOperationTime,jdbcType=TIMESTAMP},
- ISE_Operator = #{iseOperator,jdbcType=VARCHAR},
- ISE_Time_Point = #{iseTimePoint,jdbcType=VARCHAR}
- where ISE_ID = #{iseId,jdbcType=INTEGER}
- </update>
- <select id="selectEventByPatient" resultMap="BaseResultMap"
- parameterType="com.xinxin.topro.inpnurseservice.vo.InpTprEventVo">
- select
- <include refid="Base_Column_List"/>
- from inp_special_event
- where ISE_IsDel = 0 and PatientNo = #{patientNo,jdbcType=VARCHAR} and ISE_Item_Code = #{iseItemCode,jdbcType=VARCHAR}
- </select>
- <select id="selectOperationaAll" resultMap="BaseResultMap"
- parameterType="com.xinxin.topro.inpnurseservice.vo.InpTprEventVo">
- select
- <include refid="Base_Column_List"/>
- from inp_special_event
- where ISE_IsDel = 0
- <if test="patientNo != null" >
- and PatientNo = #{patientNo,jdbcType=VARCHAR}
- </if>
- <if test="iseItemCode != null" >
- and ISE_Item_Code = #{iseItemCode,jdbcType=VARCHAR}
- </if>
- <if test="beginTime != null" >
- and ISE_Measure_Time <![CDATA[>=]]> #{beginTime}
- </if>
- <if test="endTime != null" >
- and ISE_Measure_Time <![CDATA[<=]]>#{endTime}
- </if>
- ORDER BY ISE_Measure_Time DESC
- </select>
- <select id="selectEventByPatientNo" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List"/>
- from inp_special_event
- where ISE_IsDel = 0 and PatientNo = #{patientNo,jdbcType=VARCHAR}
- ORDER BY ISE_Measure_Time DESC
- </select>
- <select id="getOperationRatio" resultMap="BaseResultMap" >
- SELECT ISE_REMARK,count(*) count
- from inp_special_event
- where DW_WardDm = #{wardDm,jdbcType=VARCHAR}
- and ISE_Measure_Time <= #{etime,jdbcType=TIMESTAMP}
- AND ISE_Measure_Time >= #{stime,jdbcType=TIMESTAMP}
- AND ISE_Item_Code = 'Operation'
- GROUP BY ISE_REMARK
- </select>
- <select id="selectEventByTimeRange" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List"/>
- from inp_special_event
- where ISE_IsDel = 0 and PatientNo = #{patientNo,jdbcType=VARCHAR}
- and ISE_Measure_Time between #{beginDate,jdbcType=TIMESTAMP} and #{endDate,jdbcType=TIMESTAMP}
- </select>
- <select id="selectOperationInfo" resultMap="ResultMap">
- SELECT b.IMO_Open_Time operateTime, b.IMO_Order_Name operateName, d.UI_Name doctorName from inp_special_event a
- INNER JOIN inp_med_order b on a.ISE_Original_ID = b.IMO_ID
- INNER JOIN inp_patient c on b.PatientNo = c.IP_PatientNo
- INNER JOIN sys_userinfo d on c.IP_Attending_Doctor = d.UI_Code
- where a.ISE_IsDel = 0 and a.PatientNo = #{patientNo,jdbcType=VARCHAR}
- and a.ISE_Item_Code = 'Operation'
- order by b.IMO_Open_Time desc
- </select>
- <select id="selectEventByIseCode" resultMap="BaseResultMap">
- select *
- from inp_special_event
- where PatientNo = #{patientNo,jdbcType=VARCHAR}
- and HI_ID = #{hiId,jdbcType=INTEGER}
- and ISE_Item_Code = #{iseCode,jdbcType=VARCHAR}
- and ISE_Original_ID is not null
- and ISE_IsDel = 0
- </select>
- <select id="selectExistAdmissionEvent" resultType="java.lang.Integer">
- select count(1)
- from inp_special_event
- where PatientNo = #{patientNo,jdbcType=VARCHAR}
- and HI_ID = #{hiId,jdbcType=INTEGER}
- and ISE_Item_Code = #{iseCode,jdbcType=VARCHAR}
- and ISE_Original_ID is not null
- and ISE_IsDel = 0
- </select>
- <insert id="bulkInsert" useGeneratedKeys="true" keyColumn="ISE_ID" keyProperty="iseId">
- insert into inp_special_event (ISE_ID, PatientNo, HI_ID,
- DD_DepDm, DW_WardDm, DB_BedNo,
- ISE_Measure_Time, ISE_Recordor, ISE_Record_Time,
- ISE_Item_Code, ISE_Item_Name, ISE_Item_Value,
- ISE_Remark, ISE_Original, ISE_Original_ID,
- ISE_IsDel, ISE_Operation_Time, ISE_Operator,ISE_Time_Point
- )
- values <foreach collection="list" separator="," index="index" item="item">
- (#{item.iseId,jdbcType=INTEGER}, #{item.patientno,jdbcType=VARCHAR}, #{item.hiId,jdbcType=INTEGER},
- #{item.ddDepdm,jdbcType=VARCHAR}, #{item.dwWarddm,jdbcType=VARCHAR}, #{item.dbBedno,jdbcType=VARCHAR},
- #{item.iseMeasureTime,jdbcType=TIMESTAMP}, #{item.iseRecordor,jdbcType=VARCHAR}, #{item.iseRecordTime,jdbcType=TIMESTAMP},
- #{item.iseItemCode,jdbcType=VARCHAR}, #{item.iseItemName,jdbcType=VARCHAR}, #{item.iseItemValue,jdbcType=VARCHAR},
- #{item.iseRemark,jdbcType=VARCHAR}, #{item.iseOriginal,jdbcType=VARCHAR}, #{item.iseOriginalId,jdbcType=INTEGER},
- #{item.iseIsdel,jdbcType=INTEGER}, #{item.iseOperationTime,jdbcType=TIMESTAMP}, #{item.iseOperator,jdbcType=VARCHAR},
- #{item.iseTimePoint,jdbcType=VARCHAR}
- )
- </foreach>
- </insert>
- <update id="updateByIseOriginalId" >
- update inp_special_event
- set ISE_IsDel = -1
- where ISE_Original = #{iseOriginal,jdbcType=VARCHAR}
- and ISE_Original_ID = #{iseOriginalId,jdbcType=INTEGER}
- and HI_ID = #{hiId,jdbcType=INTEGER}
- and ISE_IsDel=0
- </update>
- <select id="selectByIseOriginalId" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from inp_special_event
- where ISE_IsDel=0
- and ISE_Original = #{iseOriginal,jdbcType=VARCHAR}
- and ISE_Original_ID=#{iseOriginalId,jdbcType=INTEGER}
- and HI_ID =#{hiId,jdbcType=INTEGER}
- </select>
- <select id="selectByIseOriginalIds" resultMap="BaseResultMap"
- parameterType="com.xinxin.topro.inpnurseservice.vo.InpEventOriginalListVo">
- select
- <include refid="Base_Column_List" />
- from inp_special_event
- where ISE_IsDel=0
- and ISE_Original = #{vo.iseOriginal,jdbcType=VARCHAR}
- and HI_ID =#{vo.hiId,jdbcType=INTEGER}
- and ISE_Original_ID in
- <foreach collection="vo.iseOriginalId" index="index" item="item" separator="," open="(" close=")">
- #{item,jdbcType=INTEGER}
- </foreach>
- </select>
- <update id="updateByIseOriginalIds" parameterType="java.util.List">
- update inp_special_event
- set ISE_IsDel = -1
- where ISE_IsDel=0
- and ISE_Original_ID in
- <foreach collection="iseOriginalIds" item="item" index="index" open="(" close=")" separator=",">
- #{item,jdbcType=INTEGER}
- </foreach>
- </update>
- <select id="selectEventByTimeRangeAndCode" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List"/>
- from inp_special_event
- where ISE_IsDel = 0
- and ISE_Measure_Time between #{beginDate,jdbcType=TIMESTAMP} and #{endDate,jdbcType=TIMESTAMP}
- and ISE_Item_Code = #{iseCode,jdbcType=VARCHAR}
- and PatientNo in
- <foreach collection="patientNos" item="item" index="index" separator="," open="(" close=")">
- #{item,jdbcType=VARCHAR}
- </foreach>
- </select>
- <select id="selectFirstTimeByCodes" resultType="java.util.Date">
- select min(ISE_Measure_Time)
- from inp_special_event
- where ISE_IsDel = 0
- and PatientNo = #{patientNo,jdbcType=VARCHAR}
- and ISE_Item_Code in
- <foreach collection="codes" item="item" index="index" separator="," open="(" close=")">
- #{item,jdbcType=VARCHAR}
- </foreach>
- and HI_ID =#{hiId,jdbcType=INTEGER}
- </select>
- </mapper>
|