Browse Source

功能查询

xiaoming_global 4 years ago
parent
commit
4c8a723c71
4 changed files with 90 additions and 63 deletions
  1. 75 49
      .idea/workspace.xml
  2. BIN
      XT_Admin_Api.exe
  3. BIN
      XT_Admin_Api.exe~
  4. 15 14
      service/function_service.go

+ 75 - 49
.idea/workspace.xml View File

4
     <list default="true" id="7aa7cc45-aece-4fa3-9063-5e3df12471b4" name="Default" comment="">
4
     <list default="true" id="7aa7cc45-aece-4fa3-9063-5e3df12471b4" name="Default" comment="">
5
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
5
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
6
       <change beforePath="$PROJECT_DIR$/XT_Admin_Api.exe" beforeDir="false" afterPath="$PROJECT_DIR$/XT_Admin_Api.exe" afterDir="false" />
6
       <change beforePath="$PROJECT_DIR$/XT_Admin_Api.exe" beforeDir="false" afterPath="$PROJECT_DIR$/XT_Admin_Api.exe" afterDir="false" />
7
-      <change beforePath="$PROJECT_DIR$/controllers/function_api_controllers/function_api_base_controller.go" beforeDir="false" afterPath="$PROJECT_DIR$/controllers/function_api_controllers/function_api_base_controller.go" afterDir="false" />
8
-      <change beforePath="$PROJECT_DIR$/controllers/function_api_controllers/function_api_router_register.go" beforeDir="false" afterPath="$PROJECT_DIR$/controllers/function_api_controllers/function_api_router_register.go" afterDir="false" />
9
       <change beforePath="$PROJECT_DIR$/service/function_service.go" beforeDir="false" afterPath="$PROJECT_DIR$/service/function_service.go" afterDir="false" />
7
       <change beforePath="$PROJECT_DIR$/service/function_service.go" beforeDir="false" afterPath="$PROJECT_DIR$/service/function_service.go" afterDir="false" />
10
     </list>
8
     </list>
11
     <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
9
     <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
20
       <file leaf-file-name="function_api_router_register.go" pinned="false" current-in-tab="false">
18
       <file leaf-file-name="function_api_router_register.go" pinned="false" current-in-tab="false">
21
         <entry file="file://$PROJECT_DIR$/controllers/function_api_controllers/function_api_router_register.go">
19
         <entry file="file://$PROJECT_DIR$/controllers/function_api_controllers/function_api_router_register.go">
22
           <provider selected="true" editor-type-id="text-editor">
20
           <provider selected="true" editor-type-id="text-editor">
23
-            <state relative-caret-position="47">
21
+            <state relative-caret-position="391">
24
               <caret line="87" column="79" selection-start-line="87" selection-start-column="54" selection-end-line="87" selection-end-column="79" />
22
               <caret line="87" column="79" selection-start-line="87" selection-start-column="54" selection-end-line="87" selection-end-column="79" />
25
               <folding>
23
               <folding>
26
                 <element signature="e#34#79#0" expanded="true" />
24
                 <element signature="e#34#79#0" expanded="true" />
41
       <file leaf-file-name="function_service.go" pinned="false" current-in-tab="true">
39
       <file leaf-file-name="function_service.go" pinned="false" current-in-tab="true">
42
         <entry file="file://$PROJECT_DIR$/service/function_service.go">
40
         <entry file="file://$PROJECT_DIR$/service/function_service.go">
43
           <provider selected="true" editor-type-id="text-editor">
41
           <provider selected="true" editor-type-id="text-editor">
44
-            <state relative-caret-position="296">
45
-              <caret line="137" column="248" selection-start-line="137" selection-start-column="248" selection-end-line="137" selection-end-column="248" />
42
+            <state relative-caret-position="373">
43
+              <caret line="149" column="138" selection-start-line="149" selection-start-column="138" selection-end-line="149" selection-end-column="138" />
46
               <folding>
44
               <folding>
47
                 <element signature="e#17#73#0" expanded="true" />
45
                 <element signature="e#17#73#0" expanded="true" />
