16
This commit is contained in:
parent
7a7b51382b
commit
ffff3ee5f3
@ -444,14 +444,15 @@ func (r *OrderPrescriptionDao) GetOrderTransferPrescriptionExportListSearch(req
|
||||
|
||||
prescriptionTable := (&model.OrderPrescription{}).TableName()
|
||||
inquiryTable := (&model.OrderInquiry{}).TableName()
|
||||
userTable := (&model.User{}).TableName()
|
||||
|
||||
userDoctorTable := (&model.UserDoctor{}).TableName()
|
||||
|
||||
// 构建查询条件
|
||||
query := global.Db.Model(&model.OrderPrescription{})
|
||||
|
||||
// 关联问诊表,只查询TransferDoctorId不等于null的记录
|
||||
query = query.Joins("INNER JOIN " + inquiryTable + " ON " + prescriptionTable + ".order_inquiry_id = " + inquiryTable + ".order_inquiry_id").
|
||||
query = query.
|
||||
Joins("INNER JOIN " + inquiryTable + " ON " + prescriptionTable + ".order_inquiry_id = " + inquiryTable + ".order_inquiry_id").
|
||||
Joins("INNER JOIN " + userDoctorTable + " ON " + inquiryTable + ".transfer_doctor_id = " + userDoctorTable + ".doctor_id").
|
||||
Where(inquiryTable + ".transfer_doctor_id IS NOT NULL")
|
||||
|
||||
// 患者表
|
||||
@ -491,9 +492,9 @@ func (r *OrderPrescriptionDao) GetOrderTransferPrescriptionExportListSearch(req
|
||||
// if req.DoctorName != "" {
|
||||
// query = query.Where("doctor_name LIKE ?", "%"+req.DoctorName+"%")
|
||||
// }
|
||||
// 医生名称 - 查询抄方医生名称
|
||||
// 医生名称 - 查询抄方医生名称(来自 gdxz_user_doctor.user_name)
|
||||
if req.DoctorName != "" {
|
||||
query = query.Where(userTable+".user_name LIKE ?", "%"+req.DoctorName+"%")
|
||||
query = query.Where(userDoctorTable+".user_name LIKE ?", "%"+req.DoctorName+"%")
|
||||
}
|
||||
|
||||
// 患者姓名-就诊人
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user