|
@@ -20,30 +20,32 @@ import java.util.List;
|
|
|
public interface YiJiFeiYongLuRuDao {
|
|
|
|
|
|
@Select("<script>" +
|
|
|
- "SELECT rtrim(inpatient_no) inpatient_no," +
|
|
|
- " admiss_times," +
|
|
|
- " admiss_dept," +
|
|
|
- " rtrim(name) name," +
|
|
|
- " rtrim(bed_no) bed_no," +
|
|
|
- " ward," +
|
|
|
- " ward_name=(select rtrim(name) name from zd_unit_code where zd_unit_code.code = ward)," +
|
|
|
- " responce_type," +
|
|
|
- " responce_type_name=(select rtrim(name) name from zy_zd_responce_type where responce_type = zy_zd_responce_type.code)," +
|
|
|
- " balance," +
|
|
|
- " dept," +
|
|
|
- " refer_physician," +
|
|
|
- " total_charge," +
|
|
|
- " rtrim(charge_type) charge_type," +
|
|
|
- " times_billed," +
|
|
|
- " rtrim(admiss_diag_str) admiss_diag_str," +
|
|
|
- " rtrim(admiss_diag) admiss_diag," +
|
|
|
- " admiss_date," +
|
|
|
- " sex," +
|
|
|
- " zy_serial_no," +
|
|
|
- " mz_no," +
|
|
|
- " rtrim(intern_code) intern_code," +
|
|
|
- " zk_ward " +
|
|
|
- "FROM ${tableName} " +
|
|
|
+ "SELECT rtrim(a.inpatient_no) inpatient_no," +
|
|
|
+ " a.admiss_times," +
|
|
|
+ " ledger_sn = " +
|
|
|
+ "(select max(ledger_sn)ledger_sn from zy_ledger_file where zy_ledger_file.inpatient_no = a.inpatient_no and zy_ledger_file.admiss_times = a.admiss_times)," +
|
|
|
+ " a.admiss_dept," +
|
|
|
+ " rtrim(a.name) name," +
|
|
|
+ " rtrim(a.bed_no) bed_no," +
|
|
|
+ " a.ward," +
|
|
|
+ " ward_name=(select rtrim(name) name from zd_unit_code where zd_unit_code.code = a.ward)," +
|
|
|
+ " a.responce_type," +
|
|
|
+ " responce_type_name=(select rtrim(name) name from zy_zd_responce_type where a.responce_type = zy_zd_responce_type.code)," +
|
|
|
+ " a.balance," +
|
|
|
+ " a.dept," +
|
|
|
+ " a.refer_physician," +
|
|
|
+ " a.total_charge," +
|
|
|
+ " rtrim(a.charge_type) charge_type," +
|
|
|
+ " a.times_billed," +
|
|
|
+ " rtrim(a.admiss_diag_str) admiss_diag_str," +
|
|
|
+ " rtrim(a.admiss_diag) admiss_diag," +
|
|
|
+ " a.admiss_date," +
|
|
|
+ " a.sex," +
|
|
|
+ " a.zy_serial_no," +
|
|
|
+ " a.mz_no," +
|
|
|
+ " rtrim(a.intern_code) intern_code," +
|
|
|
+ " a.zk_ward " +
|
|
|
+ "FROM ${tableName} a " +
|
|
|
"WHERE inpatient_no = #{inpatientNo} " +
|
|
|
"<if test=\"admissTimes != 0 \">" +
|
|
|
"and admiss_times = #{admissTimes} " +
|