瀏覽代碼

修改bug

csx 4 年之前
父節點
當前提交
5e8a200462

+ 1 - 1
conf/app.conf 查看文件

@@ -1,6 +1,6 @@
1 1
 appname = 血透
2 2
 httpport = 9550
3
-runmode = dev
3
+runmode = prod
4 4
 
5 5
 copyrequestbody = true
6 6
 sessionon = true

+ 4 - 0
controllers/admin_api_controllers/admin_api_router_register.go 查看文件

@@ -45,4 +45,8 @@ func AdminAPIControllersRegisterRouters() {
45 45
 	beego.Router("/admin/api/followorg/list", &SystemApiController{}, "get:GetWaitFollowOrg")
46 46
 	beego.Router("/admin/api/unfolloworg/list", &SystemApiController{}, "get:GetAllFollowOrg")
47 47
 
48
+	beego.Router("/admin/api/org/list", &OrgAPIController{}, "get:GetOrgListOther")
49
+
50
+	//beego.Router("/admin/api/unfolloworg/list", &SystemApiController{}, "get:GetAllFollowOrg")
51
+
48 52
 }

+ 13 - 0
controllers/admin_api_controllers/org_api_controller.go 查看文件

@@ -322,3 +322,16 @@ func (this *OrgAPIController) GetOrgBed() {
322 322
 		"numbers": numbers,
323 323
 	})
324 324
 }
325
+
326
+func (this *OrgAPIController) GetOrgListOther() {
327
+	follow, _ := this.GetInt64("follow")
328
+
329
+	list, err := service.GetFollowOrgList(follow)
330
+	if err != nil {
331
+
332
+	} else {
333
+		this.ServeSuccessJSON(map[string]interface{}{
334
+			"list": list,
335
+		})
336
+	}
337
+}

文件差異過大導致無法顯示
+ 1018 - 1017
controllers/function_api_controllers/function_api_base_controller.go


+ 57 - 0
controllers/function_api_controllers/function_base_controller.go 查看文件

@@ -0,0 +1,57 @@
1
+package function_api_controllers
2
+
3
+import (
4
+	"XT_Admin_Api/controllers"
5
+	"XT_Admin_Api/enums"
6
+	"XT_Admin_Api/models/admin_models"
7
+)
8
+
9
+type FuntionBaseController struct {
10
+	controllers.BaseAPIController
11
+}
12
+
13
+func (this *FuntionBaseController) ErrorLog(format string, a ...interface{}) {
14
+	//beego.Error(fmt.Sprintf("[管理员后台] %v", fmt.Sprintf(format, a...)))
15
+}
16
+
17
+func (this *FuntionBaseController) WarnLog(format string, a ...interface{}) {
18
+	//beego.Warn(fmt.Sprintf("[管理员后台] %v", fmt.Sprintf(format, a...)))
19
+}
20
+
21
+func (this *FuntionBaseController) InfoLog(format string, a ...interface{}) {
22
+	//beego.Info(fmt.Sprintf("[管理员后台] %v", fmt.Sprintf(format, a...)))
23
+}
24
+
25
+func (this *FuntionBaseController) DebugLog(format string, a ...interface{}) {
26
+	//beego.Debug(fmt.Sprintf("[管理员后台] %v", fmt.Sprintf(format, a...)))
27
+}
28
+
29
+func (this *FuntionBaseController) TraceLog(format string, a ...interface{}) {
30
+	//beego.Trace(fmt.Sprintf("[管理员后台] %v", fmt.Sprintf(format, a...)))
31
+}
32
+
33
+func (this *FuntionBaseController) GetAdminInfo() *AdminInfo {
34
+	userInfo := this.GetSession("admin_info")
35
+	if userInfo == nil {
36
+		return nil
37
+	} else {
38
+		return userInfo.(*AdminInfo)
39
+	}
40
+}
41
+
42
+type AdminInfo struct {
43
+	Admin *admin_models.AdminAccount
44
+}
45
+
46
+type FunctionBaseAPIAuthController struct {
47
+	FuntionBaseController
48
+}
49
+
50
+func (this *FunctionBaseAPIAuthController) Prepare() {
51
+	this.FuntionBaseController.Prepare()
52
+	adminInfo := this.GetAdminInfo()
53
+	if adminInfo == nil {
54
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNotLogin)
55
+		this.StopRun()
56
+	}
57
+}

+ 369 - 372
models/function_models/fuction_query_models.go 查看文件

@@ -1,152 +1,151 @@
1 1
 package function_models
2 2
 
3 3
 type XtPatients struct {
4
-	ID int64 `gorm:"column:id" json:"id" form:"id"`
5
-	UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
6
-	UserId int64 `gorm:"column:user_id" json:"user_id" form:"user_id"`
7
-	Avatar string `gorm:"column:avatar" json:"avatar" form:"avatar"`
8
-	PatientType int64 `gorm:"column:patient_type" json:"patient_type" form:"patient_type"`
9
-	DialysisNo string `gorm:"column:dialysis_no" json:"dialysis_no" form:"dialysis_no"`
10
-	AdmissionNumber string `gorm:"column:admission_number" json:"admission_number" form:"admission_number"`
11
-	Source int64 `gorm:"column:source" json:"source" form:"source"`
12
-	Lapseto int64 `gorm:"column:lapseto" json:"lapseto" form:"lapseto"`
13
-	PartitionId int64 `gorm:"column:partition_id" json:"partition_id" form:"partition_id"`
14
-	BedId int64 `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
15
-	Name string `gorm:"column:name" json:"name" form:"name"`
16
-	Alias string `gorm:"column:alias" json:"alias" form:"alias"`
17
-	Gender int64 `gorm:"column:gender" json:"gender" form:"gender"`
18
-	MaritalStatus int64 `gorm:"column:marital_status" json:"marital_status" form:"marital_status"`
19
-	IdCardNo string `gorm:"column:id_card_no" json:"id_card_no" form:"id_card_no"`
20
-	Birthday int64 `gorm:"column:birthday" json:"birthday" form:"birthday"`
21
-	ReimbursementWayId int64 `gorm:"column:reimbursement_way_id" json:"reimbursement_way_id" form:"reimbursement_way_id"`
22
-	HealthCareType int64 `gorm:"column:health_care_type" json:"health_care_type" form:"health_care_type"`
23
-	HealthCareNo string `gorm:"column:health_care_no" json:"health_care_no" form:"health_care_no"`
24
-	HealthCareDueDate int64 `gorm:"column:health_care_due_date" json:"health_care_due_date" form:"health_care_due_date"`
25
-	Height int64 `gorm:"column:height" json:"height" form:"height"`
26
-	BloodType int64 `gorm:"column:blood_type" json:"blood_type" form:"blood_type"`
27
-	Rh int64 `gorm:"column:rh" json:"rh" form:"rh"`
28
-	HealthCareDueAlertDate int64 `gorm:"column:health_care_due_alert_date" json:"health_care_due_alert_date" form:"health_care_due_alert_date"`
29
-	EducationLevel int64 `gorm:"column:education_level" json:"education_level" form:"education_level"`
30
-	Profession int64 `gorm:"column:profession" json:"profession" form:"profession"`
31
-	Phone string `gorm:"column:phone" json:"phone" form:"phone"`
32
-	HomeTelephone string `gorm:"column:home_telephone" json:"home_telephone" form:"home_telephone"`
33
-	RelativePhone string `gorm:"column:relative_phone" json:"relative_phone" form:"relative_phone"`
34
-	RelativeRelations string `gorm:"column:relative_relations" json:"relative_relations" form:"relative_relations"`
35
-	HomeAddress string `gorm:"column:home_address" json:"home_address" form:"home_address"`
36
-	WorkUnit string `gorm:"column:work_unit" json:"work_unit" form:"work_unit"`
37
-	UnitAddress string `gorm:"column:unit_address" json:"unit_address" form:"unit_address"`
38
-	Children int64 `gorm:"column:children" json:"children" form:"children"`
39
-	ReceivingDate int64 `gorm:"column:receiving_date" json:"receiving_date" form:"receiving_date"`
40
-	IsHospitalFirstDialysis int64 `gorm:"column:is_hospital_first_dialysis" json:"is_hospital_first_dialysis" form:"is_hospital_first_dialysis"`
41
-	FirstDialysisDate int64 `gorm:"column:first_dialysis_date" json:"first_dialysis_date" form:"first_dialysis_date"`
42
-	FirstDialysisHospital string `gorm:"column:first_dialysis_hospital" json:"first_dialysis_hospital" form:"first_dialysis_hospital"`
43
-	PredialysisCondition string `gorm:"column:predialysis_condition" json:"predialysis_condition" form:"predialysis_condition"`
44
-	PreHospitalDialysisFrequency string `gorm:"column:pre_hospital_dialysis_frequency" json:"pre_hospital_dialysis_frequency" form:"pre_hospital_dialysis_frequency"`
45
-	PreHospitalDialysisTimes int64 `gorm:"column:pre_hospital_dialysis_times" json:"pre_hospital_dialysis_times" form:"pre_hospital_dialysis_times"`
46
-	HospitalFirstDialysisDate int64 `gorm:"column:hospital_first_dialysis_date" json:"hospital_first_dialysis_date" form:"hospital_first_dialysis_date"`
47
-	InductionPeriod int64 `gorm:"column:induction_period" json:"induction_period" form:"induction_period"`
48
-	InitialDialysis int64 `gorm:"column:initial_dialysis" json:"initial_dialysis" form:"initial_dialysis"`
49
-	TotalDialysis int64 `gorm:"column:total_dialysis" json:"total_dialysis" form:"total_dialysis"`
50
-	AttendingDoctorId int64 `gorm:"column:attending_doctor_id" json:"attending_doctor_id" form:"attending_doctor_id"`
51
-	HeadNurseId int64 `gorm:"column:head_nurse_id" json:"head_nurse_id" form:"head_nurse_id"`
52
-	Evaluate string `gorm:"column:evaluate" json:"evaluate" form:"evaluate"`
53
-	Diagnose string `gorm:"column:diagnose" json:"diagnose" form:"diagnose"`
54
-	Remark string `gorm:"column:remark" json:"remark" form:"remark"`
55
-	RegistrarsId int64 `gorm:"column:registrars_id" json:"registrars_id" form:"registrars_id"`
56
-	Registrars string `gorm:"column:registrars" json:"registrars" form:"registrars"`
57
-	QrCode string `gorm:"column:qr_code" json:"qr_code" form:"qr_code"`
58
-	BindingState int64 `gorm:"column:binding_state" json:"binding_state" form:"binding_state"`
59
-	PatientComplains string `gorm:"column:patient_complains" json:"patient_complains" form:"patient_complains"`
60
-	PresentHistory string `gorm:"column:present_history" json:"present_history" form:"present_history"`
61
-	PastHistory string `gorm:"column:past_history" json:"past_history" form:"past_history"`
62
-	Temperature float64 `gorm:"column:temperature" json:"temperature" form:"temperature"`
63
-	Pulse int64 `gorm:"column:pulse" json:"pulse" form:"pulse"`
64
-	Respiratory int64 `gorm:"column:respiratory" json:"respiratory" form:"respiratory"`
65
-	Sbp int64 `gorm:"column:sbp" json:"sbp" form:"sbp"`
66
-	Dbp int64 `gorm:"column:dbp" json:"dbp" form:"dbp"`
67
-	Status int64 `gorm:"column:status" json:"status" form:"status"`
68
-	CreatedTime int64 `gorm:"column:created_time" json:"created_time" form:"created_time"`
69
-	UpdatedTime int64 `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
70
-	Nation string `gorm:"column:nation" json:"nation" form:"nation"`
71
-	NativePlace string `gorm:"column:native_place" json:"native_place" form:"native_place"`
72
-	Age int64 `gorm:"column:age" json:"age" form:"age"`
4
+	ID                           int64   `gorm:"column:id" json:"id" form:"id"`
5
+	UserOrgId                    int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
6
+	UserId                       int64   `gorm:"column:user_id" json:"user_id" form:"user_id"`
7
+	Avatar                       string  `gorm:"column:avatar" json:"avatar" form:"avatar"`
8
+	PatientType                  int64   `gorm:"column:patient_type" json:"patient_type" form:"patient_type"`
9
+	DialysisNo                   string  `gorm:"column:dialysis_no" json:"dialysis_no" form:"dialysis_no"`
10
+	AdmissionNumber              string  `gorm:"column:admission_number" json:"admission_number" form:"admission_number"`
11
+	Source                       int64   `gorm:"column:source" json:"source" form:"source"`
12
+	Lapseto                      int64   `gorm:"column:lapseto" json:"lapseto" form:"lapseto"`
13
+	PartitionId                  int64   `gorm:"column:partition_id" json:"partition_id" form:"partition_id"`
14
+	BedId                        int64   `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
15
+	Name                         string  `gorm:"column:name" json:"name" form:"name"`
16
+	Alias                        string  `gorm:"column:alias" json:"alias" form:"alias"`
17
+	Gender                       int64   `gorm:"column:gender" json:"gender" form:"gender"`
18
+	MaritalStatus                int64   `gorm:"column:marital_status" json:"marital_status" form:"marital_status"`
19
+	IdCardNo                     string  `gorm:"column:id_card_no" json:"id_card_no" form:"id_card_no"`
20
+	Birthday                     int64   `gorm:"column:birthday" json:"birthday" form:"birthday"`
21
+	ReimbursementWayId           int64   `gorm:"column:reimbursement_way_id" json:"reimbursement_way_id" form:"reimbursement_way_id"`
22
+	HealthCareType               int64   `gorm:"column:health_care_type" json:"health_care_type" form:"health_care_type"`
23
+	HealthCareNo                 string  `gorm:"column:health_care_no" json:"health_care_no" form:"health_care_no"`
24
+	HealthCareDueDate            int64   `gorm:"column:health_care_due_date" json:"health_care_due_date" form:"health_care_due_date"`
25
+	Height                       int64   `gorm:"column:height" json:"height" form:"height"`
26
+	BloodType                    int64   `gorm:"column:blood_type" json:"blood_type" form:"blood_type"`
27
+	Rh                           int64   `gorm:"column:rh" json:"rh" form:"rh"`
28
+	HealthCareDueAlertDate       int64   `gorm:"column:health_care_due_alert_date" json:"health_care_due_alert_date" form:"health_care_due_alert_date"`
29
+	EducationLevel               int64   `gorm:"column:education_level" json:"education_level" form:"education_level"`
30
+	Profession                   int64   `gorm:"column:profession" json:"profession" form:"profession"`
31
+	Phone                        string  `gorm:"column:phone" json:"phone" form:"phone"`
32
+	HomeTelephone                string  `gorm:"column:home_telephone" json:"home_telephone" form:"home_telephone"`
33
+	RelativePhone                string  `gorm:"column:relative_phone" json:"relative_phone" form:"relative_phone"`
34
+	RelativeRelations            string  `gorm:"column:relative_relations" json:"relative_relations" form:"relative_relations"`
35
+	HomeAddress                  string  `gorm:"column:home_address" json:"home_address" form:"home_address"`
36
+	WorkUnit                     string  `gorm:"column:work_unit" json:"work_unit" form:"work_unit"`
37
+	UnitAddress                  string  `gorm:"column:unit_address" json:"unit_address" form:"unit_address"`
38
+	Children                     int64   `gorm:"column:children" json:"children" form:"children"`
39
+	ReceivingDate                int64   `gorm:"column:receiving_date" json:"receiving_date" form:"receiving_date"`
40
+	IsHospitalFirstDialysis      int64   `gorm:"column:is_hospital_first_dialysis" json:"is_hospital_first_dialysis" form:"is_hospital_first_dialysis"`
41
+	FirstDialysisDate            int64   `gorm:"column:first_dialysis_date" json:"first_dialysis_date" form:"first_dialysis_date"`
42
+	FirstDialysisHospital        string  `gorm:"column:first_dialysis_hospital" json:"first_dialysis_hospital" form:"first_dialysis_hospital"`
43
+	PredialysisCondition         string  `gorm:"column:predialysis_condition" json:"predialysis_condition" form:"predialysis_condition"`
44
+	PreHospitalDialysisFrequency string  `gorm:"column:pre_hospital_dialysis_frequency" json:"pre_hospital_dialysis_frequency" form:"pre_hospital_dialysis_frequency"`
45
+	PreHospitalDialysisTimes     int64   `gorm:"column:pre_hospital_dialysis_times" json:"pre_hospital_dialysis_times" form:"pre_hospital_dialysis_times"`
46
+	HospitalFirstDialysisDate    int64   `gorm:"column:hospital_first_dialysis_date" json:"hospital_first_dialysis_date" form:"hospital_first_dialysis_date"`
47
+	InductionPeriod              int64   `gorm:"column:induction_period" json:"induction_period" form:"induction_period"`
48
+	InitialDialysis              int64   `gorm:"column:initial_dialysis" json:"initial_dialysis" form:"initial_dialysis"`
49
+	TotalDialysis                int64   `gorm:"column:total_dialysis" json:"total_dialysis" form:"total_dialysis"`
50
+	AttendingDoctorId            int64   `gorm:"column:attending_doctor_id" json:"attending_doctor_id" form:"attending_doctor_id"`
51
+	HeadNurseId                  int64   `gorm:"column:head_nurse_id" json:"head_nurse_id" form:"head_nurse_id"`
52
+	Evaluate                     string  `gorm:"column:evaluate" json:"evaluate" form:"evaluate"`
53
+	Diagnose                     string  `gorm:"column:diagnose" json:"diagnose" form:"diagnose"`
54
+	Remark                       string  `gorm:"column:remark" json:"remark" form:"remark"`
55
+	RegistrarsId                 int64   `gorm:"column:registrars_id" json:"registrars_id" form:"registrars_id"`
56
+	Registrars                   string  `gorm:"column:registrars" json:"registrars" form:"registrars"`
57
+	QrCode                       string  `gorm:"column:qr_code" json:"qr_code" form:"qr_code"`
58
+	BindingState                 int64   `gorm:"column:binding_state" json:"binding_state" form:"binding_state"`
59
+	PatientComplains             string  `gorm:"column:patient_complains" json:"patient_complains" form:"patient_complains"`
60
+	PresentHistory               string  `gorm:"column:present_history" json:"present_history" form:"present_history"`
61
+	PastHistory                  string  `gorm:"column:past_history" json:"past_history" form:"past_history"`
62
+	Temperature                  float64 `gorm:"column:temperature" json:"temperature" form:"temperature"`
63
+	Pulse                        int64   `gorm:"column:pulse" json:"pulse" form:"pulse"`
64
+	Respiratory                  int64   `gorm:"column:respiratory" json:"respiratory" form:"respiratory"`
65
+	Sbp                          int64   `gorm:"column:sbp" json:"sbp" form:"sbp"`
66
+	Dbp                          int64   `gorm:"column:dbp" json:"dbp" form:"dbp"`
67
+	Status                       int64   `gorm:"column:status" json:"status" form:"status"`
68
+	CreatedTime                  int64   `gorm:"column:created_time" json:"created_time" form:"created_time"`
69
+	UpdatedTime                  int64   `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
70
+	Nation                       string  `gorm:"column:nation" json:"nation" form:"nation"`
71
+	NativePlace                  string  `gorm:"column:native_place" json:"native_place" form:"native_place"`
72
+	Age                          int64   `gorm:"column:age" json:"age" form:"age"`
73 73
 }
