123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583 |
- <?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.InpRecordDetailOldMapper" >
- <resultMap id="BaseResultMap" type="com.xinxin.topro.inpnurseservice.mysqlmodel.InpRecordDetailOld" >
- <id column="IRD_ID" property="irdId" jdbcType="INTEGER" />
- <result column="IR_ID" property="irId" jdbcType="INTEGER" />
- <result column="IRD_Record_Code" property="irdRecordCode" jdbcType="VARCHAR" />
- <result column="IRD_Record_Name" property="irdRecordName" jdbcType="VARCHAR" />
- <result column="IRD_Record_Value" property="irdRecordValue" jdbcType="VARCHAR" />
- <result column="IRD_Unit" property="irdUnit" jdbcType="VARCHAR" />
- <result column="IRD_Remark" property="irdRemark" jdbcType="VARCHAR" />
- <result column="IRD_Recordor" property="irdRecordor" jdbcType="VARCHAR" />
- <result column="IRD_Record_Time" property="irdRecordTime" jdbcType="TIMESTAMP" />
- <result column="IRD_Operation_Time" property="irdOperationTime" jdbcType="TIMESTAMP" />
- <result column="IRD_Operator" property="irdOperator" jdbcType="VARCHAR" />
- <result column="IRD_IsDel" property="irdIsdel" jdbcType="INTEGER" />
- <result column="IRD_Property" property="irdProperty" jdbcType="VARCHAR" />
- <result column="IC_ID" property="icId" jdbcType="INTEGER" />
- <result column="IRD_Catheter_Name" property="irdCatheterName" jdbcType="VARCHAR" />
- <result column="IRD_Original" property="irdOriginal" jdbcType="VARCHAR" />
- <result column="IRD_Original_ID" property="irdOriginalId" jdbcType="INTEGER" />
- <result column="IRD_Source" property="irdSource" jdbcType="INTEGER" />
- <result column="IRD_Unmeasure_Code" property="irdUnmeasureCode" jdbcType="VARCHAR" />
- <result column="IRD_Unmeasure_Reason" property="irdUnmeasureReason" jdbcType="VARCHAR" />
- <result column="IRD_IsTPR" property="irdIsTpr" jdbcType="INTEGER" />
- <result column="IRD_Time_Point" property="irdTimePoint" jdbcType="VARCHAR" />
- </resultMap>
- <sql id="Base_Column_List" >
- IRD_ID, IR_ID, IRD_Record_Code, IRD_Record_Name, IRD_Record_Value, IRD_Unit, IRD_Remark,
- IRD_Recordor, IRD_Record_Time, IRD_Operation_Time, IRD_Operator, IRD_IsDel, IRD_Property,
- IC_ID, IRD_Catheter_Name, IRD_Original, IRD_Original_ID, IRD_Source, IRD_Unmeasure_Code,
- IRD_Unmeasure_Reason, IRD_IsTPR, IRD_Time_Point
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
- select
- <include refid="Base_Column_List" />
- from inp_record_detail_old
- where IRD_IsDel = 0 and IRD_ID = #{irdId,jdbcType=INTEGER}
- </select>
- <select id="selectAll" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from inp_record_detail_old
- where IRD_IsDel = 0
- </select>
- <select id="selectByIds" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from inp_record_detail_old
- where IRD_IsDel = 0
- and IR_ID in
- <foreach collection="list" item="item" index="index" separator="," open="(" close=")">
- #{item,jdbcType=INTEGER}
- </foreach>
- </select>
- <select id="selectByIRid" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
- select
- <include refid="Base_Column_List" />
- from inp_record_detail_old
- where IRD_IsDel = 0 and IR_ID = #{irId,jdbcType=INTEGER}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
- delete from inp_record_detail_old
- where IRD_ID = #{irdId,jdbcType=INTEGER}
- </delete>
- <insert id="insert" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpRecordDetailOld" useGeneratedKeys="true" keyColumn="IRD_ID" keyProperty="irdId">
- insert into inp_record_detail_old (IRD_ID, IR_ID, IRD_Record_Code,
- IRD_Record_Name, IRD_Record_Value, IRD_Unit,
- IRD_Remark, IRD_Recordor, IRD_Record_Time,
- IRD_Operation_Time, IRD_Operator, IRD_IsDel,
- IRD_Property, IC_ID, IRD_Catheter_Name,
- IRD_Original, IRD_Original_ID, IRD_Source,
- IRD_Unmeasure_Code, IRD_Unmeasure_Reason, IRD_IsTPR, IRD_Time_Point)
- values (#{irdId,jdbcType=INTEGER}, #{irId,jdbcType=INTEGER}, #{irdRecordCode,jdbcType=VARCHAR},
- #{irdRecordName,jdbcType=VARCHAR}, #{irdRecordValue,jdbcType=VARCHAR}, #{irdUnit,jdbcType=VARCHAR},
- #{irdRemark,jdbcType=VARCHAR}, #{irdRecordor,jdbcType=VARCHAR}, #{irdRecordTime,jdbcType=TIMESTAMP},
- #{irdOperationTime,jdbcType=TIMESTAMP}, #{irdOperator,jdbcType=VARCHAR}, #{irdIsdel,jdbcType=INTEGER},
- #{irdProperty,jdbcType=VARCHAR}, #{icId,jdbcType=INTEGER}, #{irdCatheterName,jdbcType=VARCHAR},
- #{irdOriginal,jdbcType=VARCHAR}, #{irdOriginalId,jdbcType=INTEGER}, #{irdSource,jdbcType=INTEGER},
- #{irdUnmeasureCode,jdbcType=VARCHAR}, #{irdUnmeasureReason,jdbcType=VARCHAR}, #{irdIsTpr,jdbcType=INTEGER}, #{irdTimePoint,jdbcType=VARCHAR})
- </insert>
- <insert id="batchInsert" useGeneratedKeys="true" keyColumn="IRD_ID" keyProperty="irdId">
- insert into inp_record_detail_old (IR_ID, IRD_Record_Code,
- IRD_Record_Name, IRD_Record_Value, IRD_Unit,
- IRD_Remark, IRD_Recordor, IRD_Record_Time,
- IRD_Operation_Time, IRD_Operator, IRD_IsDel,
- IRD_Property, IC_ID, IRD_Catheter_Name,
- IRD_Original, IRD_Original_ID, IRD_Source,
- IRD_Unmeasure_Code, IRD_Unmeasure_Reason, IRD_IsTPR, IRD_Time_Point
- )
- values <foreach collection="list" item="item" separator=",">
- (#{item.irId,jdbcType=INTEGER}, #{item.irdRecordCode,jdbcType=VARCHAR},
- #{item.irdRecordName,jdbcType=VARCHAR}, #{item.irdRecordValue,jdbcType=VARCHAR}, #{item.irdUnit,jdbcType=VARCHAR},
- #{item.irdRemark,jdbcType=VARCHAR}, #{item.irdRecordor,jdbcType=VARCHAR}, #{item.irdRecordTime,jdbcType=TIMESTAMP},
- #{item.irdOperationTime,jdbcType=TIMESTAMP}, #{item.irdOperator,jdbcType=VARCHAR}, 0,
- #{item.irdProperty,jdbcType=VARCHAR}, #{item.icId,jdbcType=INTEGER}, #{item.irdCatheterName,jdbcType=VARCHAR},
- #{item.irdOriginal,jdbcType=VARCHAR}, #{item.irdOriginalId,jdbcType=INTEGER}, #{item.irdSource,jdbcType=INTEGER},
- #{item.irdUnmeasureCode,jdbcType=VARCHAR}, #{item.irdUnmeasureReason,jdbcType=VARCHAR}, #{item.irdIsTpr,jdbcType=INTEGER},
- #{item.irdTimePoint,jdbcType=VARCHAR}
- )
- </foreach>
- </insert>
- <insert id="insertSelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpRecordDetailOld" >
- insert into inp_record_detail_old
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="irdId != null" >
- IRD_ID,
- </if>
- <if test="irId != null" >
- IR_ID,
- </if>
- <if test="irdRecordCode != null" >
- IRD_Record_Code,
- </if>
- <if test="irdRecordName != null" >
- IRD_Record_Name,
- </if>
- <if test="irdRecordValue != null" >
- IRD_Record_Value,
- </if>
- <if test="irdUnit != null" >
- IRD_Unit,
- </if>
- <if test="irdRemark != null" >
- IRD_Remark,
- </if>
- <if test="irdRecordor != null" >
- IRD_Recordor,
- </if>
- <if test="irdRecordTime != null" >
- IRD_Record_Time,
- </if>
- <if test="irdOperationTime != null" >
- IRD_Operation_Time,
- </if>
- <if test="irdOperator != null" >
- IRD_Operator,
- </if>
- <if test="irdIsdel != null" >
- IRD_IsDel,
- </if>
- <if test="irdProperty != null" >
- IRD_Property,
- </if>
- <if test="icId != null" >
- IC_ID,
- </if>
- <if test="irdCatheterName != null" >
- IRD_Catheter_Name,
- </if>
- <if test="irdOriginal != null" >
- IRD_Original,
- </if>
- <if test="irdOriginalId != null" >
- IRD_Original_ID,
- </if>
- <if test="irdSource != null" >
- IRD_Source,
- </if>
- <if test="irdUnmeasureCode != null" >
- IRD_Unmeasure_Code,
- </if>
- <if test="irdUnmeasureReason != null" >
- IRD_Unmeasure_Reason,
- </if>
- <if test="irdIsTpr != null" >
- IRD_IsTPR,
- </if>
- <if test="irdTimePoint != null" >
- IRD_Time_Point,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="irdId != null" >
- #{irdId,jdbcType=INTEGER},
- </if>
- <if test="irId != null" >
- #{irId,jdbcType=INTEGER},
- </if>
- <if test="irdRecordCode != null" >
- #{irdRecordCode,jdbcType=VARCHAR},
- </if>
- <if test="irdRecordName != null" >
- #{irdRecordName,jdbcType=VARCHAR},
- </if>
- <if test="irdRecordValue != null" >
- #{irdRecordValue,jdbcType=VARCHAR},
- </if>
- <if test="irdUnit != null" >
- #{irdUnit,jdbcType=VARCHAR},
- </if>
- <if test="irdRemark != null" >
- #{irdRemark,jdbcType=VARCHAR},
- </if>
- <if test="irdRecordor != null" >
- #{irdRecordor,jdbcType=VARCHAR},
- </if>
- <if test="irdRecordTime != null" >
- #{irdRecordTime,jdbcType=TIMESTAMP},
- </if>
- <if test="irdOperationTime != null" >
- #{irdOperationTime,jdbcType=TIMESTAMP},
- </if>
- <if test="irdOperator != null" >
- #{irdOperator,jdbcType=VARCHAR},
- </if>
- <if test="irdIsdel != null" >
- #{irdIsdel,jdbcType=INTEGER},
- </if>
- <if test="irdProperty != null" >
- #{irdProperty,jdbcType=VARCHAR},
- </if>
- <if test="icId != null" >
- #{icId,jdbcType=INTEGER},
- </if>
- <if test="irdCatheterName != null" >
- #{irdCatheterName,jdbcType=VARCHAR},
- </if>
- <if test="irdOriginal != null" >
- #{irdOriginal,jdbcType=VARCHAR},
- </if>
- <if test="irdOriginalId != null" >
- #{irdOriginalId,jdbcType=INTEGER},
- </if>
- <if test="irdSource != null" >
- #{irdSource,jdbcType=INTEGER},
- </if>
- <if test="irdUnmeasureCode != null" >
- #{irdUnmeasureCode,jdbcType=VARCHAR},
- </if>
- <if test="irdUnmeasureReason != null" >
- #{irdUnmeasureReason,jdbcType=VARCHAR},
- </if>
- <if test="irdIsTpr != null" >
- #{irdIsTpr,jdbcType=INTEGER},
- </if>
- <if test="irdTimePoint != null" >
- #{irdTimePoint,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpRecordDetailOld" >
- update inp_record_detail_old
- <set >
- <if test="irId != null" >
- IR_ID = #{irId,jdbcType=INTEGER},
- </if>
- <if test="irdRecordCode != null" >
- IRD_Record_Code = #{irdRecordCode,jdbcType=VARCHAR},
- </if>
- <if test="irdRecordName != null" >
- IRD_Record_Name = #{irdRecordName,jdbcType=VARCHAR},
- </if>
- <if test="irdRecordValue != null" >
- IRD_Record_Value = #{irdRecordValue,jdbcType=VARCHAR},
- </if>
- <if test="irdUnit != null" >
- IRD_Unit = #{irdUnit,jdbcType=VARCHAR},
- </if>
- <if test="irdRemark != null" >
- IRD_Remark = #{irdRemark,jdbcType=VARCHAR},
- </if>
- <if test="irdRecordor != null" >
- IRD_Recordor = #{irdRecordor,jdbcType=VARCHAR},
- </if>
- <if test="irdRecordTime != null" >
- IRD_Record_Time = #{irdRecordTime,jdbcType=TIMESTAMP},
- </if>
- <if test="irdOperationTime != null" >
- IRD_Operation_Time = #{irdOperationTime,jdbcType=TIMESTAMP},
- </if>
- <if test="irdOperator != null" >
- IRD_Operator = #{irdOperator,jdbcType=VARCHAR},
- </if>
- <if test="irdIsdel != null" >
- IRD_IsDel = #{irdIsdel,jdbcType=INTEGER},
- </if>
- <if test="irdProperty != null" >
- IRD_Property = #{irdProperty,jdbcType=VARCHAR},
- </if>
- <if test="icId != null" >
- IC_ID = #{icId,jdbcType=INTEGER},
- </if>
- <if test="irdCatheterName != null" >
- IRD_Catheter_Name = #{irdCatheterName,jdbcType=VARCHAR},
- </if>
- <if test="irdOriginal != null" >
- IRD_Original = #{irdOriginal,jdbcType=VARCHAR},
- </if>
- <if test="irdOriginalId != null" >
- IRD_Original_ID = #{irdOriginalId,jdbcType=INTEGER},
- </if>
- <if test="irdSource != null" >
- IRD_Source = #{irdSource,jdbcType=INTEGER},
- </if>
- <if test="irdUnmeasureCode != null" >
- IRD_Unmeasure_Code = #{irdUnmeasureCode,jdbcType=VARCHAR},
- </if>
- <if test="irdUnmeasureReason != null" >
- IRD_Unmeasure_Reason = #{irdUnmeasureReason,jdbcType=VARCHAR},
- </if>
- <if test="irdIsTpr != null" >
- IRD_IsTPR = #{irdIsTpr,jdbcType=INTEGER},
- </if>
- <if test="irdTimePoint != null" >
- IRD_Time_Point = #{irdTimePoint,jdbcType=INTEGER},
- </if>
- </set>
- where IRD_ID = #{irdId,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpRecordDetailOld" >
- update inp_record_detail_old
- set IR_ID = #{irId,jdbcType=INTEGER},
- IRD_Record_Code = #{irdRecordCode,jdbcType=VARCHAR},
- IRD_Record_Name = #{irdRecordName,jdbcType=VARCHAR},
- IRD_Record_Value = #{irdRecordValue,jdbcType=VARCHAR},
- IRD_Unit = #{irdUnit,jdbcType=VARCHAR},
- IRD_Remark = #{irdRemark,jdbcType=VARCHAR},
- IRD_Recordor = #{irdRecordor,jdbcType=VARCHAR},
- IRD_Record_Time = #{irdRecordTime,jdbcType=TIMESTAMP},
- IRD_Operation_Time = #{irdOperationTime,jdbcType=TIMESTAMP},
- IRD_Operator = #{irdOperator,jdbcType=VARCHAR},
- IRD_IsDel = #{irdIsdel,jdbcType=INTEGER},
- IRD_Property = #{irdProperty,jdbcType=VARCHAR},
- IC_ID = #{icId,jdbcType=INTEGER},
- IRD_Catheter_Name = #{irdCatheterName,jdbcType=VARCHAR},
- IRD_Original = #{irdOriginal,jdbcType=VARCHAR},
- IRD_Original_ID = #{irdOriginalId,jdbcType=INTEGER},
- IRD_Source = #{irdSource,jdbcType=INTEGER},
- IRD_Unmeasure_Code = #{irdUnmeasureCode,jdbcType=VARCHAR},
- IRD_Unmeasure_Reason = #{irdUnmeasureReason,jdbcType=VARCHAR},
- IRD_IsTPR = #{irdIsTpr,jdbcType=INTEGER},
- IRD_Time_Point = #{irdTimePoint,jdbcType=INTEGER}
- where IRD_ID = #{irdId,jdbcType=INTEGER}
- </update>
- <!-- 以下为自定义sql请勿删除 -->
- <update id="updateIsDelByIrdId" parameterType="java.lang.Integer">
- update inp_record_detail_old set IRD_IsDel = -1
- where IR_ID = #{irId,jdbcType=INTEGER}
- </update>
- <update id="updateIsIrdId" parameterType="java.lang.Integer">
- update inp_record_detail_old set IRD_IsDel = -1
- where IRD_ID = #{irdId,jdbcType=INTEGER}
- </update>
- <update id="updateIsDelByIrIdList" parameterType="java.util.List">
- update inp_record_detail_old set IRD_IsDel = -1
- where IR_ID in
- <foreach collection="list" item="item" index="index" separator="," close=")" open="(">
- #{item,jdbcType=INTEGER}
- </foreach>
- </update>
- <update id="batchDeleteByIrId">
- UPDATE inp_record_detail_old SET IRD_IsDel = -1,
- IRD_Operator = #{irdOperator,jdbcType=VARCHAR},
- IRD_Operation_Time = #{irdOperationTime,jdbcType=TIMESTAMP}
- WHERE IR_ID = #{irId,jdbcType=INTEGER}
- </update>
- <update id="updateIsDelByIrIdAndCodes">
- UPDATE inp_record_detail_old SET IRD_IsDel = -1,
- IRD_Operator = #{irdOperator,jdbcType=VARCHAR},
- IRD_Operation_Time = #{irdOperationTime,jdbcType=TIMESTAMP}
- WHERE IR_ID = #{irId,jdbcType=INTEGER}
- AND IRD_Record_Code in
- <foreach collection="codes" item="item" index="index" separator="," close=")" open="(">
- #{item,jdbcType=VARCHAR}
- </foreach>
- </update>
- <select id="selectBySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpRecordDetailOld" resultMap="BaseResultMap">
- SELECT
- <include refid="Base_Column_List" />
- FROM inp_record_detail_old
- WHERE
- IRD_IsDel = 0
- <if test="irId != null">
- AND IR_ID = #{irId,jdbcType=INTEGER}
- </if>
- <if test="irdOriginal != null" >
- AND IRD_Original = #{irdOriginal,jdbcType=VARCHAR}
- </if>
- <if test="irdOriginalId != null" >
- AND IRD_Original_ID = #{irdOriginalId,jdbcType=INTEGER}
- </if>
- <if test="irdSource != null" >
- AND IRD_Source = #{irdSource,jdbcType=INTEGER}
- </if>
- </select>
- <select id="selectByList" resultMap="BaseResultMap">
- SELECT
- <include refid="Base_Column_List" />
- FROM inp_record_detail_old
- WHERE
- IRD_IsDel = 0
- AND IR_ID IN
- <foreach collection="irIds" item="item" index="index" separator="," close=")" open="(">
- #{item,jdbcType=INTEGER}
- </foreach>
- ORDER BY IRD_Operation_Time DESC
- </select>
- <select id="selectByTime" resultMap="BaseResultMap">
- SELECT ird.* FROM inp_record_old ir
- INNER JOIN inp_record_detail_old ird ON ir.IR_ID = ird.IR_ID
- WHERE ir.IR_IsDel = 0
- AND ird.IRD_IsDel = 0
- AND ir.PatientNo = #{patientNo,jdbcType=VARCHAR}
- AND ir.IR_Measure_Time <![CDATA[>=]]>#{start}
- AND ir.IR_Measure_Time <![CDATA[<=]]>#{end}
- ORDER BY ir.IR_Measure_Time DESC
- </select>
- <select id="selectByPatientNo" resultMap="BaseResultMap">
- SELECT ird.* FROM inp_record_old ir
- INNER JOIN inp_record_detail_old ird ON ir.IR_ID = ird.IR_ID
- WHERE ir.IR_IsDel = 0
- AND ird.IRD_IsDel = 0
- AND ir.PatientNo = #{patientNo,jdbcType=VARCHAR}
- AND ir.HI_ID = #{hiId,jdbcType=VARCHAR}
- ORDER BY ir.IR_Measure_Time DESC
- </select>
- <select id="getIoListByTime" resultType="com.xinxin.topro.inpnurseservice.vo.InpRecordDetailOldVO">
- SELECT
- ird.IRD_Record_Value irdRecordValue,
- ir.IR_Measure_Time irMeasureTime,
- ird.IRD_Record_Code irdRecordCode,
- ird.IRD_Unit irdUnit,
- ird.IRD_Remark irdRemark,
- (select di.DIO_IOName from dic_io di where (di.HI_ID = #{hiId,jdbcType=INTEGER} OR di.HI_ID = 0) and di.DIO_IsDel = 0 and di.DIO_IO_Code = ird.IRD_Remark limit 1) ioName
- FROM inp_record_detail_old ird,inp_record_old ir
- WHERE ir.IR_ID = ird.IR_ID
- AND (ird.IRD_Record_Code = 'enter' OR ird.IRD_Record_Code = 'out_put')
- AND ird.IRD_IsDel = 0
- AND ir.IR_IsDel = 0
- and IRD_Record_Value is not null and IRD_Record_Value != ''
- and ir.PatientNo = #{patientNo,jdbcType=VARCHAR}
- <if test="start != null">
- AND ir.IR_Measure_Time >= #{start,jdbcType=TIMESTAMP}
- </if>
- <if test="end != null">
- AND #{end,jdbcType=TIMESTAMP} > ir.IR_Measure_Time
- </if>
- ORDER BY ir.IR_Measure_Time
- </select>
- <update id="batchDeleteByOriginal">
- UPDATE inp_record_detail_old SET IRD_IsDel = -1,
- IRD_Operator = #{irdOperator,jdbcType=VARCHAR},
- IRD_Operation_Time = #{irdOperationTime,jdbcType=TIMESTAMP}
- WHERE IR_ID = #{irId,jdbcType=INTEGER}
- and IRD_Original = #{irdOriginal,jdbcType=VARCHAR}
- and IRD_Original_ID = #{irdOriginalId,jdbcType=INTEGER}
- </update>
- <update id="updateBatchDeleteByOriginal">
- UPDATE inp_record_detail_old SET IRD_IsDel = -1,
- IRD_Operator = #{irdOperator,jdbcType=VARCHAR},
- IRD_Operation_Time = #{irdOperationTime,jdbcType=TIMESTAMP}
- WHERE IRD_Original = #{irdOriginal,jdbcType=VARCHAR}
- and IRD_Original_ID in
- <foreach collection="list" item="item" index="index" separator="," open="(" close=")">
- #{item,jdbcType=INTEGER}
- </foreach>
- </update>
- <select id="selectByIrIdAndSource" resultMap="BaseResultMap">
- select <include refid="Base_Column_List" />
- from inp_record_detail_old
- where IR_ID=#{irId,jdbcType=INTEGER}
- and IRD_Original=#{irdOriginal,jdbcType=VARCHAR} LIMIT 1
- </select>
- <resultMap id="RelationMap" type="com.xinxin.topro.inpnurseservice.vo.InpRecordOldRelationVO">
- <id column="IR_ID" property="irId" 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="IR_Measure_Time" property="irMeasureTime" jdbcType="TIMESTAMP" />
- <result column="IR_Recordor" property="irRecordor" jdbcType="VARCHAR" />
- <result column="IR_Record_Time" property="irRecordTime" jdbcType="TIMESTAMP" />
- <result column="IR_Source" property="irSource" jdbcType="INTEGER" />
- <result column="IR_Original" property="irOriginal" jdbcType="VARCHAR" />
- <result column="IR_Original_ID" property="irOriginalId" jdbcType="INTEGER" />
- <result column="IR_Operation_Time" property="irOperationTime" jdbcType="TIMESTAMP" />
- <result column="IR_Operator" property="irOperator" jdbcType="VARCHAR" />
- <result column="IR_IsDel" property="irIsdel" jdbcType="INTEGER" />
- <result column="IR_Record" property="irRecord" jdbcType="VARCHAR" />
- <result column="IR_FormerID" property="irFormerid" jdbcType="INTEGER" />
- <result column="IR_IsICU" property="irIsicu" jdbcType="INTEGER" />
- <result column="IR_CA" property="irCa" jdbcType="INTEGER" />
- <result column="IR_IsPrint" property="irIsprint" jdbcType="INTEGER" />
- <result column="IR_Printer" property="irPrinter" jdbcType="VARCHAR" />
- <result column="IR_IsIO" property="irIsio" jdbcType="INTEGER" />
- <result column="recordName" property="recordName" jdbcType="VARCHAR" />
- <result column="remark" property="remark" jdbcType="VARCHAR" />
- <collection property="detailList" ofType="com.xinxin.topro.inpnurseservice.vo.InpRecordDetailOldVO" >
- <result column="IRD_Record_Code" property="irdRecordCode" jdbcType="VARCHAR" />
- <result column="IRD_Record_Name" property="irdRecordName" jdbcType="VARCHAR" />
- <result column="IRD_Record_Value" property="irdRecordValue" jdbcType="VARCHAR" />
- <result column="IRD_Unit" property="irdUnit" jdbcType="VARCHAR" />
- <result column="IRD_Remark" property="irdRemark" jdbcType="VARCHAR" />
- <result column="IRD_Recordor" property="irdRecordor" jdbcType="VARCHAR" />
- <result column="IRD_Record_Time" property="irdRecordTime" jdbcType="TIMESTAMP" />
- <result column="IRD_Operation_Time" property="irdOperationTime" jdbcType="TIMESTAMP" />
- <result column="IRD_Operator" property="irdOperator" jdbcType="VARCHAR" />
- <result column="IRD_IsDel" property="irdIsdel" jdbcType="INTEGER" />
- <result column="IRD_Property" property="irdProperty" jdbcType="VARCHAR" />
- <result column="ioName" property="ioName" jdbcType="VARCHAR" />
- <result column="property" property="property" jdbcType="VARCHAR" />
- </collection>
- </resultMap>
- <select id="selectByPatientTimeCode" resultMap="RelationMap">
- select
- ir.IR_ID, PatientNo, HI_ID, DD_DepDm, DW_WardDm, DB_BedNo, IR_Measure_Time, IR_Recordor,
- IR_Record_Time, IR_Source, IR_Original, IR_Original_ID, IR_Operation_Time, IR_Operator,
- IR_IsDel, IR_Record, IR_FormerID, IR_IsICU, IR_CA, IR_IsPrint, IR_Printer, IR_IsIO,
- IRD_ID, IRD_Record_Code, IRD_Record_Name, IRD_Record_Value, IRD_Unit, IRD_Remark,
- IRD_Recordor, IRD_Record_Time, IRD_Operation_Time, IRD_Operator, IRD_IsDel, IRD_Property,
- (select su.UI_Name from sys_userinfo su where su.UI_Code = ir.IR_Recordor and su.HI_ID = ir.HI_ID limit 1) recordName,
- (select irm.IRM_Record from inp_remark irm where irm.IRM_Measure_Time = ir.IR_Measure_Time and irm.PatientNo = ir.PatientNo and irm.HI_ID = ir.HI_ID and irm.IRM_IsDel = 0 limit 1) remark
- from inp_record_old ir left join inp_record_detail_old ird on ird.IRD_IsDel = 0 and ird.IR_ID = ir.IR_ID and ird.IRD_Record_Value is not null and ird.IRD_Record_Value != '' and ird.IRD_Record_Code is not null
- where
- ir.PatientNo = #{patientNo,jdbcType=VARCHAR}
- <if test="dwWardDm != null">
- and ir.DW_WardDm = #{dwWardDm,jdbcType=VARCHAR}
- </if>
- and ir.HI_ID = #{hiId,jdbcType=INTEGER}
- and ir.IR_IsDel = 0
- <if test="startDate != null">
- and ir.IR_Measure_Time >= #{startDate,jdbcType=TIMESTAMP}
- </if>
- <if test="endDate != null">
- and #{endDate,jdbcType=TIMESTAMP} >= ir.IR_Measure_Time
- </if>
- <if test="measureTime != null">
- and ir.IR_Measure_Time = #{measureTime,jdbcType=TIMESTAMP}
- </if>
- <choose>
- <when test="list != null">
- and (ird.IRD_Record_Code in
- <foreach collection="list" separator="," item="item" open="(" close=")">
- #{item,jdbcType=VARCHAR}
- </foreach>
- or exists(select 1 from inp_remark irm where irm.IRM_Measure_Time = ir.IR_Measure_Time and irm.PatientNo = ir.PatientNo and irm.HI_ID = ir.HI_ID and irm.IRM_IsDel = 0))
- </when>
- <otherwise>
- and exists(select 1 from inp_remark irm where irm.IRM_Measure_Time = ir.IR_Measure_Time and irm.PatientNo = ir.PatientNo and irm.HI_ID = ir.HI_ID and irm.IRM_IsDel = 0))
- </otherwise>
- </choose>
- <choose>
- <when test="isIo == 1 ">
- and ir.IR_IsIO = 1
- </when>
- <when test="isIo == 0 ">
- and (ir.IR_IsIO = 0 or ir.IR_IsIO is null)
- </when>
- <otherwise>
- and 1 = 1
- </otherwise>
- </choose>
- order by ir.IR_Measure_Time desc, ird.IRD_Operation_Time desc
- </select>
- <update id="updateIsDelByIrdIdList" parameterType="java.util.List">
- update inp_record_detail_old set IRD_IsDel = -1
- where IRD_ID in
- <foreach collection="list" item="item" index="index" separator="," close=")" open="(">
- #{item,jdbcType=INTEGER}
- </foreach>
- </update>
- </mapper>
|