123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265 |
- package service
-
- import (
- "XT_Admin_Api/models/admin_models"
- "XT_Admin_Api/models/function_models"
- )
-
- // 病人管理
- func GetTodayInfo(to int64, ctime int64, page int64, limit int64, admin *admin_models.AdminAccount) (patientinfo []function_models.PatientInfo, total int64, err error) {
-
- //offset := (page - 1) * limit
- if admin.IsAdmin == 1 {
- err = readUserDb.Raw("select *, a.name as admin_name, d.namepath as namepath from sgj_users.sgj_user_org as u left join sgj_org_follow as f On f.org_id = u.id AND f.status = 1 left JOIN sgj_user_district as d On d.id = u.city left JoIN sgj_admin as a On a.id = f.admin_user_id AND a.status = 1 left join sgj_xt.xt_patients as x on x.user_org_id = u.id where x.created_time >= ? AND x.created_time <= ? AND u.import <> 1 GROUP BY x.user_org_id", to, ctime).Scan(&patientinfo).Error
- } else {
- err = readUserDb.Raw("select *, a.name as admin_name, d.namepath as namepath from sgj_users.sgj_user_org as u join sgj_org_follow as f On f.org_id = u.id AND f.status = 1 AND f.admin_user_id = ? left JoIN sgj_admin as a On a.id = f.admin_user_id AND a.status = 1 left JOIN sgj_user_district as d On d.id = u.city left join sgj_xt.xt_patients as x on x.user_org_id = u.id where x.created_time >= ? AND x.created_time <= ? AND u.import <> 1 GROUP BY x.user_org_id", admin.ID, to, ctime).Scan(&patientinfo).Error
- }
- //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()
- //fmt.Println("rows是什么", rows)
- //defer rows.Close()
- //if rows.Next() {
- // rows.Scan(&total)
- //}
- //fmt.Println("&total是什么", total)
- return patientinfo, total, err
- }
-
- // 透析处方
- func GetTodayDialysisPatientsInfo(to int64, ctime int64, page int64, limit int64, admin *admin_models.AdminAccount) (patientinfo []function_models.PatientInfo, total int64, err error) {
-
- //offset := (page - 1) * limit
-
- if admin.IsAdmin == 1 {
- err = readUserDb.Raw("select * , a.name as admin_name, d.namepath as namepath from sgj_users.sgj_user_org as u left JOIN sgj_user_district as d On d.id = u.city left join sgj_org_follow as f On f.org_id = u.id AND f.status = 1 left JoIN sgj_admin as a On a.id = f.admin_user_id AND a.status = 1 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 <= ? AND u.import <> 1 GROUP BY x.user_org_id", to, ctime).Scan(&patientinfo).Error
-
- } else {
-
- err = readUserDb.Raw("select * , a.name as admin_name, d.namepath as namepath from sgj_users.sgj_user_org as u left JOIN sgj_user_district as d On d.id = u.city join sgj_org_follow as f On f.org_id = u.id AND f.admin_user_id = ? AND f.status = 1 left JoIN sgj_admin as a On a.id = f.admin_user_id AND a.status = 1 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 <= ? AND u.import <> 1 GROUP BY x.user_org_id", admin.ID, to, ctime).Scan(&patientinfo).Error
-
- }
- //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()
- //defer rows.Close()
- //
- //if rows.Next() {
- // rows.Scan(&total)
- //}
-
- return patientinfo, total, err
- }
-
- // 接诊评估
- func GetTodayReceivePatientsInfo(to int64, ctime int64, page int64, limit int64, admin *admin_models.AdminAccount) (patientinfo []function_models.PatientInfo, total int64, err error) {
-
- //offset := (page - 1) * limit
- if admin.IsAdmin == 1 {
- err = readUserDb.Raw("select *, a.name as admin_name, d.namepath as namepath from sgj_users.sgj_user_org as u left JOIN sgj_user_district as d On d.id = u.city left join sgj_org_follow as f On f.org_id = u.id AND f.status = 1 left JoIN sgj_admin as a On a.id = f.admin_user_id AND a.status = 1 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 <= ? AND u.import <> 1 GROUP BY x.user_org_id", to, ctime).Scan(&patientinfo).Error
-
- } else {
- err = readUserDb.Raw("select *, a.name as admin_name, d.namepath as namepath from sgj_users.sgj_user_org as u left JOIN sgj_user_district as d On d.id = u.city join sgj_org_follow as f On f.org_id = u.id AND f.status = 1 AND f.admin_user_id = ? left JoIN sgj_admin as a On a.id = f.admin_user_id AND a.status = 1 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 <= ? AND u.import <> 1 GROUP BY x.user_org_id", admin.ID, to, ctime).Scan(&patientinfo).Error
-
- }
-
- //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()
- //defer rows.Close()
- //
- //if rows.Next() {
- // rows.Scan(&total)
- //}
-
- return patientinfo, total, err
- }
-
- // 透前评估
- func GetTodayBeforDislysisInfo(to int64, ctime int64, page int64, limit int64, admin *admin_models.AdminAccount) (patientinfo []function_models.PatientInfo, total int64, err error) {
- //offset := (page - 1) * limit
- if admin.IsAdmin == 1 {
- err = readUserDb.Raw("select *, a.name as admin_name, d.namepath as namepath from sgj_users.sgj_user_org as u left JOIN sgj_user_district as d On d.id = u.city left join sgj_org_follow as f On f.org_id = u.id left AND f.status = 1 JoIN sgj_admin as a On a.id = f.admin_user_id AND a.status = 1 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 <= ? AND u.import <> 1 GROUP BY x.user_org_id", to, ctime).Scan(&patientinfo).Error
-
- } else {
-
- err = readUserDb.Raw("select *, a.name as admin_name, d.namepath as namepath from sgj_users.sgj_user_org as u left JOIN sgj_user_district as d On d.id = u.city join sgj_org_follow as f On f.org_id = u.id AND f.admin_user_id = ? AND f.status = 1 left JoIN sgj_admin as a On a.id = f.admin_user_id AND a.status = 1 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 <= ? AND u.import <> 1 GROUP BY x.user_org_id", admin.ID, to, ctime).Scan(&patientinfo).Error
-
- }
-
- //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()
- //defer rows.Close()
- //
- //if rows.Next() {
- // rows.Scan(&total)
- //}
-
- return patientinfo, total, err
- }
-
- // 零食医嘱
- func GetTodayDoctorsOrderInfo(to int64, ctime int64, page int64, limit int64, admin *admin_models.AdminAccount) (patientinfo []function_models.PatientInfo, total int64, err error) {
-
- //offset := (page - 1) * limit
-
- if admin.IsAdmin == 1 {
-
- err = readUserDb.Raw("select *, a.name as admin_name, d.namepath as namepath from sgj_users.sgj_user_org as u left JOIN sgj_user_district as d On d.id = u.city left join sgj_org_follow as f On f.org_id = u.id AND f.status = 1 left JoIN sgj_admin as a On a.id = f.admin_user_id AND a.status = 1 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 <= ? AND u.import <> 1 GROUP BY x.user_org_id", to, ctime).Scan(&patientinfo).Error
-
- } else {
-
- err = readUserDb.Raw("select *, a.name as admin_name, d.namepath as namepath from sgj_users.sgj_user_org as u left JOIN sgj_user_district as d On d.id = u.city join sgj_org_follow as f On f.org_id = u.id AND f.admin_user_id = ? AND f.status = 1 left JoIN sgj_admin as a On a.id = f.admin_user_id AND a.status = 1 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 <= ? AND u.import <> 1 GROUP BY x.user_org_id", admin.ID, to, ctime).Scan(&patientinfo).Error
-
- }
- //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()
- //defer rows.Close()
- //
- //if rows.Next() {
- // rows.Scan(&total)
- //}
-
- return patientinfo, total, err
- }
-
- // 双人核对
- func GetTodayDoubleCheckInfo(to int64, ctime int64, page int64, limit int64, admin *admin_models.AdminAccount) (patientinfo []function_models.PatientInfo, total int64, err error) {
-
- //offset := (page - 1) * limit
- if admin.IsAdmin == 1 {
- err = readUserDb.Raw("select *, a.name as admin_name, d.namepath as namepath from sgj_users.sgj_user_org as u left JOIN sgj_user_district as d On d.id = u.city left join sgj_org_follow as f On f.org_id = u.id AND f.status = 1 left JoIN sgj_admin as a On a.id = f.admin_user_id AND a.status = 1 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 <= ? AND u.import <> 1 GROUP BY x.user_org_id", to, ctime).Scan(&patientinfo).Error
-
- } else {
- err = readUserDb.Raw("select *, a.name as admin_name, d.namepath as namepath from sgj_users.sgj_user_org as u left JOIN sgj_user_district as d On d.id = u.city join sgj_org_follow as f On f.org_id = u.id AND f.admin_user_id = ? AND f.status = 1 left JoIN sgj_admin as a On a.id = f.admin_user_id AND a.status = 1 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 <= ? AND u.import <> 1 GROUP BY x.user_org_id", admin.ID, to, ctime).Scan(&patientinfo).Error
-
- }
-
- //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()
- //defer rows.Close()
- //
- //if rows.Next() {
- // rows.Scan(&total)
- //}
-
- return patientinfo, total, err
- }
-
- // 透析上机
- func GetTodayDialysisMachinek(to int64, ctime int64, page int64, limit int64, admin *admin_models.AdminAccount) (patientinfo []function_models.PatientInfo, total int64, err error) {
-
- //offset := (page - 1) * limit
- if admin.IsAdmin == 1 {
- err = readUserDb.Raw("select *, a.name as admin_name, d.namepath as namepath from sgj_users.sgj_user_org as u left JOIN sgj_user_district as d On d.id = u.city left join sgj_org_follow as f On f.org_id = u.id AND f.status = 1 left JoIN sgj_admin as a On a.id = f.admin_user_id AND a.status = 1 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 <= ? AND u.import <> 1 GROUP BY x.user_org_id", to, ctime).Scan(&patientinfo).Error
-
- } else {
-
- err = readUserDb.Raw("select *, a.name as admin_name, d.namepath as namepath from sgj_users.sgj_user_org as u left JOIN sgj_user_district as d On d.id = u.city join sgj_org_follow as f On f.org_id = u.id AND f.admin_user_id = ? AND f.status = 1 left JoIN sgj_admin as a On a.id = f.admin_user_id AND a.status = 1 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 <= ? AND u.import <> 1 GROUP BY x.user_org_id", admin.ID, to, ctime).Scan(&patientinfo).Error
-
- }
-
- //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()
- //defer rows.Close()
- //
- //if rows.Next() {
- // rows.Scan(&total)
- //}
-
- return patientinfo, total, err
- }
-
- // 透析检测
- func GetTodayDialysisExamination(to int64, ctime int64, page int64, limit int64, admin *admin_models.AdminAccount) (patientinfo []function_models.PatientInfo, total int64, err error) {
-
- //offset := (page - 1) * limit
- if admin.IsAdmin == 1 {
- err = readUserDb.Raw("select *, a.name as admin_name, d.namepath as namepath from sgj_users.sgj_user_org as u left JOIN sgj_user_district as d On d.id = u.city left join sgj_org_follow as f On f.org_id = u.id AND f.status = 1 left JoIN sgj_admin as a On a.id = f.admin_user_id AND a.status = 1 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 <= ? AND u.import <> 1 GROUP BY x.user_org_id", to, ctime).Scan(&patientinfo).Error
-
- } else {
- err = readUserDb.Raw("select *, a.name as admin_name, d.namepath as namepath from sgj_users.sgj_user_org as u left JOIN sgj_user_district as d On d.id = u.city join sgj_org_follow as f On f.org_id = u.id AND f.admin_user_id = ? AND f.status = 1 left JoIN sgj_admin as a On a.id = f.admin_user_id AND a.status = 1 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 <= ? AND u.import <> 1 GROUP BY x.user_org_id", admin.ID, to, ctime).Scan(&patientinfo).Error
-
- }
- //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()
- //defer rows.Close()
- //
- //if rows.Next() {
- // rows.Scan(&total)
- //}
-
- return patientinfo, total, err
- }
-
- // 透析下机
- func GetTodayBeforOrpenetration(to int64, ctime int64, page int64, limit int64, admin *admin_models.AdminAccount) (patientinfo []function_models.PatientInfo, total int64, err error) {
-
- //offset := (page - 1) * limit
- if admin.IsAdmin == 1 {
- err = readUserDb.Raw("select *, a.name as admin_name, d.namepath as namepath from sgj_users.sgj_user_org as u left JOIN sgj_user_district as d On d.id = u.city left join sgj_org_follow as f On f.org_id = u.id AND f.status = 1 left JoIN sgj_admin as a On a.id = f.admin_user_id AND a.status = 1 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 <= ? AND u.import <> 1 GROUP BY x.user_org_id", to, ctime).Scan(&patientinfo).Error
-
- } else {
- err = readUserDb.Raw("select *, a.name as admin_name, d.namepath as namepath from sgj_users.sgj_user_org as u left JOIN sgj_user_district as d On d.id = u.city join sgj_org_follow as f On f.org_id = u.id AND f.admin_user_id = ? AND f.status = 1 left JoIN sgj_admin as a On a.id = f.admin_user_id AND a.status = 1 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 <= ? AND u.import <> 1 GROUP BY x.user_org_id", admin.ID, to, ctime).Scan(&patientinfo).Error
-
- }
- //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()
- //defer rows.Close()
- //
- //if rows.Next() {
- // rows.Scan(&total)
- //}
-
- return patientinfo, total, err
- }
-
- // 透后评估
- func GetTodayPostAssessment(to int64, ctime int64, page int64, limit int64, admin *admin_models.AdminAccount) (patientinfo []function_models.PatientInfo, total int64, err error) {
- //offset := (page - 1) * limit
- if admin.IsAdmin == 1 {
- err = readUserDb.Raw("select *, a.name as admin_name, d.namepath as namepath from sgj_users.sgj_user_org as u left JOIN sgj_user_district as d On d.id = u.city left join sgj_org_follow as f On f.org_id = u.id AND f.status = 1 left JoIN sgj_admin as a On a.id = f.admin_user_id AND a.status = 1 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 <= ? AND u.import <> 1 GROUP BY x.user_org_id", to, ctime).Scan(&patientinfo).Error
-
- } else {
- err = readUserDb.Raw("select *, a.name as admin_name, d.namepath as namepath from sgj_users.sgj_user_org as u left JOIN sgj_user_district as d On d.id = u.city join sgj_org_follow as f On f.org_id = u.id AND f.admin_user_id = ? AND f.status = 1 left JoIN sgj_admin as a On a.id = f.admin_user_id AND a.status = 1 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 <= ? AND u.import <> 1 GROUP BY x.user_org_id", admin.ID, to, ctime).Scan(&patientinfo).Error
-
- }
-
- //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()
- //defer rows.Close()
- //
- //if rows.Next() {
- // rows.Scan(&total)
- //}
-
- return patientinfo, total, err
- }
-
- func GetTodayEntrylist(to int64, ctime int64, limit int64, page int64, admin *admin_models.AdminAccount) (patientinfo []function_models.PatientInfo, total int64, err error) {
- //offset := (page - 1) * limit
- if admin.IsAdmin == 1 {
- err = readUserDb.Raw("select *, a.name as admin_name, d.namepath as namepath from sgj_users.sgj_user_org as u left JOIN sgj_user_district as d On d.id = u.city 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 AND f.status = 1 LEFT JOIN sgj_users.sgj_admin as a on a.id = f.admin_user_id AND a.status = 1 where x.ctime >= ? AND x.ctime<= ? AND u.import <> 1 GROUP BY x.org_id", to, ctime).Scan(&patientinfo).Error
-
- } else {
- err = readUserDb.Raw("select *, a.name as admin_name, d.namepath as namepath from sgj_users.sgj_user_org as u left JOIN sgj_user_district as d On d.id = u.city join sgj_xt.xt_warehouse as x on x.org_id = u.id JOIN sgj_users.sgj_org_follow as f ON f.org_id = u.id AND f.admin_user_id = ? AND f.status = 1 LEFT JOIN sgj_users.sgj_admin as a on a.id = f.admin_user_id AND a.status = 1 where x.ctime >= ? AND x.ctime<= ? AND u.import <> 1 GROUP BY x.org_id", admin.ID, to, ctime).Scan(&patientinfo).Error
-
- }
-
- //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()
- //defer rows.Close()
- //
- //if rows.Next() {
- // rows.Scan(&total)
- //}
-
- return patientinfo, total, err
- }
-
- func GetTodayExitlist(to int64, ctime int64, limit int64, page int64, admin *admin_models.AdminAccount) (patientinfo []function_models.PatientInfo, total int64, err error) {
- //offset := (page - 1) * limit
- if admin.IsAdmin == 1 {
- err = readUserDb.Raw("select *, a.name as admin_name, d.namepath as namepath from sgj_users.sgj_user_org as u left JOIN sgj_user_district as d On d.id = u.city 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 AND f.status = 1 LEFT JOIN sgj_users.sgj_admin as a on a.id = f.admin_user_id AND a.status = 1 where x.ctime >= ? AND x.ctime<= ? AND u.import <> 1 GROUP BY x.org_id", to, ctime).Scan(&patientinfo).Error
-
- } else {
- err = readUserDb.Raw("select *, a.name as admin_name, d.namepath as namepath from sgj_users.sgj_user_org as u left JOIN sgj_user_district as d On d.id = u.city join sgj_xt.xt_warehouse_out as x on x.org_id = u.id JOIN sgj_users.sgj_org_follow as f ON f.org_id = u.id AND f.admin_user_id = ? AND f.status = 1 LEFT JOIN sgj_users.sgj_admin as a on a.id = f.admin_user_id AND a.status = 1 where x.ctime >= ? AND x.ctime<= ? AND u.import <> 1 GROUP BY x.org_id", admin.ID, to, ctime).Scan(&patientinfo).Error
-
- }
-
- //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()
- //defer rows.Close()
- //
- //if rows.Next() {
- // rows.Scan(&total)
- //}
-
- return patientinfo, total, err
- }
|