123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305 |
- <?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.InpComplicationMapper" >
- <resultMap id="BaseResultMap" type="com.xinxin.topro.inpnurseservice.mysqlmodel.InpComplication" >
- <id column="ICOM_ID" property="icomId" 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="ICOM_Measure_Time" property="icomMeasureTime" jdbcType="TIMESTAMP" />
- <result column="ICOM_Recordor" property="icomRecordor" jdbcType="VARCHAR" />
- <result column="ICOM_Record_Time" property="icomRecordTime" jdbcType="TIMESTAMP" />
- <result column="ICOM_Order_ID" property="icomOrderId" jdbcType="VARCHAR" />
- <result column="ICOM_Order_Name" property="icomOrderName" jdbcType="VARCHAR" />
- <result column="ICOM_Complication_Code" property="icomComplicationCode" jdbcType="VARCHAR" />
- <result column="ICOM_Complication" property="icomComplication" jdbcType="VARCHAR" />
- <result column="ICOM_IsDel" property="icomIsdel" jdbcType="INTEGER" />
- <result column="ICOM_Symptom" property="icomSymptom" jdbcType="VARCHAR" />
- <result column="ICOM_Measure" property="icomMeasure" jdbcType="VARCHAR" />
- <result column="ICOM_Result" property="icomResult" jdbcType="VARCHAR" />
- <result column="ICOM_Tool_Code" property="icomToolCode" jdbcType="VARCHAR" />
- <result column="ICOM_Tool" property="icomTool" jdbcType="VARCHAR" />
- <result column="ICOM_Part_Code" property="icomPartCode" jdbcType="VARCHAR" />
- <result column="ICOM_Part" property="icomPart" jdbcType="VARCHAR" />
- </resultMap>
- <sql id="Base_Column_List" >
- ICOM_ID, PatientNo, HI_ID, DD_DepDm, DW_WardDm, DB_BedNo, ICOM_Measure_Time, ICOM_Recordor,
- ICOM_Record_Time, ICOM_Order_ID, ICOM_Order_Name, ICOM_Complication_Code, ICOM_Complication,
- ICOM_IsDel, ICOM_Symptom, ICOM_Measure, ICOM_Result, ICOM_Tool_Code, ICOM_Tool, ICOM_Part_Code,
- ICOM_Part
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
- select
- <include refid="Base_Column_List" />
- from inp_complication
- where ICOM_ID = #{icomId,jdbcType=INTEGER}
- and ICOM_IsDel = 0
- </select>
- <insert id="insert" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpComplication" useGeneratedKeys="true" keyProperty="icomId">
- insert into inp_complication (PatientNo, HI_ID,
- DD_DepDm, DW_WardDm, DB_BedNo,
- ICOM_Measure_Time, ICOM_Recordor, ICOM_Record_Time,
- ICOM_Order_ID, ICOM_Order_Name, ICOM_Complication_Code,
- ICOM_Complication, ICOM_IsDel, ICOM_Symptom,
- ICOM_Measure, ICOM_Result, ICOM_Tool_Code,
- ICOM_Tool, ICOM_Part_Code, ICOM_Part
- )
- values (#{patientno,jdbcType=VARCHAR}, #{hiId,jdbcType=INTEGER},
- #{ddDepdm,jdbcType=VARCHAR}, #{dwWarddm,jdbcType=VARCHAR}, #{dbBedno,jdbcType=VARCHAR},
- #{icomMeasureTime,jdbcType=TIMESTAMP}, #{icomRecordor,jdbcType=VARCHAR}, now(),
- #{icomOrderId,jdbcType=VARCHAR}, #{icomOrderName,jdbcType=VARCHAR}, #{icomComplicationCode,jdbcType=VARCHAR},
- #{icomComplication,jdbcType=VARCHAR},0, #{icomSymptom,jdbcType=VARCHAR},
- #{icomMeasure,jdbcType=VARCHAR}, #{icomResult,jdbcType=VARCHAR}, #{icomToolCode,jdbcType=VARCHAR},
- #{icomTool,jdbcType=VARCHAR}, #{icomPartCode,jdbcType=VARCHAR}, #{icomPart,jdbcType=VARCHAR}
- )
- </insert>
- <insert id="insertSelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpComplication" >
- insert into inp_complication
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="icomId != null" >
- ICOM_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="icomMeasureTime != null" >
- ICOM_Measure_Time,
- </if>
- <if test="icomRecordor != null" >
- ICOM_Recordor,
- </if>
- <if test="icomRecordTime != null" >
- ICOM_Record_Time,
- </if>
- <if test="icomOrderId != null" >
- ICOM_Order_ID,
- </if>
- <if test="icomOrderName != null" >
- ICOM_Order_Name,
- </if>
- <if test="icomComplicationCode != null" >
- ICOM_Complication_Code,
- </if>
- <if test="icomComplication != null" >
- ICOM_Complication,
- </if>
- <if test="icomIsdel != null" >
- ICOM_IsDel,
- </if>
- <if test="icomSymptom != null" >
- ICOM_Symptom,
- </if>
- <if test="icomMeasure != null" >
- ICOM_Measure,
- </if>
- <if test="icomResult != null" >
- ICOM_Result,
- </if>
- <if test="icomToolCode != null" >
- ICOM_Tool_Code,
- </if>
- <if test="icomTool != null" >
- ICOM_Tool,
- </if>
- <if test="icomPartCode != null" >
- ICOM_Part_Code,
- </if>
- <if test="icomPart != null" >
- ICOM_Part,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="icomId != null" >
- #{icomId,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="icomMeasureTime != null" >
- #{icomMeasureTime,jdbcType=TIMESTAMP},
- </if>
- <if test="icomRecordor != null" >
- #{icomRecordor,jdbcType=VARCHAR},
- </if>
- <if test="icomRecordTime != null" >
- #{icomRecordTime,jdbcType=TIMESTAMP},
- </if>
- <if test="icomOrderId != null" >
- #{icomOrderId,jdbcType=VARCHAR},
- </if>
- <if test="icomOrderName != null" >
- #{icomOrderName,jdbcType=VARCHAR},
- </if>
- <if test="icomComplicationCode != null" >
- #{icomComplicationCode,jdbcType=VARCHAR},
- </if>
- <if test="icomComplication != null" >
- #{icomComplication,jdbcType=VARCHAR},
- </if>
- <if test="icomIsdel != null" >
- #{icomIsdel,jdbcType=INTEGER},
- </if>
- <if test="icomSymptom != null" >
- #{icomSymptom,jdbcType=VARCHAR},
- </if>
- <if test="icomMeasure != null" >
- #{icomMeasure,jdbcType=VARCHAR},
- </if>
- <if test="icomResult != null" >
- #{icomResult,jdbcType=VARCHAR},
- </if>
- <if test="icomToolCode != null" >
- #{icomToolCode,jdbcType=VARCHAR},
- </if>
- <if test="icomTool != null" >
- #{icomTool,jdbcType=VARCHAR},
- </if>
- <if test="icomPartCode != null" >
- #{icomPartCode,jdbcType=VARCHAR},
- </if>
- <if test="icomPart != null" >
- #{icomPart,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpComplication" >
- update inp_complication
- <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="icomMeasureTime != null" >
- ICOM_Measure_Time = #{icomMeasureTime,jdbcType=TIMESTAMP},
- </if>
- <if test="icomRecordor != null" >
- ICOM_Recordor = #{icomRecordor,jdbcType=VARCHAR},
- </if>
- <if test="icomOrderId != null" >
- ICOM_Order_ID = #{icomOrderId,jdbcType=VARCHAR},
- </if>
- <if test="icomOrderName != null" >
- ICOM_Order_Name = #{icomOrderName,jdbcType=VARCHAR},
- </if>
- <if test="icomComplicationCode != null" >
- ICOM_Complication_Code = #{icomComplicationCode,jdbcType=VARCHAR},
- </if>
- <if test="icomComplication != null" >
- ICOM_Complication = #{icomComplication,jdbcType=VARCHAR},
- </if>
- <if test="icomToolCode != null" >
- ICOM_Tool_Code = #{icomToolCode,jdbcType=VARCHAR},
- </if>
- <if test="icomTool != null" >
- ICOM_Tool = #{icomTool,jdbcType=VARCHAR},
- </if>
- <if test="icomPartCode != null" >
- ICOM_Part_Code = #{icomPartCode,jdbcType=VARCHAR},
- </if>
- <if test="icomPart != null" >
- ICOM_Part = #{icomPart,jdbcType=VARCHAR},
- </if>
- ICOM_Symptom = #{icomSymptom,jdbcType=VARCHAR},
- ICOM_Measure = #{icomMeasure,jdbcType=VARCHAR},
- ICOM_Result = #{icomResult,jdbcType=VARCHAR}
- </set>
- where ICOM_ID = #{icomId,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpComplication" >
- update inp_complication
- 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},
- ICOM_Measure_Time = #{icomMeasureTime,jdbcType=TIMESTAMP},
- ICOM_Recordor = #{icomRecordor,jdbcType=VARCHAR},
- ICOM_Record_Time = #{icomRecordTime,jdbcType=TIMESTAMP},
- ICOM_Order_ID = #{icomOrderId,jdbcType=VARCHAR},
- ICOM_Order_Name = #{icomOrderName,jdbcType=VARCHAR},
- ICOM_Complication_Code = #{icomComplicationCode,jdbcType=VARCHAR},
- ICOM_Complication = #{icomComplication,jdbcType=VARCHAR},
- ICOM_IsDel = #{icomIsdel,jdbcType=INTEGER},
- ICOM_Symptom = #{icomSymptom,jdbcType=VARCHAR},
- ICOM_Measure = #{icomMeasure,jdbcType=VARCHAR},
- ICOM_Result = #{icomResult,jdbcType=VARCHAR},
- ICOM_Tool_Code = #{icomToolCode,jdbcType=VARCHAR},
- ICOM_Tool = #{icomTool,jdbcType=VARCHAR},
- ICOM_Part_Code = #{icomPartCode,jdbcType=VARCHAR},
- ICOM_Part = #{icomPart,jdbcType=VARCHAR}
- where ICOM_ID = #{icomId,jdbcType=INTEGER}
- </update>
- <update id="delById">
- update inp_complication
- set ICOM_IsDel = -1,
- ICOM_Record_Time = now(),
- ICOM_Recordor = #{icomRecordor,jdbcType=VARCHAR}
- where ICOM_ID = #{icomId,jdbcType=INTEGER}
- </update>
- <resultMap id="RelationResultMap" type="com.xinxin.topro.inpnurseservice.response.ComplicationListResponse" extends="BaseResultMap">
- <result column="wardStr" property="wardStr" jdbcType="VARCHAR" />
- <collection property="measureList" ofType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpComplicationMeasure" >
- <result column="ICM_Name" property="icmName" jdbcType="VARCHAR" />
- </collection>
- <collection property="resultList" ofType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpComplicationResult" >
- <result column="ICR_Name" property="icrName" jdbcType="VARCHAR" />
- </collection>
- <collection property="symptomList" ofType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpComplicationSymptom" >
- <result column="ICS_Name" property="icsName" jdbcType="VARCHAR" />
- </collection>
- </resultMap>
- <select id="selectRelationListByPatient" resultMap="RelationResultMap">
- select
- ic.*,
- (select dw.DW_WardName from dic_ward dw where dw.DW_WardDm = ic.DW_WardDm and ic.HI_ID = dw.HI_ID and dw.DW_IsDel = 0) wardStr,
- icm.ICM_Name,
- icr.ICR_Name,
- ics.ICS_Name
- from inp_complication ic
- left join inp_complication_measure icm on ic.ICOM_ID = icm.ICOM_ID and icm.ICM_IsDel = 0
- left join inp_complication_result icr on ic.ICOM_ID = icr.ICOM_ID and icr.ICR_IsDel = 0
- left join inp_complication_symptom ics on ic.ICOM_ID = ics.ICOM_ID and ics.ICS_IsDel = 0
- where ic.HI_ID = #{hiId,jdbcType=INTEGER}
- and ic.PatientNo = #{patientNo,jdbcType=VARCHAR}
- and ic.ICOM_IsDel = 0
- order by ic.ICOM_Record_Time,ic.ICOM_ID
- </select>
- </mapper>
|