123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544 |
- <?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.pubservice.mysqlmapper.InpExpandOrderMapper" >
- <resultMap id="BaseResultMap" type="com.xinxin.topro.pubservice.mysqlModel.InpExpandOrder" >
- <result column="RecordId" property="recordid" jdbcType="INTEGER" />
- <result column="VisitNo" property="visitno" jdbcType="VARCHAR" />
- <result column="PtName" property="ptname" jdbcType="VARCHAR" />
- <result column="InfantID" property="infantid" jdbcType="INTEGER" />
- <result column="ChartNo" property="chartno" jdbcType="VARCHAR" />
- <result column="DepartNo" property="departno" jdbcType="VARCHAR" />
- <result column="DepartName" property="departname" jdbcType="CHAR" />
- <result column="Gender" property="gender" jdbcType="VARCHAR" />
- <result column="Age" property="age" jdbcType="BIGINT" />
- <result column="PtWeight" property="ptweight" jdbcType="DOUBLE" />
- <result column="VisitZone" property="visitzone" jdbcType="INTEGER" />
- <result column="BirthDay" property="birthday" jdbcType="DATE" />
- <result column="DivNo" property="divno" jdbcType="VARCHAR" />
- <result column="DivName" property="divname" jdbcType="CHAR" />
- <result column="BedNo" property="bedno" jdbcType="VARCHAR" />
- <result column="AdmitTime" property="admittime" jdbcType="TIMESTAMP" />
- <result column="IdNo" property="idno" jdbcType="VARCHAR" />
- <result column="PhyDoctor" property="phydoctor" jdbcType="VARCHAR" />
- <result column="InHospitalStatus" property="inhospitalstatus" jdbcType="INTEGER" />
- <result column="OrderNo" property="orderno" jdbcType="VARCHAR" />
- <result column="OrderUser" property="orderuser" jdbcType="VARCHAR" />
- <result column="OrderUserName" property="orderusername" jdbcType="VARCHAR" />
- <result column="OrderTime" property="ordertime" jdbcType="TIMESTAMP" />
- <result column="PreExecTime" property="preexectime" jdbcType="TIMESTAMP" />
- <result column="PreExecLocName" property="preexeclocname" jdbcType="CHAR" />
- <result column="PreExecBed" property="preexecbed" jdbcType="CHAR" />
- <result column="ExecTime" property="exectime" jdbcType="CHAR" />
- <result column="ExecLocName" property="execlocname" jdbcType="CHAR" />
- <result column="ItemNo" property="itemno" jdbcType="VARCHAR" />
- <result column="Dose" property="dose" jdbcType="DOUBLE" />
- <result column="DoseUnit" property="doseunit" jdbcType="VARCHAR" />
- <result column="WayNo" property="wayno" jdbcType="CHAR" />
- <result column="SkinTest" property="skintest" jdbcType="CHAR" />
- <result column="WayType" property="waytype" jdbcType="VARCHAR" />
- <result column="WayName" property="wayname" jdbcType="CHAR" />
- <result column="ItemCode" property="itemcode" jdbcType="VARCHAR" />
- <result column="ItemName" property="itemname" jdbcType="VARCHAR" />
- <result column="OrderType" property="ordertype" jdbcType="INTEGER" />
- <result column="BigType" property="bigtype" jdbcType="CHAR" />
- <result column="PairItemNo" property="pairitemno" jdbcType="VARCHAR" />
- <result column="Rate" property="rate" jdbcType="VARCHAR" />
- <result column="RateUnit" property="rateunit" jdbcType="VARCHAR" />
- <result column="TakeMedWay" property="takemedway" jdbcType="INTEGER" />
- <result column="Usage" property="usage" jdbcType="VARCHAR" />
- <result column="LongOrTempFlag" property="longortempflag" jdbcType="INTEGER" />
- <result column="ExecStatus" property="execstatus" jdbcType="INTEGER" />
- <result column="BloodStatus" property="bloodstatus" jdbcType="CHAR" />
- <result column="Advise" property="advise" jdbcType="VARCHAR" />
- <result column="DrugBarCode" property="drugbarcode" jdbcType="VARCHAR" />
- <result column="isCollection" property="isCollection" jdbcType="INTEGER"/>
- <result column="PSM_Collect_Time" property="collectTime" jdbcType="TIMESTAMP" />
- <result column="UI_Name" property="collector" jdbcType="VARCHAR" />
- <result column="validTime" property="validTime" jdbcType="VARCHAR" />
- <result column="Entrust" property="entrust" jdbcType="VARCHAR" />
- </resultMap>
- <resultMap id="CommonResultMap" type="com.xinxin.topro.base.sqlservermodel.OrderInfo" >
- <result column="RecordId" property="recordid" jdbcType="INTEGER" />
- <result column="VisitNo" property="visitno" jdbcType="VARCHAR" />
- <result column="InfantID" property="infantid" jdbcType="VARCHAR" />
- <result column="ChartNo" property="chartno" jdbcType="VARCHAR" />
- <result column="DepartNo" property="departno" jdbcType="VARCHAR" />
- <result column="DepartName" property="departname" jdbcType="VARCHAR" />
- <result column="Gender" property="gender" jdbcType="VARCHAR" />
- <result column="Age" property="age" jdbcType="INTEGER" />
- <result column="BirthDay" property="birthday" jdbcType="TIMESTAMP" />
- <result column="DivNo" property="divno" jdbcType="VARCHAR" />
- <result column="DivName" property="divname" jdbcType="NVARCHAR" />
- <result column="BedNo" property="bedno" jdbcType="VARCHAR" />
- <result column="AdmitTime" property="admittime" jdbcType="TIMESTAMP" />
- <result column="IdNo" property="idno" jdbcType="VARCHAR" />
- <result column="PhyDoctor" property="phydoctor" jdbcType="VARCHAR" />
- <result column="OrderNo" property="orderno" jdbcType="VARCHAR" />
- <result column="OrderUser" property="orderuser" jdbcType="VARCHAR" />
- <result column="OrderTime" property="ordertime" jdbcType="TIMESTAMP" />
- <result column="PreExecTime" property="preexectime" jdbcType="TIMESTAMP" />
- <result column="PreExecLocName" property="preexeclocname" jdbcType="VARCHAR" />
- <result column="PreExecBed" property="preexecbed" jdbcType="VARCHAR" />
- <result column="ExecTime" property="exectime" jdbcType="TIMESTAMP" />
- <result column="ExecLocName" property="execlocname" jdbcType="VARCHAR" />
- <result column="ItemNo" property="itemno" jdbcType="VARCHAR" />
- <result column="Dose" property="dose" jdbcType="DECIMAL" />
- <result column="DoseUnit" property="doseunit" jdbcType="VARCHAR" />
- <result column="WayType" property="waytype" jdbcType="VARCHAR" />
- <result column="WayName" property="wayname" jdbcType="VARCHAR" />
- <result column="ItemCode" property="itemcode" jdbcType="VARCHAR" />
- <result column="ItemName" property="itemname" jdbcType="VARCHAR" />
- <result column="OrderType" property="ordertype" jdbcType="INTEGER" />
- <result column="BigType" property="bigtype" jdbcType="VARCHAR" />
- <result column="PairItemNo" property="pairitemno" jdbcType="VARCHAR" />
- <result column="Rate" property="rate" jdbcType="VARCHAR" />
- <result column="RateUnit" property="rateunit" jdbcType="VARCHAR" />
- <result column="TakeMedWay" property="takemedway" jdbcType="VARCHAR" />
- <result column="Usage" property="usage" jdbcType="VARCHAR" />
- <result column="LongOrTempFlag" property="longortempflag" jdbcType="INTEGER" />
- <result column="ExecStatus" property="execstatus" jdbcType="INTEGER" />
- <result column="BloodStatus" property="bloodstatus" jdbcType="INTEGER" />
- <result column="DrugBarCode" property="drugbarcode" jdbcType="VARCHAR" />
- </resultMap>
- <insert id="insert" parameterType="com.xinxin.topro.pubservice.mysqlModel.InpExpandOrder" >
- insert into v_expand_order (RecordId, VisitNo, PtName,
- InfantID, ChartNo, DepartNo,
- DepartName, Gender, Age,
- PtWeight, VisitZone, BirthDay,
- DivNo, DivName, BedNo,
- AdmitTime, IdNo, PhyDoctor,
- InHospitalStatus, OrderNo, OrderUser,
- OrderUserName, OrderTime, PreExecTime,
- PreExecLocName, PreExecBed, ExecTime,
- ExecLocName, ItemNo, Dose,
- DoseUnit, WayNo, SkinTest,
- WayType, WayName, ItemCode,
- ItemName, OrderType, BigType,
- PairItemNo, Rate, RateUnit,
- TakeMedWay, Usage, LongOrTempFlag,
- ExecStatus, BloodStatus, Advise,
- DrugBarCode)
- values (#{recordid,jdbcType=INTEGER}, #{visitno,jdbcType=VARCHAR}, #{ptname,jdbcType=VARCHAR},
- #{infantid,jdbcType=INTEGER}, #{chartno,jdbcType=VARCHAR}, #{departno,jdbcType=VARCHAR},
- #{departname,jdbcType=CHAR}, #{gender,jdbcType=VARCHAR}, #{age,jdbcType=BIGINT},
- #{ptweight,jdbcType=DOUBLE}, #{visitzone,jdbcType=INTEGER}, #{birthday,jdbcType=DATE},
- #{divno,jdbcType=VARCHAR}, #{divname,jdbcType=CHAR}, #{bedno,jdbcType=VARCHAR},
- #{admittime,jdbcType=TIMESTAMP}, #{idno,jdbcType=VARCHAR}, #{phydoctor,jdbcType=VARCHAR},
- #{inhospitalstatus,jdbcType=INTEGER}, #{orderno,jdbcType=VARCHAR}, #{orderuser,jdbcType=VARCHAR},
- #{orderusername,jdbcType=VARCHAR}, #{ordertime,jdbcType=TIMESTAMP}, #{preexectime,jdbcType=TIMESTAMP},
- #{preexeclocname,jdbcType=CHAR}, #{preexecbed,jdbcType=CHAR}, #{exectime,jdbcType=CHAR},
- #{execlocname,jdbcType=CHAR}, #{itemno,jdbcType=VARCHAR}, #{dose,jdbcType=DOUBLE},
- #{doseunit,jdbcType=VARCHAR}, #{wayno,jdbcType=CHAR}, #{skintest,jdbcType=CHAR},
- #{waytype,jdbcType=VARCHAR}, #{wayname,jdbcType=CHAR}, #{itemcode,jdbcType=VARCHAR},
- #{itemname,jdbcType=VARCHAR}, #{ordertype,jdbcType=INTEGER}, #{bigtype,jdbcType=CHAR},
- #{pairitemno,jdbcType=VARCHAR}, #{rate,jdbcType=VARCHAR}, #{rateunit,jdbcType=VARCHAR},
- #{takemedway,jdbcType=INTEGER}, #{usage,jdbcType=VARCHAR}, #{longortempflag,jdbcType=INTEGER},
- #{execstatus,jdbcType=INTEGER}, #{bloodstatus,jdbcType=CHAR}, #{advise,jdbcType=VARCHAR},
- #{drugbarcode,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.xinxin.topro.pubservice.mysqlModel.InpExpandOrder" >
- insert into v_expand_order
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="recordid != null" >
- RecordId,
- </if>
- <if test="visitno != null" >
- VisitNo,
- </if>
- <if test="ptname != null" >
- PtName,
- </if>
- <if test="infantid != null" >
- InfantID,
- </if>
- <if test="chartno != null" >
- ChartNo,
- </if>
- <if test="departno != null" >
- DepartNo,
- </if>
- <if test="departname != null" >
- DepartName,
- </if>
- <if test="gender != null" >
- Gender,
- </if>
- <if test="age != null" >
- Age,
- </if>
- <if test="ptweight != null" >
- PtWeight,
- </if>
- <if test="visitzone != null" >
- VisitZone,
- </if>
- <if test="birthday != null" >
- BirthDay,
- </if>
- <if test="divno != null" >
- DivNo,
- </if>
- <if test="divname != null" >
- DivName,
- </if>
- <if test="bedno != null" >
- BedNo,
- </if>
- <if test="admittime != null" >
- AdmitTime,
- </if>
- <if test="idno != null" >
- IdNo,
- </if>
- <if test="phydoctor != null" >
- PhyDoctor,
- </if>
- <if test="inhospitalstatus != null" >
- InHospitalStatus,
- </if>
- <if test="orderno != null" >
- OrderNo,
- </if>
- <if test="orderuser != null" >
- OrderUser,
- </if>
- <if test="orderusername != null" >
- OrderUserName,
- </if>
- <if test="ordertime != null" >
- OrderTime,
- </if>
- <if test="preexectime != null" >
- PreExecTime,
- </if>
- <if test="preexeclocname != null" >
- PreExecLocName,
- </if>
- <if test="preexecbed != null" >
- PreExecBed,
- </if>
- <if test="exectime != null" >
- ExecTime,
- </if>
- <if test="execlocname != null" >
- ExecLocName,
- </if>
- <if test="itemno != null" >
- ItemNo,
- </if>
- <if test="dose != null" >
- Dose,
- </if>
- <if test="doseunit != null" >
- DoseUnit,
- </if>
- <if test="wayno != null" >
- WayNo,
- </if>
- <if test="skintest != null" >
- SkinTest,
- </if>
- <if test="waytype != null" >
- WayType,
- </if>
- <if test="wayname != null" >
- WayName,
- </if>
- <if test="itemcode != null" >
- ItemCode,
- </if>
- <if test="itemname != null" >
- ItemName,
- </if>
- <if test="ordertype != null" >
- OrderType,
- </if>
- <if test="bigtype != null" >
- BigType,
- </if>
- <if test="pairitemno != null" >
- PairItemNo,
- </if>
- <if test="rate != null" >
- Rate,
- </if>
- <if test="rateunit != null" >
- RateUnit,
- </if>
- <if test="takemedway != null" >
- TakeMedWay,
- </if>
- <if test="usage != null" >
- Usage,
- </if>
- <if test="longortempflag != null" >
- LongOrTempFlag,
- </if>
- <if test="execstatus != null" >
- ExecStatus,
- </if>
- <if test="bloodstatus != null" >
- BloodStatus,
- </if>
- <if test="advise != null" >
- Advise,
- </if>
- <if test="drugbarcode != null" >
- DrugBarCode,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="recordid != null" >
- #{recordid,jdbcType=INTEGER},
- </if>
- <if test="visitno != null" >
- #{visitno,jdbcType=VARCHAR},
- </if>
- <if test="ptname != null" >
- #{ptname,jdbcType=VARCHAR},
- </if>
- <if test="infantid != null" >
- #{infantid,jdbcType=INTEGER},
- </if>
- <if test="chartno != null" >
- #{chartno,jdbcType=VARCHAR},
- </if>
- <if test="departno != null" >
- #{departno,jdbcType=VARCHAR},
- </if>
- <if test="departname != null" >
- #{departname,jdbcType=CHAR},
- </if>
- <if test="gender != null" >
- #{gender,jdbcType=VARCHAR},
- </if>
- <if test="age != null" >
- #{age,jdbcType=BIGINT},
- </if>
- <if test="ptweight != null" >
- #{ptweight,jdbcType=DOUBLE},
- </if>
- <if test="visitzone != null" >
- #{visitzone,jdbcType=INTEGER},
- </if>
- <if test="birthday != null" >
- #{birthday,jdbcType=DATE},
- </if>
- <if test="divno != null" >
- #{divno,jdbcType=VARCHAR},
- </if>
- <if test="divname != null" >
- #{divname,jdbcType=CHAR},
- </if>
- <if test="bedno != null" >
- #{bedno,jdbcType=VARCHAR},
- </if>
- <if test="admittime != null" >
- #{admittime,jdbcType=TIMESTAMP},
- </if>
- <if test="idno != null" >
- #{idno,jdbcType=VARCHAR},
- </if>
- <if test="phydoctor != null" >
- #{phydoctor,jdbcType=VARCHAR},
- </if>
- <if test="inhospitalstatus != null" >
- #{inhospitalstatus,jdbcType=INTEGER},
- </if>
- <if test="orderno != null" >
- #{orderno,jdbcType=VARCHAR},
- </if>
- <if test="orderuser != null" >
- #{orderuser,jdbcType=VARCHAR},
- </if>
- <if test="orderusername != null" >
- #{orderusername,jdbcType=VARCHAR},
- </if>
- <if test="ordertime != null" >
- #{ordertime,jdbcType=TIMESTAMP},
- </if>
- <if test="preexectime != null" >
- #{preexectime,jdbcType=TIMESTAMP},
- </if>
- <if test="preexeclocname != null" >
- #{preexeclocname,jdbcType=CHAR},
- </if>
- <if test="preexecbed != null" >
- #{preexecbed,jdbcType=CHAR},
- </if>
- <if test="exectime != null" >
- #{exectime,jdbcType=CHAR},
- </if>
- <if test="execlocname != null" >
- #{execlocname,jdbcType=CHAR},
- </if>
- <if test="itemno != null" >
- #{itemno,jdbcType=VARCHAR},
- </if>
- <if test="dose != null" >
- #{dose,jdbcType=DOUBLE},
- </if>
- <if test="doseunit != null" >
- #{doseunit,jdbcType=VARCHAR},
- </if>
- <if test="wayno != null" >
- #{wayno,jdbcType=CHAR},
- </if>
- <if test="skintest != null" >
- #{skintest,jdbcType=CHAR},
- </if>
- <if test="waytype != null" >
- #{waytype,jdbcType=VARCHAR},
- </if>
- <if test="wayname != null" >
- #{wayname,jdbcType=CHAR},
- </if>
- <if test="itemcode != null" >
- #{itemcode,jdbcType=VARCHAR},
- </if>
- <if test="itemname != null" >
- #{itemname,jdbcType=VARCHAR},
- </if>
- <if test="ordertype != null" >
- #{ordertype,jdbcType=INTEGER},
- </if>
- <if test="bigtype != null" >
- #{bigtype,jdbcType=CHAR},
- </if>
- <if test="pairitemno != null" >
- #{pairitemno,jdbcType=VARCHAR},
- </if>
- <if test="rate != null" >
- #{rate,jdbcType=VARCHAR},
- </if>
- <if test="rateunit != null" >
- #{rateunit,jdbcType=VARCHAR},
- </if>
- <if test="takemedway != null" >
- #{takemedway,jdbcType=INTEGER},
- </if>
- <if test="usage != null" >
- #{usage,jdbcType=VARCHAR},
- </if>
- <if test="longortempflag != null" >
- #{longortempflag,jdbcType=INTEGER},
- </if>
- <if test="execstatus != null" >
- #{execstatus,jdbcType=INTEGER},
- </if>
- <if test="bloodstatus != null" >
- #{bloodstatus,jdbcType=CHAR},
- </if>
- <if test="advise != null" >
- #{advise,jdbcType=VARCHAR},
- </if>
- <if test="drugbarcode != null" >
- #{drugbarcode,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <select id="getOrderInfoByOrderType" resultMap="BaseResultMap">
- SELECT a.*,CASE when psm_barcode is null then 0 else 1 end isCollection
- from v_expand_order a LEFT JOIN pda_specimen b on a.drugbarcode = b.psm_barcode
- where
- DepartNo = #{DepartNo,jdbcType=VARCHAR} and InHospitalStatus = 0 and VisitZone = #{visitZone,jdbcType=INTEGER}
- and orderType = #{orderType,jdbcType=INTEGER}
- </select>
- <select id="getSpecimenByPatientNo" resultMap="BaseResultMap">
- SELECT * from (
- SELECT DISTINCT a.*,CASE when psm_barcode is null then 0 else 1 end isCollection ,PSM_Collect_Time,c.UI_Name
- from v_expand_order a LEFT JOIN pda_specimen b on a.drugbarcode = b.psm_barcode
- LEFT JOIN sys_userinfo c on b.PSM_Collector = c.UI_Code
- where
- VisitNo = #{patientNo,jdbcType=VARCHAR} and InHospitalStatus = 0 and VisitZone = #{visitZone,jdbcType=INTEGER}
- and orderType = 3 ) cc where isCollection = #{status,jdbcType=VARCHAR}
- <if test="collectTime != null" >
- and DATE_FORMAT(PSM_Collect_Time,'%Y-%m-%d') = #{collectTime,jdbcType=VARCHAR}
- </if>
- </select>
- <select id="selectByLabelPrint" resultMap="BaseResultMap">
- SELECT c.DB_BedNo BedNo,c.IP_Name PtName,c.IP_Med_Rec ChartNo,c.IP_Sex Gender,a.IEO_DrugValidity validTime,
- d.DMW_Name WayName,a.IEO_Rate Rate,a.IEO_Item_Name ItemName,a.IEO_Dose Dose,a.IEO_DoseUnit DoseUnit,a.IEO_Entrust Entrust,
- a.IEO_Item_Explain Advise,a.IMO_Med_Usage `Usage`,
- (case a.IEO_TakeMed_Way when 1 then CONCAT('JSY-', a.IEO_ID)
- ELSE a.IEO_Bar_Code END)
- AS DrugBarCode,a.IEO_Pre_ExecTime PreExecTime,a.IEO_TakeMed_Way TakeMedWay
- from inp_expand_order a
- INNER JOIN inp_patient c on a.PatientNo = c.IP_PatientNo
- LEFT JOIN dic_med_way d on a.IEO_AdviceNo = d.DMW_Code
- where
- a.PatientNo in <foreach item='item' index='index' collection='patinetNos' open='(' separator=',' close=')'> #{item} </foreach>
- -- and (b.IMO_PIVA != 1 or IEO_TakeMed_Way in (2,3))
- <if test="takeMedWay != null" >
- and IEO_TakeMed_Way = #{takeMedWay}
- </if>
- <if test="longTemp != null" >
- and IEO_IsLong = #{longTemp,jdbcType=INTEGER}
- </if>
- and ((a.IEO_Bar_Code != '' and a.IEO_Bar_Code is not null) or (IEO_TakeMed_Way = 1))
- <choose>
- <when test="timeStatus == 3">
- and (IEO_Open_Time BETWEEN #{orderSTime,jdbcType=TIMESTAMP} and #{orderETime,jdbcType=TIMESTAMP})
- </when>
- <otherwise>
- and (IEO_Pre_ExecTime BETWEEN #{preSTime,jdbcType=TIMESTAMP} and #{preETime,jdbcType=TIMESTAMP})
- </otherwise>
- </choose>
- <if test="medWays != null">
- <choose>
- <when test="inFlag==1">
- and IEO_Med_Way in <foreach item='item' index='index' collection='medWays' open='(' separator=',' close=')'> #{item} </foreach>
- </when>
- <otherwise>
- and IEO_Med_Way not in <foreach item='item' index='index' collection='medWays' open='(' separator=',' close=')'> #{item} </foreach>
- </otherwise>
- </choose>
- </if>
- </select>
- <select id="getRecivedOrderByDispensedTime" resultMap="CommonResultMap">
- SELECT `a`.`PatientNo` AS `VisitNo`,
- `a`.`IEO_Dose` AS `Dose`,
- `a`.`IEO_DoseUnit` AS `DoseUnit`,
- `a`.`IEO_Item_Name` AS `ItemName`,
- `a`.`IEO_Item_OrderID` AS `PairItemNo`,
- `a`.`IMO_Med_Usage` AS `Usage`,
- `a`.`IEO_IsLong` AS `LongOrTempFlag`,
- `a`.`IEO_Pre_ExecTime` AS `PreExecTime`,
- `d`.`DMW_Name` AS `WayName`,`a`.`IEO_Item_Explain` AS `Advise`,
- a.IEO_Bar_Code AS `DrugBarCode`
- FROM `inp_expand_order` `a`
- LEFT JOIN `dic_med_way` `d` ON `a`.`IEO_AdviceNo` = `d`.`DMW_Code`
- where DATE_FORMAT(a.IEO_DispensedTime,'%Y-%m-%d') = #{PreExecTime}
- and a.DW_WardDm = #{DepartNo}
- and a.HI_ID = #{visitZone}
- and (a.IEO_Order_Type = 2 or a.IEO_Order_Type = 99)
- and a.IEO_Status = 3
- and a.ieo_bar_code is not null
- and a.PatientNo in <foreach item='item' index='index' collection='list' open='(' separator=',' close=')'> #{item} </foreach>
- </select>
- <select id="getTotalBarCode" resultType="String">
- SELECT ieo_bar_code FROM inp_expand_order
- WHERE DATE_FORMAT(IEO_DispensedTime,'%Y-%m-%d') = #{PreExecTime}
- AND DW_WardDm = #{DepartNo} AND IEO_Status = 3 AND HI_ID = #{visitZone}
- and (IEO_Order_Type = 2 or IEO_Order_Type = 99)
- and patientno in <foreach item='item' index='index' collection='list' open='(' separator=',' close=')'> #{item} </foreach>
- and ieo_bar_code is not null GROUP BY ieo_bar_code
- </select>
- <select id="getOrderCountByBarCodes" resultType="Integer">
- select count(1) from pda_order WHERE PO_OperatType = 0 and PO_IsDel = 0 and po_barcode
- in <foreach item='item' index='index' collection='barCodes' open='(' separator=',' close=')'> #{item} </foreach>
- GROUP BY po_barcode
- </select>
- <update id="updateByBarCodes" >
- <foreach collection="ids" item="item" index="index" open="" close="" separator=";">
- update inp_expand_order
- <set>
- IEO_Bar_Code= CONCAT('JSY-', ${item})
- </set>
- where IEO_ID = ${item}
- </foreach>
- </update>
- </mapper>
|