48
               </folding>
46
               </folding>
50
           </provider>
48
           </provider>
51
         </entry>
49
         </entry>
52
       </file>
50
       </file>
51
+      <file leaf-file-name="admin_api_router_register.go" pinned="false" current-in-tab="false">
52
+        <entry file="file://$PROJECT_DIR$/controllers/admin_api_controllers/admin_api_router_register.go">
53
+          <provider selected="true" editor-type-id="text-editor">
54
+            <state relative-caret-position="279">
55
+              <caret line="24" column="62" selection-start-line="24" selection-start-column="46" selection-end-line="24" selection-end-column="62" />
56
+            </state>
57
+          </provider>
58
+        </entry>
59
+      </file>
60
+      <file leaf-file-name="org_api_controller.go" pinned="false" current-in-tab="false">
61
+        <entry file="file://$PROJECT_DIR$/controllers/admin_api_controllers/org_api_controller.go">
62
+          <provider selected="true" editor-type-id="text-editor">
63
+            <state relative-caret-position="230">
64
+              <caret line="278" column="72" selection-start-line="278" selection-start-column="47" selection-end-line="278" selection-end-column="72" />
65
+            </state>
66
+          </provider>
67
+        </entry>
68
+      </file>
69
+      <file leaf-file-name="org_service.go" pinned="false" current-in-tab="false">
70
+        <entry file="file://$PROJECT_DIR$/service/org_service.go">
71
+          <provider selected="true" editor-type-id="text-editor">
72
+            <state relative-caret-position="5020">
73
+              <caret line="566" column="267" selection-start-line="566" selection-start-column="176" selection-end-line="566" selection-end-column="267" />
74
+            </state>
75
+          </provider>
76
+        </entry>
77
+      </file>
53
       <file leaf-file-name="fuction_query_models.go" pinned="false" current-in-tab="false">
78
       <file leaf-file-name="fuction_query_models.go" pinned="false" current-in-tab="false">
54
         <entry file="file://$PROJECT_DIR$/models/function_models/fuction_query_models.go">
79
         <entry file="file://$PROJECT_DIR$/models/function_models/fuction_query_models.go">
55
           <provider selected="true" editor-type-id="text-editor">
80
           <provider selected="true" editor-type-id="text-editor">
56
-            <state relative-caret-position="11286">
57
-              <caret line="513" column="13" selection-start-line="513" selection-start-column="13" selection-end-line="513" selection-end-column="13" />
81
+            <state relative-caret-position="11264">
82
+              <caret line="512" column="5" selection-start-line="512" selection-start-column="5" selection-end-line="512" selection-end-column="5" />
58
             </state>
83
             </state>
59
           </provider>
84
           </provider>
60
         </entry>
85
         </entry>
62
       <file leaf-file-name="function_api_base_controller.go" pinned="false" current-in-tab="false">
87
       <file leaf-file-name="function_api_base_controller.go" pinned="false" current-in-tab="false">
63
         <entry file="file://$PROJECT_DIR$/controllers/function_api_controllers/function_api_base_controller.go">
88
         <entry file="file://$PROJECT_DIR$/controllers/function_api_controllers/function_api_base_controller.go">
64
           <provider selected="true" editor-type-id="text-editor">
89
           <provider selected="true" editor-type-id="text-editor">
65
-            <state relative-caret-position="319">
90
+            <state relative-caret-position="79068">
66
               <caret line="3601" column="90" selection-start-line="3601" selection-start-column="90" selection-end-line="3601" selection-end-column="90" />
91
               <caret line="3601" column="90" selection-start-line="3601" selection-start-column="90" selection-end-line="3601" selection-end-column="90" />
67
             </state>
92
             </state>
68
           </provider>
93
           </provider>
97
   </component>
122
   </component>
98
   <component name="FindInProjectRecents">
123
   <component name="FindInProjectRecents">
99
     <findStrings>
124
     <findStrings>
100
-      <find>SchedualPatient</find>
101
-      <find>patient_count_list</find>
102
-      <find>aaa</find>
103
-      <find>newPatientStatistics</find>
104
       <find>/api/dialysis/start_record</find>
