123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519 |
- <?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.InpSheetMapper" >
- <resultMap id="BaseResultMap" type="com.xinxin.topro.inpnurseservice.mysqlmodel.InpSheet" >
- <id column="IST_ID" property="istId" jdbcType="INTEGER" />
- <result column="recordor" property="recordor" jdbcType="VARCHAR" />
- <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="IST_Measure_Time" property="istMeasureTime" jdbcType="TIMESTAMP" />
- <result column="IST_Recordor" property="istRecordor" jdbcType="VARCHAR" />
- <result column="IST_Record_Time" property="istRecordTime" jdbcType="TIMESTAMP" />
- <result column="IST_Type" property="istType" jdbcType="INTEGER" />
- <result column="IST_Operation_Time" property="istOperationTime" jdbcType="TIMESTAMP" />
- <result column="IST_Operator" property="istOperator" jdbcType="VARCHAR" />
- <result column="IST_IsDel" property="istIsdel" jdbcType="INTEGER" />
- <result column="IST_Remark" property="istRemark" jdbcType="VARCHAR" />
- <result column="IST_FormerID" property="istFormerid" jdbcType="INTEGER" />
- <result column="IST_IsPrint" property="istIsprint" jdbcType="INTEGER" />
- <result column="IST_Printer" property="istPrinter" jdbcType="VARCHAR" />
- </resultMap>
- <resultMap id="BaseDetailResultMap" type="com.xinxin.topro.inpnurseservice.vo.InpSheetVO" extends="BaseResultMap">
- <result column="recordor" property="recordor" jdbcType="VARCHAR" />
- <collection property="detailList" ofType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpSheetDetail">
- <result column="ISD_ID" property="isdId" jdbcType="INTEGER" />
- <result column="ISD_Code" property="isdCode" jdbcType="VARCHAR" />
- <result column="ISD_Name" property="isdName" jdbcType="VARCHAR" />
- <result column="ISD_Value" property="isdValue" jdbcType="VARCHAR" />
- <result column="ISD_Remark" property="isdRemark" jdbcType="VARCHAR" />
- <result column="ISD_Recordor" property="isdRecordor" jdbcType="VARCHAR" />
- <result column="ISD_Record_Time" property="isdRecordTime" jdbcType="TIMESTAMP" />
- <result column="ISD_Operation_Time" property="isdOperationTime" jdbcType="TIMESTAMP" />
- <result column="ISD_Operator" property="isdOperator" jdbcType="VARCHAR" />
- <result column="ISD_IsDel" property="isdIsdel" jdbcType="INTEGER" />
- </collection>
- </resultMap>
- <sql id="Base_Column_List" >
- IST_ID, PatientNo, HI_ID, DD_DepDm, DW_WardDm, DB_BedNo, IST_Measure_Time, IST_Recordor,
- IST_Record_Time, IST_Type, IST_Operation_Time, IST_Operator, IST_IsDel, IST_Remark,
- IST_FormerID, IST_IsPrint, IST_Printer
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
- select
- <include refid="Base_Column_List" />
- from inp_sheet
- where IST_ID = #{istId,jdbcType=INTEGER}
- and IST_IsDel = 0
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
- delete from inp_sheet
- where IST_ID = #{istId,jdbcType=INTEGER}
- </delete>
- <insert id="insert" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpSheet" >
- insert into inp_sheet (IST_ID, PatientNo, HI_ID,
- DD_DepDm, DW_WardDm, DB_BedNo,
- IST_Measure_Time, IST_Recordor, IST_Record_Time,
- IST_Type, IST_Operation_Time, IST_Operator,
- IST_IsDel, IST_Remark, IST_FormerID,
- IST_IsPrint, IST_Printer)
- values (#{istId,jdbcType=INTEGER}, #{patientno,jdbcType=VARCHAR}, #{hiId,jdbcType=INTEGER},
- #{ddDepdm,jdbcType=VARCHAR}, #{dwWarddm,jdbcType=VARCHAR}, #{dbBedno,jdbcType=VARCHAR},
- #{istMeasureTime,jdbcType=TIMESTAMP}, #{istRecordor,jdbcType=VARCHAR}, #{istRecordTime,jdbcType=TIMESTAMP},
- #{istType,jdbcType=INTEGER}, #{istOperationTime,jdbcType=TIMESTAMP}, #{istOperator,jdbcType=VARCHAR},
- #{istIsdel,jdbcType=INTEGER}, #{istRemark,jdbcType=VARCHAR}, #{istFormerid,jdbcType=INTEGER},
- #{istIsprint,jdbcType=INTEGER}, #{istPrinter,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpSheet" useGeneratedKeys="true" keyProperty="istId" keyColumn="IST_ID">
- insert into inp_sheet
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <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="istMeasureTime != null" >
- IST_Measure_Time,
- </if>
- <if test="istRecordor != null" >
- IST_Recordor,
- </if>
- <if test="istRecordTime != null" >
- IST_Record_Time,
- </if>
- <if test="istType != null" >
- IST_Type,
- </if>
- <if test="istOperationTime != null" >
- IST_Operation_Time,
- </if>
- <if test="istOperator != null" >
- IST_Operator,
- </if>
- <if test="istIsdel != null" >
- IST_IsDel,
- </if>
- <if test="istRemark != null" >
- IST_Remark,
- </if>
- <if test="istFormerid != null" >
- IST_FormerID,
- </if>
- <if test="istIsprint != null" >
- IST_IsPrint,
- </if>
- <if test="istPrinter != null" >
- IST_Printer,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <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="istMeasureTime != null" >
- #{istMeasureTime,jdbcType=TIMESTAMP},
- </if>
- <if test="istRecordor != null" >
- #{istRecordor,jdbcType=VARCHAR},
- </if>
- <if test="istRecordTime != null" >
- #{istRecordTime,jdbcType=TIMESTAMP},
- </if>
- <if test="istType != null" >
- #{istType,jdbcType=INTEGER},
- </if>
- <if test="istOperationTime != null" >
- #{istOperationTime,jdbcType=TIMESTAMP},
- </if>
- <if test="istOperator != null" >
- #{istOperator,jdbcType=VARCHAR},
- </if>
- <if test="istIsdel != null" >
- #{istIsdel,jdbcType=INTEGER},
- </if>
- <if test="istRemark != null" >
- #{istRemark,jdbcType=VARCHAR},
- </if>
- <if test="istFormerid != null" >
- #{istFormerid,jdbcType=INTEGER},
- </if>
- <if test="istIsprint != null" >
- #{istIsprint,jdbcType=INTEGER},
- </if>
- <if test="istPrinter != null" >
- #{istPrinter,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpSheet" >
- update inp_sheet
- <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="istMeasureTime != null" >
- IST_Measure_Time = #{istMeasureTime,jdbcType=TIMESTAMP},
- </if>
- <if test="istRecordor != null" >
- IST_Recordor = #{istRecordor,jdbcType=VARCHAR},
- </if>
- <if test="istRecordTime != null" >
- IST_Record_Time = #{istRecordTime,jdbcType=TIMESTAMP},
- </if>
- <if test="istType != null" >
- IST_Type = #{istType,jdbcType=INTEGER},
- </if>
- <if test="istOperationTime != null" >
- IST_Operation_Time = #{istOperationTime,jdbcType=TIMESTAMP},
- </if>
- <if test="istOperator != null" >
- IST_Operator = #{istOperator,jdbcType=VARCHAR},
- </if>
- <if test="istIsdel != null" >
- IST_IsDel = #{istIsdel,jdbcType=INTEGER},
- </if>
- <if test="istRemark != null" >
- IST_Remark = #{istRemark,jdbcType=VARCHAR},
- </if>
- <if test="istFormerid != null" >
- IST_FormerID = #{istFormerid,jdbcType=INTEGER},
- </if>
- <if test="istIsprint != null" >
- IST_IsPrint = #{istIsprint,jdbcType=INTEGER},
- </if>
- <if test="istPrinter != null" >
- IST_Printer = #{istPrinter,jdbcType=VARCHAR},
- </if>
- </set>
- where IST_ID = #{istId,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpSheet" >
- update inp_sheet
- 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},
- IST_Measure_Time = #{istMeasureTime,jdbcType=TIMESTAMP},
- IST_Recordor = #{istRecordor,jdbcType=VARCHAR},
- IST_Record_Time = #{istRecordTime,jdbcType=TIMESTAMP},
- IST_Type = #{istType,jdbcType=INTEGER},
- IST_Operation_Time = #{istOperationTime,jdbcType=TIMESTAMP},
- IST_Operator = #{istOperator,jdbcType=VARCHAR},
- IST_IsDel = #{istIsdel,jdbcType=INTEGER},
- IST_Remark = #{istRemark,jdbcType=VARCHAR},
- IST_FormerID = #{istFormerid,jdbcType=INTEGER},
- IST_IsPrint = #{istIsprint,jdbcType=INTEGER},
- IST_Printer = #{istPrinter,jdbcType=VARCHAR}
- where IST_ID = #{istId,jdbcType=INTEGER}
- </update>
- <select id="selectByPatientTimeType" resultMap="BaseDetailResultMap">
- select
- iss.IST_ID, PatientNo, HI_ID, DD_DepDm, DW_WardDm, DB_BedNo, IST_Measure_Time, IST_Recordor,
- IST_Record_Time, IST_Type, IST_Operation_Time, IST_Operator, IST_IsDel, IST_Remark,
- IST_FormerID, IST_IsPrint, IST_Printer,ISD_ID, ISD_Code, ISD_Name, ISD_Value,ISD_Remark, ISD_Recordor, ISD_Record_Time, ISD_Operation_Time,
- ISD_Operator, ISD_IsDel,
- (select su.UI_Name from sys_userinfo su where su.UI_Code = iss.IST_Recordor and su.HI_ID = iss.HI_ID limit 1) recordor
- from inp_sheet iss left join inp_sheet_detail isd on iss.IST_ID = isd.IST_ID and isd.ISD_IsDel = 0
- where
- iss.PatientNo = #{patientno,jdbcType=VARCHAR}
- and iss.HI_ID = #{hiId,jdbcType=INTEGER}
- <if test="dwWarddm != null">
- and iss.DW_WardDm = #{dwWarddm,jdbcType=VARCHAR}
- </if>
- and iss.IST_Type = #{istType,jdbcType=INTEGER}
- <if test="startTime != null">
- and iss.IST_Measure_Time >= #{startTime,jdbcType=TIMESTAMP}
- </if>
- <if test="endTime != null">
- and #{endTime,jdbcType=TIMESTAMP} >= iss.IST_Measure_Time
- </if>
- <if test="measureTime != null">
- and iss.IST_Measure_Time = #{measureTime,jdbcType=TIMESTAMP}
- </if>
- and iss.IST_IsDel = 0
- order by iss.IST_Measure_Time desc
- </select>
- <update id="delByIds">
- update inp_sheet
- set
- IST_Operation_Time = #{istOperationTime,jdbcType=TIMESTAMP},
- IST_Operator = #{istOperator,jdbcType=VARCHAR},
- IST_IsDel = -1
- where IST_ID in
- <foreach collection="list" open="(" close=")" separator="," item="item">
- #{item,jdbcType=INTEGER}
- </foreach>
- </update>
- <select id="selectRelationByPatientListTimeType" resultMap="BaseDetailResultMap">
- select
- iss.IST_ID, PatientNo, HI_ID, DD_DepDm, DW_WardDm, DB_BedNo, IST_Measure_Time, IST_Recordor,
- IST_Record_Time, IST_Type, IST_Operation_Time, IST_Operator, IST_IsDel, IST_Remark,
- IST_FormerID, IST_IsPrint, IST_Printer,ISD_ID, ISD_Code, ISD_Name, ISD_Value,ISD_Remark, ISD_Recordor, ISD_Record_Time, ISD_Operation_Time,
- ISD_Operator, ISD_IsDel,
- (select su.UI_Name from sys_userinfo su where su.UI_Code = iss.IST_Recordor and su.HI_ID = iss.HI_ID limit 1) recordor
- from inp_sheet iss left join inp_sheet_detail isd on iss.IST_ID = isd.IST_ID and isd.ISD_IsDel = 0
- where iss.IST_IsDel = 0
- and iss.PatientNo in
- <foreach collection="list" open="(" close=")" separator="," item="item">
- #{item,jdbcType=VARCHAR}
- </foreach>
- and iss.HI_ID = #{hiId,jdbcType=INTEGER}
- and iss.IST_Type = #{istType,jdbcType=INTEGER}
- and iss.IST_Measure_Time = #{measureTime,jdbcType=TIMESTAMP}
- </select>
- <select id="selectRelationByWardTimeType" resultMap="BaseDetailResultMap">
- select
- iss.IST_ID, PatientNo, HI_ID, DD_DepDm, DW_WardDm, DB_BedNo, IST_Measure_Time, IST_Recordor,
- IST_Record_Time, IST_Type, IST_Operation_Time, IST_Operator, IST_IsDel, IST_Remark,
- IST_FormerID, IST_IsPrint, IST_Printer,ISD_ID, ISD_Code, ISD_Name, ISD_Value,ISD_Remark, ISD_Recordor, ISD_Record_Time, ISD_Operation_Time,
- ISD_Operator, ISD_IsDel,
- (select su.UI_Name from sys_userinfo su where su.UI_Code = iss.IST_Recordor and su.HI_ID = iss.HI_ID limit 1) recordor
- from inp_sheet iss left join inp_sheet_detail isd on iss.IST_ID = isd.IST_ID and isd.ISD_IsDel = 0
- where iss.IST_IsDel = 0
- and iss.DW_WardDm = #{wardDm,jdbcType=VARCHAR}
- and iss.HI_ID = #{hiId,jdbcType=INTEGER}
- and iss.IST_Type = #{istType,jdbcType=INTEGER}
- and iss.IST_Measure_Time = #{measureTime,jdbcType=TIMESTAMP}
- </select>
- <select id="selectByPatientListTimeType" resultMap="BaseResultMap">
- select <include refid="Base_Column_List"/>
- from inp_sheet
- where IST_IsDel = 0
- and PatientNo in
- <foreach collection="list" open="(" close=")" separator="," item="item">
- #{item,jdbcType=VARCHAR}
- </foreach>
- and HI_ID = #{hiId,jdbcType=INTEGER}
- and IST_Type = #{istType,jdbcType=INTEGER}
- and IST_Measure_Time = #{measureTime,jdbcType=TIMESTAMP}
- </select>
- <select id="selectBySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpSheet" resultMap="BaseResultMap">
- SELECT
- <include refid="Base_Column_List"/>
- FROM inp_sheet
- WHERE IST_IsDel = 0
- <if test="patientno != null" >
- AND PatientNo = #{patientno,jdbcType=VARCHAR}
- </if>
- <if test="hiId != null" >
- AND HI_ID = #{hiId,jdbcType=INTEGER}
- </if>
- <if test="dwWarddm != null" >
- AND DW_WardDm = #{dwWarddm,jdbcType=VARCHAR}
- </if>
- <if test="istMeasureTime != null" >
- AND IST_Measure_Time = #{istMeasureTime,jdbcType=TIMESTAMP}
- </if>
- <if test="istType != null" >
- AND IST_Type = #{istType,jdbcType=INTEGER}
- </if>
- <if test="typeList != null" >
- AND IST_Type in
- <foreach collection="typeList" open="(" close=")" separator="," item="item">
- #{item,jdbcType=INTEGER}
- </foreach>
- </if>
- ORDER BY IST_Measure_Time DESC
- </select>
- <select id="selectByPatient" resultMap="BaseResultMap">
- SELECT
- iss.*,
- (select su.UI_Name from sys_userinfo su where su.UI_Code = iss.IST_Recordor and su.HI_ID = iss.HI_ID limit 1) recordor
- FROM inp_sheet iss
- where
- PatientNo = #{patientNo,jdbcType=VARCHAR}
- AND HI_ID = #{hiId,jdbcType=INTEGER}
- <if test="dwWardDm != null">
- AND DW_WardDm = #{dwWardDm,jdbcType=VARCHAR}
- </if>
- AND IST_Type = #{type,jdbcType=INTEGER}
- <if test="startTime != null">
- AND IST_Measure_Time <![CDATA[>=]]> #{startTime}
- </if>
- <if test="endTime != null">
- AND IST_Measure_Time <![CDATA[<=]]>#{endTime}
- </if>
- AND IST_IsDel = 0
- ORDER BY IST_Measure_Time DESC
- </select>
- <insert id="batchInsert" useGeneratedKeys="true" keyColumn="IST_ID" keyProperty="istId">
- insert into inp_sheet (PatientNo, HI_ID,
- DD_DepDm, DW_WardDm, DB_BedNo,
- IST_Measure_Time, IST_Recordor, IST_Record_Time,
- IST_Type, IST_Operation_Time, IST_Operator,
- IST_IsDel, IST_Remark, IST_FormerID,
- IST_IsPrint, IST_Printer)
- values
- <foreach collection="list" separator="," item="item">
- (#{item.patientno,jdbcType=VARCHAR}, #{item.hiId,jdbcType=INTEGER},
- #{item.ddDepdm,jdbcType=VARCHAR}, #{item.dwWarddm,jdbcType=VARCHAR}, #{item.dbBedno,jdbcType=VARCHAR},
- #{item.istMeasureTime,jdbcType=TIMESTAMP}, #{item.istRecordor,jdbcType=VARCHAR}, #{item.istRecordTime,jdbcType=TIMESTAMP},
- #{item.istType,jdbcType=INTEGER}, #{item.istOperationTime,jdbcType=TIMESTAMP}, #{item.istOperator,jdbcType=VARCHAR},
- 0, #{item.istRemark,jdbcType=VARCHAR}, #{item.istFormerid,jdbcType=INTEGER},
- #{item.istIsprint,jdbcType=INTEGER}, #{item.istPrinter,jdbcType=VARCHAR})
- </foreach>
- </insert>
- <update id="deleteByIstId">
- UPDATE inp_sheet
- SET
- IST_Operation_Time = #{istOperationTime,jdbcType=TIMESTAMP},
- IST_Operator = #{istOperator,jdbcType=VARCHAR},
- IST_IsDel = -1
- where IST_ID = #{istId,jdbcType=INTEGER}
- </update>
- <update id="delByTypeAndPatient">
- UPDATE inp_sheet
- SET
- IST_Operation_Time = #{istOperationTime,jdbcType=TIMESTAMP},
- IST_Operator = #{istOperator,jdbcType=VARCHAR},
- IST_IsDel = -1
- WHERE PatientNo = #{patientNo,jdbcType=VARCHAR}
- AND IST_Type = #{type,jdbcType=INTEGER}
- </update>
- <select id="selectByPatientTimeTypes" resultMap="BaseDetailResultMap">
- select
- iss.IST_ID, PatientNo, HI_ID, DD_DepDm, DW_WardDm, DB_BedNo, IST_Measure_Time, IST_Recordor,
- IST_Record_Time, IST_Type, IST_Operation_Time, IST_Operator, IST_IsDel, IST_Remark,
- IST_FormerID, IST_IsPrint, IST_Printer,ISD_ID, ISD_Code, ISD_Name, ISD_Value,ISD_Remark, ISD_Recordor, ISD_Record_Time, ISD_Operation_Time,
- ISD_Operator, ISD_IsDel,
- (select su.UI_Name from sys_userinfo su where su.UI_Code = iss.IST_Recordor and su.HI_ID = iss.HI_ID limit 1) recordor
- from inp_sheet iss inner join inp_sheet_detail isd on iss.IST_ID = isd.IST_ID and isd.ISD_IsDel = 0
- where
- iss.PatientNo = #{patientno,jdbcType=VARCHAR}
- and iss.HI_ID = #{hiId,jdbcType=INTEGER}
- and iss.IST_Type in
- <foreach collection="list" open="(" close=")" separator="," item="item">
- #{item,jdbcType=INTEGER}
- </foreach>
- <if test="startTime != null">
- and iss.IST_Measure_Time >= #{startTime,jdbcType=TIMESTAMP}
- </if>
- <if test="endTime != null">
- and #{endTime,jdbcType=TIMESTAMP} >= iss.IST_Measure_Time
- </if>
- and iss.IST_IsDel = 0
- order by iss.IST_Measure_Time desc
- </select>
- <select id="selectByTimeType" resultMap="BaseResultMap">
- SELECT
- <include refid="Base_Column_List"/>
- FROM inp_sheet
- where
- PatientNo = #{patientNo,jdbcType=VARCHAR}
- AND HI_ID = #{hiId,jdbcType=INTEGER}
- <if test="dwWardDm != null">
- AND DW_WardDm = #{dwWardDm,jdbcType=VARCHAR}
- </if>
- AND IST_Type = #{type,jdbcType=INTEGER}
- AND IST_Measure_Time = #{istMeasureTime,jdbcType=TIMESTAMP}
- AND IST_IsDel = 0
- LIMIT 1
- </select>
- <select id="selectByPatientNoAndCode" resultType="java.lang.String">
- SELECT DISTINCT isd.ISD_Value FROM inp_sheet ist
- INNER JOIN inp_sheet_detail isd ON ist.IST_ID = isd.IST_ID
- WHERE
- ist.PatientNo = #{patientNo,jdbcType=VARCHAR}
- AND ist.HI_ID = #{hiId,jdbcType=INTEGER}
- AND ist.IST_Type = #{type,jdbcType=INTEGER}
- AND isd.ISD_Code = #{isdCode,jdbcType=VARCHAR}
- AND ist.IST_IsDel = 0
- AND isd.ISD_IsDel = 0
- ORDER BY ist.IST_Measure_Time
- </select>
- <select id="selectRelationByWardPatientType" resultMap="BaseDetailResultMap">
- select
- iss.IST_ID, PatientNo, HI_ID, DD_DepDm, DW_WardDm, DB_BedNo, IST_Measure_Time, IST_Recordor,
- IST_Record_Time, IST_Type, IST_Operation_Time, IST_Operator, IST_IsDel, IST_Remark,
- IST_FormerID, IST_IsPrint, IST_Printer,ISD_ID, ISD_Code, ISD_Name, ISD_Value,ISD_Remark, ISD_Recordor, ISD_Record_Time, ISD_Operation_Time,
- ISD_Operator, ISD_IsDel,
- (select su.UI_Name from sys_userinfo su where su.UI_Code = iss.IST_Recordor and su.HI_ID = iss.HI_ID limit 1) recordor
- from inp_sheet iss left join inp_sheet_detail isd on iss.IST_ID = isd.IST_ID and isd.ISD_IsDel = 0
- where iss.IST_IsDel = 0
- <if test="wardDm != null">
- and iss.DW_WardDm = #{wardDm,jdbcType=VARCHAR}
- </if>
- and iss.PatientNo = #{patientNo,jdbcType=VARCHAR}
- and iss.HI_ID = #{hiId,jdbcType=INTEGER}
- and iss.IST_Type = #{istType,jdbcType=INTEGER}
- </select>
- <select id="selectRelationById" resultMap="BaseDetailResultMap">
- select
- iss.IST_ID, PatientNo, HI_ID, DD_DepDm, DW_WardDm, DB_BedNo, IST_Measure_Time, IST_Recordor,
- IST_Record_Time, IST_Type, IST_Operation_Time, IST_Operator, IST_IsDel, IST_Remark,
- IST_FormerID, IST_IsPrint, IST_Printer,ISD_ID, ISD_Code, ISD_Name, ISD_Value,ISD_Remark, ISD_Recordor, ISD_Record_Time, ISD_Operation_Time,
- ISD_Operator, ISD_IsDel,
- (select su.UI_Name from sys_userinfo su where su.UI_Code = iss.IST_Recordor and su.HI_ID = iss.HI_ID limit 1) recordor
- from inp_sheet iss left join inp_sheet_detail isd on iss.IST_ID = isd.IST_ID and isd.ISD_IsDel = 0
- where iss.IST_ID = #{istId,jdbcType=INTEGER}
- </select>
- <select id="selectRelationByTypeRemark" resultMap="BaseDetailResultMap">
- select
- iss.IST_ID, PatientNo, HI_ID, DD_DepDm, DW_WardDm, DB_BedNo, IST_Measure_Time, IST_Recordor,
- IST_Record_Time, IST_Type, IST_Operation_Time, IST_Operator, IST_IsDel, IST_Remark,
- IST_FormerID, IST_IsPrint, IST_Printer,ISD_ID, ISD_Code, ISD_Name, ISD_Value,ISD_Remark, ISD_Recordor, ISD_Record_Time, ISD_Operation_Time,
- ISD_Operator, ISD_IsDel,
- (select su.UI_Name from sys_userinfo su where su.UI_Code = iss.IST_Recordor and su.HI_ID = iss.HI_ID limit 1) recordor
- from inp_sheet iss left join inp_sheet_detail isd on iss.IST_ID = isd.IST_ID and isd.ISD_IsDel = 0
- where iss.IST_Type = #{istType,jdbcType=INTEGER}
- and iss.HI_ID = #{hiId,jdbcType=INTEGER}
- and iss.IST_IsDel = 0
- and iss.IST_Remark = #{remark,jdbcType=VARCHAR}
- </select>
- <update id="updateRemarkByTypeRemark">
- update inp_sheet
- set IST_Remark = #{remark,jdbcType=VARCHAR}
- where IST_Type = #{istType,jdbcType=INTEGER}
- and HI_ID = #{hiId,jdbcType=INTEGER}
- and IST_IsDel = 0
- and IST_Remark = #{oldRemark,jdbcType=VARCHAR}
- and PatientNo = #{patientNo,jdbcType=VARCHAR}
- </update>
- </mapper>
|