|
@@ -73,11 +73,12 @@ public interface SiPatInfoMapper {
|
|
|
* @return 处方列表
|
|
|
*/
|
|
|
@Select({
|
|
|
- "SELECT c.order_no as orderNo, c.charge_date as orderTime, c.receipt_no as receiptNo, c.real_no as realNo, ",
|
|
|
+ "SELECT DISTINCT c.order_no as orderNo, c.charge_date as orderTime, c.receipt_no as receiptNo, c.real_no as realNo, ",
|
|
|
"c.name as doctorName, c.exec_dept as deptName, ",
|
|
|
- "ISNULL(c.order_type, '') as orderType, ISNULL(c.unit_price * c.quantity, 0) as totalAmount, ISNULL(c.confirm_flag, 0) as confirmFlag ",
|
|
|
+ "ISNULL(c.order_type, '') as orderType, ISNULL(SUM(c.unit_price * c.quantity), 0) as totalAmount, ISNULL(c.confirm_flag, 0) as confirmFlag ",
|
|
|
"FROM mz_charge_detail c ",
|
|
|
"WHERE c.patient_id = #{patientId} AND c.times = #{times} ",
|
|
|
+ "GROUP BY c.order_no, c.charge_date, c.receipt_no, c.real_no, c.name, c.exec_dept, c.order_type, c.confirm_flag ",
|
|
|
"ORDER BY c.charge_date DESC"
|
|
|
})
|
|
|
List<PrescriptionVo> selectPrescriptionsByVisit(@Param("patientId") String patientId, @Param("times") Integer times);
|
|
@@ -92,8 +93,12 @@ public interface SiPatInfoMapper {
|
|
|
@Select({
|
|
|
"SELECT m.charge_item_code as chargeItemCode, ISNULL(m.drug_name, '') as drugName, ISNULL(m.specification, '') as specification, ",
|
|
|
"1 as quantity, ISNULL(m.unit_price, 0) as unitPrice, m.drug_trac_codg as drugTracCodg, m.confirm_time as scanTime, ",
|
|
|
- "ISNULL(m.confirm_name, '') as scanUser, m.order_no as orderNo, m.receipt_no as receiptNo, m.real_no as realNo ",
|
|
|
+ "ISNULL(m.confirm_name, '') as scanUser, m.order_no as orderNo, m.receipt_no as receiptNo, m.real_no as realNo, ",
|
|
|
+ "ISNULL(y.national_code, '') as medListCodg, '0' as rxFlag, '0' as trdnFlag, ",
|
|
|
+ "ISNULL(p.psn_cert_type, '01') as psnCertType, ISNULL(p.certno, '') as certno ",
|
|
|
"FROM mz_drug_trac_codg m ",
|
|
|
+ "LEFT JOIN yp_zd_dict y ON m.charge_item_code = y.code AND y.serial = '01' ",
|
|
|
+ "LEFT JOIN t_si_pat_info p ON m.patient_id = p.pat_no AND m.times = p.times ",
|
|
|
"WHERE m.patient_id = #{patientId} AND m.times = #{times} ",
|
|
|
"AND m.order_no = #{orderNo} ",
|
|
|
"AND m.drug_trac_codg IS NOT NULL ",
|