125
       <find>/api/dialysis/start_record</find>
105
       <find>GetMonthReceiveinfo</find>
126
       <find>GetMonthReceiveinfo</find>
106
       <find>GetTodayDialysisMachinek</find>
127
       <find>GetTodayDialysisMachinek</find>
127
       <find>GetYesterdayEntrylist</find>
148
       <find>GetYesterdayEntrylist</find>
128
       <find>GetYesterdayExitlist</find>
149
       <find>GetYesterdayExitlist</find>
129
       <find>/api/function/getyestrdayexitlist</find>
150
       <find>/api/function/getyestrdayexitlist</find>
151
+      <find>/org/org_info</find>
152
+      <find>/admin/api/org/adminuser</find>
153
+      <find>GetOrgAdminUser</find>
154
+      <find>import</find>
130
     </findStrings>
155
     </findStrings>
131
     <dirStrings>
156
     <dirStrings>
132
       <dir>D:\goyard\src\XT_Admin_Api\controllers\admin_api_controllers</dir>
157
       <dir>D:\goyard\src\XT_Admin_Api\controllers\admin_api_controllers</dir>
211
     <property name="DefaultGoTemplateProperty" value="Go Application" />
236
     <property name="DefaultGoTemplateProperty" value="Go Application" />
212
     <property name="go.gopath.indexing.explicitly.defined" value="true" />
237
     <property name="go.gopath.indexing.explicitly.defined" value="true" />
213
     <property name="go.sdk.automatically.set" value="true" />
238
     <property name="go.sdk.automatically.set" value="true" />
214
-    <property name="last_opened_file_path" value="$PROJECT_DIR$/../XT" />
239
+    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
215
   </component>
240
   </component>
216
   <component name="RunDashboard">
241
   <component name="RunDashboard">
217
     <option name="ruleStates">
242
     <option name="ruleStates">
227
   </component>
252
   </component>
228
   <component name="ToolWindowManager">
253
   <component name="ToolWindowManager">
229
     <frame x="-7" y="-7" width="1550" height="838" extended-state="6" />
254
     <frame x="-7" y="-7" width="1550" height="838" extended-state="6" />
255
+    <editor active="true" />
230
     <layout>
256
     <layout>
231
-      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.20710456" />
257
+      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.21782842" />
232
       <window_info anchor="bottom" id="TODO" order="6" />
258
       <window_info anchor="bottom" id="TODO" order="6" />
233
-      <window_info anchor="bottom" id="Event Log" order="7" sideWeight="0.113270774" side_tool="true" visible="true" weight="0.39372325" />
259
+      <window_info anchor="bottom" id="Event Log" order="7" sideWeight="0.11461126" side_tool="true" weight="0.29101285" />
234
       <window_info anchor="right" id="Database" order="3" />
260
       <window_info anchor="right" id="Database" order="3" />
261
+      <window_info anchor="bottom" id="Find" order="1" />
235
       <window_info anchor="bottom" id="Database Changes" order="8" show_stripe_button="false" />
262
       <window_info anchor="bottom" id="Database Changes" order="8" show_stripe_button="false" />
236
       <window_info anchor="bottom" id="Version Control" order="9" />
263
       <window_info anchor="bottom" id="Version Control" order="9" />
237
       <window_info anchor="bottom" id="Run" order="2" />
264
       <window_info anchor="bottom" id="Run" order="2" />
238
       <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
265
       <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
239
-      <window_info active="true" anchor="bottom" id="Terminal" order="10" sideWeight="0.88672924" visible="true" weight="0.39372325" />
266
+      <window_info active="true" anchor="bottom" id="Terminal" order="10" sideWeight="0.88538873" visible="true" weight="0.0" />
240
       <window_info id="Favorites" order="2" side_tool="true" />
267
       <window_info id="Favorites" order="2" side_tool="true" />
241
       <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
268
       <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
242
       <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
269
       <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
245
       <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
272
       <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