74 74
 
75 75
 func (XtPatients) TableName() string {
76 76
 	return "xt_patients"
77 77
 }
78 78
 
79
-
80 79
 type XtDialysisPrescription struct {
81
-	ID int64 `gorm:"column:id" json:"id" form:"id"`
82
-	UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
83
-	PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
84
-	Dialyzer int64 `gorm:"column:dialyzer" json:"dialyzer" form:"dialyzer"`
85
-	MachineType string `gorm:"column:machine_type" json:"machine_type" form:"machine_type"`
86
-	DewaterAmount float64 `gorm:"column:dewater_amount" json:"dewater_amount" form:"dewater_amount"`
87
-	DialyzerPerfusionApparatus string `gorm:"column:dialyzer_perfusion_apparatus" json:"dialyzer_perfusion_apparatus" form:"dialyzer_perfusion_apparatus"`
88
-	PrescriptionDewatering float64 `gorm:"column:prescription_dewatering" json:"prescription_dewatering" form:"prescription_dewatering"`
89
-	Anticoagulant int64 `gorm:"column:anticoagulant" json:"anticoagulant" form:"anticoagulant"`
90
-	AnticoagulantShouji float64 `gorm:"column:anticoagulant_shouji" json:"anticoagulant_shouji" form:"anticoagulant_shouji"`
91
-	AnticoagulantWeichi float64 `gorm:"column:anticoagulant_weichi" json:"anticoagulant_weichi" form:"anticoagulant_weichi"`
92
-	AnticoagulantZongliang float64 `gorm:"column:anticoagulant_zongliang" json:"anticoagulant_zongliang" form:"anticoagulant_zongliang"`
93
-	AnticoagulantGaimingcheng string `gorm:"column:anticoagulant_gaimingcheng" json:"anticoagulant_gaimingcheng" form:"anticoagulant_gaimingcheng"`
94
-	AnticoagulantGaijiliang string `gorm:"column:anticoagulant_gaijiliang" json:"anticoagulant_gaijiliang" form:"anticoagulant_gaijiliang"`
95
-	ModeId int64 `gorm:"column:mode_id" json:"mode_id" form:"mode_id"`
96
-	DialysisDurationHour int64 `gorm:"column:dialysis_duration_hour" json:"dialysis_duration_hour" form:"dialysis_duration_hour"`
97
-	DialysisDurationMinute int64 `gorm:"column:dialysis_duration_minute" json:"dialysis_duration_minute" form:"dialysis_duration_minute"`
98
-	DialysisDuration float64 `gorm:"column:dialysis_duration" json:"dialysis_duration" form:"dialysis_duration"`
99
-	ReplacementTotal float64 `gorm:"column:replacement_total" json:"replacement_total" form:"replacement_total"`
100
-	ReplacementWay int64 `gorm:"column:replacement_way" json:"replacement_way" form:"replacement_way"`
101
-	HemodialysisMachine int64 `gorm:"column:hemodialysis_machine" json:"hemodialysis_machine" form:"hemodialysis_machine"`
102
-	BloodFilter int64 `gorm:"column:blood_filter" json:"blood_filter" form:"blood_filter"`
103
-	PerfusionApparatus int64 `gorm:"column:perfusion_apparatus" json:"perfusion_apparatus" form:"perfusion_apparatus"`
104
-	DryWeight float64 `gorm:"column:dry_weight" json:"dry_weight" form:"dry_weight"`
105
-	VascularAccessMode int64 `gorm:"column:vascular_access_mode" json:"vascular_access_mode" form:"vascular_access_mode"`
106
-	VascularAccess int64 `gorm:"column:vascular_access" json:"vascular_access" form:"vascular_access"`
107
-	BloodFlowVolume float64 `gorm:"column:blood_flow_volume" json:"blood_flow_volume" form:"blood_flow_volume"`
108
-	DialysateFlow float64 `gorm:"column:dialysate_flow" json:"dialysate_flow" form:"dialysate_flow"`
109
-	DisplaceLiqui float64 `gorm:"column:displace_liqui" json:"displace_liqui" form:"displace_liqui"`
110
-	Kalium float64 `gorm:"column:kalium" json:"kalium" form:"kalium"`
111
-	Sodium float64 `gorm:"column:sodium" json:"sodium" form:"sodium"`
112
-	Calcium float64 `gorm:"column:calcium" json:"calcium" form:"calcium"`
113
-	Bicarbonate float64 `gorm:"column:bicarbonate" json:"bicarbonate" form:"bicarbonate"`
114
-	Glucose float64 `gorm:"column:glucose" json:"glucose" form:"glucose"`
115
-	DialysateTemperature float64 `gorm:"column:dialysate_temperature" json:"dialysate_temperature" form:"dialysate_temperature"`
116
-	Conductivity float64 `gorm:"column:conductivity" json:"conductivity" form:"conductivity"`
117
-	PrescriptionDoctor int64 `gorm:"column:prescription_doctor" json:"prescription_doctor" form:"prescription_doctor"`
118
-	Creater int64 `gorm:"column:creater" json:"creater" form:"creater"`
119
-	Modifier int64 `gorm:"column:modifier" json:"modifier" form:"modifier"`
120
-	Remark string `gorm:"column:remark" json:"remark" form:"remark"`
121
-	Status int64 `gorm:"column:status" json:"status" form:"status"`
122
-	CreatedTime int64 `gorm:"column:created_time" json:"created_time" form:"created_time"`
123
-	UpdatedTime int64 `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
124
-	RecordDate int64 `gorm:"column:record_date" json:"record_date" form:"record_date"`
125
-	RecordId int64 `gorm:"column:record_id" json:"record_id" form:"record_id"`
126
-	TargetUltrafiltration float64 `gorm:"column:target_ultrafiltration" json:"target_ultrafiltration" form:"target_ultrafiltration"`
127
-	DialysateFormulation int64 `gorm:"column:dialysate_formulation" json:"dialysate_formulation" form:"dialysate_formulation"`
128
-	BodyFluid int64 `gorm:"column:body_fluid" json:"body_fluid" form:"body_fluid"`
129
-	SpecialMedicine int64 `gorm:"column:special_medicine" json:"special_medicine" form:"special_medicine"`
130
-	SpecialMedicineOther string `gorm:"column:special_medicine_other" json:"special_medicine_other" form:"special_medicine_other"`
131
-	DisplaceLiquiPart int64 `gorm:"column:displace_liqui_part" json:"displace_liqui_part" form:"displace_liqui_part"`
132
-	BloodAccess int64 `gorm:"column:blood_access" json:"blood_access" form:"blood_access"`
133
-	DisplaceLiquiValue float64 `gorm:"column:displace_liqui_value" json:"displace_liqui_value" form:"displace_liqui_value"`
134
-	Ultrafiltration float64 `gorm:"column:ultrafiltration" json:"ultrafiltration" form:"ultrafiltration"`
135
-	BodyFluidOther string `gorm:"column:body_fluid_other" json:"body_fluid_other" form:"body_fluid_other"`
136
-	Niprocart int64 `gorm:"column:niprocart" json:"niprocart" form:"niprocart"`
137
-	Jms int64 `gorm:"column:jms" json:"jms" form:"jms"`
138
-	FistulaNeedleSet int64 `gorm:"column:fistula_needle_set" json:"fistula_needle_set" form:"fistula_needle_set"`
139
-	FistulaNeedleSet16 int64 `gorm:"column:fistula_needle_set_16" json:"fistula_needle_set_16" form:"fistula_needle_set_16"`
140
-	Hemoperfusion int64 `gorm:"column:hemoperfusion" json:"hemoperfusion" form:"hemoperfusion"`
141
-	DialyserSterilised int64 `gorm:"column:dialyser_sterilised" json:"dialyser_sterilised" form:"dialyser_sterilised"`
142
-	Filtryzer int64 `gorm:"column:filtryzer" json:"filtryzer" form:"filtryzer"`
143
-	TargetKtv float64 `gorm:"column:target_ktv" json:"target_ktv" form:"target_ktv"`
144
-	Dialyzers int64 `gorm:"column:dialyzers" json:"dialyzers" form:"dialyzers"`
145
-	Injector int64 `gorm:"column:injector" json:"injector" form:"injector"`
146
-	Bloodlines int64 `gorm:"column:bloodlines" json:"bloodlines" form:"bloodlines"`
147
-	TubingHemodialysis int64 `gorm:"column:tubing_hemodialysis" json:"tubing_hemodialysis" form:"tubing_hemodialysis"`
148
-	Package int64 `gorm:"column:package" json:"package" form:"package"`
149
-	ALiquid int64 `gorm:"column:a_liquid" json:"a_liquid" form:"a_liquid"`
80
+	ID                         int64   `gorm:"column:id" json:"id" form:"id"`
81
+	UserOrgId                  int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
82
+	PatientId                  int64   `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
83
+	Dialyzer                   int64   `gorm:"column:dialyzer" json:"dialyzer" form:"dialyzer"`
84
+	MachineType                string  `gorm:"column:machine_type" json:"machine_type" form:"machine_type"`
85
+	DewaterAmount              float64 `gorm:"column:dewater_amount" json:"dewater_amount" form:"dewater_amount"`
86
+	DialyzerPerfusionApparatus string  `gorm:"column:dialyzer_perfusion_apparatus" json:"dialyzer_perfusion_apparatus" form:"dialyzer_perfusion_apparatus"`
87
+	PrescriptionDewatering     float64 `gorm:"column:prescription_dewatering" json:"prescription_dewatering" form:"prescription_dewatering"`
88
+	Anticoagulant              int64   `gorm:"column:anticoagulant" json:"anticoagulant" form:"anticoagulant"`
89
+	AnticoagulantShouji        float64 `gorm:"column:anticoagulant_shouji" json:"anticoagulant_shouji" form:"anticoagulant_shouji"`
90
+	AnticoagulantWeichi        float64 `gorm:"column:anticoagulant_weichi" json:"anticoagulant_weichi" form:"anticoagulant_weichi"`
91
+	AnticoagulantZongliang     float64 `gorm:"column:anticoagulant_zongliang" json:"anticoagulant_zongliang" form:"anticoagulant_zongliang"`
92
+	AnticoagulantGaimingcheng  string  `gorm:"column:anticoagulant_gaimingcheng" json:"anticoagulant_gaimingcheng" form:"anticoagulant_gaimingcheng"`
93
+	AnticoagulantGaijiliang    string  `gorm:"column:anticoagulant_gaijiliang" json:"anticoagulant_gaijiliang" form:"anticoagulant_gaijiliang"`
94
+	ModeId                     int64   `gorm:"column:mode_id" json:"mode_id" form:"mode_id"`
95
+	DialysisDurationHour       int64   `gorm:"column:dialysis_duration_hour" json:"dialysis_duration_hour" form:"dialysis_duration_hour"`
96
+	DialysisDurationMinute     int64   `gorm:"column:dialysis_duration_minute" json:"dialysis_duration_minute" form:"dialysis_duration_minute"`
97
+	DialysisDuration           float64 `gorm:"column:dialysis_duration" json:"dialysis_duration" form:"dialysis_duration"`
98
+	ReplacementTotal           float64 `gorm:"column:replacement_total" json:"replacement_total" form:"replacement_total"`
99
+	ReplacementWay             int64   `gorm:"column:replacement_way" json:"replacement_way" form:"replacement_way"`
100
+	HemodialysisMachine        int64   `gorm:"column:hemodialysis_machine" json:"hemodialysis_machine" form:"hemodialysis_machine"`
101
+	BloodFilter                int64   `gorm:"column:blood_filter" json:"blood_filter" form:"blood_filter"`
102
+	PerfusionApparatus         int64   `gorm:"column:perfusion_apparatus" json:"perfusion_apparatus" form:"perfusion_apparatus"`
103
+	DryWeight                  float64 `gorm:"column:dry_weight" json:"dry_weight" form:"dry_weight"`
104
+	VascularAccessMode         int64   `gorm:"column:vascular_access_mode" json:"vascular_access_mode" form:"vascular_access_mode"`
105
+	VascularAccess             int64   `gorm:"column:vascular_access" json:"vascular_access" form:"vascular_access"`
106
+	BloodFlowVolume            float64 `gorm:"column:blood_flow_volume" json:"blood_flow_volume" form:"blood_flow_volume"`
107
+	DialysateFlow              float64 `gorm:"column:dialysate_flow" json:"dialysate_flow" form:"dialysate_flow"`
108
+	DisplaceLiqui              float64 `gorm:"column:displace_liqui" json:"displace_liqui" form:"displace_liqui"`
109
+	Kalium                     float64 `gorm:"column:kalium" json:"kalium" form:"kalium"`
110
+	Sodium                     float64 `gorm:"column:sodium" json:"sodium" form:"sodium"`
111
+	Calcium                    float64 `gorm:"column:calcium" json:"calcium" form:"calcium"`
112
+	Bicarbonate                float64 `gorm:"column:bicarbonate" json:"bicarbonate" form:"bicarbonate"`
113
+	Glucose                    float64 `gorm:"column:glucose" json:"glucose" form:"glucose"`
114
+	DialysateTemperature       float64 `gorm:"column:dialysate_temperature" json:"dialysate_temperature" form:"dialysate_temperature"`
115
+	Conductivity               float64 `gorm:"column:conductivity" json:"conductivity" form:"conductivity"`
116
+	PrescriptionDoctor         int64   `gorm:"column:prescription_doctor" json:"prescription_doctor" form:"prescription_doctor"`
117
+	Creater                    int64   `gorm:"column:creater" json:"creater" form:"creater"`
118
+	Modifier                   int64   `gorm:"column:modifier" json:"modifier" form:"modifier"`
119
+	Remark                     string  `gorm:"column:remark" json:"remark" form:"remark"`
120
+	Status                     int64   `gorm:"column:status" json:"status" form:"status"`
121
+	CreatedTime                int64   `gorm:"column:created_time" json:"created_time" form:"created_time"`
122
+	UpdatedTime                int64   `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
123
+	RecordDate                 int64   `gorm:"column:record_date" json:"record_date" form:"record_date"`
124
+	RecordId                   int64   `gorm:"column:record_id" json:"record_id" form:"record_id"`
125
+	TargetUltrafiltration      float64 `gorm:"column:target_ultrafiltration" json:"target_ultrafiltration" form:"target_ultrafiltration"`
126
+	DialysateFormulation       int64   `gorm:"column:dialysate_formulation" json:"dialysate_formulation" form:"dialysate_formulation"`
127
+	BodyFluid                  int64   `gorm:"column:body_fluid" json:"body_fluid" form:"body_fluid"`
128
+	SpecialMedicine            int64   `gorm:"column:special_medicine" json:"special_medicine" form:"special_medicine"`
129
+	SpecialMedicineOther       string  `gorm:"column:special_medicine_other" json:"special_medicine_other" form:"special_medicine_other"`
130
+	DisplaceLiquiPart          int64   `gorm:"column:displace_liqui_part" json:"displace_liqui_part" form:"displace_liqui_part"`
131
+	BloodAccess                int64   `gorm:"column:blood_access" json:"blood_access" form:"blood_access"`
132
+	DisplaceLiquiValue         float64 `gorm:"column:displace_liqui_value" json:"displace_liqui_value" form:"displace_liqui_value"`
133
+	Ultrafiltration            float64 `gorm:"column:ultrafiltration" json:"ultrafiltration" form:"ultrafiltration"`
134
+	BodyFluidOther             string  `gorm:"column:body_fluid_other" json:"body_fluid_other" form:"body_fluid_other"`
135
+	Niprocart                  int64   `gorm:"column:niprocart" json:"niprocart" form:"niprocart"`
136
+	Jms                        int64   `gorm:"column:jms" json:"jms" form:"jms"`
137
+	FistulaNeedleSet           int64   `gorm:"column:fistula_needle_set" json:"fistula_needle_set" form:"fistula_needle_set"`
138
+	FistulaNeedleSet16         int64   `gorm:"column:fistula_needle_set_16" json:"fistula_needle_set_16" form:"fistula_needle_set_16"`
139
+	Hemoperfusion              int64   `gorm:"column:hemoperfusion" json:"hemoperfusion" form:"hemoperfusion"`
140
+	DialyserSterilised         int64   `gorm:"column:dialyser_sterilised" json:"dialyser_sterilised" form:"dialyser_sterilised"`
141
+	Filtryzer                  int64   `gorm:"column:filtryzer" json:"filtryzer" form:"filtryzer"`
142
+	TargetKtv                  float64 `gorm:"column:target_ktv" json:"target_ktv" form:"target_ktv"`
143
+	Dialyzers                  int64   `gorm:"column:dialyzers" json:"dialyzers" form:"dialyzers"`
144
+	Injector                   int64   `gorm:"column:injector" json:"injector" form:"injector"`
145
+	Bloodlines                 int64   `gorm:"column:bloodlines" json:"bloodlines" form:"bloodlines"`
146
+	TubingHemodialysis         int64   `gorm:"column:tubing_hemodialysis" json:"tubing_hemodialysis" form:"tubing_hemodialysis"`
147
+	Package                    int64   `gorm:"column:package" json:"package" form:"package"`
148
+	ALiquid                    int64   `gorm:"column:a_liquid" json:"a_liquid" form:"a_liquid"`
150 149
 }
151 150
 
152 151
 func (XtDialysisPrescription) TableName() string {
@@ -154,109 +153,107 @@ func (XtDialysisPrescription) TableName() string {
154 153
 }
155 154
 
156 155
 type XtReceiveTreatmentAsses struct {
157
-	ID int64 `gorm:"column:id" json:"id" form:"id"`
158
-	Way int64 `gorm:"column:way" json:"way" form:"way"`
159
-	Consciousness int64 `gorm:"column:consciousness" json:"consciousness" form:"consciousness"`
160
-	Appetite int64 `gorm:"column:appetite" json:"appetite" form:"appetite"`
161
-	Condition int64 `gorm:"column:condition" json:"condition" form:"condition"`
162
-	Creater int64 `gorm:"column:creater" json:"creater" form:"creater"`
163
-	Posture int64 `gorm:"column:posture" json:"posture" form:"posture"`
164
-	CreatedTime int64 `gorm:"column:created_time" json:"created_time" form:"created_time"`
165
-	UpdateTime int64 `gorm:"column:update_time" json:"update_time" form:"update_time"`
166
-	RecordId int64 `gorm:"column:record_id" json:"record_id" form:"record_id"`
167
-	RecordDate int64 `gorm:"column:record_date" json:"record_date" form:"record_date"`
168
-	Modifier int64 `gorm:"column:modifier" json:"modifier" form:"modifier"`
169
-	Status int64 `gorm:"column:status" json:"status" form:"status"`
170
-	UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
171
-	PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
172
-	SickCondition int64 `gorm:"column:sick_condition" json:"sick_condition" form:"sick_condition"`
173
-	SickConditionOther string `gorm:"column:sick_condition_other" json:"sick_condition_other" form:"sick_condition_other"`
174
-	DangerLevel int64 `gorm:"column:danger_level" json:"danger_level" form:"danger_level"`
175
-	Intake int64 `gorm:"column:intake" json:"intake" form:"intake"`
176
-	Nutrition int64 `gorm:"column:nutrition" json:"nutrition" form:"nutrition"`
177
-	PsychologicalAssessment int64 `gorm:"column:psychological_assessment" json:"psychological_assessment" form:"psychological_assessment"`
156
+	ID                           int64  `gorm:"column:id" json:"id" form:"id"`
157
+	Way                          int64  `gorm:"column:way" json:"way" form:"way"`
158
+	Consciousness                int64  `gorm:"column:consciousness" json:"consciousness" form:"consciousness"`
159
+	Appetite                     int64  `gorm:"column:appetite" json:"appetite" form:"appetite"`
160
+	Condition                    int64  `gorm:"column:condition" json:"condition" form:"condition"`
161
+	Creater                      int64  `gorm:"column:creater" json:"creater" form:"creater"`
162
+	Posture                      int64  `gorm:"column:posture" json:"posture" form:"posture"`
163
+	CreatedTime                  int64  `gorm:"column:created_time" json:"created_time" form:"created_time"`
164
+	UpdateTime                   int64  `gorm:"column:update_time" json:"update_time" form:"update_time"`
165
+	RecordId                     int64  `gorm:"column:record_id" json:"record_id" form:"record_id"`
166
+	RecordDate                   int64  `gorm:"column:record_date" json:"record_date" form:"record_date"`
167
+	Modifier                     int64  `gorm:"column:modifier" json:"modifier" form:"modifier"`
168
+	Status                       int64  `gorm:"column:status" json:"status" form:"status"`
169
+	UserOrgId                    int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
170
+	PatientId                    int64  `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
171
+	SickCondition                int64  `gorm:"column:sick_condition" json:"sick_condition" form:"sick_condition"`
172
+	SickConditionOther           string `gorm:"column:sick_condition_other" json:"sick_condition_other" form:"sick_condition_other"`
173
+	DangerLevel                  int64  `gorm:"column:danger_level" json:"danger_level" form:"danger_level"`
174
+	Intake                       int64  `gorm:"column:intake" json:"intake" form:"intake"`
175
+	Nutrition                    int64  `gorm:"column:nutrition" json:"nutrition" form:"nutrition"`
176
+	PsychologicalAssessment      int64  `gorm:"column:psychological_assessment" json:"psychological_assessment" form:"psychological_assessment"`
178 177
 	PsychologicalAssessmentOther string `gorm:"column:psychological_assessment_other" json:"psychological_assessment_other" form:"psychological_assessment_other"`
179
-	IsPrecaution int64 `gorm:"column:is_precaution" json:"is_precaution" form:"is_precaution"`
180
-	Score string `gorm:"column:score" json:"score" form:"score"`
181
-	Precaution int64 `gorm:"column:precaution" json:"precaution" form:"precaution"`
182
-	PrecautionOther string `gorm:"column:precaution_other" json:"precaution_other" form:"precaution_other"`
183
-	PsychologicalOther string `gorm:"column:psychological_other" json:"psychological_other" form:"psychological_other"`
178
+	IsPrecaution                 int64  `gorm:"column:is_precaution" json:"is_precaution" form:"is_precaution"`
179
+	Score                        string `gorm:"column:score" json:"score" form:"score"`
180
+	Precaution                   int64  `gorm:"column:precaution" json:"precaution" form:"precaution"`
181
+	PrecautionOther              string `gorm:"column:precaution_other" json:"precaution_other" form:"precaution_other"`
182
+	PsychologicalOther           string `gorm:"column:psychological_other" json:"psychological_other" form:"psychological_other"`
184 183
 }
