|
|
@@ -86,7 +86,9 @@ public interface YfSpiritAnestheticPrintMapper {
|
|
|
" charge_item_code=charge_code," +
|
|
|
" a.manu_no," +
|
|
|
" p.exec_unit" +
|
|
|
- " from yp_zy_patient a WITH(NOLOCK),yp_zd_dict b WITH(NOLOCK),a_patient_mi c WITH(NOLOCK),zy_patient e WITH(NOLOCK),view_yz_all_order p WITH(NOLOCK)" +
|
|
|
+ " from yp_zy_patient a WITH(NOLOCK)" +
|
|
|
+ " left join view_yz_all_order p WITH(NOLOCK) on a.act_order_no = p.act_order_no," +
|
|
|
+ " yp_zd_dict b WITH(NOLOCK),a_patient_mi c WITH(NOLOCK),zy_patient e WITH(NOLOCK) " +
|
|
|
" where a.charge_code=b.code and" +
|
|
|
" a.serial=b.serial and" +
|
|
|
" b.drug_flag in " +
|
|
|
@@ -95,7 +97,7 @@ public interface YfSpiritAnestheticPrintMapper {
|
|
|
" </foreach> and" +
|
|
|
" a.inpatient_no=c.inpatient_no and" +
|
|
|
" a.inpatient_no=e.inpatient_no and" +
|
|
|
- " a.admiss_times*=e.admiss_times and" +
|
|
|
+ " a.admiss_times =e.admiss_times and" +
|
|
|
" <when test='chargeItemCode!=null'>"+
|
|
|
" a.charge_code=#{chargeItemCode} and" +
|
|
|
" </when>"+
|
|
|
@@ -103,8 +105,7 @@ public interface YfSpiritAnestheticPrintMapper {
|
|
|
" a.dept_code=#{unitCode} and" +
|
|
|
" </when>"+
|
|
|
" a.confirm_time <![CDATA[>=]]>#{beginDate} and" +
|
|
|
- " a.confirm_time <![CDATA[<=]]>#{endDate} and" +
|
|
|
- " a.act_order_no*=p.act_order_no" +
|
|
|
+ " a.confirm_time <![CDATA[<=]]>#{endDate} " +
|
|
|
" order by charge_code asc",
|
|
|
"</script>"})
|
|
|
List<MzSendMedicineVo> selectZySpiritAnestheticPrint(@Param("beginDate") String beginDate,@Param("endDate") String endDate,
|
|
|
@@ -175,43 +176,32 @@ public interface YfSpiritAnestheticPrintMapper {
|
|
|
" a.act_order_no," +
|
|
|
" g.exec_unit," +
|
|
|
" h2.name as exec_name" +
|
|
|
- " FROM yp_zy_patient a WITH(NOLOCK)," +
|
|
|
- " zy_patient b WITH(NOLOCK)," +
|
|
|
- " a_employee_mi c WITH(NOLOCK)," +
|
|
|
- " yp_zd_dict d WITH(NOLOCK)," +
|
|
|
- " yp_zd_manufactory e WITH(NOLOCK)," +
|
|
|
- " zd_unit_code h WITH(NOLOCK)," +
|
|
|
- " zd_unit_code h2 WITH(NOLOCK)," +
|
|
|
- " a_patient_mi i WITH(NOLOCK)," +
|
|
|
- " view_yz_all_order g WITH(NOLOCK)," +
|
|
|
- " yz_supply_type k WITH(NOLOCK)" +
|
|
|
- " WHERE a.inpatient_no = b.inpatient_no and" +
|
|
|
- " a.admiss_times=b.admiss_times and" +
|
|
|
- " case when isnull(g.physician,'')='' then a.doctor_name else g.physician end*= c.code and" +
|
|
|
- " a.charge_code = d.code and" +
|
|
|
- " a.serial = d.serial and" +
|
|
|
- " d.manu_code*= e.code and" +
|
|
|
- " a.inpatient_no*=i.inpatient_no and" +
|
|
|
- " b.admiss_dept=h.code and" +
|
|
|
- " g.exec_unit=h2.code and" +
|
|
|
- " a.act_order_no = g.act_order_no and" +
|
|
|
- " g.supply_code *= k.supply_code and" +
|
|
|
+ " FROM yp_zy_patient a WITH(NOLOCK) " +
|
|
|
+ " INNER JOIN zy_patient b WITH(NOLOCK) ON a.inpatient_no = b.inpatient_no AND a.admiss_times = b.admiss_times " +
|
|
|
+ " INNER JOIN view_yz_all_order g WITH(NOLOCK) ON a.act_order_no = g.act_order_no " +
|
|
|
+ " LEFT JOIN a_employee_mi c WITH(NOLOCK) ON (case when isnull(g.physician,'')='' then a.doctor_name else g.physician end) = c.code " +
|
|
|
+ " INNER JOIN yp_zd_dict d WITH(NOLOCK) ON a.charge_code = d.code AND a.serial = d.serial " +
|
|
|
+ " LEFT JOIN yp_zd_manufactory e WITH(NOLOCK) ON d.manu_code = e.code " +
|
|
|
+ " LEFT JOIN a_patient_mi i WITH(NOLOCK) ON a.inpatient_no = i.inpatient_no " +
|
|
|
+ " INNER JOIN zd_unit_code h WITH(NOLOCK) ON b.admiss_dept = h.code " +
|
|
|
+ " LEFT JOIN yz_supply_type k WITH(NOLOCK) ON g.supply_code = k.supply_code " +
|
|
|
+ " INNER JOIN zd_unit_code h2 WITH(NOLOCK) ON g.exec_unit = h2.code " +
|
|
|
+ " WHERE a.act_order_no <> '3' " +
|
|
|
" <when test='sendDrugRecordVo.beginDate != null'>" +
|
|
|
- " a.confirm_time<![CDATA[>]]>#{sendDrugRecordVo.beginDate} and" +
|
|
|
+ " and a.confirm_time > #{sendDrugRecordVo.beginDate} " +
|
|
|
" </when>" +
|
|
|
" <when test='sendDrugRecordVo.endDate != null'>" +
|
|
|
- " a.confirm_time<![CDATA[<=]]>#{sendDrugRecordVo.endDate} and" +
|
|
|
+ " and a.confirm_time <= #{sendDrugRecordVo.endDate} " +
|
|
|
" </when>" +
|
|
|
" <when test='sendDrugRecordVo.chargeCode != null'>" +
|
|
|
- " a.charge_code = #{sendDrugRecordVo.chargeCode} and" +
|
|
|
+ " and a.charge_code = #{sendDrugRecordVo.chargeCode} " +
|
|
|
" </when>" +
|
|
|
" <when test='sendDrugRecordVo.serial != null'>" +
|
|
|
- " a.serial = #{sendDrugRecordVo.serial} and" +
|
|
|
+ " and a.serial = #{sendDrugRecordVo.serial} " +
|
|
|
" </when>" +
|
|
|
" <when test='sendDrugRecordVo.warnDept != null'>" +
|
|
|
- " h.code = #{sendDrugRecordVo.warnDept} and" +
|
|
|
+ " and h.code = #{sendDrugRecordVo.warnDept} " +
|
|
|
" </when>" +
|
|
|
- " a.act_order_no <![CDATA[<>]]> '3'" ,
|
|
|
" </script>"})
|
|
|
List<SendDrugRecordVo> selectZyRecord(@Param("sendDrugRecordVo") SendDrugRecordVo sendDrugRecordVo);
|
|
|
|
|
|
@@ -230,7 +220,7 @@ public interface YfSpiritAnestheticPrintMapper {
|
|
|
" icd_text=isnull(nullif(i.icd_text_new,''), rtrim(i.icd_text))," +
|
|
|
" drug_name=d.name," +
|
|
|
" abbr_name=e.name," +
|
|
|
- " quantity = case when a.serial=d.serial then case when a.receipt_no <![CDATA[<]]> '0' then -abs(a.quantity*isnull(a.cy_fy,1)) else a.quantity*isnull(a.cy_fy,1) end else case when a.receipt_no <![CDATA[<]]> '0' then -abs(a.quantity*isnull(a.cy_fy,1)/d.pack_size) else a.quantity*isnull(a.cy_fy,1)/d.pack_size end end," +
|
|
|
+ " quantity = case when a.serial=d.serial then case when a.receipt_no < '0' then -abs(a.quantity*isnull(a.cy_fy,1)) else a.quantity*isnull(a.cy_fy,1) end else case when a.receipt_no < '0' then -abs(a.quantity*isnull(a.cy_fy,1)/d.pack_size) else a.quantity*isnull(a.cy_fy,1)/d.pack_size end end," +
|
|
|
" d.specification," +
|
|
|
" charge_date=a.confirm_time," +
|
|
|
" employee_name=c.name," +
|
|
|
@@ -239,49 +229,34 @@ public interface YfSpiritAnestheticPrintMapper {
|
|
|
" k.supply_name," +
|
|
|
" g.frequency," +
|
|
|
" a.manu_no" +
|
|
|
- " FROM yp_mz_fytj a WITH(NOLOCK)," +
|
|
|
- " mz_patient_mi b WITH(NOLOCK)," +
|
|
|
- " a_employee_mi c WITH(NOLOCK)," +
|
|
|
- " yp_zd_dict d WITH(NOLOCK)," +
|
|
|
- " yp_zd_manufactory e WITH(NOLOCK)," +
|
|
|
- " zd_unit_code h WITH(NOLOCK)," +
|
|
|
- " mz_visit_table i WITH(NOLOCK)," +
|
|
|
- " mz_charge_detail g WITH(NOLOCK)," +
|
|
|
- " mz_zd_supply_type k WITH(NOLOCK)" +
|
|
|
- " WHERE ( a.patient_id = b.patient_id ) and" +
|
|
|
- " ( a.doctor_id*= c.code ) and" +
|
|
|
- " ( a.charge_item_code = d.code ) and" +
|
|
|
- " ( a.serial = d.serial) and" +
|
|
|
- " ( d.manu_code*= e.code ) and" +
|
|
|
- " a.warn_dept=h.code and" +
|
|
|
- " a.patient_id*=i.patient_id and" +
|
|
|
- " a.times*=i.times and" +
|
|
|
- " isnull(a.pay_mark,5)<![CDATA[<>]]> 5 and" +
|
|
|
- " a.patient_id = g.patient_id and" +
|
|
|
- " a.times = g.times and" +
|
|
|
- " a.receipt_no = g.receipt_no and" +
|
|
|
- " a.order_no = g.order_no and" +
|
|
|
- " a.item_no = g.item_no and" +
|
|
|
- " a.charge_item_code = g.charge_item_code and" +
|
|
|
- " g.supply_code *= k.supply_code and" +
|
|
|
- " isnull(a.confirm_flag,2) != 2 and" +
|
|
|
- " a.quantity !=0 and" +
|
|
|
+ " FROM yp_mz_fytj a WITH(NOLOCK) " +
|
|
|
+ " INNER JOIN mz_patient_mi b WITH(NOLOCK) ON a.patient_id = b.patient_id" +
|
|
|
+ " LEFT JOIN a_employee_mi c WITH(NOLOCK) ON a.doctor_id = c.code" +
|
|
|
+ " INNER JOIN yp_zd_dict d WITH(NOLOCK) ON a.charge_item_code = d.code AND a.serial = d.serial" +
|
|
|
+ " LEFT JOIN yp_zd_manufactory e WITH(NOLOCK) ON d.manu_code = e.code" +
|
|
|
+ " INNER JOIN zd_unit_code h WITH(NOLOCK) ON a.warn_dept = h.code" +
|
|
|
+ " LEFT JOIN mz_visit_table i WITH(NOLOCK) ON a.patient_id = i.patient_id AND a.times = i.times" +
|
|
|
+ " INNER JOIN mz_charge_detail g WITH(NOLOCK) ON a.patient_id = g.patient_id AND a.times = g.times AND a.receipt_no = g.receipt_no AND a.order_no = g.order_no AND a.item_no = g.item_no AND a.charge_item_code = g.charge_item_code" +
|
|
|
+ " LEFT JOIN mz_zd_supply_type k WITH(NOLOCK) ON g.supply_code = k.supply_code" +
|
|
|
+ " WHERE isnull(a.pay_mark, 5) <> 5 " +
|
|
|
+ " and isnull(a.confirm_flag, 2) != 2 " +
|
|
|
+ " and a.quantity != 0 " +
|
|
|
" <when test='sendDrugRecordVo.beginDate != null'>" +
|
|
|
- " a.confirm_time<![CDATA[>]]>#{sendDrugRecordVo.beginDate} and" +
|
|
|
+ " and a.confirm_time > #{sendDrugRecordVo.beginDate} " +
|
|
|
" </when>" +
|
|
|
" <when test='sendDrugRecordVo.endDate != null'>" +
|
|
|
- " a.confirm_time<![CDATA[<=]]>#{sendDrugRecordVo.endDate} and" +
|
|
|
+ " and a.confirm_time <= #{sendDrugRecordVo.endDate} " +
|
|
|
" </when>" +
|
|
|
" <when test='sendDrugRecordVo.chargeCode != null'>" +
|
|
|
- " a.charge_item_code = #{sendDrugRecordVo.chargeCode} and" +
|
|
|
+ " and a.charge_item_code = #{sendDrugRecordVo.chargeCode} " +
|
|
|
" </when>" +
|
|
|
" <when test='sendDrugRecordVo.serial != null'>" +
|
|
|
- " a.serial = #{sendDrugRecordVo.serial} and" +
|
|
|
+ " and a.serial = #{sendDrugRecordVo.serial} " +
|
|
|
" </when>" +
|
|
|
" <when test='sendDrugRecordVo.warnDept != null'>" +
|
|
|
- " h.code = #{sendDrugRecordVo.warnDept} and" +
|
|
|
+ " and h.code = #{sendDrugRecordVo.warnDept} " +
|
|
|
" </when>" +
|
|
|
- " 1=1 order by d.code" ,
|
|
|
+ " order by d.code" ,
|
|
|
" </script>"})
|
|
|
List<SendDrugRecordVo> selectMzRecord(@Param("sendDrugRecordVo") SendDrugRecordVo sendDrugRecordVo);
|
|
|
|