246
       <window_info anchor="bottom" id="Message" order="0" />
273
       <window_info anchor="bottom" id="Message" order="0" />
247
       <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
274
       <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
248
-      <window_info anchor="bottom" id="Find" order="1" />
249
     </layout>
275
     </layout>
250
   </component>
276
   </component>
251
   <component name="TypeScriptGeneratedFilesManager">
277
   <component name="TypeScriptGeneratedFilesManager">
260
     </breakpoint-manager>
286
     </breakpoint-manager>
261
   </component>
287
   </component>
262
   <component name="editorHistoryManager">
288
   <component name="editorHistoryManager">
263
-    <entry file="file://$PROJECT_DIR$/controllers/function_api_controllers/function_api_base_controller.go">
264
-      <provider selected="true" editor-type-id="text-editor">
265
-        <state relative-caret-position="65296">
266
-          <caret line="2975" column="6" selection-start-line="2975" selection-start-column="6" selection-end-line="2975" selection-end-column="6" />
267
-        </state>
268
-      </provider>
269
-    </entry>
270
-    <entry file="file://$PROJECT_DIR$/controllers/admin_api_controllers/analysis_api_controller.go">
271
-      <provider selected="true" editor-type-id="text-editor">
272
-        <state relative-caret-position="9240">
273
-          <caret line="427" selection-start-line="427" selection-end-line="427" />
274
-        </state>
275
-      </provider>
276
-    </entry>
277
     <entry file="file://$PROJECT_DIR$/controllers/function_api_controllers/function_api_router_register.go">
289
     <entry file="file://$PROJECT_DIR$/controllers/function_api_controllers/function_api_router_register.go">
278
       <provider selected="true" editor-type-id="text-editor">
290
       <provider selected="true" editor-type-id="text-editor">
279
         <state relative-caret-position="1650">
291
         <state relative-caret-position="1650">
507
         </state>
519
         </state>
508
       </provider>
520
       </provider>
509
     </entry>
521
     </entry>
510
-    <entry file="file://$PROJECT_DIR$/controllers/admin_api_controllers/admin_api_router_register.go">
511
-      <provider selected="true" editor-type-id="text-editor">
512
-        <state relative-caret-position="308">
513
-          <caret line="19" lean-forward="true" selection-start-line="19" selection-end-line="19" />
514
-        </state>
515
-      </provider>
516
-    </entry>
517
     <entry file="file://$PROJECT_DIR$/controllers/admin_api_controllers/login_api_controller.go">
522
     <entry file="file://$PROJECT_DIR$/controllers/admin_api_controllers/login_api_controller.go">
518
       <provider selected="true" editor-type-id="text-editor">
523
       <provider selected="true" editor-type-id="text-editor">
519
         <state relative-caret-position="110">
524
         <state relative-caret-position="110">
584
         </state>
589
         </state>
585
       </provider>
590
       </provider>
586
     </entry>
591
     </entry>
587
-    <entry file="file://$PROJECT_DIR$/models/function_models/fuction_query_models.go">
588
-      <provider selected="true" editor-type-id="text-editor">
589
-        <state relative-caret-position="11286">
590
-          <caret line="513" column="13" selection-start-line="513" selection-start-column="13" selection-end-line="513" selection-end-column="13" />
591
-        </state>
592
-      </provider>
593
-    </entry>
594
     <entry file="file://$PROJECT_DIR$/service/admin_service.go">
592
     <entry file="file://$PROJECT_DIR$/service/admin_service.go">
595
       <provider selected="true" editor-type-id="text-editor">
593
       <provider selected="true" editor-type-id="text-editor">
596
         <state relative-caret-position="572">
594
         <state relative-caret-position="572">
607
     </entry>
605
     </entry>
608
     <entry file="file://$PROJECT_DIR$/controllers/function_api_controllers/function_api_base_controller.go">
606
     <entry file="file://$PROJECT_DIR$/controllers/function_api_controllers/function_api_base_controller.go">
609
       <provider selected="true" editor-type-id="text-editor">
