| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645 | package thyyxxk.webserver.dao.his.zhuyuanyisheng;import com.baomidou.mybatisplus.core.conditions.Wrapper;import com.baomidou.mybatisplus.core.toolkit.Constants;import org.apache.ibatis.annotations.*;import thyyxxk.webserver.entity.datamodify.GetDropdownBox;import thyyxxk.webserver.entity.datamodify.YzActOrder;import thyyxxk.webserver.entity.datamodify.ZyDetailCharge;import thyyxxk.webserver.entity.inpatient.patient.Overview;import thyyxxk.webserver.entity.inpatient.patient.Patient;import thyyxxk.webserver.entity.zhuyuanyisheng.DoctorSOrderFee;import thyyxxk.webserver.entity.zhuyuanyisheng.ZyOrderZk;import thyyxxk.webserver.entity.zhuyuanyisheng.yizhuluru.*;import java.math.BigDecimal;import java.util.Date;import java.util.List;import java.util.Map;import java.util.Set;/** * <p> * 描述: 医嘱录入dao * </p> * * @author xc * @date 2022-01-04 17:00 */@Mapperpublic interface YiZhuLuRuDao {    @Select("SELECT " +            "RTRIM(a.bed_no) bedNo, " +            "RTRIM(a.inpatient_no) inpatientNo, " +            "a.admiss_times, " +            "RTRIM(a.name) as name, " +            "sex=isnull(a.sex, 9), " +            "mdtrtId=(select b.mdtrt_id from t_si_pat_info b where b.pat_no=a.inpatient_no " +            "and b.times=a.admiss_times and b.ledger_sn=a.times_billed), " +            "injurySerialNo=(select serial_no from t_injury_si_pat_info where pat_no=a.inpatient_no " +            "and times=a.admiss_times and ledger_sn=a.times_billed), " +            "medType=a.med_type, " +            "dismissOrder=(select count(1) from yz_act_order b where b.inpatient_no=a.inpatient_no " +            "and b.admiss_times=a.admiss_times and status_flag > '1' and isnull(group_no,'00')='00' " +            "and order_code in ('06026','06053','05973'))," +            "orderNoCount = (select count(1) " +            "                    from yz_act_order c " +            "                    where a.inpatient_no = c.inpatient_no " +            "                      and c.admiss_times = a.admiss_times " +            "                      and c.status_flag = '1' " +            "                      and c.enter_oper = #{userCode}), " +            "                   refer_physician, " +            "                   (select name from a_employee_mi where code = refer_physician) as refer_physician_name, " +            "                   consult_physician, " +            "                   (select name from a_employee_mi where code = refer_physician) as consult_physician_name, " +            "                   dept_director, " +            "                   (select name from a_employee_mi where code = refer_physician) as dept_director_name " +            "FROM zy_actpatient a with (NOLOCK) " +            "where refer_physician = #{code} " +            "ORDER BY cast(bed_no AS int) ")    List<Patient> getMyPatient(String code);    @Select("select isnull(balance,0) balance, " +            "       total_charge, " +            "       charge1, " +            "       charge2, " +            "       charge3, " +            "       charge4, " +            "       charge5, " +            "       charge6, " +            "       charge7, " +            "       charge8, " +            "       charge9, " +            "       charge10, " +            "       charge11, " +            "       charge12, " +            "       charge13, " +            "       charge14, " +            "       charge15, " +            "       charge16, " +            "       charge17, " +            "       charge18, " +            "       charge19, " +            "       charge20, " +            "       charge21, " +            "       charge22, " +            "       charge23, " +            "       charge24, " +            "       charge25, " +            "       charge26, " +            "       charge27, " +            "       charge28, " +            "       charge29, " +            "       charge30, " +            "       yp   = (isnull(charge1 + charge2 + charge28, 0))," +            "       jyjc = (isnull(charge8 + charge9 + charge11 + charge18 + charge13, 0))," +            "       isnull(charge_yb, 0) charge_yb " +            "from zy_ledger_file with (NOLOCK) " +            "where inpatient_no = #{inpatientNo} " +            "  and admiss_times = #{admissTimes} " +            "  and ledger_sn = #{ledgerSn} ")    HuanZheFeiYong feiYongXinXi(@Param("inpatientNo") String inpatientNo,                                @Param("admissTimes") Integer admissTimes,                                @Param("ledgerSn") Integer ledgerSn);    @Select("select                     a.act_order_no, " +            "                           cast(cast(a.act_order_no as decimal) as varchar) id," +            "                           newOrderFlag = (select count(*) from new_act_order_recording where new_act_order_recording.act_order_no = a.act_order_no),    " +            "                           order_code, " +            "                           order_name, " +            "                           rtrim(frequ_code)                              frequ_code, " +            "    frequ_code_name      = (select rtrim(comm) " +            "                            from yz_order_frequency " +            "                            where code = frequ_code), " +            "                           instruction, " +            "                           discription, " +            "                           infant_flag, " +            "                           order_time, " +            "                           physician, " +            "                           start_time, " +            "                           drug_specification, " +            "                           drug_quan, " +            "    drug_quan_name       = (select name " +            "                            from yp_zd_unit with (NOLOCK) " +            "                            where code = mini_unit), " +            "                           supply_code, " +            "    supply_code_name     = (select supply_name " +            "                            from yz_supply_type with (NOLOCK) " +            "                            where yz_supply_type.supply_code = a.supply_code), " +            "                           a.inpatient_no, " +            "                           a.admiss_times, " +            "                           drug_flag, " +            "                           enter_oper," +            "enter_oper_name      = (select top (1) rtrim(name) " +            "                            from a_employee_mi with (NOLOCK) " +            "                            where code = enter_oper) /* 录入人 */, " +            "                           enter_time, " +            "                           mini_unit, " +            "                           drug_weight, " +            "                           drug_weight_unit, " +            "                           rtrim(status_flag) status_flag, " +            "                           status_time, " +            "                           parent_no," +            " parent_no_name    = (select kfc.order_name from yz_act_order kfc where kfc.act_order_no = a.parent_no)," +            "                           self_buy, " +            "                           dose, " +            "                           dose_unit, " +            "    dose_unit_name       = (select name " +            "                            from yp_zd_unit with (NOLOCK) " +            "                            where dose_unit = code), " +            "                           drug_occ, " +            "                           drug_volume, " +            "                           drug_vol_unit, " +            "                           exclu_back_time, " +            "                           exclu_act_order_no, " +            "                           pay_self, " +            "                           serial, " +            "                           group_no, " +            "                           signer, " +            "                           cl_code, " +            "                           doctor_flag, " +            "                           emergency_flag, " +            "    exclu_type='', " +            "    end_time_b=end_time, " +            "                           exec_unit, " +            "                           dept_code, " +            "                           ward_code, " +            "    new_flag='0', " +            "    order_no_pattern=0, " +            "    suprice_flag='', " +            "    self_flag            ='', " +            "    pack_size=0.0, " +            "    parent_no_c=           -1000, " +            "                           reg_flag, " +            "    parent_flag='', " +            "                           yb_self_flag, " +            "                           kf_flag, " +            "                           refer_physician, " +            "                           consult_physician, " +            "    physician_name       = (select top (1) rtrim(name) " +            "                            from a_employee_mi with (NOLOCK) " +            "                            where code = physician) /* 开这个医嘱的医生 */, " +            "    exec_unit_name       = (select top (1) rtrim(name) " +            "                            from zd_unit_code with (NOLOCK) " +            "                            where code = exec_unit), " +            "    /*管床医生*/ " +            "    refer_physician_name = (select rtrim(name) " +            "                            from a_employee_mi with (NOLOCK) " +            "                            where code = refer_physician), " +            "    group_no_name        = (select rtrim(group_name) " +            "                            from yp_zd_group_name with (NOLOCK) " +            "                            where a.group_no = group_no), " +            "    signer_name          = (select top (1) rtrim(name) " +            "                            from a_employee_mi with (NOLOCK) " +            "                            where code = signer) /*确认人*/, " +            "                           confirm_time /*确认时间*/, " +            "                           modifier, " +            "    modifier_name        = (select top (1) rtrim(name) " +            "                            from a_employee_mi with (NOLOCK) " +            "                            where code = modifier) /*停止人*/, " +            "                           end_time /*停止时间*/," +            "                           b.new_ward as  zkWardCode, " +            "                           b.new_dept as  zkDeptCode," +            " kss.yyfs , kss.ssqk,kss.yysj," +            "   executer1       = (select name from a_employee_mi where code = executer1), " +            "   executer2= (select name from a_employee_mi where code = executer2) " +            "from yz_act_order a  with (NOLOCK) left join " +            "zy_order_zk b with (NOLOCK) on (a.act_order_no = b.act_order_no) left join " +            "yz_act_record_kss kss on (a.act_order_no = kss.act_order_no) " +            " ${ew.customSqlSegment} ")    List<XinZhenYzActOrder> selectOrderNo(@Param(Constants.WRAPPER) Wrapper<?> wq);    @Select("select act_order_no, " +            "rtrim(status_flag) status_flag," +            "frequ_code," +            "enter_oper," +            "inpatient_no " +            "from yz_act_order with (NOLOCK) " +            "${ew.customSqlSegment}")    List<XinZhenYzActOrder> getOrdersToDelete(@Param(Constants.WRAPPER) Wrapper<?> wq);    @Update("update yz_act_order " +            "set " +            "    order_time  = #{order.orderTime,jdbcType=TIMESTAMP}, " +            "    start_time  = #{order.startTime,jdbcType=TIMESTAMP}, " +            "    end_time    = #{order.endTime,jdbcType=TIMESTAMP}, " +            "    supply_code = '044', " +            "    frequ_code  = #{order.frequCode}," +            "    group_no  = #{order.groupNo}," +            "    exec_unit  = #{order.execUnit} " +            "    modifier = #{order.modifier} " +            "where act_order_no = ${orderNo} ")    void updateSubOrderStatus(BigDecimal orderNo, XinZhenYzActOrder order);    @Delete("delete yz_act_order ${ew.customSqlSegment} ")    void deleteMultipleOrders(@Param(Constants.WRAPPER) Wrapper<?> wq);    @Update("<script>" +            "update yz_act_order " +            "set parent_no = null " +            "where inpatient_no = #{patNo} " +            "  and admiss_times = #{times} " +            "  and parent_no in " +            "<foreach collection='list' item='item'  open='(' close=')' separator=','>" +            "#{item}" +            "</foreach>" +            "</script>")    void deleteParentChildRelationship(String patNo,                                       Integer times,                                       List<BigDecimal> list);    @Select("<script>" +            "<foreach collection=\"list\" item=\"item\" index=\"index\" separator=\";\">" +            "update yz_act_order " +            "set modifier = #{userCode}, " +            " end_time = #{item.endTime} " +            "where inpatient_no = #{patNo} " +            "  and admiss_times = #{times}" +            "  and (act_order_no = #{item.actOrderNo} or parent_no = #{item.actOrderNo}) " +            "  and end_time is null" +            "</foreach>" +            "</script>")    void setStopTime(List<XinZhenYzActOrder> list,                     String userCode,                     String patNo,                     Integer times);    @Select("SELECT         rtrim(a.code) + rtrim(serial) as id, " +            "               py_code=a.py_code, " +            "                d_code =a.d_code, " +            "                order_code =a.code, " +            "                order_name =a.name, " +            "                drug_specification=a.specification, " +            "                    drug_flag =case a.infusion_flag " +            "                    when '1' then 'i' " +            "                    else (case categories_flag " +            "                              when '0' " +            "                                  then 'd' " +            "                              else 'z' " +            "                        end) " +            "                           end, " +            "                parent_code=null, " +            "                exclu_group_type=null, " +            "                discription=case a.infusion_flag " +            "                                when '1' then '大输液' " +            "                                else (case " +            "                                          when a.code >= '30000' and a.code < '50000' then '中药' " +            "                                          else '西药  ' end) end + convert(char(10), a.pack_retprice) + '元' + '(医保类别:' + " +            "                            ltrim(rtrim(yb_flag_new)) + ';报销比例:' + ltrim(rtrim(yb_bl_new)) + ';医保说明:' + " +            "                            ltrim(rtrim(yb_comment_new)) + ')', " +            "                serial=a.serial, " +            "                group_no=a.group_no, " +            "                infusion_flag=a.infusion_flag, " +            "                group_name =a.group_name, " +            "                pack_size=a.pack_size, " +            "                order_class='Y', " +            "                spec_pack=a.spec_pack, " +            "                jsy_flag =a.jsy_flag, " +            "                xnh_flag, " +            "                yb_comment, " +            "                dosage = a.dosage, " +            "                yb_type, " +            "                yb_flag_new," +            "                father_flag, " +            "                manu_name=(select name from yp_zd_manufactory with (NOLOCK) where code = a.manu_code), " +            "                stock_amount=a.stock_amount, " +            "                national_code," +            "                national_name " +            "FROM view_yp_zd_dict_base_yf a with (NOLOCK) " +            "WHERE isnull(a.visible_flag_zy, '') <> '1' " +            "  and (a.py_code like #{code} or a.name like #{code} or code like #{code}) " +            "  and group_no = '${groupNo}' ")    List<YiZhuMingChen> yiZhuYaoPing(@Param("code") String code,                                     @Param("groupNo") String groupNo);    @Select("select act_order_no, " +            "rtrim(status_flag) as status_flag," +            "rtrim(frequ_code) as frequ_code," +            "rtrim(supply_code) as supply_code, " +            "inpatient_no," +            "admiss_times," +            "enter_oper," +            "rtrim(serial) as serial," +            "order_time," +            "start_time," +            "end_time," +            "group_no," +            "ward_code," +            "parent_no " +            "from yz_act_order with (NOLOCK) " +            "where act_order_no = #{orderNo} ")    XinZhenYzActOrder getActOrderNoOne(String orderNo);    @Select("select cast(cast(act_order_no as decimal) as varchar) " +            "from yz_act_order with (NOLOCK) " +            "where parent_no = #{orderNo}")    List<String> getParentChildOrders(String orderNo);    @Select("<script>" +            "select * " +            "from zy_detail_charge with (NOLOCK) " +            "where inpatient_no = #{patNo} " +            "  and admiss_times = #{times} " +            "  and ori_detail_sn is null" +            "  and charge_fee > 0 " +            "  and order_no in " +            "<foreach collection='list' item='item' index='index' open='(' close=')' separator=','>" +            " #{item}" +            "</foreach>" +            "</script>")    List<ZyDetailCharge> getExpenseData(String patNo,                                        Integer times,                                        List<String> list);    @Update("<script>" +            "update zy_detail_charge " +            "set ori_detail_sn = -1 " +            "where inpatient_no = #{patNo} " +            "  and admiss_times = #{times} " +            "  and ori_detail_sn is null " +            "  and charge_fee > 0 " +            "  and order_no in " +            "<foreach collection='list' item='item' index='index' open='(' close=')' separator=','>" +            " #{item}" +            "</foreach>" +            "</script>")    void updateItemFlag(String patNo,                        Integer times,                        List<String> list);    @Update("update yz_act_order " +            "set status_flag = '-1', " +            "    end_time    = getdate(), " +            "    modifier    = #{userCode}, " +            "    instruction = #{reasonForCancellation}," +            "    order_name = cast('(作废)' + yz_act_order.order_name as char(100))" +            "where act_order_no = #{orderNo}")    void updateVoidedOrders(String orderNo,                            String userCode,                            String reasonForCancellation);    @Update("update yz_act_order " +            "set status_flag = '-1', " +            "    end_time    = getdate(), " +            "    modifier    = #{userCode}, " +            "    instruction = #{reasonForCancellation}, " +            "    order_name = cast('(作废)' + yz_act_order.order_name as char(100))" +            "where parent_no = #{orderNo}")    void updateChildOrders(String orderNo,                           String userCode,                           String reasonForCancellation);    /**     * 获取医生下面的病区     *     * @param deptCode 科室编码     * @return     */    @Select("select dept " +            "from zd_dept_all with (NOLOCK) " +            "where small_dept = #{deptCode} " +            "  and dept is not null")    List<String> getTheDoctorSDepartment(String deptCode);    /**     * 获取已经确认收费的医嘱     *     * @param orderNo 医嘱号     * @return     */    @Select("select count(*) " +            "from yz_zy_patient_fee with (NOLOCK) " +            "where " +            "inpatient_no = #{patNo} and " +            "admiss_times = #{times} and " +            "act_order_no = #{orderNo} and " +            "charge_status = '1'")    Integer getADoctorSOrderWithADefiniteFee(String patNo,                                             Integer times,                                             String orderNo);    @Select("select count(*) " +            "from zy_detail_charge with (NOLOCK) " +            "where inpatient_no = #{patNo} " +            "  and admiss_times = #{times} " +            "  and order_no = #{orderNo} " +            "  and ori_detail_sn is null" +            "  and charge_fee > 0 ")    Integer getDetailChargeFee(String patNo,                               Integer times,                               String orderNo);    @Update("UPDATE " +            "    yz_zy_patient_fee " +            "SET charge_status = '2', " +            "    op_id         =  #{userid}, " +            "    op_date       = GETDATE() " +            "WHERE act_order_no = #{orderNo} " +            "  AND inpatient_no = #{patNo} " +            "  AND admiss_times = #{times} ")    void cancelMedicalTechnologyAssuranceFee(String userid,                                             String orderNo,                                             String patNo,                                             Integer times);    /**     * 获取,有未确认和未执行的医嘱     *     * @param patNo   住院号     * @param times   住院次数     * @param orderNo 医嘱号     * @return 数据     */    @Select("select count(1) " +            "from yz_act_order with (NOLOCK) " +            "where inpatient_no = #{patNo} " +            "  and admiss_times = #{times} " +            "  and status_flag in (1, 2)" +            "  and frequ_code <> 'ONCE' " +            "  and act_order_no <> #{orderNo}")    Integer thereAreUnexecutedOrders(String patNo,                                     Integer times,                                     BigDecimal orderNo);    @Select("select count(1) " +            "from yz_act_order " +            "where inpatient_no = #{yz.inpatientNo} " +            "  and admiss_times = #{yz.admissTimes} " +            "  and status_flag = 1 " +            "  and isnull(self_buy, '0') <> '4' " +            "  and enter_oper = #{userCode} " +            "  and order_code in (select rtrim(order_code) " +            "                     from yz_zd_order_item_confirm " +            "                     where item_name = N'出院')")    int selectDischargeOrde(@Param("yz") XinZhenYiZhu yz,                            @Param("userCode") String userCode);    @Update("update yz_act_order " +            "set modifier = #{userCode}, " +            "    end_time = #{date}," +            "    exclu_act_order_no = #{orderNo} " +            "where inpatient_no = #{patNo} " +            "  and admiss_times = #{times}" +            "  and frequ_code != 'ONCE' " +            "  AND status_flag IN (3, 4, 5) " +            "  and isnull(end_time, dateadd(day, 1, #{date})) >= #{date} ")    void stopOrder(String patNo, Integer times, Date date, String userCode, BigDecimal orderNo);    @Update("update yz_act_order " +            "set confirm_time = #{confirmDate}, " +            "    signer       = #{userCode}, " +            "    status_time  = #{confirmDate}, " +            "    status_flag  = '2'," +            "    supply_code  = case " +            "                      when parent_no is not null then (select isnull(nullif(supply_child, ''), '044') " +            "                                                       from yz_supply_type c " +            "                                                       where c.supply_code = (select supply_code " +            "                                                                              from yz_act_order b " +            "                                                                              where b.act_order_no = yz_act_order.parent_no)) " +            "                      else " +            "                          yz_act_order.supply_code end " +            " where act_order_no = #{decimal}")    void confirmOrders(BigDecimal decimal, String userCode, Date confirmDate);    @Update("update yz_act_order " +            "set confirm_time = #{confirmDate}, " +            "    signer       = #{userCode}, " +            "    status_time  = #{confirmDate}, " +            "    status_flag  = '5'," +            "    modifier     = #{userCode}," +            "    end_time = #{confirmDate}, " +            "    frequ_code = 'ONCE'  " +            " where act_order_no = #{decimal} ")    void takeMedicineAfterDischargeStopOrder(BigDecimal decimal, String userCode, Date confirmDate);    @Delete("delete yz_act_record_kss where act_order_no =#{orderNo}; " +            "delete zy_order_zk where act_order_no =#{orderNo};" +            "delete op_record where inpatient_no = #{patNo} and act_order_no =#{orderNo};" +            "delete ysh_yj_req where inpatient_no =#{patNo} and act_order_no =#{orderNo};" +            "DELETE FROM yz_act_order WHERE act_order_no = #{orderNo};   ")    void toDeleteAnOrder(String orderNo, String patNo);    @Update("UPDATE yz_act_order SET parent_no = NULL WHERE parent_no = #{orderNo} ")    void deleteGroup(String orderNo);    @Delete("delete yz_act_order where " +            "act_order_no = #{orderNo} ")    void deleteOrderNo(String orderNo);    @Insert("INSERT INTO yz_act_order (order_code, order_name, frequ_code, instruction, discription, infant_flag, order_time, " +            "    /*录入人*/physician, start_time, drug_specification, drug_quan, supply_code, act_order_no, inpatient_no, " +            "                          admiss_times, drug_flag/*药品中找这个是 药品的类型 a i d*/, enter_oper, /*录入时间*/ " +            "                          enter_time, " +            "                          mini_unit /*药品中找 最小包装规格*/, " +            "                          drug_weight/*药品的重量*/, drug_weight_unit/*药品重量单位*/, " +            "                          status_flag/*1*/, self_buy, dose, dose_unit, drug_occ, drug_volume/*药品中的 volum 找*/, " +            "                          drug_vol_unit/* 药品中的 vol_unit */, pay_self/*0*/, " +            "                          serial/*前端传*/, group_no/*药房 */, doctor_flag/*写死为 1*/, exec_unit, dept_code/* 在院病人表中的 dept */, " +            "                          ward_code /* 在院病人表中的 zk_ward*/, " +            "                          reg_flag/* 0 */, " +            "                          yb_self_flag/*医保自费标志*/, emergency_flag, " +            "                          kf_flag /*饭前饭后*/, parent_no, refer_physician/*患者的管床医生*/, end_time," +            "                          modifier) " +            "values (#{pa.orderCode}, #{pa.orderName}, #{pa.frequCode}, #{pa.instruction}, #{pa.discription}, #{patInfo.infantFlag}, " +            "        #{pa.orderTime}, #{userCode}, " +            "        #{pa.startTime}, cast(#{pa.drugSpecification} as varchar(16)), #{pa.drugQuan,jdbcType=REAL}, #{pa.supplyCode}, #{pa.actOrderNo,jdbcType=REAL}, #{patInfo.inpatientNo}, " +            "        #{patInfo.admissTimes}, #{pa.drugFlag}, #{userCode}, getdate(), " +            "        #{pa.miniUnit}, #{pa.drugWeight,jdbcType = REAL}, #{pa.drugWeightUnit,jdbcType=REAL}, '1', #{pa.selfBuy}, " +            "        #{pa.dose ,jdbcType = REAL}, #{pa.doseUnit}, #{pa.drugOcc ,jdbcType = REAL}, " +            "        #{pa.drugVolume,jdbcType=REAL}, #{pa.drugVolUnit}, '0', #{pa.serial}, #{pa.groupNo}, '1', #{pa.execUnit}, " +            "        #{patInfo.deptCode}, #{patInfo.deptCode}, '0', #{pa.ybSelfFlag}, #{pa.emergencyFlag}, " +            "        #{pa.kfFlag}, #{pa.parentNo,jdbcType=REAL}, #{patInfo.referPhysician}, #{pa.endTime}," +            "        #{pa.modifier})")    void insertEntryOrder(XinZhenYiZhu patInfo, XinZhenYzActOrder pa, String userCode);    @Update("update yz_act_order set " +            "frequ_code = #{frequCode}," +            "exec_unit = #{execUnit}," +            "order_time = #{orderTime}," +            "start_time = #{startTime,jdbcType=TIMESTAMP}," +            "end_time = #{endTime,jdbcType=TIMESTAMP}," +            "group_no = #{groupNo}," +            "modifier = #{modifier} " +            "where parent_no = #{actOrderNo,jdbcType=REAL}")    void howOftenTheSubPhysicianOrderIsModified(XinZhenYzActOrder pa);    @Select("SELECT rtrim(a.order_code) + '00' as id," +            "a.py_code, " +            "       a.d_code, " +            "       a.order_code , " +            "       rtrim(a.order_name) order_name, " +            "       drug_specification='诊疗项目', " +            "       drug_flag   = isnull(operation,'o') , " +            "       a.parent_code , " +            "       a.exclu_group_type, " +            "       discription=a.discription + '  ' + a.yb_comment, " +            "       serial       ='00', " +            "       group_no='00', " +            "       infusion_flag='', " +            "       group_name   ='', " +            "       pack_size=1, " +            "       order_class=a.order_class, " +            "       spec_pack='', " +            "       jsy_flag     ='', " +            "       xnh_flag='', " +            "       yb_comment   =null, " +            "       dosage='', " +            "       yb_type='', " +            "       father_flag='0', " +            "       manu_name='', " +            "       stock_amount=0 " +            "FROM yz_order_item a with (NOLOCK) " +            "WHERE isnull(a.del_flag, '') <> '1' " +            "  and (py_code like #{code} or order_name like #{code} or order_code like #{code}) " +            "  and order_code not in (select zy_order_code from jc_zd_item) " +            "  and isnull(exec_dept, '') <> '2010000' ")    List<YiZhuMingChen> yiZhuXiangMu(String code);    @Select("SELECT a.py_code, " +            "       a.d_code, " +            "       a.pattern_code as order_code, " +            "       a.pattern_name as order_name, " +            "       specification='                ', " +            "       order_type ='t', " +            "       parent_code=space(7), " +            "       exclu_group_type=space(1), " +            "       discription='成组医嘱', " +            "       serial ='0000', " +            "       group_no='0000', " +            "       infusion_flag='', " +            "       drug_flag ='', " +            "       group_name ='', " +            "       pack_size =1, " +            "       order_class ='', " +            "       spec_pack='', " +            "       jsy_flag ='', " +            "       exclu_group_type='', " +            "       xnh_flag='', " +            "       yb_comment =null, " +            "       dosage = '', " +            "       yb_type='', " +            "       father_flag='0', " +            "       manu_name='', " +            "       stock_amount=0 " +            "FROM yz_OrderPattern a with (NOLOCK) " +            "where (py_code like #{code} or " +            "pattern_name like #{code} or " +            "d_code like  #{code}) and  dept_code = #{deptCode} ")    List<YiZhuMingChen> composeOrders(String code, String deptCode);    @Select("SELECT                 act_order_no, " +            "                       order_name, " +            "                       order_time, " +            "                       start_time, " +            "                       rtrim(frequ_code)  frequ_code, " +            "    frequ_code_name  = (select rtrim(comm) from yz_order_frequency where frequ_code = code), " +            "                       rtrim(supply_code) supply_code, " +            "    supply_code_name = (select rtrim(supply_name) " +            "                        from yz_supply_type " +            "                        where yz_act_order.supply_code = yz_supply_type.supply_code)," +            "                       group_no, " +            "    group_no_name    = (select rtrim(group_name) " +            "                        from yp_zd_group_name " +            "                        where yp_zd_group_name.group_no = yz_act_order.group_no) " +            "FROM yz_act_order with (NOLOCK) " +            "WHERE inpatient_no = #{patNo} " +            "  AND admiss_times = #{times} " +            "  AND isnull(parent_no, 0) = 0 " +            "  and status_flag = '1' " +            "  and serial <> '00' ")    List<XinZhenYzActOrder> getParentOrders(String patNo, Integer times);    @Select("SELECT cast(rtrim(isnull(nullif(del_flag, " +            "                                ''), " +            "                         0)) as int) as del_flag, " +            "       national_code                 as national_code, " +            "       name                          as order_name " +            "FROM yz_order_occurence a with (NOLOCK), " +            "     zd_charge_item b with (NOLOCK) " +            "where a.occ_code = b.code " +            "  and a.order_code = #{code}")    List<XinZhenYzActOrder> huoQuXiangMu(String code);    @Select("select isnull(exclu_group_type, 0) " +            "from yz_order_item with (NOLOCK) where order_code = #{code}")    Integer shiFouPaiChiYiZhu(String code);    @Select("select " +            "         drug_flag, categories_flag," +            "                       a.serial, " +            "    /* 医保自费 */ " +            "                       cast(isnull(NULLIF(self_flag_yb, " +            "                                          ''), " +            "                                   0) as int)                      as self_flag_yb, " +            "    /* 重量 */ " +            "                       weight, " +            "    /* 重量单位 */ " +            "                       weigh_unit, " +            "    weigh_unit_name  = (select name " +            "                        from yp_zd_unit with (NOLOCK) " +            "                        where code = weigh_unit), " +            "    /*体积*/ " +            "                       volum, " +            "    /*体积单位*/ " +            "                       vol_unit, " +            "    vol_unit_name    = (select name " +            "                        from yp_zd_unit with (NOLOCK) " +            "                        where code = vol_unit), " +            "    /*包装体积*/ " +            "                       pack_size, " +            "    /*包装单位*/ " +            "                       pack_unit, " +            "    pack_unit_name   = (select name " +            "                        from yp_zd_unit with (NOLOCK) " +            "                        where code = pack_unit), " +            "    /*最小单位*/ " +            "                       mini_unit, " +            "    mini_unit_name   = (select name " +            "                        from yp_zd_unit with (NOLOCK) " +            "                        where code = mini_unit), " +            "    /* 需要判断医生的权限 在 select " +            "        doctor_xz_yp " +            "    from " +            "        a_employee_mi */ " +            "                       cast(isnull(NULLIF(yp_level, " +            "                                          ''), " +            "                                   0) as int)                      as yp_level, " +            "    /*需要皮试*/ " +            "                       cast(isnull(NULLIF(ps_flag, " +            "                                          ''), " +            "                                   0) as int)                      as ps_flag, " +            "                       cast(isnull(NULLIF(kss_flag, " +            "                                          ''), " +            "                                   0) as int)                      as kss_flag, " +            "                       cast(isnull(NULLIF(kjyw_flag, " +            "                                          ''), " +            "                                   0) as int)                      as kjyw_flag, " +            "                       code                                        as order_code, " +            "                       name                                        as order_name, " +            "                       frequency                                   as frequCode, " +            "                       (select isnull(rtrim(comm), " +            "                                      '') " +            "                        from yz_order_frequency " +            "                        where yz_order_frequency.code = frequency) as frequCodeName, " +            "                       supply_type                                 as supply_code, " +            "    supply_code_name = (select supply_name " +            "                        from yz_supply_type with (NOLOCK) " +            "                        where yz_supply_type.supply_code = supply_type), " +            "                       national_code, " +            "                       stock_amount," +            "                       cast(isnull(nullif(visible_flag_zy, ''), 0) as int) as visible_flag_zy  " +            "from yp_zd_dict a with (NOLOCK) " +            "         left join yp_base_yf b on (code = b.charge_code and a.serial = b.serial) " +            "where  rtrim(code) + rtrim(a.serial) = #{code}  " +            "  and cast(isnull(NULLIF(del_flag, ''), 0) as int) = 0 " +            "  and group_no = #{groupNo} ")    YaoPinXinXi huoQuYaoPin(@Param("code") String code,                            @Param("groupNo") String groupNo);    @Select("select count(1) " +            "from yp_zd_dept " +            "where charge_code = #{code}  " +            "  and dept_code = #{dept} ")    Integer restrictedUseInTheDepartment(@Param("code") String code,                                         @Param("dept") String dept);    @Select("select cast(isnull(NULLIF(doctor_xz_yp, ''), 0) as int) + 1  from a_employee_mi with (NOLOCK) where code = #{code}")    Integer huoQuYiShenDengJi(String code);    /**     * 出院带药数量     *     * @param patNo 住院号     * @param times 住院次数     * @return     */    @Select("select count(*) " +            "from yz_act_order with (NOLOCK) " +            "where inpatient_no = #{patNo} " +            "  and admiss_times = #{times} " +            "  and self_buy = '4' " +            "  and status_flag <> '6' ")    int obtainTheNumberOfDischargedDrugs(String patNo, Integer times);    @Select("select day_800, day_830, day_900, " +            "       day_930, day_1000, day_1030, day_1100, day_1130, day_1200, day_1230, day_1300, day_1330, " +            "       day_1400, day_1430, day_1500, day_1530, day_1600, day_1630, day_1700, day_1730, " +            "       day_1800, day_1830, day_1900, day_1930, day_2000, day_2030, day_2100, day_2130, " +            "       day_2200, day_2230, day_2300, day_2330, day_2400, day_030, day_100, day_130, day_200, " +            "       day_230, day_300, day_330, day_400, day_430, day_500, day_530, day_600, day_630, " +            "       day_700, day_730 " +            "from yz_order_frequency where code = #{code}")    Map<String, Short> numberOfTimesADay(String code);    /**     * 出院带药只能要这些给药方式     *     * @param code 编码     * @return 返回数量     */    @Select("select count(1) " +            "from (select b.charge_code, a.* " +            "      from yz_supply_type a " +            "               left join yz_supply_charge b on a.supply_code = b.supply_code) aa " +            "where charge_code is null and supply_code = #{code} ")    int dischargeWithMedicationAdministration(String code);    @Update("update yz_act_order set drug_quan = #{item.drugQuan}," +            "drug_occ = #{item.drugOcc} where act_order_no = #{item.actOrderNo} ")    void updateThePickup(@Param("item") XinZhenYzActOrder item);    @Select("select rtrim(supply_code) code,rtrim(supply_name) name " +            "from yz_supply_type with (NOLOCK) " +            "where ps_flag in ('1', '0')")    List<GetDropdownBox> piShiGeiYaoFangShi();    @Select("select rtrim(code) code, rtrim(comm) name " +            "from yz_order_frequency with (NOLOCK) " +            "where (code like #{code} or comm like #{code})")    List<GetDropdownBox> huoQuZhuYuanPinLv(String code);    @Select("select rtrim(code) as code, rtrim(comm) name " +            "from yz_order_frequency")    List<GetDropdownBox> selectFrequency();    @Select("select rtrim(supply_code) code, rtrim(supply_name) name " +            "from yz_supply_type with (NOLOCK) " +            "where (supply_code like #{code} or supply_name like #{code} or py_code like #{code} )")    List<GetDropdownBox> huoQuGeiYaoFangShi(String code);    @Select("select rtrim(supply_code) code, rtrim(supply_name) name " +            "from (select b.charge_code, a.* " +            "      from yz_supply_type a " +            "               left join yz_supply_charge b on a.supply_code = b.supply_code) aa " +            "where charge_code is null " +            "  and (py_code like #{code} or d_code like #{code} or supply_name like #{code} or supply_code like #{code})")    List<GetDropdownBox> getCostFreeDosing(String code);    @Select("SELECT a.code code, " +            "       a.name name " +            "FROM zd_unit_code a with (NOLOCK), " +            "     zd_dept_all b with (NOLOCK) " +            "where isnull(a.del_flag, '0') <> '1' " +            "  and a.code = b.small_dept " +            "  and (a.code like #{code} or a.name like #{code} or py_code like #{code}) " +            "group by code,name")    List<GetDropdownBox> huoQuZhiXinKeShi(String code);    @Select("<script>" +            "select rtrim(code)                       order_code, " +            "       rtrim(a.serial)                   serial, " +            "       rtrim(group_no)                   group_no, " +            "       rtrim(name)                       order_name," +            "       case infusion_flag " +            "           when '1' then 'i' " +            "           else " +            "               (case " +            "                    when rtrim(code) >= '30000' and rtrim(code) < '50000' then 'z' " +            "                    else 'd' end) end as drug_flag, " +            "       mini_unit, " +            "       isnull(weight,1)                  drug_weight, " +            "       weigh_unit                        drug_weight_unit, " +            "       isnull(volum,1)                   drug_volume, " +            "       vol_unit                          drug_vol_unit," +            "       isnull(pack_size,1) pack_size,  " +            "       pack_unit," +            "       a.pack_retprice,  " +            "       national_code," +            "       cast(isnull(NULLIF(kjyw_flag, ''), 0) as int) as kjyw_flag," +            "       cast(isnull(NULLIF(yp_level, ''), 0) as int)  as yp_level," +            "       cast(isnull(NULLIF(del_flag, ''), 0) as int)  as del_flag,  " +            "       CASE " +            "                           WHEN isnull(b.open_virtual2, '') = '1' then isnull(b.stock_amount_virtual2, 0) " +            "                           else isnull(stock_amount,0) end as stock_amount," +            "       cast(isnull(nullif(visible_flag_zy, ''), 0) as int) as visible_flag_zy," +            "       deptRestrictions = (select count(1) from yp_zd_dept where code = yp_zd_dept.charge_code and dept_code = '${dept}')  " +            " from yp_zd_dict a with (NOLOCK)  " +            " left join yp_base_yf b on (code = b.charge_code and  a.serial = b.serial) " +            "where rtrim(code) + rtrim(a.serial) + rtrim(group_no) in " +            "<foreach collection='code' item='item' index='index' open='(' close=')' separator=','>" +            "#{item}" +            "</foreach>" +            "</script>")    List<XinZhenYzActOrder> huoQuYaoPinXinXi(@Param("code") Set<String> code,                                             @Param("dept") String dept);    @Select("select rtrim(code)                       order_code, " +            "       rtrim(a.serial)                     serial, " +            "       rtrim(name)                       order_name," +            "       case infusion_flag " +            "           when '1' then 'i' " +            "           else " +            "               (case " +            "                    when rtrim(code) >= '30000' and rtrim(code) < '50000' then 'z' " +            "                    else 'd' end) end as drug_flag, " +            "       mini_unit, " +            "       isnull(weight,1)                  drug_weight, " +            "       weigh_unit                        drug_weight_unit, " +            "       isnull(volum,1)                   drug_volume, " +            "       vol_unit                          drug_vol_unit," +            "       isnull(pack_size,1) pack_size,  " +            "       pack_unit," +            "       a.pack_retprice,  " +            "       national_code," +            "       cast(isnull(NULLIF(kjyw_flag, ''), 0) as int) as kjyw_flag," +            "       cast(isnull(NULLIF(yp_level, ''), 0) as int)  as yp_level," +            "       cast(isnull(NULLIF(del_flag, ''), 0) as int)  as del_flag,  " +            "       stock_amount," +            "       cast(isnull(nullif(visible_flag_zy, ''), 0) as int) as visible_flag_zy " +            " from yp_zd_dict a with (NOLOCK)  " +            " left join  yp_base_yf b on ( code = b.charge_code and  a.serial = b.serial) " +            "where rtrim(code) + rtrim(a.serial) = '${code}' " +            " and group_no = #{groupNo} ")    XinZhenYzActOrder getDrugOne(String code, String groupNo);    @Select("<script>" +            "select          b.order_code, " +            "                rtrim(c.name)                 order_name, " +            "                national_code, " +            "                kjyw_flag = 0, " +            "                cast(rtrim(isnull(nullif(c.del_flag, " +            "                                         ''), " +            "                                  0)) as int) del_flag " +            " from " +            "     yz_order_occurence b with (NOLOCK) , " +            "     zd_charge_item c with (NOLOCK) " +            "where b.order_code in " +            "<foreach collection='code' item='item' index='index' open='(' close=')' separator=','>" +            "#{item}" +            "</foreach>" +            "  and b.occ_code = c.code" +            "</script>")    List<XinZhenYzActOrder> huoQuXiangMuXinXi(Set<String> code);    @Select("select          rtrim(inpatient_no) as inpatient_no, " +            "                admiss_times, " +            "                rtrim(name)         as name, " +            "                rtrim(dept)         as dept_code, " +            "                rtrim(zk_ward)      as ward_code, " +            "                refer_physician, " +            "                times_billed, " +            "                admiss_date, " +            "                small_dept, " +            "                bed_no," +            "                zk_ward, " +            "    ledger_sn = (select max(ledger_sn) " +            "                 from zy_ledger_file with (NOLOCK) " +            "                 where zy_actpatient.inpatient_no = zy_ledger_file.inpatient_no " +            "                   and zy_actpatient.admiss_times = zy_ledger_file.admiss_times) " +            " from zy_actpatient with (NOLOCK) " +            "where inpatient_no = #{patNo} " +            "  and admiss_times = #{times} ")    XinZhenYiZhu queryPatientInfo(@Param("patNo") String patNo,                                  @Param("times") Integer times);    @Insert("<script>" +            "INSERT INTO yz_act_order (order_code, order_name, frequ_code, instruction, discription, infant_flag, order_time, " +            "    /*录入人*/physician, start_time, drug_specification, drug_quan, supply_code, act_order_no, inpatient_no, " +            "                          admiss_times, drug_flag/*药品中找这个是 药品的类型 a i d*/, enter_oper, /*录入时间*/ enter_time, " +            "                          mini_unit /*药品中找 最小包装规格*/, " +            "                          drug_weight/*药品的重量*/, drug_weight_unit/*药品重量单位*/, " +            "                          status_flag/*2*/, self_buy, dose, dose_unit, /*这个是算出来的 输入的 dose 除以选中的单位 */drug_occ, drug_volume/*药品中的 volum 找*/, " +            "                          drug_vol_unit/* 药品中的 vol_unit */, pay_self/*0*/, " +            "                          serial/*前端传*/, group_no/*药房 */, doctor_flag/*写死为 1*/, exec_unit, dept_code/* 在院病人表中的 dept */, " +            "                          ward_code /* 在院病人表中的 zk_ward*/, " +            "                          reg_flag/* 0 */, " +            "                          yb_self_flag/*医保自费标志*/,emergency_flag, " +            "                          kf_flag /*饭前饭后*/,parent_no, refer_physician/*患者的管床医生*/, confirm_time/*确认时间*/, signer/*确认人*/,end_time,modifier) " +            "VALUES " +            "<foreach collection='list' item='item' separator=','>" +            "(#{item.orderCode,jdbcType=VARCHAR}, #{item.orderName,jdbcType=VARCHAR}, #{item.frequCode,jdbcType=VARCHAR}," +            " #{item.instruction,jdbcType=VARCHAR}, #{item.discription,jdbcType=VARCHAR}, #{infantFlag,jdbcType=VARCHAR}, " +            "#{item.orderTime,jdbcType=VARCHAR}, " +            "        #{inputCode,jdbcType=TIMESTAMP}, #{item.startTime,jdbcType=TIMESTAMP}, #{item.drugSpecification}, " +            "#{item.drugQuan,jdbcType=DECIMAL}," +            " #{item.supplyCode}," +            " #{item.actOrderNo,jdbcType=DECIMAL}, #{patNo}, #{times}, " +            "#{item.drugFlag}," +            " #{inputCode}, " +            " getdate(), #{item.miniUnit}, " +            "#{item.drugWeight,jdbcType=DECIMAL}, " +            "#{item.drugWeightUnit}, '2', #{item.selfBuy}, " +            "cast(#{item.dose,jdbcType=DECIMAL} as decimal(10,2))," +            " #{item.doseUnit}, " +            "cast(#{item.drugOcc,jdbcType=DECIMAL} as decimal(10,2))," +            "cast(#{item.drugVolume,jdbcType=DECIMAL} as decimal(10,2))," +            " #{item.drugVolUnit}, 0, #{item.serial}, " +            "#{item.groupNo}," +            "'1', #{item.execUnit}, " +            "#{deptCode}, #{wardCode}, '0', #{item.ybSelfFlag},#{item.emergencyFlag}, #{item.kfFlag}," +            "#{item.parentNo,jdbcType=DECIMAL}," +            " #{referPhysician}, getdate(), #{inputCode},#{item.endTime,jdbcType=TIMESTAMP},#{item.modifier})" +            "</foreach>" +            "</script>")    void chaRuYiZhu(@Param("patNo") String patNo,                    @Param("times") Integer times,                    @Param("inputCode") String inputCode,                    @Param("infantFlag") Integer infantFlag,                    @Param("deptCode") String deptCode,                    @Param("wardCode") String wardCode,                    @Param("referPhysician") String referPhysician,                    @Param("list") List<XinZhenYzActOrder> list);    @Select("<script>" +            "select top 20 * from (" +            "SELECT row_number() over (order by pattern_code ) row_number," +            "       rtrim(pattern_code) pattern_code, " +            "       rtrim(pattern_name) pattern_name," +            "       rtrim(input_id) input_id," +            "       input_date," +            "       rtrim(input_type) input_type, " +            "       sort_no," +            "       yiBeiShouCang = (select count(1) from yz_OrderPattern b with (NOLOCK) where b.collect_code = a.pattern_code " +            "                           and b.input_id = #{inputId})," +            "       collect_code " +            "FROM yz_OrderPattern a with (NOLOCK) " +            "where 1=1 " +            "<if test=\"code != null and code != '' \">" +            "and (py_code like #{code} " +            "    or pattern_code like #{code} " +            "    or pattern_name like #{code}) " +            "</if>" +            "<if test=\"muBanLeiXing == 2 \">" +            " and dept_code = #{deptCode} AND input_type = '2' " +            "</if>" +            "<if test=\"muBanLeiXing == 3 \">" +            "  and input_id = #{inputId} AND input_type = '3' " +            "</if>" +            "<if test=\"muBanLeiXing == 1\">" +            " and input_type = '1' " +            "</if>" +            "<if test=\"muBanLeiXing == 4\">" +            " and input_id = #{inputId} AND input_type = '4' " +            "</if>" +            "<if test=\"muBanLeiXing == 0\">" +            " AND input_type <> '4' " +            "</if>" +            ") temp where row_number > (${currentPage} - 1) * 20 " +            "<if test=\"muBanLeiXing == 3 \">" +            " order by sort_no desc " +            "</if>" +            "</script>")    List<YzOrderPattern> huoQuMuBan(@Param("code") String code,                                    @Param("inputId") String inputId,                                    @Param("deptCode") String deptCode,                                    @Param("muBanLeiXing") Integer muBanLeiXing,                                    @Param("currentPage") long currentPage);    @Select("select max(sort_no + 1) " +            "from yz_OrderPattern " +            "where input_id = #{code}")    Integer getMyTemplateMaxSortNo(String code);    @Select("<script>" +            "SELECT count(*) " +            "FROM yz_OrderPattern with (NOLOCK) " +            "where 1=1 " +            "<if test=\"code != null and code != '' \">" +            "and (py_code like #{code} " +            "    or pattern_code like #{code} " +            "    or pattern_name like #{code}) " +            "</if>" +            "<if test=\"muBanLeiXing == 2 \">" +            " and dept_code = #{deptCode} AND input_type = '2' " +            "</if>" +            "<if test=\"muBanLeiXing == 3 \">" +            "  and input_id = #{inputId} AND input_type = '3' " +            "</if>" +            "<if test=\"muBanLeiXing == 1\">" +            " and input_type = '1' " +            "</if>" +            "<if test=\"muBanLeiXing == 4\">" +            " and input_id = #{inputId} AND input_type = '4' " +            "</if>" +            "<if test=\"muBanLeiXing == 0\">" +            " AND input_type <> '4' " +            "</if>" +            "</script>")    long huoQuMuBanTotal(@Param("code") String code,                         @Param("inputId") String inputId,                         @Param("deptCode") String deptCode,                         @Param("muBanLeiXing") Integer muBanLeiXing);    @Select("SELECT                 cast(cast(act_order_no as decimal) as varchar) id, " +            "                       act_order_no,  " +            "                       rtrim(a.order_name) order_name, " +            "                       rtrim(a.order_code) order_code, " +            "                       a.frequ_code, " +            "    frequ_code_name  = (select rtrim(comm) " +            "                        from yz_order_frequency with (NOLOCK) " +            "                        where yz_order_frequency.code = a.frequ_code), " +            "                       a.drug_specification, " +            "                       a.supply_code, " +            "    supply_code_name = (select rtrim(supply_name) " +            "                        from yz_supply_type with (NOLOCK) " +            "                        where yz_supply_type.supply_code = a.supply_code), " +            "                       a.drug_quan, " +            "                       a.instruction, " +            "                       a.mini_unit, " +            "    mini_unit_name   = (select rtrim(name) from yp_zd_unit with (NOLOCK) where code = mini_unit), " +            "                       a.drug_weight, " +            "                       a.drug_weight_unit, " +            "                       a.parent_no, " +            "                       a.drug_volume, " +            "                       a.drug_vol_unit, " +            "                       a.dose, " +            "                       a.dose_unit, " +            "    dose_unit_name   = (select rtrim(name) from yp_zd_unit with (NOLOCK) where code = dose_unit), " +            "                       a.exclu_act_order_no, " +            "                       a.discription, " +            "                       a.pattern_code, " +            "                       a.order_type, " +            "                       a.serial, " +            "    self_buy=isnull(a.self_buy, '0'), " +            "    del_flag=isnull(b.del_flag, ''), " +            "                       a.drug_flag, " +            "    suprice_flag='', " +            "    self_flag        ='', " +            "    parent_flag='', " +            "                       a.exec_unit, " +            "    exec_unit_name   = (select rtrim(name) from zd_unit_code with (NOLOCK) where code = exec_unit)," +            "    group_no         = '00', " +            "    group_no_name    = N'项目' " +            "FROM yz_pattern_order a with (NOLOCK), " +            "     yz_order_item b with (NOLOCK) " +            "WHERE a.pattern_code = #{code} " +            "  and isnull(a.group_no, '00') = '00' " +            "  and a.order_code = b.order_code " +            "UNION " +            "SELECT                 cast(cast(act_order_no as decimal) as varchar) id," +            "                       act_order_no,  " +            "                       a.order_name, " +            "                       a.order_code, " +            "                       a.frequ_code, " +            "    frequ_code_name  = (select rtrim(comm) " +            "                        from yz_order_frequency with (NOLOCK) " +            "                        where yz_order_frequency.code = a.frequ_code), " +            "                       a.drug_specification, " +            "                       a.supply_code, " +            "    supply_code_name = (select rtrim(supply_name) " +            "                        from yz_supply_type with (NOLOCK) " +            "                        where yz_supply_type.supply_code = a.supply_code), " +            "                       a.drug_quan, " +            "                       a.instruction, " +            "                       a.mini_unit, " +            "    mini_unit_name   = (select rtrim(name) from yp_zd_unit with (NOLOCK) where code = mini_unit), " +            "                       a.drug_weight, " +            "                       a.drug_weight_unit, " +            "                       a.parent_no, " +            "                       a.drug_volume, " +            "                       a.drug_vol_unit, " +            "                       a.dose, " +            "                       a.dose_unit, " +            "    dose_unit_name   = (select rtrim(name) from yp_zd_unit with (NOLOCK) where code = dose_unit), " +            "                       a.exclu_act_order_no, " +            "                       a.discription, " +            "                       a.pattern_code, " +            "                       a.order_type, " +            "                       a.serial, " +            "    self_buy=isnull(a.self_buy, case when b.jsy_flag = '1' then '3' else '0' end), " +            "    del_flag=isnull(b.visible_flag_zy, ''), " +            "                       a.drug_flag, " +            "    suprice_flag=b.suprice_flag, " +            "    self_flag        =b.self_flag, " +            "    parent_flag='', " +            "                       a.exec_unit, " +            "    exec_unit_name   = (select rtrim(name) from zd_unit_code with (NOLOCK) where code = exec_unit)," +            "                       a.group_no, " +            "                       (select yp_zd_group_name.group_name " +            "                        from yp_zd_group_name " +            "                        where yp_zd_group_name.group_no = a.group_no) " +            "FROM yz_pattern_order a with (NOLOCK), " +            "     view_yp_zd_dict_base_yf b with (NOLOCK) " +            "WHERE a.pattern_code = #{code} " +            "  and a.group_no = b.group_no " +            "  and a.order_code = b.code " +            "  and a.serial = b.serial " +            "  and isnull(b.visible_flag_zy, '') <> '1'")    List<YzActOrder> huoQuMuBanShuJu(String code);    @Select("select pattern_code," +            "       rtrim(input_type) as input_type," +            "       input_id  " +            "from yz_OrderPattern with (NOLOCK) " +            "where pattern_name = #{patternName} " +            "  and input_id = #{inputId}" +            "  and input_type <> 4 ")    YzOrderPattern yuanLaiDeMuBanBianMa(@Param("patternName") String patternName,                                        @Param("inputId") String inputId);    @Select("select top 1 * " +            "from yz_OrderPattern with (NOLOCK) " +            "where pattern_code = #{patternCode} " +            "  and input_id = #{inputId}" +            "  and input_type <> 4 ")    YzOrderPattern getDataAccordingToTemplateCode(@Param("patternCode") String patternCode,                                                  @Param("inputId") String input);    @Select("select pattern_code," +            "       rtrim(input_type) input_type," +            "       input_id  " +            "from yz_OrderPattern with (NOLOCK) " +            "where pattern_name = #{patternName} " +            "and input_type not in ('3','4') ")    YzOrderPattern gongGongMuBan(@Param("patternName") String patternName);    @Delete("<script>" +            "delete yz_OrderPattern " +            "where pattern_code = #{patternCode}; " +            "delete yz_pattern_order " +            "where pattern_code = #{patternCode} " +            "</script>")    void shanChuLaoMuBan(@Param("patternCode") String patternCode);    @Insert("insert yz_OrderPattern (pattern_code, pattern_name, py_code, d_code, dept_code, " +            "                        ward_code, input_id, " +            "                        input_type, input_date, sort_no) " +            "values (#{patternCode},#{patternName},#{pyCode},#{dCode},#{deptCode},#{deptCode}," +            "#{inputId},#{inputType}," +            "getdate(),#{sortNo})")    void chaRuMuBan(YzOrderPattern param);    @Select("select count(1) " +            "from yz_OrderPattern " +            "where pattern_name = #{name} and input_id = #{userCode} ")    Integer duplicateTemplateName(@Param("name") String name,                                  @Param("userCode") String userCode);    @Insert("<script>" +            "INSERT INTO yz_pattern_order (act_order_no, order_code, frequ_code, drug_flag, supply_code, drug_quan, instruction, " +            "                              drug_specification, mini_unit, drug_weight, drug_weight_unit, parent_no, drug_volume, " +            "                              drug_vol_unit, dose, dose_unit, drug_occ,  order_name, discription, " +            "                              pattern_code, serial, self_buy, exec_unit,group_no) " +            "VALUES " +            "<foreach collection='list' item='item' separator=','>" +            "(#{item.actOrderNo}, #{item.orderCode}, #{item.frequCode}," +            "<if test=\"item.drugFlag !=null and item.drugFlag != '' \">" +            "#{item.drugFlag}," +            "</if>" +            "<if test=\"item.drugFlag == null or item.drugFlag == '' \">" +            "'o'," +            "</if>" +            " #{item.supplyCode}," +            "<if test=\"item.drugQuan != null \">" +            "#{item.drugQuan}," +            "</if>" +            "<if test=\"item.drugQuan == null \">" +            "null," +            "</if>" +            "#{item.instruction}, #{item.drugSpecification}, #{item.miniUnit}, " +            "<if test=\"item.drugWeight != null\">" +            "#{item.drugWeight}, " +            "</if>" +            "<if test=\"item.drugWeight == null\">" +            "null, " +            "</if>" +            "#{item.drugWeightUnit}, " +            "<if test=\"item.parentNo != null \">" +            "#{item.parentNo}," +            "</if>" +            "<if test=\"item.parentNo == null \">" +            "null," +            "</if>" +            "<if test=\"item.drugVolume != null\">" +            "cast(#{item.drugVolume,jdbcType=DECIMAL} as decimal(10,2))," +            "</if>" +            "<if test=\"item.drugVolume == null\">" +            "null," +            "</if>" +            " #{item.drugVolUnit}, " +            "<if test=\"item.dose != null\">" +            "cast(#{item.dose,jdbcType=DECIMAL} as decimal(10,2))," +            "</if>" +            "<if test=\"item.dose == null\">" +            "null," +            "</if>" +            "#{item.doseUnit}," +            "<if test=\"item.drugOcc != null \">" +            "cast(#{item.drugOcc,jdbcType=DECIMAL} as decimal(10,2))," +            "</if>" +            "<if test=\"item.drugOcc == null \">" +            "null," +            "</if>" +            " #{item.orderName},#{item.discription},#{patternCode},#{item.serial},#{item.selfBuy},#{item.execUnit},#{item.groupNo})" +            "</foreach>" +            "</script>")    void chaRuMuBanShuJu(List<XinZhenYzActOrder> list, String patternCode);    @Select("select * " +            "from yz_OrderPattern with (NOLOCK) " +            "where pattern_code = #{code}")    YzOrderPattern huoQuMuBanXinXi(@Param("code") String code);    @Update("update yz_OrderPattern " +            "set pattern_name = #{patternName}, " +            "    py_code      = #{pyCode}, " +            "    d_code       = #{dCode}, " +            "    input_date   = getdate()," +            "    sort_no = #{sortNo} " +            "where pattern_code = #{patternCode} ")    void genXingMuBan(@Param("patternName") String patternName,                      @Param("pyCode") String pyCode,                      @Param("dCode") String dCode,                      @Param("patternCode") String patternCode,                      @Param("sortNo") Integer sortNo);    @Select("select rtrim(dept_code) from a_employee_mi where code = '${code}'")    String userDeptCode(@Param("code") String code);    @Delete("/* 父模板 */  " +            "delete yz_OrderPattern " +            "where pattern_code = #{patternCode}; " +            "/* 模板下面的数据 */  " +            "delete yz_pattern_order " +            "where pattern_code = #{patternCode} ")    void shanChuMuBan(@Param("patternCode") String patternCode);    @Select("select pattern_code " +            "from yz_OrderPattern " +            "where collect_code = #{patternCode} and input_id = #{userId}")    String whetherToSaveTheDoctorSOrderTemplate(@Param("patternCode") String patternCode,                                                @Param("userId") String userId);    @Select("select collect_code " +            "from yz_OrderPattern with (NOLOCK) " +            "where input_id = #{inputId} " +            "  and collect_code = #{collectCode} ")    String chongFuShouCang(@Param("inputId") String inputId,                           @Param("collectCode") String collectCode);    @Insert("insert into yz_OrderPattern (pattern_code, pattern_name, py_code, d_code, dept_code, ward_code, " +            "                             input_id, input_type, input_date, sort_no, collect_code) " +            "values (#{patternCode},#{patternName},#{pyCode},#{dCode},#{deptCode},#{deptCode},#{inputId},'4',getdate(),0,#{collectCode});")    void chaRuShouCang(@Param("patternCode") String patternCode,                       @Param("patternName") String patternName,                       @Param("pyCode") String pyCode,                       @Param("dCode") String dCode,                       @Param("deptCode") String deptCode,                       @Param("inputId") String inputId,                       @Param("collectCode") String collectCode);    @Select("select * " +            "from yz_act_order with (NOLOCK) " +            "where act_order_no = #{actOrderNo} ")    YzActOrder chaXunYiZhuXinXin(BigDecimal actOrderNo);    @Update("update yz_act_order set emergency_flag = #{emergencyFlag} " +            "where act_order_no = #{actOrderNo} ")    void sheZhiJinJi(@Param("actOrderNo") BigDecimal actOrderNo,                     @Param("emergencyFlag") String emergencyFlag);    @Insert("insert into yz_erase_order_comm (act_order_no, inpatient_no, admiss_times, comment, order_code, sys_date) " +            "values (#{actOrderNo}, #{patNo}, #{times}, #{content}, #{orderCode}, getdate())")    void chaRuCheXiaoYuanYin(@Param("actOrderNo") BigDecimal actOrderNo,                             @Param("patNo") String patNo,                             @Param("times") Integer times,                             @Param("content") String content,                             @Param("orderCode") String orderCode);    @Delete("/*删除费用*/ " +            "delete yz_zy_patient_fee " +            "where act_order_no = #{actOrderNo}  " +            "  and charge_status = '3';" +            "/*删除药品的药单*/  " +            "delete yz_yp_zy_order " +            "where act_order_no = #{actOrderNo} " +            "  and status_flag = '1';" +            "/*删除医嘱表*/" +            "DELETE " +            "FROM yz_act_order " +            "WHERE act_order_no = #{actOrderNo};" +            "/*删除医技*/  " +            "delete ysh_yj_req " +            "where act_order_no = #{actOrderNo};")    void cheXiaoYiZhu(@Param("actOrderNo") BigDecimal actOrderNo);    @Insert("insert into yz_erase_order " +            "select * " +            "from yz_act_order " +            "where act_order_no = #{actOrderNo}")    void chaRuShanChuBiao(@Param("actOrderNo") BigDecimal actOrderNo);    @Update("update yz_erase_order " +            "set modifier           =#{userCode}, " +            "    status_time        =getdate(), " +            "    print_order_change =case when isnull(print_order_change, '') = '' then 'd' else '' end " +            "where act_order_no = #{actOrderNo};" +            "update op_record " +            "set status ='d' " +            "where act_order_no = #{actOrderNo};")    void genXingShanChuBiaoZhi(@Param("userCode") String userCode,                               @Param("actOrderNo") BigDecimal actOrderNo);    @Update("update yz_act_order " +            "set modifier = #{userCode}, " +            "    end_time = #{endTime} " +            "where act_order_no = #{actOrderNo} ")    void sheZhiTingZhiShiJian(@Param("userCode") String userCode,                              @Param("actOrderNo") BigDecimal actOrderNo,                              @Param("endTime") String endTime);    @Select("<script>" +            "select * from yz_act_order with (NOLOCK) where act_order_no in " +            "<foreach collection='list' item='item' index='index' open='(' close=')' separator=','>" +            " #{item} " +            "</foreach>" +            "</script>")    List<YzActOrder> yiZhuXinXiJiHe(@Param("list") List<BigDecimal> list);    @Update("<script>" +            "<foreach collection='list' item='item' separator=';'>" +            "update yz_act_order " +            "set modifier = #{userCode}, " +            "    end_time = #{endTime} " +            " where act_order_no = #{item} " +            "</foreach>" +            "</script>")    void piLiangSheZhiTingZhiShiJian(@Param("list") List<BigDecimal> actOrderNo,                                     @Param("userCode") String userCode,                                     @Param("endTime") String endTime);    @Delete("delete yz_act_record_kss where act_order_no = #{orderNo}")    void deleteAntimicrobialInformation(String orderNo);    @Insert("insert into yz_act_record_kss " +            "(act_order_no, charge_code, input_id, inpatient_no, " +            "admiss_times, yyfs, ssqk, yysj)" +            "values " +            "(#{orderNo},#{kss.chargeCode},#{userCode},#{patNo}," +            "#{times},#{kss.yyfs},#{kss.ssqk},#{kss.yysj})")    void insertAntimicrobialInformation(String orderNo,                                        YzActRecordKss kss,                                        String userCode,                                        String patNo,                                        Integer times);    @Delete("delete zy_order_zk where act_order_no = #{orderNo}")    void deleteTransferOrder(String orderNo);    @Insert("insert into zy_order_zk (act_order_no, old_ward, " +            "old_dept, new_ward, new_dept) " +            "values (#{actOrderNo},#{oldWard},#{oldDept},#{newWard},#{newDept})")    void insertDoctorSOrder(ZyOrderZk zk);    @Select("execute dbo.xc_zy_order_fee;1 @in_no = #{patNo}, @in_times = #{times}")    List<DoctorSOrderFee> expensesForGettingADoctorSOrder(@Param("patNo") String patNo,                                                          @Param("times") Integer times);    @Select("select admiss_date " +            "from zy_actpatient " +            "where inpatient_no = #{patNo}")    Date patientAdmissionTime(String patNo);    @Select("<script>" +            "select act_order_no, " +            "       inpatient_no, " +            "       admiss_times, " +            "       order_code, " +            "       order_time, " +            "       frequ_code, " +            "       enter_time, " +            "       enter_oper, " +            "       start_time, " +            "       end_time, " +            "       infant_flag, " +            "       drug_flag, " +            "       supply_code, " +            "       performance_time, " +            "       physician, " +            "       confirm_time, " +            "       signer, " +            "       modifier, " +            "       status_flag, " +            "       status_time, " +            "       drug_quan, " +            "       instruction, " +            "       drug_specification, " +            "       mini_unit, " +            "       drug_weight, " +            "       drug_weight_unit, " +            "       print_order_change, " +            "       parent_no, " +            "       self_buy, " +            "       eat_card_flag, " +            "       drug_volume, " +            "       drug_vol_unit, " +            "       dose, " +            "       dose_unit, " +            "       drug_occ, " +            "       print_order, " +            "       print_order_once, " +            "       print_order_anew, " +            "       print_infusion, " +            "       exclu_back_time, " +            "       exclu_act_order_no, " +            "       order_name, " +            "       discription, " +            "       del_flag, " +            "       pay_self, " +            "       serial, " +            "       group_no, " +            "       ward_code, " +            "       yb_self_flag, " +            "       doctor_flag, " +            "       dept_code, " +            "       exec_unit, " +            "       cl_code, " +            "       zy_serial_no, " +            "       executer1, " +            "       executer2, " +            "       reg_flag, " +            "       msg_flag, " +            "       exec_time, " +            "       exec_id, " +            "       ps_status, " +            "       ps_oper, " +            "       ps_time, " +            "       exec_id2, " +            "       act_order_no2, " +            "       print_page, " +            "       print_page_once, " +            "       print_order_change_end, " +            "       emergency_flag, " +            "       req_receive_flag, " +            "       inspect_stuff, " +            "       charge_status, " +            "       ps_result_time, " +            "       kf_flag, " +            "       modifier_oper, " +            "       pass_flag, " +            "       pass_id, " +            "       pass_date, " +            "       pass_comment, " +            "       refer_physician, " +            "       consult_physician " +            "from yz_act_order " +            "where act_order_no in " +            "<foreach collection='list' item='item' index='index' open='(' close=')' separator=','>" +            "#{item} " +            "</foreach>" +            "</script>")    List<YzActOrder> getOriginalOrderData(List<String> list);    @Insert("<script>" +            "insert into yz_act_order (act_order_no, inpatient_no, admiss_times, order_code, order_time, frequ_code, enter_time, " +            "                          enter_oper, start_time, end_time, infant_flag, drug_flag, supply_code, performance_time, " +            "                          physician, confirm_time, signer, modifier, status_flag, status_time, drug_quan, instruction, " +            "                          drug_specification, mini_unit, drug_weight, drug_weight_unit, parent_no, " +            "                          self_buy, eat_card_flag, drug_volume, drug_vol_unit, dose, dose_unit, drug_occ, " +            "                          order_name, discription, del_flag, pay_self, serial, group_no, ward_code, yb_self_flag, " +            "                          doctor_flag, dept_code, exec_unit, zy_serial_no, kf_flag, refer_physician, consult_physician) " +            "values " +            "<foreach collection='list' item='item' separator=','>" +            "(#{item.actOrderNo, jdbcType = REAL}, #{item.inpatientNo}, #{item.admissTimes}, '06054', getdate(), 'ONCE', " +            "        getdate(), #{userCode}, GETDATE(), GETDATE(),#{item.infantFlag}, 'o', #{item.supplyCode}, getdate(), " +            "        #{item.physician}, getdate(), #{userCode}, " +            "        #{userCode}, 2, getdate(), " +            "        #{item.drugQuan ,jdbcType = REAL}, #{item.instruction}, #{item.drugSpecification}, #{item.miniUnit}, #{item.drugWeight ,jdbcType = REAL}, " +            "        #{item.drugWeightUnit}, #{item.parentNo ,jdbcType = REAL} , #{item.selfBuy}, #{item.eatCardFlag}, #{item.drugVolume ,jdbcType = REAL},#{item.drugVolUnit},#{item.dose ,jdbcType = REAL},#{item.doseUnit}, " +            "        #{item.drugOcc ,jdbcType = REAL},'退药: ${item.orderName}',#{item.discription},#{item.delFlag},#{item.paySelf},#{item.serial},#{item.groupNo},#{item.wardCode},#{item.ybSelfFlag}, " +            "        #{item.doctorFlag},#{item.deptCode},#{item.execUnit},#{item.zySerialNo},#{item.kfFlag},#{item.referPhysician},#{item.consultPhysician})" +            "</foreach>" +            "</script>")    void insertAReturnOrder(@Param("userCode") String userCode,                            @Param("list") List<YzActOrder> list);    @Update("UPDATE zy_actpatient " +            "SET refer_physician   = #{param.referPhysician}, " +            "    consult_physician = #{param.consultPhysician}, " +            "    dept_director     = #{param.deptDirector} " +            "WHERE inpatient_no = #{param.inpatientNo} " +            "  AND admiss_times = #{param.admissTimes} ")    void updateTheThirdLevelDoctor(@Param("param") Overview param);    /**     * 插入药品汇总单     *     * @param pageNo   药单好     * @param patInfo  患者信息     * @param userCode 插入数据     * @param groupNo  药房     */    @Insert("insert into yz_yp_page_no (page_no, dept_code, ward_code, submit_time, " +            "                           submit_name, submit_flag, " +            "                           page_class, page_name, " +            "                           start_date, end_date, group_no) " +            "values (#{pageNo}, #{patInfo.wardCode}, #{patInfo.deptCode}, getdate()," +            " #{userCode}, 1, 1, '出院带药', getdate(), getdate(), #{groupNo})")    void summarySheetOfDrugs(Integer pageNo, XinZhenYiZhu patInfo, String userCode, String groupNo);    @Insert("<script>" +            "insert into yz_yp_zy_order (inpatient_no, admiss_times, name, bed_no, dept_code, ward_code, charge_code, " +            "  amount, retprice/*药品的单价*/, charge_date, infant_flag, drawer, always_flag, status_flag/*1*/, drug_class, " +            " serail/*0*/, " +            " occ_time, act_order_no, page_no, pay_self/*0*/, serial/*serial*/, " +            " group_no, doctor_name, page_class) " +            "values " +            "<foreach collection='list' item='item' separator=','>" +            "(#{patInfo.inpatientNo},#{patInfo.admissTimes},#{patInfo.name},#{patInfo.bedNo},#{patInfo.wardCode},#{patInfo.deptCode},#{item.orderCode}," +            "#{item.drugQuan},(select pack_retprice from yp_zd_dict where code = '${item.orderCode}' and serial = '${item.serial}'),getdate()," +            "#{patInfo.infantFlag},#{userCode}," +            "'a','1',#{item.drugFlag},'0',getdate(),#{item.actOrderNo},#{pageNo},'0',#{item.serial},#{groupNo},#{userCode},'1')" +            "</foreach>" +            "</script>")    void insertDetailedMedicineList(Integer pageNo, XinZhenYiZhu patInfo, String userCode, String groupNo, List<XinZhenYzActOrder> list);    @Update("update yz_act_order " +            "    set " +            "    parent_no =    ${order.actOrderNo}," +            "    order_time  = #{order.orderTime,jdbcType=TIMESTAMP}, " +            "    start_time  = #{order.startTime,jdbcType=TIMESTAMP}, " +            "    end_time    = #{order.endTime,jdbcType=TIMESTAMP}, " +            "    supply_code = '044', " +            "    frequ_code  = #{order.frequCode}," +            "    group_no  = #{order.groupNo} " +            "where act_order_no = ${children} " +            " and group_no <> '00' and status_flag = '1' ")    void associateOrders(BigDecimal children, XinZhenYzActOrder order);}
 |