123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466 |
- <?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.InpConsulationMapper" >
- <resultMap id="BaseResultMap" type="com.xinxin.topro.inpnurseservice.mysqlmodel.InpConsulation" >
- <id column="ICO_ID" property="icoId" jdbcType="INTEGER" />
- <result column="PatientNo" property="patientno" jdbcType="VARCHAR" />
- <result column="HI_ID" property="hiId" jdbcType="INTEGER" />
- <result column="DCT_ID" property="dctId" jdbcType="INTEGER" />
- <result column="DCO_Code" property="dcoCode" jdbcType="VARCHAR" />
- <result column="DCO_Name" property="dcoName" jdbcType="VARCHAR" />
- <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="ICO_Apply_WardDm" property="icoApplyWarddm" jdbcType="VARCHAR" />
- <result column="ICO_Applicant" property="icoApplicant" jdbcType="VARCHAR" />
- <result column="ICO_Apply_Time" property="icoApplyTime" jdbcType="TIMESTAMP" />
- <result column="ICO_Request_Time" property="icoRequestTime" jdbcType="TIMESTAMP" />
- <result column="ICO_Consultation_Time" property="icoConsultationTime" jdbcType="TIMESTAMP" />
- <result column="ICO_Diagnose" property="icoDiagnose" jdbcType="VARCHAR" />
- <result column="ICO_Replier" property="icoReplier" jdbcType="VARCHAR" />
- <result column="ICO_Status" property="icoStatus" jdbcType="INTEGER" />
- <result column="ICO_Recordor" property="icoRecordor" jdbcType="VARCHAR" />
- <result column="ICO_Record_Time" property="icoRecordTime" jdbcType="TIMESTAMP" />
- <result column="ICO_FormerID" property="icoFormerid" jdbcType="INTEGER" />
- <result column="ICO_IsDel" property="icoIsdel" jdbcType="INTEGER" />
- <result column="DA_ID" property="daId" jdbcType="INTEGER" />
- <result column="UI_ID" property="uiId" jdbcType="INTEGER" />
- <result column="DCT_IDs" property="dctIds" jdbcType="VARCHAR" />
- </resultMap>
- <resultMap id="ResultMapWithBLOBs" type="com.xinxin.topro.inpnurseservice.mysqlmodel.InpConsulationWithBLOBs" extends="BaseResultMap" >
- <result column="ICO_Option" property="icoOption" jdbcType="LONGVARCHAR" />
- <result column="ICO_XML" property="icoXml" jdbcType="LONGVARCHAR" />
- <result column="ICO_List_Response" property="icoListResponse" jdbcType="LONGVARCHAR"/>
- </resultMap>
- <sql id="Base_Column_List" >
- ICO_ID, PatientNo, HI_ID, DCT_ID, DCO_Code, DCO_Name, DD_DepDm, DW_WardDm, DB_BedNo, ICO_Apply_WardDm,
- ICO_Applicant, ICO_Apply_Time, ICO_Request_Time, ICO_Consultation_Time, ICO_Diagnose,
- ICO_Replier, ICO_Status, ICO_Recordor, ICO_Record_Time, ICO_FormerID, ICO_IsDel, DA_ID, UI_ID, DCT_IDs
- </sql>
- <sql id="Blob_Column_List" >
- ICO_Option, ICO_XML,ICO_List_Response
- </sql>
- <select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Integer" >
- select
- <include refid="Base_Column_List" />
- ,
- <include refid="Blob_Column_List" />
- from inp_consulation
- where ICO_IsDel = 0 and ICO_ID = #{icoId,jdbcType=INTEGER}
- </select>
- <select id="getAllList" resultMap="ResultMapWithBLOBs" parameterType="com.xinxin.topro.inpnurseservice.vo.InpCatheterSearchVo" >
- select
- <include refid="Base_Column_List" />
- ,
- <include refid="Blob_Column_List" />
- from inp_consulation
- where ICO_IsDel = 0
- <if test="PatientNo != null">
- AND PatientNo = #{PatientNo,jdbcType=VARCHAR}
- </if>
- <if test="beginTime != null">
- AND ICO_Request_Time <![CDATA[>=]]> #{beginTime}
- </if>
- <if test="endTime != null">
- AND ICO_Request_Time <![CDATA[<=]]>#{endTime}
- </if>
- ORDER BY ICO_Request_Time DESC
- </select>
- <select id="getList" resultType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpConsulationWithBLOBs" parameterType="com.xinxin.topro.inpnurseservice.vo.InpCatheterSearchVo" >
- select
- ic.ICO_ID AS icoId,
- ic.PatientNo AS patientNo,
- ic.HI_ID AS hiId,
- ic.DCT_ID AS dctId,
- ic.DCO_Code AS dcoCode,
- ic.DCO_Name AS dcoName,
- ic.DD_DepDm AS ddDepDm,
- ic.DW_WardDm AS dwWardDm,
- ic.DB_BedNo AS dbBedno,
- ic.ICO_Apply_WardDm AS icoApplyWarddm,
- ic.ICO_Applicant AS icoApplicant,
- ic.ICO_Apply_Time AS icoApplyTime,
- ic.ICO_Request_Time AS icoRequestTime,
- ic.ICO_Consultation_Time AS icoConsultationTime,
- ic.ICO_Diagnose AS icoDiagnose,
- ic.ICO_Replier AS icoReplier,
- ic.ICO_Status AS icoStatus,
- ic.ICO_Recordor AS icoRecordor,
- ic.ICO_Record_Time AS icoRecordTime,
- ic.ICO_FormerID AS icoFormerid,
- ic.ICO_IsDel AS icoIsdel,
- ic.DA_ID AS daId,
- ic.ICO_Option AS icoOption,
- ic.ICO_XML AS icoXml,
- ic.DCT_IDs AS dctIds,
- ip.IP_Med_Rec AS chartNo,
- ip.IP_Name AS PtName,
- (
- CASE ip.IP_Sex
- WHEN 1 THEN
- '男'
- WHEN 2 THEN
- '女'
- ELSE
- '未知'
- END
- ) AS gender,
- f_getAge(ip.IP_Birth, ip.IP_Admit_Time) AS age
- from inp_consulation ic
- left join inp_patient ip on ic.PatientNo = ip.IP_PatientNo
- where ic.ICO_IsDel = 0
- <if test="beginTime != null">
- AND ICO_Request_Time <![CDATA[>=]]> #{beginTime}
- </if>
- <if test="endTime != null">
- AND ICO_Request_Time <![CDATA[<=]]>#{endTime}
- </if>
- ORDER BY ICO_Request_Time DESC
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
- delete from inp_consulation
- where ICO_ID = #{icoId,jdbcType=INTEGER}
- </delete>
- <insert id="insert" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpConsulationWithBLOBs" >
- insert into inp_consulation (ICO_ID, PatientNo, HI_ID,
- DCT_ID, DCO_Code, DCO_Name, DD_DepDm,
- DW_WardDm, DB_BedNo, ICO_Apply_WardDm,
- ICO_Applicant, ICO_Apply_Time, ICO_Request_Time,
- ICO_Consultation_Time, ICO_Diagnose, ICO_Replier,
- ICO_Status, ICO_Recordor, ICO_Record_Time,
- ICO_FormerID, ICO_IsDel, ICO_Option,
- ICO_XML, DA_ID, DCT_IDs)
- values (#{icoId,jdbcType=INTEGER}, #{patientno,jdbcType=VARCHAR}, #{hiId,jdbcType=INTEGER},
- #{dctId,jdbcType=INTEGER}, #{dcoCode,jdbcType=VARCHAR}, #{dcoName,jdbcType=VARCHAR}, #{ddDepdm,jdbcType=VARCHAR},
- #{dwWarddm,jdbcType=VARCHAR}, #{dbBedno,jdbcType=VARCHAR}, #{icoApplyWarddm,jdbcType=VARCHAR},
- #{icoApplicant,jdbcType=VARCHAR}, #{icoApplyTime,jdbcType=TIMESTAMP}, #{icoRequestTime,jdbcType=TIMESTAMP},
- #{icoConsultationTime,jdbcType=TIMESTAMP}, #{icoDiagnose,jdbcType=VARCHAR}, #{icoReplier,jdbcType=VARCHAR},
- #{icoStatus,jdbcType=INTEGER}, #{icoRecordor,jdbcType=VARCHAR}, #{icoRecordTime,jdbcType=TIMESTAMP},
- #{icoFormerid,jdbcType=INTEGER}, #{icoIsdel,jdbcType=INTEGER}, #{icoOption,jdbcType=LONGVARCHAR},
- #{icoXml,jdbcType=LONGVARCHAR}, #{daId,jdbcType=LONGVARCHAR},#{dicIds,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" useGeneratedKeys="true" keyProperty="icoId" keyColumn="ICO_ID" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpConsulationWithBLOBs" >
- insert into inp_consulation
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="icoId != null" >
- ICO_ID,
- </if>
- <if test="patientno != null" >
- PatientNo,
- </if>
- <if test="hiId != null" >
- HI_ID,
- </if>
- <if test="dctId != null" >
- DCT_ID,
- </if>
- <if test="dcoCode != null" >
- DCO_Code,
- </if>
- <if test="dcoName != null" >
- DCO_Name,
- </if>
- <if test="ddDepdm != null" >
- DD_DepDm,
- </if>
- <if test="dwWarddm != null" >
- DW_WardDm,
- </if>
- <if test="dbBedno != null" >
- DB_BedNo,
- </if>
- <if test="icoApplyWarddm != null" >
- ICO_Apply_WardDm,
- </if>
- <if test="icoApplicant != null" >
- ICO_Applicant,
- </if>
- <if test="icoApplyTime != null" >
- ICO_Apply_Time,
- </if>
- <if test="icoRequestTime != null" >
- ICO_Request_Time,
- </if>
- <if test="icoConsultationTime != null" >
- ICO_Consultation_Time,
- </if>
- <if test="icoDiagnose != null" >
- ICO_Diagnose,
- </if>
- <if test="icoReplier != null" >
- ICO_Replier,
- </if>
- <if test="icoStatus != null" >
- ICO_Status,
- </if>
- <if test="icoRecordor != null" >
- ICO_Recordor,
- </if>
- <if test="icoRecordTime != null" >
- ICO_Record_Time,
- </if>
- <if test="icoFormerid != null" >
- ICO_FormerID,
- </if>
- <if test="icoIsdel != null" >
- ICO_IsDel,
- </if>
- <if test="icoOption != null" >
- ICO_Option,
- </if>
- <if test="icoXml != null" >
- ICO_XML,
- </if>
- <if test="daId != null" >
- DA_ID,
- </if>
- <if test="uiId != null" >
- UI_ID,
- </if>
- <if test="dctIds != null" >
- DCT_IDs,
- </if>
- <if test="icoListResponse != null">
- ICO_List_Response,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="icoId != null" >
- #{icoId,jdbcType=INTEGER},
- </if>
- <if test="patientno != null" >
- #{patientno,jdbcType=VARCHAR},
- </if>
- <if test="hiId != null" >
- #{hiId,jdbcType=INTEGER},
- </if>
- <if test="dctId != null" >
- #{dctId,jdbcType=INTEGER},
- </if>
- <if test="dcoCode != null" >
- #{dcoCode,jdbcType=VARCHAR},
- </if>
- <if test="dcoName != null" >
- #{dcoName,jdbcType=VARCHAR},
- </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="icoApplyWarddm != null" >
- #{icoApplyWarddm,jdbcType=VARCHAR},
- </if>
- <if test="icoApplicant != null" >
- #{icoApplicant,jdbcType=VARCHAR},
- </if>
- <if test="icoApplyTime != null" >
- #{icoApplyTime,jdbcType=TIMESTAMP},
- </if>
- <if test="icoRequestTime != null" >
- #{icoRequestTime,jdbcType=TIMESTAMP},
- </if>
- <if test="icoConsultationTime != null" >
- #{icoConsultationTime,jdbcType=TIMESTAMP},
- </if>
- <if test="icoDiagnose != null" >
- #{icoDiagnose,jdbcType=VARCHAR},
- </if>
- <if test="icoReplier != null" >
- #{icoReplier,jdbcType=VARCHAR},
- </if>
- <if test="icoStatus != null" >
- #{icoStatus,jdbcType=INTEGER},
- </if>
- <if test="icoRecordor != null" >
- #{icoRecordor,jdbcType=VARCHAR},
- </if>
- <if test="icoRecordTime != null" >
- #{icoRecordTime,jdbcType=TIMESTAMP},
- </if>
- <if test="icoFormerid != null" >
- #{icoFormerid,jdbcType=INTEGER},
- </if>
- <if test="icoIsdel != null" >
- #{icoIsdel,jdbcType=INTEGER},
- </if>
- <if test="icoOption != null" >
- #{icoOption,jdbcType=LONGVARCHAR},
- </if>
- <if test="icoXml != null" >
- #{icoXml,jdbcType=LONGVARCHAR},
- </if>
- <if test="daId != null" >
- #{daId,jdbcType=INTEGER},
- </if>
- <if test="uiId != null" >
- #{uiId,jdbcType=INTEGER},
- </if>
- <if test="dctIds != null" >
- #{dctIds,jdbcType=VARCHAR},
- </if>
- <if test="icoListResponse != null">
- #{icoListResponse,jdbcType=VARCHAR}
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpConsulationWithBLOBs" >
- update inp_consulation
- <set >
- <if test="patientno != null" >
- PatientNo = #{patientno,jdbcType=VARCHAR},
- </if>
- <if test="hiId != null" >
- HI_ID = #{hiId,jdbcType=INTEGER},
- </if>
- <if test="dctId != null" >
- DCT_ID = #{dctId,jdbcType=INTEGER},
- </if>
- <if test="dcoCode != null" >
- DCO_Code = #{dcoCode,jdbcType=VARCHAR},
- </if>
- <if test="dcoName != null" >
- DCO_Name = #{dcoName,jdbcType=VARCHAR},
- </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="icoApplyWarddm != null" >
- ICO_Apply_WardDm = #{icoApplyWarddm,jdbcType=VARCHAR},
- </if>
- <if test="icoApplicant != null" >
- ICO_Applicant = #{icoApplicant,jdbcType=VARCHAR},
- </if>
- <if test="icoApplyTime != null" >
- ICO_Apply_Time = #{icoApplyTime,jdbcType=TIMESTAMP},
- </if>
- <if test="icoRequestTime != null" >
- ICO_Request_Time = #{icoRequestTime,jdbcType=TIMESTAMP},
- </if>
- <if test="icoConsultationTime != null" >
- ICO_Consultation_Time = #{icoConsultationTime,jdbcType=TIMESTAMP},
- </if>
- <if test="icoDiagnose != null" >
- ICO_Diagnose = #{icoDiagnose,jdbcType=VARCHAR},
- </if>
- <if test="icoReplier != null" >
- ICO_Replier = #{icoReplier,jdbcType=VARCHAR},
- </if>
- <if test="icoStatus != null" >
- ICO_Status = #{icoStatus,jdbcType=INTEGER},
- </if>
- <if test="icoRecordor != null" >
- ICO_Recordor = #{icoRecordor,jdbcType=VARCHAR},
- </if>
- <if test="icoRecordTime != null" >
- ICO_Record_Time = #{icoRecordTime,jdbcType=TIMESTAMP},
- </if>
- <if test="icoFormerid != null" >
- ICO_FormerID = #{icoFormerid,jdbcType=INTEGER},
- </if>
- <if test="icoIsdel != null" >
- ICO_IsDel = #{icoIsdel,jdbcType=INTEGER},
- </if>
- <if test="daId != null" >
- DA_ID = #{daId,jdbcType=INTEGER},
- </if>
- <if test="icoOption != null" >
- ICO_Option = #{icoOption,jdbcType=LONGVARCHAR},
- </if>
- <if test="icoXml != null" >
- ICO_XML = #{icoXml,jdbcType=LONGVARCHAR},
- </if>
- <if test="DCT_IDs != null" >
- DCT_IDs = #{dctIds,jdbcType=VARCHAR},
- </if>
- </set>
- where ICO_ID = #{icoId,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpConsulationWithBLOBs" >
- update inp_consulation
- set PatientNo = #{patientno,jdbcType=VARCHAR},
- HI_ID = #{hiId,jdbcType=INTEGER},
- DCT_ID = #{dctId,jdbcType=INTEGER},
- DCO_Code = #{dcoCode,jdbcType=VARCHAR},
- DCO_Name = #{dcoName,jdbcType=VARCHAR},
- DD_DepDm = #{ddDepdm,jdbcType=VARCHAR},
- DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
- DB_BedNo = #{dbBedno,jdbcType=VARCHAR},
- ICO_Apply_WardDm = #{icoApplyWarddm,jdbcType=VARCHAR},
- ICO_Applicant = #{icoApplicant,jdbcType=VARCHAR},
- ICO_Apply_Time = #{icoApplyTime,jdbcType=TIMESTAMP},
- ICO_Request_Time = #{icoRequestTime,jdbcType=TIMESTAMP},
- ICO_Consultation_Time = #{icoConsultationTime,jdbcType=TIMESTAMP},
- ICO_Diagnose = #{icoDiagnose,jdbcType=VARCHAR},
- ICO_Replier = #{icoReplier,jdbcType=VARCHAR},
- ICO_Status = #{icoStatus,jdbcType=INTEGER},
- ICO_Recordor = #{icoRecordor,jdbcType=VARCHAR},
- ICO_Record_Time = #{icoRecordTime,jdbcType=TIMESTAMP},
- ICO_FormerID = #{icoFormerid,jdbcType=INTEGER},
- ICO_IsDel = #{icoIsdel,jdbcType=INTEGER},
- DA_ID = #{daId,jdbcType=INTEGER},
- ICO_Option = #{icoOption,jdbcType=LONGVARCHAR},
- DCT_IDs = #{dctIds,jdbcType=VARCHAR},
- ICO_XML = #{icoXml,jdbcType=LONGVARCHAR}
- where ICO_ID = #{icoId,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.InpConsulation" >
- update inp_consulation
- set PatientNo = #{patientno,jdbcType=VARCHAR},
- HI_ID = #{hiId,jdbcType=INTEGER},
- DCT_ID = #{dctId,jdbcType=INTEGER},
- DCO_Code = #{dcoCode,jdbcType=VARCHAR},
- DCO_Name = #{dcoName,jdbcType=VARCHAR},
- DD_DepDm = #{ddDepdm,jdbcType=VARCHAR},
- DW_WardDm = #{dwWarddm,jdbcType=VARCHAR},
- DB_BedNo = #{dbBedno,jdbcType=VARCHAR},
- ICO_Apply_WardDm = #{icoApplyWarddm,jdbcType=VARCHAR},
- ICO_Applicant = #{icoApplicant,jdbcType=VARCHAR},
- ICO_Apply_Time = #{icoApplyTime,jdbcType=TIMESTAMP},
- ICO_Request_Time = #{icoRequestTime,jdbcType=TIMESTAMP},
- ICO_Consultation_Time = #{icoConsultationTime,jdbcType=TIMESTAMP},
- ICO_Diagnose = #{icoDiagnose,jdbcType=VARCHAR},
- ICO_Replier = #{icoReplier,jdbcType=VARCHAR},
- ICO_Status = #{icoStatus,jdbcType=INTEGER},
- ICO_Recordor = #{icoRecordor,jdbcType=VARCHAR},
- ICO_Record_Time = #{icoRecordTime,jdbcType=TIMESTAMP},
- ICO_FormerID = #{icoFormerid,jdbcType=INTEGER},
- DA_ID = #{daId,jdbcType=INTEGER},
- DCT_IDs = #{dctIds,jdbcType=VARCHAR},
- ICO_IsDel = #{icoIsdel,jdbcType=INTEGER}
- where ICO_ID = #{icoId,jdbcType=INTEGER}
- </update>
- <update id="updateStatus" parameterType="java.lang.Integer" >
- update inp_consulation
- set ICO_IsDel = -1
- where ICO_ID = #{icoId,jdbcType=INTEGER}
- </update>
- <update id="updateIcoState" parameterType="java.lang.Integer">
- update inp_consulation
- set ICO_Status=1
- where ICO_ID = #{icoId,jdbcType=INTEGER}
- </update>
- </mapper>
|