607
       <provider selected="true" editor-type-id="text-editor">
610
-        <state relative-caret-position="319">
608
+        <state relative-caret-position="79068">
611
           <caret line="3601" column="90" selection-start-line="3601" selection-start-column="90" selection-end-line="3601" selection-end-column="90" />
609
           <caret line="3601" column="90" selection-start-line="3601" selection-start-column="90" selection-end-line="3601" selection-end-column="90" />
612
         </state>
610
         </state>
613
       </provider>
611
       </provider>
614
     </entry>
612
     </entry>
613
+    <entry file="file://$PROJECT_DIR$/models/function_models/fuction_query_models.go">
614
+      <provider selected="true" editor-type-id="text-editor">
615
+        <state relative-caret-position="11264">
616
+          <caret line="512" column="5" selection-start-line="512" selection-start-column="5" selection-end-line="512" selection-end-column="5" />
617
+        </state>
618
+      </provider>
619
+    </entry>
620
+    <entry file="file://$PROJECT_DIR$/controllers/admin_api_controllers/admin_api_router_register.go">
621
+      <provider selected="true" editor-type-id="text-editor">
622
+        <state relative-caret-position="279">
623
+          <caret line="24" column="62" selection-start-line="24" selection-start-column="46" selection-end-line="24" selection-end-column="62" />
624
+        </state>
625
+      </provider>
626
+    </entry>
627
+    <entry file="file://$PROJECT_DIR$/controllers/admin_api_controllers/org_api_controller.go">
628
+      <provider selected="true" editor-type-id="text-editor">
629
+        <state relative-caret-position="230">
630
+          <caret line="278" column="72" selection-start-line="278" selection-start-column="47" selection-end-line="278" selection-end-column="72" />
631
+        </state>
632
+      </provider>
633
+    </entry>
634
+    <entry file="file://$PROJECT_DIR$/service/org_service.go">
635
+      <provider selected="true" editor-type-id="text-editor">
636
+        <state relative-caret-position="5020">
637
+          <caret line="566" column="267" selection-start-line="566" selection-start-column="176" selection-end-line="566" selection-end-column="267" />
638
+        </state>
639
+      </provider>
640
+    </entry>
615
     <entry file="file://$PROJECT_DIR$/controllers/function_api_controllers/function_api_router_register.go">
641
     <entry file="file://$PROJECT_DIR$/controllers/function_api_controllers/function_api_router_register.go">
616
       <provider selected="true" editor-type-id="text-editor">
642
       <provider selected="true" editor-type-id="text-editor">
617
-        <state relative-caret-position="47">
643
+        <state relative-caret-position="391">
618
           <caret line="87" column="79" selection-start-line="87" selection-start-column="54" selection-end-line="87" selection-end-column="79" />
644
           <caret line="87" column="79" selection-start-line="87" selection-start-column="54" selection-end-line="87" selection-end-column="79" />
619
           <folding>
645
           <folding>
620
             <element signature="e#34#79#0" expanded="true" />
646
             <element signature="e#34#79#0" expanded="true" />
624
     </entry>
650
     </entry>
625
     <entry file="file://$PROJECT_DIR$/service/function_service.go">
651
     <entry file="file://$PROJECT_DIR$/service/function_service.go">
626
       <provider selected="true" editor-type-id="text-editor">
652
       <provider selected="true" editor-type-id="text-editor">
627
-        <state relative-caret-position="296">
628
-          <caret line="137" column="248" selection-start-line="137" selection-start-column="248" selection-end-line="137" selection-end-column="248" />
653
+        <state relative-caret-position="373">
654
+          <caret line="149" column="138" selection-start-line="149" selection-start-column="138" selection-end-line="149" selection-end-column="138" />
629
           <folding>
655
           <folding>
630
             <element signature="e#17#73#0" expanded="true" />
656
             <element signature="e#17#73#0" expanded="true" />
631
           </folding>
657
           </folding>

BIN
XT_Admin_Api.exe View File


BIN
XT_Admin_Api.exe~ View File


+ 15 - 14
service/function_service.go View File

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