|
@@ -9,7 +9,7 @@ import (
|
9
|
9
|
func GetTodayInfo(to int64,ctime int64,page int64,limit int64)(patientinfo []function_models.PatientInfo,total int64,err error) {
|
10
|
10
|
|
11
|
11
|
offset := (page - 1) * limit
|
12
|
|
- err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u join sgj_org_follow as f On f.org_id = u.id JoIN sgj_admin as a On a.id = f.admin_user_id join sgj_xt.xt_patients as x on x.user_org_id = u.id where x.created_time >= ? AND x.created_time <= ? GROUP BY x.user_org_id",to,ctime).Scan(&patientinfo).Error
|
|
12
|
+ err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u left join sgj_org_follow as f On f.org_id = u.id left JoIN sgj_admin as a On a.id = f.admin_user_id left join sgj_xt.xt_patients as x on x.user_org_id = u.id where x.created_time >= ? AND x.created_time <= ? GROUP BY x.user_org_id",to,ctime).Scan(&patientinfo).Error
|
13
|
13
|
rows, err := readUserDb.Offset(offset).Limit(limit).Raw("select Count(1) from sgj_users.sgj_user_org as u join sgj_xt.xt_patients as x on x.user_org_id = u.id where x.created_time >= ? AND x.created_time <= ?", to, ctime).Rows()
|
14
|
14
|
fmt.Println("rows是什么",rows)
|
15
|
15
|
if rows.Next() {
|
|
@@ -23,7 +23,7 @@ func GetTodayInfo(to int64,ctime int64,page int64,limit int64)(patientinfo []fun
|
23
|
23
|
func GetTodayDialysisPatientsInfo(to int64,ctime int64,page int64,limit int64)(patientinfo []function_models.PatientInfo,total int64,err error) {
|
24
|
24
|
|
25
|
25
|
offset := (page - 1) * limit
|
26
|
|
- err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u join sgj_org_follow as f On f.org_id = u.id JoIN sgj_admin as a On a.id = f.admin_user_id join sgj_xt.xt_dialysis_prescription as x on x.user_org_id = u.id JOIN sgj_xt.xt_patients as p On p.id = x.patient_id where x.created_time >= ? AND x.created_time <= ? GROUP BY x.user_org_id",to,ctime).Scan(&patientinfo).Error
|
|
26
|
+ err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u left join sgj_org_follow as f On f.org_id = u.id left JoIN sgj_admin as a On a.id = f.admin_user_id left join sgj_xt.xt_dialysis_prescription as x on x.user_org_id = u.id left JOIN sgj_xt.xt_patients as p On p.id = x.patient_id where x.created_time >= ? AND x.created_time <= ? GROUP BY x.user_org_id",to,ctime).Scan(&patientinfo).Error
|
27
|
27
|
rows, err := readUserDb.Offset(offset).Limit(limit).Raw("select Count(1) from sgj_users.sgj_user_org as u join sgj_xt.xt_dialysis_prescription as x on x.user_org_id = u.id where x.created_time >= ? AND x.created_time <= ?", to, ctime).Rows()
|
28
|
28
|
if rows.Next() {
|
29
|
29
|
rows.Scan(&total)
|
|
@@ -37,7 +37,7 @@ func GetTodayDialysisPatientsInfo(to int64,ctime int64,page int64,limit int64)(p
|
37
|
37
|
func GetTodayReceivePatientsInfo(to int64,ctime int64,page int64,limit int64)(patientinfo []function_models.PatientInfo,total int64,err error) {
|
38
|
38
|
|
39
|
39
|
offset := (page - 1) * limit
|
40
|
|
- err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u join sgj_org_follow as f On f.org_id = u.id JoIN sgj_admin as a On a.id = f.admin_user_id join sgj_xt.xt_receive_treatment_asses as x on x.user_org_id = u.id JOIN sgj_xt.xt_patients as p On p.id = x.patient_id where x.created_time >= ? AND x.created_time <= ? GROUP BY x.user_org_id",to,ctime).Scan(&patientinfo).Error
|
|
40
|
+ err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u left join sgj_org_follow as f On f.org_id = u.id left JoIN sgj_admin as a On a.id = f.admin_user_id left join sgj_xt.xt_receive_treatment_asses as x on x.user_org_id = u.id left JOIN sgj_xt.xt_patients as p On p.id = x.patient_id where x.created_time >= ? AND x.created_time <= ? GROUP BY x.user_org_id",to,ctime).Scan(&patientinfo).Error
|
41
|
41
|
rows, err := readUserDb.Offset(offset).Limit(limit).Raw("select Count(1) from sgj_users.sgj_user_org as u join sgj_xt.xt_receive_treatment_asses as x on x.user_org_id = u.id where x.created_time >= ? AND x.created_time <= ?", to, ctime).Rows()
|
42
|
42
|
if rows.Next() {
|
43
|
43
|
rows.Scan(&total)
|
|
@@ -48,7 +48,7 @@ func GetTodayReceivePatientsInfo(to int64,ctime int64,page int64,limit int64)(pa
|
48
|
48
|
// 透前评估
|
49
|
49
|
func GetTodayBeforDislysisInfo(to int64,ctime int64,page int64,limit int64)(patientinfo []function_models.PatientInfo,total int64,err error) {
|
50
|
50
|
offset := (page - 1) * limit
|
51
|
|
- err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u join sgj_org_follow as f On f.org_id = u.id JoIN sgj_admin as a On a.id = f.admin_user_id join sgj_xt.xt_assessment_before_dislysis as x on x.user_org_id = u.id JOIN sgj_xt.xt_patients as p On p.id = x.patient_id where x.created_time >= ? AND x.created_time <= ? GROUP BY x.user_org_id",to,ctime).Scan(&patientinfo).Error
|
|
51
|
+ err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u left join sgj_org_follow as f On f.org_id = u.id left JoIN sgj_admin as a On a.id = f.admin_user_id left join sgj_xt.xt_assessment_before_dislysis as x on x.user_org_id = u.id left JOIN sgj_xt.xt_patients as p On p.id = x.patient_id where x.created_time >= ? AND x.created_time <= ? GROUP BY x.user_org_id",to,ctime).Scan(&patientinfo).Error
|
52
|
52
|
rows, err := readUserDb.Offset(offset).Limit(limit).Raw("select Count(1) from sgj_users.sgj_user_org as u join sgj_xt.xt_assessment_before_dislysis as x on x.user_org_id = u.id where x.created_time >= ? AND x.created_time <= ?", to, ctime).Rows()
|
53
|
53
|
if rows.Next() {
|
54
|
54
|
rows.Scan(&total)
|
|
@@ -62,7 +62,7 @@ func GetTodayDoctorsOrderInfo(to int64,ctime int64,page int64,limit int64)(patie
|
62
|
62
|
|
63
|
63
|
|
64
|
64
|
offset := (page - 1) * limit
|
65
|
|
- err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u join sgj_org_follow as f On f.org_id = u.id JoIN sgj_admin as a On a.id = f.admin_user_id join sgj_xt.xt_doctor_advice as x on x.user_org_id = u.id JOIN sgj_xt.xt_patients as p On p.id = x.patient_id where x.created_time >= ? AND x.created_time <= ? GROUP BY x.user_org_id",to,ctime).Scan(&patientinfo).Error
|
|
65
|
+ err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u left join sgj_org_follow as f On f.org_id = u.id left JoIN sgj_admin as a On a.id = f.admin_user_id join sgj_xt.xt_doctor_advice as x on x.user_org_id = u.id left JOIN sgj_xt.xt_patients as p On p.id = x.patient_id where x.created_time >= ? AND x.created_time <= ? GROUP BY x.user_org_id",to,ctime).Scan(&patientinfo).Error
|
66
|
66
|
rows, err := readUserDb.Offset(offset).Limit(limit).Raw("select Count(1) from sgj_users.sgj_user_org as u join sgj_xt.xt_doctor_advice as x on x.user_org_id = u.id where x.created_time >= ? AND x.created_time <= ?", to, ctime).Rows()
|
67
|
67
|
if rows.Next() {
|
68
|
68
|
rows.Scan(&total)
|
|
@@ -74,7 +74,7 @@ func GetTodayDoctorsOrderInfo(to int64,ctime int64,page int64,limit int64)(patie
|
74
|
74
|
func GetTodayDoubleCheckInfo(to int64,ctime int64,page int64,limit int64)(patientinfo []function_models.PatientInfo,total int64,err error) {
|
75
|
75
|
|
76
|
76
|
offset := (page - 1) * limit
|
77
|
|
- err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u join sgj_org_follow as f On f.org_id = u.id JoIN sgj_admin as a On a.id = f.admin_user_id join sgj_xt.xt_double_check as x on x.user_org_id = u.id JOIN sgj_xt.xt_patients as p On p.id = x.patient_id where x.created_time >= ? AND x.created_time <= ? GROUP BY x.user_org_id",to,ctime).Scan(&patientinfo).Error
|
|
77
|
+ err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u left join sgj_org_follow as f On f.org_id = u.id left JoIN sgj_admin as a On a.id = f.admin_user_id join sgj_xt.xt_double_check as x on x.user_org_id = u.id left JOIN sgj_xt.xt_patients as p On p.id = x.patient_id where x.created_time >= ? AND x.created_time <= ? GROUP BY x.user_org_id",to,ctime).Scan(&patientinfo).Error
|
78
|
78
|
rows, err := readUserDb.Offset(offset).Limit(limit).Raw("select Count(1) from sgj_users.sgj_user_org as u join sgj_xt.xt_double_check as x on x.user_org_id = u.id where x.created_time >= ? AND x.created_time <= ?", to, ctime).Rows()
|
79
|
79
|
if rows.Next() {
|
80
|
80
|
rows.Scan(&total)
|
|
@@ -86,7 +86,7 @@ func GetTodayDoubleCheckInfo(to int64,ctime int64,page int64,limit int64)(patien
|
86
|
86
|
func GetTodayDialysisMachinek(to int64,ctime int64,page int64,limit int64)(patientinfo []function_models.PatientInfo,total int64,err error) {
|
87
|
87
|
|
88
|
88
|
offset := (page - 1) * limit
|
89
|
|
- err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u join sgj_org_follow as f On f.org_id = u.id JoIN sgj_admin as a On a.id = f.admin_user_id join sgj_xt.xt_dialysis_order as x on x.user_org_id = u.id JOIN sgj_xt.xt_patients as p On p.id = x.patient_id where x.created_time >= ? AND x.created_time <= ? GROUP BY x.user_org_id",to,ctime).Scan(&patientinfo).Error
|
|
89
|
+ err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u left join sgj_org_follow as f On f.org_id = u.id left JoIN sgj_admin as a On a.id = f.admin_user_id left join sgj_xt.xt_dialysis_order as x on x.user_org_id = u.id left JOIN sgj_xt.xt_patients as p On p.id = x.patient_id where x.created_time >= ? AND x.created_time <= ? GROUP BY x.user_org_id",to,ctime).Scan(&patientinfo).Error
|
90
|
90
|
rows, err := readUserDb.Offset(offset).Limit(limit).Raw("select Count(1) from sgj_users.sgj_user_org as u join sgj_xt.xt_dialysis_order as x on x.user_org_id = u.id where x.created_time >= ? AND x.created_time <= ?", to, ctime).Rows()
|
91
|
91
|
if rows.Next() {
|
92
|
92
|
rows.Scan(&total)
|
|
@@ -99,7 +99,7 @@ func GetTodayDialysisMachinek(to int64,ctime int64,page int64,limit int64)(patie
|
99
|
99
|
func GetTodayDialysisExamination(to int64,ctime int64,page int64,limit int64)(patientinfo []function_models.PatientInfo,total int64,err error) {
|
100
|
100
|
|
101
|
101
|
offset := (page - 1) * limit
|
102
|
|
- err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u join sgj_org_follow as f On f.org_id = u.id JoIN sgj_admin as a On a.id = f.admin_user_id join sgj_xt.xt_monitoring_record as x on x.user_org_id = u.id JOIN sgj_xt.xt_patients as p On p.id = x.patient_id where x.created_time >= ? AND x.created_time <= ? GROUP BY x.user_org_id",to,ctime).Scan(&patientinfo).Error
|
|
102
|
+ err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u left join sgj_org_follow as f On f.org_id = u.id left JoIN sgj_admin as a On a.id = f.admin_user_id join sgj_xt.xt_monitoring_record as x on x.user_org_id = u.id left JOIN sgj_xt.xt_patients as p On p.id = x.patient_id where x.created_time >= ? AND x.created_time <= ? GROUP BY x.user_org_id",to,ctime).Scan(&patientinfo).Error
|
103
|
103
|
rows, err := readUserDb.Offset(offset).Limit(limit).Raw("select Count(1) from sgj_users.sgj_user_org as u join sgj_xt.xt_monitoring_record as x on x.user_org_id = u.id where x.created_time >= ? AND x.created_time <= ?", to, ctime).Rows()
|
104
|
104
|
if rows.Next() {
|
105
|
105
|
rows.Scan(&total)
|
|
@@ -112,7 +112,7 @@ func GetTodayDialysisExamination(to int64,ctime int64,page int64,limit int64)(pa
|
112
|
112
|
func GetTodayBeforOrpenetration(to int64,ctime int64,page int64,limit int64)(patientinfo []function_models.PatientInfo,total int64,err error) {
|
113
|
113
|
|
114
|
114
|
offset := (page - 1) * limit
|
115
|
|
- err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u join sgj_org_follow as f On f.org_id = u.id JoIN sgj_admin as a On a.id = f.admin_user_id join sgj_xt.xt_dialysis_order as x on x.user_org_id = u.id JOIN sgj_xt.xt_patients as p On p.id = x.patient_id where x.created_time >= ? AND x.created_time <= ? GROUP BY x.user_org_id",to,ctime).Scan(&patientinfo).Error
|
|
115
|
+ err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u left join sgj_org_follow as f On f.org_id = u.id left JoIN sgj_admin as a On a.id = f.admin_user_id join sgj_xt.xt_dialysis_order as x on x.user_org_id = u.id left JOIN sgj_xt.xt_patients as p On p.id = x.patient_id where x.created_time >= ? AND x.created_time <= ? GROUP BY x.user_org_id",to,ctime).Scan(&patientinfo).Error
|
116
|
116
|
rows, err := readUserDb.Offset(offset).Limit(limit).Raw("select Count(1) from sgj_users.sgj_user_org as u join sgj_xt.xt_dialysis_order as x on x.user_org_id = u.id where x.created_time >= ? AND x.created_time <= ?", to, ctime).Rows()
|
117
|
117
|
if rows.Next() {
|
118
|
118
|
rows.Scan(&total)
|
|
@@ -124,7 +124,7 @@ func GetTodayBeforOrpenetration(to int64,ctime int64,page int64,limit int64)(pat
|
124
|
124
|
//透后评估
|
125
|
125
|
func GetTodayPostAssessment(to int64,ctime int64,page int64,limit int64)(patientinfo []function_models.PatientInfo,total int64,err error) {
|
126
|
126
|
offset := (page - 1) * limit
|
127
|
|
- err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u join sgj_org_follow as f On f.org_id = u.id JoIN sgj_admin as a On a.id = f.admin_user_id join sgj_xt.xt_assessment_after_dislysis as x on x.user_org_id = u.id JOIN sgj_xt.xt_patients as p On p.id = x.patient_id where x.created_time >= ? AND x.created_time <= ? GROUP BY x.user_org_id",to,ctime).Scan(&patientinfo).Error
|
|
127
|
+ err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u left join sgj_org_follow as f On f.org_id = u.id left JoIN sgj_admin as a On a.id = f.admin_user_id join sgj_xt.xt_assessment_after_dislysis as x on x.user_org_id = u.id left JOIN sgj_xt.xt_patients as p On p.id = x.patient_id where x.created_time >= ? AND x.created_time <= ? GROUP BY x.user_org_id",to,ctime).Scan(&patientinfo).Error
|
128
|
128
|
rows, err := readUserDb.Offset(offset).Limit(limit).Raw("select Count(1) from sgj_users.sgj_user_org as u join sgj_xt.xt_assessment_after_dislysis as x on x.user_org_id = u.id where x.created_time >= ? AND x.created_time <= ?", to, ctime).Rows()
|
129
|
129
|
if rows.Next() {
|
130
|
130
|
rows.Scan(&total)
|
|
@@ -135,8 +135,8 @@ func GetTodayPostAssessment(to int64,ctime int64,page int64,limit int64)(patient
|
135
|
135
|
|
136
|
136
|
func GetTodayEntrylist(to int64,ctime int64,limit int64,page int64)(patientinfo []function_models.PatientInfo,total int64, err error) {
|
137
|
137
|
offset := (page - 1) * limit
|
138
|
|
- err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u join sgj_xt.xt_warehouse_info as x on x.org_id = u.id LEFT JOIN sgj_users.sgj_org_follow as f ON f.org_id = u.id LEFT JOIN sgj_users.sgj_admin as a on a.id = f.admin_user_id where x.ctime >= ? AND x.ctime<= ? GROUP BY x.org_id",to,ctime).Scan(&patientinfo).Error
|
139
|
|
- rows, err := readUserDb.Offset(offset).Limit(limit).Raw("select Count(1) from sgj_users.sgj_user_org as u join sgj_xt.xt_warehouse_info as x on x.org_id = u.id where x.ctime >= ? AND x.ctime <= ?", to, ctime).Rows()
|
|
138
|
+ err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u join sgj_xt.xt_warehouse as x on x.org_id = u.id LEFT JOIN sgj_users.sgj_org_follow as f ON f.org_id = u.id LEFT JOIN sgj_users.sgj_admin as a on a.id = f.admin_user_id where x.ctime >= ? AND x.ctime<= ? GROUP BY x.org_id",to,ctime).Scan(&patientinfo).Error
|
|
139
|
+ rows, err := readUserDb.Offset(offset).Limit(limit).Raw("select Count(1) from sgj_users.sgj_user_org as u join sgj_xt.xt_warehouse as x on x.org_id = u.id where x.ctime >= ? AND x.ctime <= ?", to, ctime).Rows()
|
140
|
140
|
if rows.Next() {
|
141
|
141
|
rows.Scan(&total)
|
142
|
142
|
}
|
|
@@ -146,10 +146,11 @@ func GetTodayEntrylist(to int64,ctime int64,limit int64,page int64)(patientinfo
|
146
|
146
|
|
147
|
147
|
func GetTodayExitlist(to int64,ctime int64,limit int64,page int64)(patientinfo []function_models.PatientInfo,total int64,err error) {
|
148
|
148
|
offset := (page - 1) * limit
|
149
|
|
- err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u join sgj_xt.xt_warehouse_out as x on x.org_id = u.id where x.warehouse_out_time >= ? AND x.warehouse_out_time<= ? GROUP BY x.org_id",to,ctime).Scan(&patientinfo).Error
|
150
|
|
- rows, err := readUserDb.Offset(offset).Limit(limit).Raw("select Count(1) from sgj_users.sgj_user_org as u join sgj_xt.xt_warehouse_out as x on x.org_id = u.id where x.warehouse_out_time >= ? AND x.warehouse_out_time <= ?", to, ctime).Rows()
|
|
149
|
+ err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u join sgj_xt.xt_warehouse_out as x on x.org_id = u.id LEFT JOIN sgj_users.sgj_org_follow as f ON f.org_id = u.id LEFT JOIN sgj_users.sgj_admin as a on a.id = f.admin_user_id where x.ctime >= ? AND x.ctime<= ? GROUP BY x.org_id",to,ctime).Scan(&patientinfo).Error
|
|
150
|
+ rows, err := readUserDb.Offset(offset).Limit(limit).Raw("select Count(1) from sgj_users.sgj_user_org as u join sgj_xt.xt_warehouse_out as x on x.org_id = u.id where x.ctime >= ? AND x.ctime <= ?", to, ctime).Rows()
|
151
|
151
|
if rows.Next() {
|
152
|
152
|
rows.Scan(&total)
|
153
|
153
|
}
|
|
154
|
+
|
154
|
155
|
return patientinfo,total,err
|
155
|
156
|
}
|