185 184
 
186 185
 func (XtReceiveTreatmentAsses) TableName() string {
187 186
 	return "xt_receive_treatement_asses"
188 187
 }
189 188
 
190
-
191 189
 type XtAssessmentBeforeDislysis struct {
192
-	ID int64 `gorm:"column:id" json:"id" form:"id"`
193
-	UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
194
-	PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
195
-	AssessmentDate int64 `gorm:"column:assessment_date" json:"assessment_date" form:"assessment_date"`
196
-	DialysisOrderId int64 `gorm:"column:dialysis_order_id" json:"dialysis_order_id" form:"dialysis_order_id"`
197
-	Temperature float64 `gorm:"column:temperature" json:"temperature" form:"temperature"`
198
-	PulseFrequency float64 `gorm:"column:pulse_frequency" json:"pulse_frequency" form:"pulse_frequency"`
199
-	BreathingRate float64 `gorm:"column:breathing_rate" json:"breathing_rate" form:"breathing_rate"`
200
-	SystolicBloodPressure float64 `gorm:"column:systolic_blood_pressure" json:"systolic_blood_pressure" form:"systolic_blood_pressure"`
201
-	DiastolicBloodPressure float64 `gorm:"column:diastolic_blood_pressure" json:"diastolic_blood_pressure" form:"diastolic_blood_pressure"`
202
-	BloodPressureType int64 `gorm:"column:blood_pressure_type" json:"blood_pressure_type" form:"blood_pressure_type"`
203
-	DryWeight float64 `gorm:"column:dry_weight" json:"dry_weight" form:"dry_weight"`
204
-	WeightAfterLastTransparency float64 `gorm:"column:weight_after_last_transparency" json:"weight_after_last_transparency" form:"weight_after_last_transparency"`
205
-	WeighingWay string `gorm:"column:weighing_way" json:"weighing_way" form:"weighing_way"`
206
-	WeighingBefore float64 `gorm:"column:weighing_before" json:"weighing_before" form:"weighing_before"`
207
-	AdditionalWeight float64 `gorm:"column:additional_weight" json:"additional_weight" form:"additional_weight"`
208
-	WeightBefore float64 `gorm:"column:weight_before" json:"weight_before" form:"weight_before"`
209
-	WeightGain float64 `gorm:"column:weight_gain" json:"weight_gain" form:"weight_gain"`
210
-	PreloadedDewatering float64 `gorm:"column:preloaded_dewatering" json:"preloaded_dewatering" form:"preloaded_dewatering"`
211
-	UltrafiltrationAmount float64 `gorm:"column:ultrafiltration_amount" json:"ultrafiltration_amount" form:"ultrafiltration_amount"`
212
-	DialysisInterphase string `gorm:"column:dialysis_interphase" json:"dialysis_interphase" form:"dialysis_interphase"`
213
-	LastPostDialysis string `gorm:"column:last_post_dialysis" json:"last_post_dialysis" form:"last_post_dialysis"`
214
-	SymptomBeforeDialysis string `gorm:"column:symptom_before_dialysis" json:"symptom_before_dialysis" form:"symptom_before_dialysis"`
215
-	InternalFistula string `gorm:"column:internal_fistula" json:"internal_fistula" form:"internal_fistula"`
216
-	InternalFistulaSkin string `gorm:"column:internal_fistula_skin" json:"internal_fistula_skin" form:"internal_fistula_skin"`
217
-	CatheterBend int64 `gorm:"column:catheter_bend" json:"catheter_bend" form:"catheter_bend"`
218
-	Catheter string `gorm:"column:catheter" json:"catheter" form:"catheter"`
219
-	Complication string `gorm:"column:complication" json:"complication" form:"complication"`
220
-	Evaluator int64 `gorm:"column:evaluator" json:"evaluator" form:"evaluator"`
221
-	Creater int64 `gorm:"column:creater" json:"creater" form:"creater"`
222
-	Remark string `gorm:"column:remark" json:"remark" form:"remark"`
223
-	Status int64 `gorm:"column:status" json:"status" form:"status"`
224
-	CreatedTime int64 `gorm:"column:created_time" json:"created_time" form:"created_time"`
225
-	UpdatedTime int64 `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
226
-	Modifier int64 `gorm:"column:modifier" json:"modifier" form:"modifier"`
227
-	BloodAccessPartId int64 `gorm:"column:blood_access_part_id" json:"blood_access_part_id" form:"blood_access_part_id"`
228
-	BloodAccessPartOperaId int64 `gorm:"column:blood_access_part_opera_id" json:"blood_access_part_opera_id" form:"blood_access_part_opera_id"`
229
-	IsHemorrhage int64 `gorm:"column:is_hemorrhage" json:"is_hemorrhage" form:"is_hemorrhage"`
230
-	Hemorrhage string `gorm:"column:hemorrhage" json:"hemorrhage" form:"hemorrhage"`
231
-	HemorrhageOther string `gorm:"column:hemorrhage_other" json:"hemorrhage_other" form:"hemorrhage_other"`
232
-	PunctureMethod string `gorm:"column:puncture_method" json:"puncture_method" form:"puncture_method"`
233
-	BloodAccessInternalFistula string `gorm:"column:blood_access_internal_fistula" json:"blood_access_internal_fistula" form:"blood_access_internal_fistula"`
234
-	InternalFistulaOther string `gorm:"column:internal_fistula_other" json:"internal_fistula_other" form:"internal_fistula_other"`
235
-	BloodAccessNoise int64 `gorm:"column:blood_access_noise" json:"blood_access_noise" form:"blood_access_noise"`
236
-	PunctureWay int64 `gorm:"column:puncture_way" json:"puncture_way" form:"puncture_way"`
237
-	VenousCatheterization int64 `gorm:"column:venous_catheterization" json:"venous_catheterization" form:"venous_catheterization"`
238
-	VenousCatheterizationPart int64 `gorm:"column:venous_catheterization_part" json:"venous_catheterization_part" form:"venous_catheterization_part"`
239
-	VenousCatheterizationPartOther string `gorm:"column:venous_catheterization_part_other" json:"venous_catheterization_part_other" form:"venous_catheterization_part_other"`
240
-	DuctusArantii string `gorm:"column:ductus_arantii" json:"ductus_arantii" form:"ductus_arantii"`
241
-	EmergencyTreatment int64 `gorm:"column:emergency_treatment" json:"emergency_treatment" form:"emergency_treatment"`
242
-	EmergencyTreatmentOther string `gorm:"column:emergency_treatment_other" json:"emergency_treatment_other" form:"emergency_treatment_other"`
243
-	DialysisCount int64 `gorm:"column:dialysis_count" json:"dialysis_count" form:"dialysis_count"`
244
-	AssessmentDoctor int64 `gorm:"column:assessment_doctor" json:"assessment_doctor" form:"assessment_doctor"`
245
-	AssessmentTime int64 `gorm:"column:assessment_time" json:"assessment_time" form:"assessment_time"`
246
-	MachineType string `gorm:"column:machine_type" json:"machine_type" form:"machine_type"`
247
-	IsInfect int64 `gorm:"column:is_infect" json:"is_infect" form:"is_infect"`
248
-	Exposed float64 `gorm:"column:exposed" json:"exposed" form:"exposed"`
249
-	Skin int64 `gorm:"column:skin" json:"skin" form:"skin"`
250
-	SkinOther string `gorm:"column:skin_other" json:"skin_other" form:"skin_other"`
251
-	InfectOther string `gorm:"column:infect_other" json:"infect_other" form:"infect_other"`
252
-	DuctusArantiiOther string `gorm:"column:ductus_arantii_other" json:"ductus_arantii_other" form:"ductus_arantii_other"`
190
+	ID                             int64   `gorm:"column:id" json:"id" form:"id"`
191
+	UserOrgId                      int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
192
+	PatientId                      int64   `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
193
+	AssessmentDate                 int64   `gorm:"column:assessment_date" json:"assessment_date" form:"assessment_date"`
194
+	DialysisOrderId                int64   `gorm:"column:dialysis_order_id" json:"dialysis_order_id" form:"dialysis_order_id"`
195
+	Temperature                    float64 `gorm:"column:temperature" json:"temperature" form:"temperature"`
196
+	PulseFrequency                 float64 `gorm:"column:pulse_frequency" json:"pulse_frequency" form:"pulse_frequency"`
197
+	BreathingRate                  float64 `gorm:"column:breathing_rate" json:"breathing_rate" form:"breathing_rate"`
198
+	SystolicBloodPressure          float64 `gorm:"column:systolic_blood_pressure" json:"systolic_blood_pressure" form:"systolic_blood_pressure"`
199
+	DiastolicBloodPressure         float64 `gorm:"column:diastolic_blood_pressure" json:"diastolic_blood_pressure" form:"diastolic_blood_pressure"`
200
+	BloodPressureType              int64   `gorm:"column:blood_pressure_type" json:"blood_pressure_type" form:"blood_pressure_type"`
201
+	DryWeight                      float64 `gorm:"column:dry_weight" json:"dry_weight" form:"dry_weight"`
202
+	WeightAfterLastTransparency    float64 `gorm:"column:weight_after_last_transparency" json:"weight_after_last_transparency" form:"weight_after_last_transparency"`
203
+	WeighingWay                    string  `gorm:"column:weighing_way" json:"weighing_way" form:"weighing_way"`
204
+	WeighingBefore                 float64 `gorm:"column:weighing_before" json:"weighing_before" form:"weighing_before"`
205
+	AdditionalWeight               float64 `gorm:"column:additional_weight" json:"additional_weight" form:"additional_weight"`
206
+	WeightBefore                   float64 `gorm:"column:weight_before" json:"weight_before" form:"weight_before"`
207
+	WeightGain                     float64 `gorm:"column:weight_gain" json:"weight_gain" form:"weight_gain"`
208
+	PreloadedDewatering            float64 `gorm:"column:preloaded_dewatering" json:"preloaded_dewatering" form:"preloaded_dewatering"`
209
+	UltrafiltrationAmount          float64 `gorm:"column:ultrafiltration_amount" json:"ultrafiltration_amount" form:"ultrafiltration_amount"`
210
+	DialysisInterphase             string  `gorm:"column:dialysis_interphase" json:"dialysis_interphase" form:"dialysis_interphase"`
211
+	LastPostDialysis               string  `gorm:"column:last_post_dialysis" json:"last_post_dialysis" form:"last_post_dialysis"`
212
+	SymptomBeforeDialysis          string  `gorm:"column:symptom_before_dialysis" json:"symptom_before_dialysis" form:"symptom_before_dialysis"`
213
+	InternalFistula                string  `gorm:"column:internal_fistula" json:"internal_fistula" form:"internal_fistula"`
214
+	InternalFistulaSkin            string  `gorm:"column:internal_fistula_skin" json:"internal_fistula_skin" form:"internal_fistula_skin"`
215
+	CatheterBend                   int64   `gorm:"column:catheter_bend" json:"catheter_bend" form:"catheter_bend"`
216
+	Catheter                       string  `gorm:"column:catheter" json:"catheter" form:"catheter"`
217
+	Complication                   string  `gorm:"column:complication" json:"complication" form:"complication"`
218
+	Evaluator                      int64   `gorm:"column:evaluator" json:"evaluator" form:"evaluator"`
219
+	Creater                        int64   `gorm:"column:creater" json:"creater" form:"creater"`
220
+	Remark                         string  `gorm:"column:remark" json:"remark" form:"remark"`
221
+	Status                         int64   `gorm:"column:status" json:"status" form:"status"`
222
+	CreatedTime                    int64   `gorm:"column:created_time" json:"created_time" form:"created_time"`
223
+	UpdatedTime                    int64   `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
224
+	Modifier                       int64   `gorm:"column:modifier" json:"modifier" form:"modifier"`
225
+	BloodAccessPartId              int64   `gorm:"column:blood_access_part_id" json:"blood_access_part_id" form:"blood_access_part_id"`
226
+	BloodAccessPartOperaId         int64   `gorm:"column:blood_access_part_opera_id" json:"blood_access_part_opera_id" form:"blood_access_part_opera_id"`
227
+	IsHemorrhage                   int64   `gorm:"column:is_hemorrhage" json:"is_hemorrhage" form:"is_hemorrhage"`
228
+	Hemorrhage                     string  `gorm:"column:hemorrhage" json:"hemorrhage" form:"hemorrhage"`
229
+	HemorrhageOther                string  `gorm:"column:hemorrhage_other" json:"hemorrhage_other" form:"hemorrhage_other"`
230
+	PunctureMethod                 string  `gorm:"column:puncture_method" json:"puncture_method" form:"puncture_method"`
231
+	BloodAccessInternalFistula     string  `gorm:"column:blood_access_internal_fistula" json:"blood_access_internal_fistula" form:"blood_access_internal_fistula"`
232
+	InternalFistulaOther           string  `gorm:"column:internal_fistula_other" json:"internal_fistula_other" form:"internal_fistula_other"`
233
+	BloodAccessNoise               int64   `gorm:"column:blood_access_noise" json:"blood_access_noise" form:"blood_access_noise"`
234
+	PunctureWay                    int64   `gorm:"column:puncture_way" json:"puncture_way" form:"puncture_way"`
235
+	VenousCatheterization          int64   `gorm:"column:venous_catheterization" json:"venous_catheterization" form:"venous_catheterization"`
236
+	VenousCatheterizationPart      int64   `gorm:"column:venous_catheterization_part" json:"venous_catheterization_part" form:"venous_catheterization_part"`
237
+	VenousCatheterizationPartOther string  `gorm:"column:venous_catheterization_part_other" json:"venous_catheterization_part_other" form:"venous_catheterization_part_other"`
238
+	DuctusArantii                  string  `gorm:"column:ductus_arantii" json:"ductus_arantii" form:"ductus_arantii"`
239
+	EmergencyTreatment             int64   `gorm:"column:emergency_treatment" json:"emergency_treatment" form:"emergency_treatment"`
240
+	EmergencyTreatmentOther        string  `gorm:"column:emergency_treatment_other" json:"emergency_treatment_other" form:"emergency_treatment_other"`
241
+	DialysisCount                  int64   `gorm:"column:dialysis_count" json:"dialysis_count" form:"dialysis_count"`
242
+	AssessmentDoctor               int64   `gorm:"column:assessment_doctor" json:"assessment_doctor" form:"assessment_doctor"`
243
+	AssessmentTime                 int64   `gorm:"column:assessment_time" json:"assessment_time" form:"assessment_time"`
244
+	MachineType                    string  `gorm:"column:machine_type" json:"machine_type" form:"machine_type"`
245
+	IsInfect                       int64   `gorm:"column:is_infect" json:"is_infect" form:"is_infect"`
246
+	Exposed                        float64 `gorm:"column:exposed" json:"exposed" form:"exposed"`
247
+	Skin                           int64   `gorm:"column:skin" json:"skin" form:"skin"`
248
+	SkinOther                      string  `gorm:"column:skin_other" json:"skin_other" form:"skin_other"`
249
+	InfectOther                    string  `gorm:"column:infect_other" json:"infect_other" form:"infect_other"`
250
+	DuctusArantiiOther             string  `gorm:"column:ductus_arantii_other" json:"ductus_arantii_other" form:"ductus_arantii_other"`
253 251
 }
254 252
 
255 253
 func (XtAssessmentBeforeDislysis) TableName() string {
256 254
 	return "xt_assessment_before_dislysis"
257 255
 }
258 256
 
259
-
260 257
 type DoctorAdvice struct {
261 258
 	ID                    int64   `gorm:"column:id" json:"id" form:"id"`
262 259
 	GroupNo               int64   `gorm:"column:groupno" json:"groupno" form:"groupno"`
@@ -331,26 +328,26 @@ func (DoubleCheck) TableName() string {
331 328
 }
332 329
 
333 330
 type DialysisOrder struct {
334
-	ID             int64        `gorm:"column:id" json:"id"`
335
-	DialysisDate   int64        `gorm:"column:dialysis_date" json:"dialysis_date"`
336
-	UserOrgId      int64        `gorm:"column:user_org_id" json:"user_org_id"`
337
-	PatientId      int64        `gorm:"column:patient_id" json:"patient_id"`
338
-	PrescriptionId int64        `gorm:"column:prescription_id" json:"prescription_id"`
339
-	Stage          int64        `gorm:"column:stage" json:"stage"`
340
-	Remark         string       `gorm:"column:remark" json:"remark"`
341
-	BedID          int64        `gorm:"column:bed_id" json:"bed_id"`
342
-	StartNurse     int64        `gorm:"column:start_nurse" json:"start_nurse"`
343
-	FinishNurse    int64        `gorm:"column:finish_nurse" json:"finish_nurse"`
344
-	Status         int64        `gorm:"column:status" json:"status"`
345
-	CreatedTime    int64        `gorm:"column:created_time" json:"created_time"`
346
-	UpdatedTime    int64        `gorm:"column:updated_time" json:"updated_time"`
347
-	StartTime      int64        `gorm:"column:start_time" json:"start_time"`
348
-	EndTime        int64        `gorm:"column:end_time" json:"end_time"`
349
-	PunctureNurse  int64        `gorm:"column:puncture_nurse" json:"puncture_nurse"`
350
-	Creator        int64        `gorm:"column:creator" json:"creator"`
351
-	Modifier       int64        `gorm:"column:modifier" json:"modifier"`
352
-	FinishCreator  int64        `gorm:"column:finish_creator" json:"finish_creator"`
353
-	FinishModifier int64        `gorm:"column:finish_modifier" json:"finish_modifier"`
331
+	ID             int64  `gorm:"column:id" json:"id"`
332
+	DialysisDate   int64  `gorm:"column:dialysis_date" json:"dialysis_date"`
333
+	UserOrgId      int64  `gorm:"column:user_org_id" json:"user_org_id"`
334
+	PatientId      int64  `gorm:"column:patient_id" json:"patient_id"`
335
+	PrescriptionId int64  `gorm:"column:prescription_id" json:"prescription_id"`
336
+	Stage          int64  `gorm:"column:stage" json:"stage"`
337
+	Remark         string `gorm:"column:remark" json:"remark"`
338
+	BedID          int64  `gorm:"column:bed_id" json:"bed_id"`
339
+	StartNurse     int64  `gorm:"column:start_nurse" json:"start_nurse"`
340
+	FinishNurse    int64  `gorm:"column:finish_nurse" json:"finish_nurse"`
341
+	Status         int64  `gorm:"column:status" json:"status"`
342
+	CreatedTime    int64  `gorm:"column:created_time" json:"created_time"`
343
+	UpdatedTime    int64  `gorm:"column:updated_time" json:"updated_time"`
344
+	StartTime      int64  `gorm:"column:start_time" json:"start_time"`
345
+	EndTime        int64  `gorm:"column:end_time" json:"end_time"`
346
+	PunctureNurse  int64  `gorm:"column:puncture_nurse" json:"puncture_nurse"`
347
+	Creator        int64  `gorm:"column:creator" json:"creator"`
348
+	Modifier       int64  `gorm:"column:modifier" json:"modifier"`
349
+	FinishCreator  int64  `gorm:"column:finish_creator" json:"finish_creator"`
350
+	FinishModifier int64  `gorm:"column:finish_modifier" json:"finish_modifier"`
354 351
 }
355 352
 
356 353
 func (DialysisOrder) TableName() string {
@@ -358,41 +355,41 @@ func (DialysisOrder) TableName() string {
358 355
 }
359 356
 
360 357
 type SgjUserOrg struct {
361
-	ID int64 `gorm:"column:id" json:"id" form:"id"`
362
-	Creator int64 `gorm:"column:creator" json:"creator" form:"creator"`
363
-	OrgName string `gorm:"column:org_name" json:"org_name" form:"org_name"`
364
-	OrgShortName string `gorm:"column:org_short_name" json:"org_short_name" form:"org_short_name"`
365
-	OrgLogo string `gorm:"column:org_logo" json:"org_logo" form:"org_logo"`
366
-	OrgIntroduction string `gorm:"column:org_introduction" json:"org_introduction" form:"org_introduction"`
367
-	Illness string `gorm:"column:illness" json:"illness" form:"illness"`
368
-	Province int64 `gorm:"column:province" json:"province" form:"province"`
369
-	City int64 `gorm:"column:city" json:"city" form:"city"`
370
-	District int64 `gorm:"column:district" json:"district" form:"district"`
371
-	Address string `gorm:"column:address" json:"address" form:"address"`
372
-	Longitude string `gorm:"column:longitude" json:"longitude" form:"longitude"`
373
-	Latitude string `gorm:"column:latitude" json:"latitude" form:"latitude"`
374
-	OrgType int64 `gorm:"column:org_type" json:"org_type" form:"org_type"`
375
-	Comments int64 `gorm:"column:comments" json:"comments" form:"comments"`
376
-	Evaluate float64 `gorm:"column:evaluate" json:"evaluate" form:"evaluate"`
377
-	Gallery string `gorm:"column:gallery" json:"gallery" form:"gallery"`
378
-	BusinessWeek string `gorm:"column:business_week" json:"business_week" form:"business_week"`
379
-	BusinessTime string `gorm:"column:business_time" json:"business_time" form:"business_time"`
380
-	ContactName string `gorm:"column:contact_name" json:"contact_name" form:"contact_name"`
381
-	Telephone string `gorm:"column:telephone" json:"telephone" form:"telephone"`
382
-	Claim int64 `gorm:"column:claim" json:"claim" form:"claim"`
383
-	OperatingState int64 `gorm:"column:operating_state" json:"operating_state" form:"operating_state"`
384
-	Status int64 `gorm:"column:status" json:"status" form:"status"`
385
-	Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
386
-	Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
387
-	Source int64 `gorm:"column:source" json:"source" form:"source"`
388
-	Ttype int64 `gorm:"column:ttype" json:"ttype" form:"ttype"`
389
-	Ttid int64 `gorm:"column:ttid" json:"ttid" form:"ttid"`
390
-	Tuid int64 `gorm:"column:tuid" json:"tuid" form:"tuid"`
391
-	Reason string `gorm:"column:reason" json:"reason" form:"reason"`
392
-	Level int64 `gorm:"column:level" json:"level" form:"level"`
393
-	Website string `gorm:"column:website" json:"website" form:"website"`
394
-	Import int64 `gorm:"column:import" json:"import" form:"import"`
395
-	Sortno int64 `gorm:"column:sortno" json:"sortno" form:"sortno"`
358
+	ID              int64   `gorm:"column:id" json:"id" form:"id"`
359
+	Creator         int64   `gorm:"column:creator" json:"creator" form:"creator"`
360
+	OrgName         string  `gorm:"column:org_name" json:"org_name" form:"org_name"`
361
+	OrgShortName    string  `gorm:"column:org_short_name" json:"org_short_name" form:"org_short_name"`
362
+	OrgLogo         string  `gorm:"column:org_logo" json:"org_logo" form:"org_logo"`
363
+	OrgIntroduction string  `gorm:"column:org_introduction" json:"org_introduction" form:"org_introduction"`
364
+	Illness         string  `gorm:"column:illness" json:"illness" form:"illness"`
365
+	Province        int64   `gorm:"column:province" json:"province" form:"province"`
366
+	City            int64   `gorm:"column:city" json:"city" form:"city"`
367
+	District        int64   `gorm:"column:district" json:"district" form:"district"`
368
+	Address         string  `gorm:"column:address" json:"address" form:"address"`
369
+	Longitude       string  `gorm:"column:longitude" json:"longitude" form:"longitude"`
370
+	Latitude        string  `gorm:"column:latitude" json:"latitude" form:"latitude"`
371
+	OrgType         int64   `gorm:"column:org_type" json:"org_type" form:"org_type"`
372
+	Comments        int64   `gorm:"column:comments" json:"comments" form:"comments"`
373
+	Evaluate        float64 `gorm:"column:evaluate" json:"evaluate" form:"evaluate"`
374
+	Gallery         string  `gorm:"column:gallery" json:"gallery" form:"gallery"`
375
+	BusinessWeek    string  `gorm:"column:business_week" json:"business_week" form:"business_week"`
376
+	BusinessTime    string  `gorm:"column:business_time" json:"business_time" form:"business_time"`
377
+	ContactName     string  `gorm:"column:contact_name" json:"contact_name" form:"contact_name"`
378
+	Telephone       string  `gorm:"column:telephone" json:"telephone" form:"telephone"`
379
+	Claim           int64   `gorm:"column:claim" json:"claim" form:"claim"`
380
+	OperatingState  int64   `gorm:"column:operating_state" json:"operating_state" form:"operating_state"`
381
+	Status          int64   `gorm:"column:status" json:"status" form:"status"`
382
+	Ctime           int64   `gorm:"column:ctime" json:"ctime" form:"ctime"`
383
+	Mtime           int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
384
+	Source          int64   `gorm:"column:source" json:"source" form:"source"`
385
+	Ttype           int64   `gorm:"column:ttype" json:"ttype" form:"ttype"`
386
+	Ttid            int64   `gorm:"column:ttid" json:"ttid" form:"ttid"`
387
+	Tuid            int64   `gorm:"column:tuid" json:"tuid" form:"tuid"`
388
+	Reason          string  `gorm:"column:reason" json:"reason" form:"reason"`
389
+	Level           int64   `gorm:"column:level" json:"level" form:"level"`
390
+	Website         string  `gorm:"column:website" json:"website" form:"website"`
391
+	Import          int64   `gorm:"column:import" json:"import" form:"import"`
392
+	Sortno          int64   `gorm:"column:sortno" json:"sortno" form:"sortno"`
396 393
 	//XtPatients  []XtPatients `gorm:"ForeignKey:UserOrgId"`
397 394
 }
398 395
 
@@ -444,66 +441,66 @@ func (MonitoringRecord) TableName() string {
444 441
 }
445 442
 
446 443
 type XtAssessmentAfterDislysis struct {
447
-	ID int64 `gorm:"column:id" json:"id" form:"id"`
448
-	UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
449
-	PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
450
-	AssessmentDate int64 `gorm:"column:assessment_date" json:"assessment_date" form:"assessment_date"`
451
-	DialysisOrderId int64 `gorm:"column:dialysis_order_id" json:"dialysis_order_id" form:"dialysis_order_id"`
452
-	Temperature float64 `gorm:"column:temperature" json:"temperature" form:"temperature"`
453
-	PulseFrequency float64 `gorm:"column:pulse_frequency" json:"pulse_frequency" form:"pulse_frequency"`
454
-	BreathingRate float64 `gorm:"column:breathing_rate" json:"breathing_rate" form:"breathing_rate"`
455
-	SystolicBloodPressure float64 `gorm:"column:systolic_blood_pressure" json:"systolic_blood_pressure" form:"systolic_blood_pressure"`
456
-	DiastolicBloodPressure float64 `gorm:"column:diastolic_blood_pressure" json:"diastolic_blood_pressure" form:"diastolic_blood_pressure"`
457
-	BloodPressureType int64 `gorm:"column:blood_pressure_type" json:"blood_pressure_type" form:"blood_pressure_type"`
458
-	ActualUltrafiltration float64 `gorm:"column:actual_ultrafiltration" json:"actual_ultrafiltration" form:"actual_ultrafiltration"`
459
-	ActualDisplacement float64 `gorm:"column:actual_displacement" json:"actual_displacement" form:"actual_displacement"`
460
-	ActualTreatmentHour int64 `gorm:"column:actual_treatment_hour" json:"actual_treatment_hour" form:"actual_treatment_hour"`
461
-	ActualTreatmentMinute int64 `gorm:"column:actual_treatment_minute" json:"actual_treatment_minute" form:"actual_treatment_minute"`
462
-	WeighingWay string `gorm:"column:weighing_way" json:"weighing_way" form:"weighing_way"`
463
-	WeightAfter float64 `gorm:"column:weight_after" json:"weight_after" form:"weight_after"`
464
-	WeightLoss float64 `gorm:"column:weight_loss" json:"weight_loss" form:"weight_loss"`
465
-	Cruor string `gorm:"column:cruor" json:"cruor" form:"cruor"`
466
-	SymptomAfterDialysis string `gorm:"column:symptom_after_dialysis" json:"symptom_after_dialysis" form:"symptom_after_dialysis"`
467
-	InternalFistula string `gorm:"column:internal_fistula" json:"internal_fistula" form:"internal_fistula"`
468
-	Catheter string `gorm:"column:catheter" json:"catheter" form:"catheter"`
469
-	Complication string `gorm:"column:complication" json:"complication" form:"complication"`
470
-	Evaluator int64 `gorm:"column:evaluator" json:"evaluator" form:"evaluator"`
471
-	Remark string `gorm:"column:remark" json:"remark" form:"remark"`
472
-	DialysisIntakes int64 `gorm:"column:dialysis_intakes" json:"dialysis_intakes" form:"dialysis_intakes"`
473
-	DialysisIntakesFeed int64 `gorm:"column:dialysis_intakes_feed" json:"dialysis_intakes_feed" form:"dialysis_intakes_feed"`
474
-	DialysisIntakesTransfusion int64 `gorm:"column:dialysis_intakes_transfusion" json:"dialysis_intakes_transfusion" form:"dialysis_intakes_transfusion"`
475
-	DialysisIntakesBloodTransfusion int64 `gorm:"column:dialysis_intakes_blood_transfusion" json:"dialysis_intakes_blood_transfusion" form:"dialysis_intakes_blood_transfusion"`
476
-	DialysisIntakesWashpipe int64 `gorm:"column:dialysis_intakes_washpipe" json:"dialysis_intakes_washpipe" form:"dialysis_intakes_washpipe"`
477
-	Status int64 `gorm:"column:status" json:"status" form:"status"`
478
-	CreatedTime int64 `gorm:"column:created_time" json:"created_time" form:"created_time"`
479
-	UpdatedTime int64 `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
480
-	Creater int64 `gorm:"column:creater" json:"creater" form:"creater"`
481
-	Modifier int64 `gorm:"column:modifier" json:"modifier" form:"modifier"`
482
-	BloodAccessPartId int64 `gorm:"column:blood_access_part_id" json:"blood_access_part_id" form:"blood_access_part_id"`
483
-	BloodAccessPartOperaId int64 `gorm:"column:blood_access_part_opera_id" json:"blood_access_part_opera_id" form:"blood_access_part_opera_id"`
484
-	PuncturePointOozingBlood int64 `gorm:"column:puncture_point_oozing_blood" json:"puncture_point_oozing_blood" form:"puncture_point_oozing_blood"`
485
-	PuncturePointHaematoma int64 `gorm:"column:puncture_point_haematoma" json:"puncture_point_haematoma" form:"puncture_point_haematoma"`
486
-	InternalFistulaTremorAc int64 `gorm:"column:internal_fistula_tremor_ac" json:"internal_fistula_tremor_ac" form:"internal_fistula_tremor_ac"`
487
-	PatientGose int64 `gorm:"column:patient_gose" json:"patient_gose" form:"patient_gose"`
488
-	InpatientDepartment string `gorm:"column:inpatient_department" json:"inpatient_department" form:"inpatient_department"`
489
-	ObservationContent string `gorm:"column:observation_content" json:"observation_content" form:"observation_content"`
490
-	ObservationContentOther string `gorm:"column:observation_content_other" json:"observation_content_other" form:"observation_content_other"`
491
-	DryWeight float64 `gorm:"column:dry_weight" json:"dry_weight" form:"dry_weight"`
492
-	DialysisProcess int64 `gorm:"column:dialysis_process" json:"dialysis_process" form:"dialysis_process"`
493
-	InAdvanceMinute float64 `gorm:"column:in_advance_minute" json:"in_advance_minute" form:"in_advance_minute"`
494
-	InAdvanceReason string `gorm:"column:in_advance_reason" json:"in_advance_reason" form:"in_advance_reason"`
495
-	HemostasisMinute int64 `gorm:"column:hemostasis_minute" json:"hemostasis_minute" form:"hemostasis_minute"`
496
-	HemostasisOpera int64 `gorm:"column:hemostasis_opera" json:"hemostasis_opera" form:"hemostasis_opera"`
497
-	TremorNoise int64 `gorm:"column:tremor_noise" json:"tremor_noise" form:"tremor_noise"`
498
-	DisequilibriumSyndrome int64 `gorm:"column:disequilibrium_syndrome" json:"disequilibrium_syndrome" form:"disequilibrium_syndrome"`
499
-	DisequilibriumSyndromeOption string `gorm:"column:disequilibrium_syndrome_option" json:"disequilibrium_syndrome_option" form:"disequilibrium_syndrome_option"`
500
-	ArterialTube int64 `gorm:"column:arterial_tube" json:"arterial_tube" form:"arterial_tube"`
501
-	IntravenousTube int64 `gorm:"column:intravenous_tube" json:"intravenous_tube" form:"intravenous_tube"`
502
-	Dialyzer int64 `gorm:"column:dialyzer" json:"dialyzer" form:"dialyzer"`
503
-	InAdvanceReasonOther string `gorm:"column:in_advance_reason_other" json:"in_advance_reason_other" form:"in_advance_reason_other"`
504
-	AssessmentDoctor int64 `gorm:"column:assessment_doctor" json:"assessment_doctor" form:"assessment_doctor"`
505
-	AssessmentTime int64 `gorm:"column:assessment_time" json:"assessment_time" form:"assessment_time"`
506
-	IsEat int64 `gorm:"column:is_eat" json:"is_eat" form:"is_eat"`
444
+	ID                              int64   `gorm:"column:id" json:"id" form:"id"`
445
+	UserOrgId                       int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
446
+	PatientId                       int64   `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
447
+	AssessmentDate                  int64   `gorm:"column:assessment_date" json:"assessment_date" form:"assessment_date"`
448
+	DialysisOrderId                 int64   `gorm:"column:dialysis_order_id" json:"dialysis_order_id" form:"dialysis_order_id"`
449
+	Temperature                     float64 `gorm:"column:temperature" json:"temperature" form:"temperature"`
450
+	PulseFrequency                  float64 `gorm:"column:pulse_frequency" json:"pulse_frequency" form:"pulse_frequency"`
451
+	BreathingRate                   float64 `gorm:"column:breathing_rate" json:"breathing_rate" form:"breathing_rate"`
452
+	SystolicBloodPressure           float64 `gorm:"column:systolic_blood_pressure" json:"systolic_blood_pressure" form:"systolic_blood_pressure"`
453
+	DiastolicBloodPressure          float64 `gorm:"column:diastolic_blood_pressure" json:"diastolic_blood_pressure" form:"diastolic_blood_pressure"`
454
+	BloodPressureType               int64   `gorm:"column:blood_pressure_type" json:"blood_pressure_type" form:"blood_pressure_type"`
455
+	ActualUltrafiltration           float64 `gorm:"column:actual_ultrafiltration" json:"actual_ultrafiltration" form:"actual_ultrafiltration"`
456
+	ActualDisplacement              float64 `gorm:"column:actual_displacement" json:"actual_displacement" form:"actual_displacement"`
457
+	ActualTreatmentHour             int64   `gorm:"column:actual_treatment_hour" json:"actual_treatment_hour" form:"actual_treatment_hour"`
458
+	ActualTreatmentMinute           int64   `gorm:"column:actual_treatment_minute" json:"actual_treatment_minute" form:"actual_treatment_minute"`
459
+	WeighingWay                     string  `gorm:"column:weighing_way" json:"weighing_way" form:"weighing_way"`
460
+	WeightAfter                     float64 `gorm:"column:weight_after" json:"weight_after" form:"weight_after"`
461
+	WeightLoss                      float64 `gorm:"column:weight_loss" json:"weight_loss" form:"weight_loss"`
462
+	Cruor                           string  `gorm:"column:cruor" json:"cruor" form:"cruor"`
463
+	SymptomAfterDialysis            string  `gorm:"column:symptom_after_dialysis" json:"symptom_after_dialysis" form:"symptom_after_dialysis"`
464
+	InternalFistula                 string  `gorm:"column:internal_fistula" json:"internal_fistula" form:"internal_fistula"`
465
+	Catheter                        string  `gorm:"column:catheter" json:"catheter" form:"catheter"`
466
+	Complication                    string  `gorm:"column:complication" json:"complication" form:"complication"`
467
+	Evaluator                       int64   `gorm:"column:evaluator" json:"evaluator" form:"evaluator"`
468
+	Remark                          string  `gorm:"column:remark" json:"remark" form:"remark"`
469
+	DialysisIntakes                 int64   `gorm:"column:dialysis_intakes" json:"dialysis_intakes" form:"dialysis_intakes"`
470
+	DialysisIntakesFeed             int64   `gorm:"column:dialysis_intakes_feed" json:"dialysis_intakes_feed" form:"dialysis_intakes_feed"`
471
+	DialysisIntakesTransfusion      int64   `gorm:"column:dialysis_intakes_transfusion" json:"dialysis_intakes_transfusion" form:"dialysis_intakes_transfusion"`
472
+	DialysisIntakesBloodTransfusion int64   `gorm:"column:dialysis_intakes_blood_transfusion" json:"dialysis_intakes_blood_transfusion" form:"dialysis_intakes_blood_transfusion"`
473
+	DialysisIntakesWashpipe         int64   `gorm:"column:dialysis_intakes_washpipe" json:"dialysis_intakes_washpipe" form:"dialysis_intakes_washpipe"`
474
+	Status                          int64   `gorm:"column:status" json:"status" form:"status"`
475
+	CreatedTime                     int64   `gorm:"column:created_time" json:"created_time" form:"created_time"`
476
+	UpdatedTime                     int64   `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
477
+	Creater                         int64   `gorm:"column:creater" json:"creater" form:"creater"`
478
+	Modifier                        int64   `gorm:"column:modifier" json:"modifier" form:"modifier"`
479
+	BloodAccessPartId               int64   `gorm:"column:blood_access_part_id" json:"blood_access_part_id" form:"blood_access_part_id"`
480
+	BloodAccessPartOperaId          int64   `gorm:"column:blood_access_part_opera_id" json:"blood_access_part_opera_id" form:"blood_access_part_opera_id"`
481
+	PuncturePointOozingBlood        int64   `gorm:"column:puncture_point_oozing_blood" json:"puncture_point_oozing_blood" form:"puncture_point_oozing_blood"`
482
+	PuncturePointHaematoma          int64   `gorm:"column:puncture_point_haematoma" json:"puncture_point_haematoma" form:"puncture_point_haematoma"`
483
+	InternalFistulaTremorAc         int64   `gorm:"column:internal_fistula_tremor_ac" json:"internal_fistula_tremor_ac" form:"internal_fistula_tremor_ac"`
484
+	PatientGose                     int64   `gorm:"column:patient_gose" json:"patient_gose" form:"patient_gose"`
485
+	InpatientDepartment             string  `gorm:"column:inpatient_department" json:"inpatient_department" form:"inpatient_department"`
486
+	ObservationContent              string  `gorm:"column:observation_content" json:"observation_content" form:"observation_content"`
487
+	ObservationContentOther         string  `gorm:"column:observation_content_other" json:"observation_content_other" form:"observation_content_other"`
488
+	DryWeight                       float64 `gorm:"column:dry_weight" json:"dry_weight" form:"dry_weight"`
489
+	DialysisProcess                 int64   `gorm:"column:dialysis_process" json:"dialysis_process" form:"dialysis_process"`
490
+	InAdvanceMinute                 float64 `gorm:"column:in_advance_minute" json:"in_advance_minute" form:"in_advance_minute"`
491
+	InAdvanceReason                 string  `gorm:"column:in_advance_reason" json:"in_advance_reason" form:"in_advance_reason"`
492
+	HemostasisMinute                int64   `gorm:"column:hemostasis_minute" json:"hemostasis_minute" form:"hemostasis_minute"`
493
+	HemostasisOpera                 int64   `gorm:"column:hemostasis_opera" json:"hemostasis_opera" form:"hemostasis_opera"`
494
+	TremorNoise                     int64   `gorm:"column:tremor_noise" json:"tremor_noise" form:"tremor_noise"`
495
+	DisequilibriumSyndrome          int64   `gorm:"column:disequilibrium_syndrome" json:"disequilibrium_syndrome" form:"disequilibrium_syndrome"`
496
+	DisequilibriumSyndromeOption    string  `gorm:"column:disequilibrium_syndrome_option" json:"disequilibrium_syndrome_option" form:"disequilibrium_syndrome_option"`
497
+	ArterialTube                    int64   `gorm:"column:arterial_tube" json:"arterial_tube" form:"arterial_tube"`
498
+	IntravenousTube                 int64   `gorm:"column:intravenous_tube" json:"intravenous_tube" form:"intravenous_tube"`
499
+	Dialyzer                        int64   `gorm:"column:dialyzer" json:"dialyzer" form:"dialyzer"`
500
+	InAdvanceReasonOther            string  `gorm:"column:in_advance_reason_other" json:"in_advance_reason_other" form:"in_advance_reason_other"`
501
+	AssessmentDoctor                int64   `gorm:"column:assessment_doctor" json:"assessment_doctor" form:"assessment_doctor"`
502
+	AssessmentTime                  int64   `gorm:"column:assessment_time" json:"assessment_time" form:"assessment_time"`
503
+	IsEat                           int64   `gorm:"column:is_eat" json:"is_eat" form:"is_eat"`
507 504
 }
