package thyyxxk.webserver.dao.his.yibao; import com.baomidou.mybatisplus.core.metadata.IPage; import org.apache.ibatis.annotations.*; import thyyxxk.webserver.entity.datamodify.GetDropdownBox; import thyyxxk.webserver.entity.datamodify.MzChargeDetail; import thyyxxk.webserver.entity.datamodify.ZyDetailCharge; import thyyxxk.webserver.entity.yibao.ZyActpatient; import java.util.List; /** *
* 描述: 门急诊费用转入 *
* * @author xc * @date 2021-05-25 17:35 */ @Mapper public interface TransferInOfExpensesDao { /** * 查询患者的基本信息 * * @param inpatientNo 住院号 * @return 返回一条信息 */ @Select("select rtrim(inpatient_no) inpatient_no,admiss_times,rtrim(zk_dept) zk_dept,ward,dept," + "rtrim(admiss_ward) wardCode," + "rtrim(small_dept) deptCode,zy_serial_no, " + "rtrim(isnull(operation, '')) as operation, " + "rtrim(refer_physician) refer_physician, " + "rtrim(consult_physician) consult_physician,zk_ward, " + "ledgerSn=(select max(ledger_sn) from zy_ledger_file " + "where inpatient_no=a.inpatient_no and admiss_times=a.admiss_times), " + "maxDetailSn=(select max(detail_sn) from zy_detail_charge " + "where inpatient_no=a.inpatient_no and admiss_times=a.admiss_times), " + "rtrim(a.name)name,sex,rtrim(bed_no)bed_no,(b.name) ward_name, " + "admiss_date,(c.name)responce_type_name,total_charge,balance " + "from zy_actpatient a left join zd_unit_code b on (a.ward = b.code) left join zy_zd_responce_type c on (a.responce_type = c.code) " + "where inpatient_no = #{inpatientNo}") ZyActpatient queryHuanZhe(String inpatientNo); /** * 根据机制号来查询门诊发票信息 * * @param tableName 要查询的表格 * @param serialNo 机制号 * @return 返回多个 */ @Select("select " + " patient_name =rtrim(a.name), " + " item_name = c.name, " + " charge_amount = a.quantity, " + " self_flag=c.self_flag, " + " separate_flag = c.separate_flag, " + " suppress_flag = c.suppress_flag, " + " charge_code = a.charge_item_code, " + " charge_code_mx = a.charge_item_code, " + " serial = a.serial, " + " group_no = a.group_no, " + " price = a.unit_price, " + " charge_fee=a.unit_price * a.quantity * isnull(a.drug_win,1), " + " check_flag='0', " + " warn_dept =a.warn_dept, " + " doctor_code = a.doctor_code, " + " bill_item_code = rtrim(a.bill_item_code), " + " exec_dept = a.exec_dept " + "from ${tableName} a,mz_receipt_serial b,zd_charge_item c " + "where a.patient_id = b.patient_id and " + " a.times = b.times and " + " a.receipt_no = b.receipt_no and " + " a.serial_no= b.serial_no and " + " b.receipt_sn=#{serialNo} and " + " a.charge_item_code=c.code and " + " isnull(a.group_no,'00')='00' " + "union all " + "select patient_name =rtrim(a.name), " + " item_name = (select name from yp_zd_dict where yp_zd_dict.code=c.charge_code and yp_zd_dict.serial=c.serial),/*c.drugname,*/ " + " charge_amount = a.quantity, " + " self_flag=a.self_flag, " + " separate_flag = (select separate_flag from yp_zd_dict where yp_zd_dict.code=c.charge_code and yp_zd_dict.serial=c.serial), " + " suppress_flag = (select suprice_flag from yp_zd_dict where yp_zd_dict.code=c.charge_code and yp_zd_dict.serial=c.serial), " + " charge_code = a.charge_item_code, " + " charge_code_mx = a.charge_item_code, " + " serial = a.serial, " + " group_no = a.group_no, " + " price = a.unit_price, " + " charge_fee=a.unit_price * a.quantity * isnull(a.drug_win,1), " + " check_flag='0', " + " warn_dept =a.warn_dept, " + " doctor_code = a.doctor_code, " + " bill_item_code = rtrim(a.bill_item_code), " + " exec_dept = a.exec_dept " + "from ${tableName} a,mz_receipt_serial b,yp_base_yf c " + "where a.patient_id = b.patient_id and " + " a.times = b.times and " + " a.receipt_no = b.receipt_no and " + " a.serial_no= b.serial_no and " + " b.receipt_sn=#{serialNo} and " + " a.charge_item_code=c.charge_code and " + " a.serial = c.serial and " + " a.group_no = c.group_no and " + " isnull(a.group_no,'00')<>'00'") List