508 505
 
509 506
 func (XtAssessmentAfterDislysis) TableName() string {
@@ -511,25 +508,25 @@ func (XtAssessmentAfterDislysis) TableName() string {
511 508
 }
512 509
 
513 510
 type PatientInfo struct {
514
-	ID  int64
515
-	OrgName string
516
-	Name string
517
-    Ctime string
518
-    Address string
511
+	ID          int64
512
+	OrgName     string
513
+	AdminName   string
514
+	Ctime       string
515
+	Address     string
519 516
 	ContactName string
520
-
521
-
517
+	OrgType     int64
518
+	Namepath    string
522 519
 }
523 520
 
524 521
 type SgjUserAdminLoginLog struct {
525
-	ID int64 `gorm:"column:id" json:"id" form:"id"`
526
-	AdminUserId int64 `gorm:"column:admin_user_id" json:"admin_user_id" form:"admin_user_id"`
527
-	OrgId int64 `gorm:"column:org_id" json:"org_id" form:"org_id"`
528
-	AppId int64 `gorm:"column:app_id" json:"app_id" form:"app_id"`
529
-	Ip string `gorm:"column:ip" json:"ip" form:"ip"`
530
-	OperateType int64 `gorm:"column:operate_type" json:"operate_type" form:"operate_type"`
531
-	AppType int64 `gorm:"column:app_type" json:"app_type" form:"app_type"`
532
-	Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
522
+	ID          int64  `gorm:"column:id" json:"id" form:"id"`
523
+	AdminUserId int64  `gorm:"column:admin_user_id" json:"admin_user_id" form:"admin_user_id"`
524
+	OrgId       int64  `gorm:"column:org_id" json:"org_id" form:"org_id"`
525
+	AppId       int64  `gorm:"column:app_id" json:"app_id" form:"app_id"`
526
+	Ip          string `gorm:"column:ip" json:"ip" form:"ip"`
527
+	OperateType int64  `gorm:"column:operate_type" json:"operate_type" form:"operate_type"`
528
+	AppType     int64  `gorm:"column:app_type" json:"app_type" form:"app_type"`
529
+	Ctime       int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
533 530
 }
534 531
 
535 532
 func (SgjUserAdminLoginLog) TableName() string {
@@ -541,12 +538,12 @@ type Logout struct {
541 538
 }
542 539
 
543 540
 type SgjOrgFollow struct {
544
-	ID int64 `gorm:"column:id" json:"id" form:"id"`
545
-	OrgId int64 `gorm:"column:org_id" json:"org_id" form:"org_id"`
541
+	ID          int64 `gorm:"column:id" json:"id" form:"id"`
542
+	OrgId       int64 `gorm:"column:org_id" json:"org_id" form:"org_id"`
546 543
 	AdminUserId int64 `gorm:"column:admin_user_id" json:"admin_user_id" form:"admin_user_id"`
547
-	Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
548
-	Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
549
-	Status int64 `gorm:"column:status" json:"status" form:"status"`
544
+	Ctime       int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
545
+	Mtime       int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
546
+	Status      int64 `gorm:"column:status" json:"status" form:"status"`
550 547
 }
551 548
 
552 549
 func (SgjOrgFollow) TableName() string {
@@ -554,16 +551,16 @@ func (SgjOrgFollow) TableName() string {
554 551
 }
555 552
 
556 553
 type SgjAdmin struct {
557
-	ID int64 `gorm:"column:id" json:"id" form:"id"`
558
-	Account string `gorm:"column:account" json:"account" form:"account"`
559
-	Pwd string `gorm:"column:pwd" json:"pwd" form:"pwd"`
560
-	Status int64 `gorm:"column:status" json:"status" form:"status"`
561
-	Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
562
-	Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
563
-	IsSuperAdmin int64 `gorm:"column:is_super_admin" json:"is_super_admin" form:"is_super_admin"`
564
-	Name string `gorm:"column:name" json:"name" form:"name"`
554
+	ID           int64  `gorm:"column:id" json:"id" form:"id"`
555
+	Account      string `gorm:"column:account" json:"account" form:"account"`
556
+	Pwd          string `gorm:"column:pwd" json:"pwd" form:"pwd"`
557
+	Status       int64  `gorm:"column:status" json:"status" form:"status"`
558
+	Ctime        int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
559
+	Mtime        int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
560
+	IsSuperAdmin int64  `gorm:"column:is_super_admin" json:"is_super_admin" form:"is_super_admin"`
561
+	Name         string `gorm:"column:name" json:"name" form:"name"`
565 562
 }
563
+
566 564
 func (SgjAdmin) TableName() string {
567 565
 	return "sgj_admin"
568 566
 }
569
-

+ 3 - 0
service/admin_service.go 查看文件

@@ -340,7 +340,10 @@ func UpdateAdmin(admin *admin_models.AdminAccount) (err error) {
340 340
 
341 341
 func DeleteAdmin(id int64) (err error) {
342 342
 	err = readUserDb.Model(&admin_models.AdminAccount{}).Where("id = ?", id).Updates(map[string]interface{}{"status": 0}).Error
343
+	err = readUserDb.Model(&models.OrgFollow{}).Where("admin_user_id = ?", id).Updates(map[string]interface{}{"status": 0}).Error
344
+
343 345
 	return
346
+
344 347
 }
345 348
 
346 349
 func FindAllOrg() (org []*models.Org, err error) {

+ 174 - 90
service/function_service.go 查看文件

@@ -1,180 +1,264 @@
1 1
 package service
2 2
 
3 3
 import (
4
+	"XT_Admin_Api/models/admin_models"
4 5
 	"XT_Admin_Api/models/function_models"
5
-	"fmt"
6 6
 )
7 7
 
8 8
 //病人管理
9
-func GetTodayInfo(to int64, ctime int64, page int64, limit int64) (patientinfo []function_models.PatientInfo, total int64, err error) {
10
-
11
-	offset := (page - 1) * limit
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
-	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
-	fmt.Println("rows是什么", rows)
15
-	defer rows.Close()
16
-	if rows.Next() {
17
-		rows.Scan(&total)
9
+func GetTodayInfo(to int64, ctime int64, page int64, limit int64, admin *admin_models.AdminAccount) (patientinfo []function_models.PatientInfo, total int64, err error) {
10
+
11
+	//offset := (page - 1) * limit
12
+	if admin.IsSuperAdmin == 1 {
13
+		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
14
+	} else {
15
+		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
18 16
 	}
19
-	fmt.Println("&total是什么", total)
17
+	//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()
18
+	//fmt.Println("rows是什么", rows)
19
+	//defer rows.Close()
20
+	//if rows.Next() {
21
+	//	rows.Scan(&total)
22
+	//}
23
+	//fmt.Println("&total是什么", total)
20 24
 	return patientinfo, total, err
21 25
 }
22 26
 
23 27
 //透析处方
24
-func GetTodayDialysisPatientsInfo(to int64, ctime int64, page int64, limit int64) (patientinfo []function_models.PatientInfo, total int64, err error) {
28
+func GetTodayDialysisPatientsInfo(to int64, ctime int64, page int64, limit int64, admin *admin_models.AdminAccount) (patientinfo []function_models.PatientInfo, total int64, err error) {
29
+
30
+	//offset := (page - 1) * limit
31
+
32
+	if admin.IsSuperAdmin == 1 {
33
+		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
34
+
35
+	} else {
25 36
 
26
-	offset := (page - 1) * limit
27
-	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
28
-	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()
29
-	defer rows.Close()
37
+		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
30 38
 
31
-	if rows.Next() {
32
-		rows.Scan(&total)
33 39
 	}
40
+	//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()
41
+	//defer rows.Close()
42
+	//
43
+	//if rows.Next() {
44
+	//	rows.Scan(&total)
45
+	//}
34 46
 
35 47
 	return patientinfo, total, err
36 48
 }
37 49
 
38 50
 //接诊评估
39
-func GetTodayReceivePatientsInfo(to int64, ctime int64, page int64, limit int64) (patientinfo []function_models.PatientInfo, total int64, err error) {
51
+func GetTodayReceivePatientsInfo(to int64, ctime int64, page int64, limit int64, admin *admin_models.AdminAccount) (patientinfo []function_models.PatientInfo, total int64, err error) {
40 52
 
41
-	offset := (page - 1) * limit
42
-	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
43
-	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()
44
-	defer rows.Close()
53
+	//offset := (page - 1) * limit
54
+	if admin.IsSuperAdmin == 1 {
55
+		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
56
+
57
+	} else {
58
+		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
45 59
 
46
-	if rows.Next() {
47
-		rows.Scan(&total)
48 60
 	}
49 61
 
62
+	//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()
63
+	//defer rows.Close()
64
+	//
65
+	//if rows.Next() {
66
+	//	rows.Scan(&total)
67
+	//}
68
+
50 69
 	return patientinfo, total, err
51 70
 }
52 71
 
53 72
 // 透前评估
54
-func GetTodayBeforDislysisInfo(to int64, ctime int64, page int64, limit int64) (patientinfo []function_models.PatientInfo, total int64, err error) {
55
-	offset := (page - 1) * limit
56
-	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
57
-	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()
58
-	defer rows.Close()
59
-
60
-	if rows.Next() {
61
-		rows.Scan(&total)
73
+func GetTodayBeforDislysisInfo(to int64, ctime int64, page int64, limit int64, admin *admin_models.AdminAccount) (patientinfo []function_models.PatientInfo, total int64, err error) {
74
+	//offset := (page - 1) * limit
75
+	if admin.IsSuperAdmin == 1 {
76
+		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
77
+
78
+	} else {
79
+
80
+		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
81
+
62 82
 	}
63 83
 
84
+	//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()
85
+	//defer rows.Close()
86
+	//
87
+	//if rows.Next() {
88
+	//	rows.Scan(&total)
89
+	//}
90
+
64 91
 	return patientinfo, total, err
65 92
 }
66 93
 
67 94
 //零食医嘱
68
-func GetTodayDoctorsOrderInfo(to int64, ctime int64, page int64, limit int64) (patientinfo []function_models.PatientInfo, total int64, err error) {
95
+func GetTodayDoctorsOrderInfo(to int64, ctime int64, page int64, limit int64, admin *admin_models.AdminAccount) (patientinfo []function_models.PatientInfo, total int64, err error) {
96
+
97
+	//offset := (page - 1) * limit
98
+
99
+	if admin.IsSuperAdmin == 1 {
100
+
101
+		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
102
+
103
+	} else {
69 104
 
70
-	offset := (page - 1) * limit
71
-	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
72
-	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()
73
-	defer rows.Close()
105
+		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
74 106
 
75
-	if rows.Next() {
76
-		rows.Scan(&total)
77 107
 	}
108
+	//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()
109
+	//defer rows.Close()
110
+	//
111
+	//if rows.Next() {
112
+	//	rows.Scan(&total)
113
+	//}
78 114
 
79 115
 	return patientinfo, total, err
80 116
 }
81 117
 
82 118
 //双人核对
83
-func GetTodayDoubleCheckInfo(to int64, ctime int64, page int64, limit int64) (patientinfo []function_models.PatientInfo, total int64, err error) {
119
+func GetTodayDoubleCheckInfo(to int64, ctime int64, page int64, limit int64, admin *admin_models.AdminAccount) (patientinfo []function_models.PatientInfo, total int64, err error) {
84 120
 
85
-	offset := (page - 1) * limit
86
-	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
87
-	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()
88
-	defer rows.Close()
121
+	//offset := (page - 1) * limit
122
+	if admin.IsSuperAdmin == 1 {
123
+		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
124
+
125
+	} else {
126
+		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
89 127
 
90
-	if rows.Next() {
91
-		rows.Scan(&total)
92 128
 	}
93 129
 
130
+	//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()
131
+	//defer rows.Close()
132
+	//
133
+	//if rows.Next() {
134
+	//	rows.Scan(&total)
135
+	//}
136
+
94 137
 	return patientinfo, total, err
95 138
 }
96 139
 
97 140
 //透析上机
98
-func GetTodayDialysisMachinek(to int64, ctime int64, page int64, limit int64) (patientinfo []function_models.PatientInfo, total int64, err error) {
141
+func GetTodayDialysisMachinek(to int64, ctime int64, page int64, limit int64, admin *admin_models.AdminAccount) (patientinfo []function_models.PatientInfo, total int64, err error) {
142
+
143
+	//offset := (page - 1) * limit
144
+	if admin.IsSuperAdmin == 1 {
145
+		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
146
+
147
+	} else {
99 148
 
100
-	offset := (page - 1) * limit
101
-	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
102
-	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()
103
-	defer rows.Close()
149
+		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
104 150
 
105
-	if rows.Next() {
106
-		rows.Scan(&total)
107 151
 	}
108 152
 
153
+	//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()
154
+	//defer rows.Close()
155
+	//
156
+	//if rows.Next() {
157
+	//	rows.Scan(&total)
158
+	//}
159
+
109 160
 	return patientinfo, total, err
110 161
 }
111 162
 
112 163
 //透析检测
113
-func GetTodayDialysisExamination(to int64, ctime int64, page int64, limit int64) (patientinfo []function_models.PatientInfo, total int64, err error) {
164
+func GetTodayDialysisExamination(to int64, ctime int64, page int64, limit int64, admin *admin_models.AdminAccount) (patientinfo []function_models.PatientInfo, total int64, err error) {
165
+
166
+	//offset := (page - 1) * limit
167
+	if admin.IsSuperAdmin == 1 {
168
+		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
114 169
 
115
-	offset := (page - 1) * limit
116
-	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
117
-	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()
118
-	defer rows.Close()
170
+	} else {
171
+		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
119 172
 
120
-	if rows.Next() {
121
-		rows.Scan(&total)
122 173
 	}
174
+	//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()
175
+	//defer rows.Close()
176
+	//
177
+	//if rows.Next() {
178
+	//	rows.Scan(&total)
179
+	//}
123 180
 
124 181
 	return patientinfo, total, err
125 182
 }
126 183
 
127 184
 //透析下机
128
-func GetTodayBeforOrpenetration(to int64, ctime int64, page int64, limit int64) (patientinfo []function_models.PatientInfo, total int64, err error) {
185
+func GetTodayBeforOrpenetration(to int64, ctime int64, page int64, limit int64, admin *admin_models.AdminAccount) (patientinfo []function_models.PatientInfo, total int64, err error) {
186
+
187
+	//offset := (page - 1) * limit
188
+	if admin.IsSuperAdmin == 1 {
189
+		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
129 190
 
130
-	offset := (page - 1) * limit
131
-	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
132
-	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()
133
-	defer rows.Close()
191
+	} else {
192
+		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
134 193
 
135
-	if rows.Next() {
136
-		rows.Scan(&total)
137 194
 	}
195
+	//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()
196
+	//defer rows.Close()
197
+	//
198
+	//if rows.Next() {
199
+	//	rows.Scan(&total)
200
+	//}
138 201
 
139 202
 	return patientinfo, total, err
140 203
 }
141 204
 
142 205
 //透后评估
143
-func GetTodayPostAssessment(to int64, ctime int64, page int64, limit int64) (patientinfo []function_models.PatientInfo, total int64, err error) {
144
-	offset := (page - 1) * limit
145
-	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
146
-	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()
147
-	defer rows.Close()
148
-
149
-	if rows.Next() {
150
-		rows.Scan(&total)
206
+func GetTodayPostAssessment(to int64, ctime int64, page int64, limit int64, admin *admin_models.AdminAccount) (patientinfo []function_models.PatientInfo, total int64, err error) {
207
+	//offset := (page - 1) * limit
208
+	if admin.IsSuperAdmin == 1 {
209
+		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
210
+
211
+	} else {
212
+		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
213
+
151 214
 	}
152 215
 
216
+	//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()
217
+	//defer rows.Close()
218
+	//
219
+	//if rows.Next() {
220
+	//	rows.Scan(&total)
221
+	//}
222
+
153 223
 	return patientinfo, total, err
154 224
 }
155 225
 
156
-func GetTodayEntrylist(to int64, ctime int64, limit int64, page int64) (patientinfo []function_models.PatientInfo, total int64, err error) {
157
-	offset := (page - 1) * limit
158
-	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
159
-	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()
160
-	defer rows.Close()
226
+func GetTodayEntrylist(to int64, ctime int64, limit int64, page int64, admin *admin_models.AdminAccount) (patientinfo []function_models.PatientInfo, total int64, err error) {
227
+	//offset := (page - 1) * limit
228
+	if admin.IsSuperAdmin == 1 {
229
+		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
230
+
231
+	} else {
232
+		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
161 233
 
162
-	if rows.Next() {
163
-		rows.Scan(&total)
164 234
 	}
165 235
 
236
+	//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()
237
+	//defer rows.Close()
238
+	//
239
+	//if rows.Next() {
240
+	//	rows.Scan(&total)
241
+	//}
242
+
166 243
 	return patientinfo, total, err
167 244
 }
168 245
 
169
-func GetTodayExitlist(to int64, ctime int64, limit int64, page int64) (patientinfo []function_models.PatientInfo, total int64, err error) {
170
-	offset := (page - 1) * limit
171
-	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
172
-	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()
173
-	defer rows.Close()
246
+func GetTodayExitlist(to int64, ctime int64, limit int64, page int64, admin *admin_models.AdminAccount) (patientinfo []function_models.PatientInfo, total int64, err error) {
247
+	//offset := (page - 1) * limit
248
+	if admin.IsSuperAdmin == 1 {
249
+		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
250
+
251
+	} else {
252
+		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
174 253
 
175
-	if rows.Next() {
176
-		rows.Scan(&total)
177 254
 	}
178 255
 
256
+	//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()
257
+	//defer rows.Close()
258
+	//
259
+	//if rows.Next() {
260
+	//	rows.Scan(&total)
261
+	//}
262
+
179 263
 	return patientinfo, total, err
180 264
 }

+ 18 - 7
service/org_service.go 查看文件

@@ -10,7 +10,6 @@ import (
10 10
 )
11 11
 
12 12
 func GetAllOrgList(active_status int64, depth_active_status int64, start_time int64, end_time int64, province int64, city int64, district int64, follow int64, keyword string, page int64, limit int64, is_super_admin int64) (list []*models.Org, err error, total int64) {
13
-	fmt.Println("--------- ")
14 13
 
15 14
 	fmt.Println(follow)
16 15
 	offset := (page - 1) * limit
@@ -83,12 +82,12 @@ func GetAllOrgList(active_status int64, depth_active_status int64, start_time in
83 82
 		}
84 83
 
85 84
 	}
86
-	if is_super_admin == 1 {
87
-		db = db.Where("sgj_user_org.status = 1 AND sgj_user_org.import <> 1").Group("sgj_user_org.id")
88
-
89
-	} else {
90
-		db = db.Where("sgj_user_org.status = 1 AND sgj_user_org.import <> 1 AND DATE_SUB(CURDATE(), INTERVAL 15 DAY) <= date(from_unixtime(sgj_user_org.ctime))").Group("sgj_user_org.id")
91
-	}
85
+	//if is_super_admin == 1 {
86
+	db = db.Where("sgj_user_org.status = 1 AND sgj_user_org.import <> 1").Group("sgj_user_org.id")
87
+	//
88
+	//} else {
89
+	//	db = db.Where("sgj_user_org.status = 1 AND sgj_user_org.import <> 1 AND DATE_SUB(CURDATE(), INTERVAL 15 DAY) <= date(from_unixtime(sgj_user_org.ctime))").Group("sgj_user_org.id")
90
+	//}
92 91
 
93 92
 	db = db.Count(&total)
94 93
 	err = db.Preload("OrgFollow", func(db *gorm.DB) *gorm.DB {
@@ -689,3 +688,15 @@ func GetAllValidDeviceNumbers(orgID int64) ([]*DeviceNumberViewModel, error) {
689 688
 	}
690 689
 	return vms, nil
691 690
 }
691
+
692
+func GetFollowOrgList(follow int64) (list []*models.Org, err error) {
693
+
694
+	err = readUserDb.Model(&models.Org{}).Where("NOT EXISTS (Select * FROM sgj_org_follow Where sgj_org_follow.org_id = sgj_user_org.id AND sgj_org_follow.status = 1) AND import <> 1 AND DATE_SUB(CURDATE(), INTERVAL 15 DAY) <= date(from_unixtime(sgj_user_org.ctime)) AND status = 1").Preload("OrgFollow", func(db *gorm.DB) *gorm.DB {
695
+		return db.Model(&models.OrgFollow{}).Where("status = 1").Preload("AdminAccount", "status = 1")
696
+	}).Preload("AdminUserLoginLog", func(db *gorm.DB) *gorm.DB {
697
+		return db.Model(&models.AdminUserLoginLog{}).Where("id = (SELECT max(id))")
698
+	}).Preload("Citys").Order("ctime desc").Scan(&list).Error
699
+
700
+	return
701
+
702
+}