|
@@ -8699,10 +8699,11 @@ func GetPatientDryWeight(org_id int64, patient_id int64) (weight []*models.SgjPa
|
8699
|
8699
|
return weight, err
|
8700
|
8700
|
}
|
8701
|
8701
|
|
8702
|
|
-func MobileGetLongScheduleDoctorAdvices(orgID int64, scheduleDate int64, adviceType int, patientType int, adminUserId int64, deliverWay string, scheduleType int64, partitonType int64, patient_id int64, execution_state int64, cost_type int64, execution_frequency string) ([]*MScheduleDoctorAdviceVM, error) {
|
|
8702
|
+func MobileGetLongScheduleDoctorAdvices(orgID int64, scheduleDate int64, adviceType int, patientType int, adminUserId int64, deliverWay string, scheduleType int64, partitonType int64, patient_id int64, execution_state int64, cost_type int64, execution_frequency string, keyword string) ([]*MScheduleDoctorAdviceVM, error) {
|
8703
|
8703
|
|
8704
|
8704
|
var vms []*MScheduleDoctorAdviceVM
|
8705
|
8705
|
adviceWhere := ""
|
|
8706
|
+ keyword = "%" + keyword + "%"
|
8706
|
8707
|
adviceCondition := []interface{}{}
|
8707
|
8708
|
if adviceType == 1 {
|
8708
|
8709
|
if patientType == 0 {
|
|
@@ -8710,20 +8711,44 @@ func MobileGetLongScheduleDoctorAdvices(orgID int64, scheduleDate int64, adviceT
|
8710
|
8711
|
if execution_state > 0 {
|
8711
|
8712
|
if cost_type > 0 {
|
8712
|
8713
|
if len(execution_frequency) > 0 {
|
8713
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 and patient_id = ? and execution_state = ? and is_settle = ? and execution_frequency = ?"
|
8714
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, execution_state, cost_type, execution_frequency)
|
|
8714
|
+ if len(keyword) > 0 {
|
|
8715
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 and patient_id = ? and execution_state = ? and is_settle = ? and execution_frequency = ? and advice_name like ?"
|
|
8716
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, execution_state, cost_type, execution_frequency, keyword)
|
|
8717
|
+ } else {
|
|
8718
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 and patient_id = ? and execution_state = ? and is_settle = ? and execution_frequency = ?"
|
|
8719
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, execution_state, cost_type, execution_frequency)
|
|
8720
|
+ }
|
|
8721
|
+
|
8715
|
8722
|
} else {
|
8716
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 and patient_id = ? and execution_state = ? and is_settle = ?"
|
8717
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, execution_state, cost_type)
|
|
8723
|
+ if len(keyword) > 0 {
|
|
8724
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 and patient_id = ? and execution_state = ? and is_settle = ? and advice_name like ?"
|
|
8725
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, execution_state, cost_type, keyword)
|
|
8726
|
+ } else {
|
|
8727
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 and patient_id = ? and execution_state = ? and is_settle = ?"
|
|
8728
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, execution_state, cost_type)
|
|
8729
|
+ }
|
|
8730
|
+
|
8718
|
8731
|
}
|
8719
|
8732
|
|
8720
|
8733
|
} else {
|
8721
|
8734
|
if len(execution_frequency) > 0 {
|
8722
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 and patient_id = ? and execution_state = ? and execution_frequency = ?"
|
8723
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, execution_state, execution_frequency)
|
|
8735
|
+ if len(keyword) > 0 {
|
|
8736
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 and patient_id = ? and execution_state = ? and execution_frequency = ? and advice_name like ?"
|
|
8737
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, execution_state, execution_frequency, keyword)
|
|
8738
|
+ } else {
|
|
8739
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 and patient_id = ? and execution_state = ? and execution_frequency = ?"
|
|
8740
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, execution_state, execution_frequency)
|
|
8741
|
+ }
|
|
8742
|
+
|
8724
|
8743
|
} else {
|
8725
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 and patient_id = ? and execution_state = ?"
|
8726
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, execution_state)
|
|
8744
|
+ if len(keyword) > 0 {
|
|
8745
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 and patient_id = ? and execution_state = ? and advice_name like ?"
|
|
8746
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, execution_state, keyword)
|
|
8747
|
+ } else {
|
|
8748
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 and patient_id = ? and execution_state = ?"
|
|
8749
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, execution_state)
|
|
8750
|
+ }
|
|
8751
|
+
|
8727
|
8752
|
}
|
8728
|
8753
|
|
8729
|
8754
|
}
|
|
@@ -8731,20 +8756,44 @@ func MobileGetLongScheduleDoctorAdvices(orgID int64, scheduleDate int64, adviceT
|
8731
|
8756
|
} else {
|
8732
|
8757
|
if cost_type > 0 {
|
8733
|
8758
|
if len(execution_frequency) > 0 {
|
8734
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 and patient_id = ? and is_settle = ? and execution_frequency = ?"
|
8735
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, cost_type, execution_frequency)
|
|
8759
|
+ if len(keyword) > 0 {
|
|
8760
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 and patient_id = ? and is_settle = ? and execution_frequency = ? and advice_name like ?"
|
|
8761
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, cost_type, execution_frequency, keyword)
|
|
8762
|
+ } else {
|
|
8763
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 and patient_id = ? and is_settle = ? and execution_frequency = ?"
|
|
8764
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, cost_type, execution_frequency)
|
|
8765
|
+ }
|
|
8766
|
+
|
8736
|
8767
|
} else {
|
8737
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 and patient_id = ? and is_settle = ? "
|
8738
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, cost_type)
|
|
8768
|
+ if len(keyword) > 0 {
|
|
8769
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 and patient_id = ? and is_settle = ? and advice_name like ?"
|
|
8770
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, cost_type, keyword)
|
|
8771
|
+ } else {
|
|
8772
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 and patient_id = ? and is_settle = ? "
|
|
8773
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, cost_type)
|
|
8774
|
+ }
|
|
8775
|
+
|
8739
|
8776
|
}
|
8740
|
8777
|
|
8741
|
8778
|
} else {
|
8742
|
8779
|
if len(execution_frequency) > 0 {
|
8743
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 and patient_id = ? and execution_frequency = ?"
|
8744
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, execution_frequency)
|
|
8780
|
+ if len(keyword) > 0 {
|
|
8781
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 and patient_id = ? and execution_frequency = ? and advice_name like ?"
|
|
8782
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, execution_frequency, keyword)
|
|
8783
|
+ } else {
|
|
8784
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 and patient_id = ? and execution_frequency = ?"
|
|
8785
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, execution_frequency)
|
|
8786
|
+ }
|
|
8787
|
+
|
8745
|
8788
|
} else {
|
8746
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 and patient_id = ? "
|
8747
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id)
|
|
8789
|
+ if len(keyword) > 0 {
|
|
8790
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 and patient_id = ? and advice_name like ?"
|
|
8791
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, keyword)
|
|
8792
|
+ } else {
|
|
8793
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 and patient_id = ? "
|
|
8794
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id)
|
|
8795
|
+ }
|
|
8796
|
+
|
8748
|
8797
|
}
|
8749
|
8798
|
|
8750
|
8799
|
}
|
|
@@ -8755,31 +8804,67 @@ func MobileGetLongScheduleDoctorAdvices(orgID int64, scheduleDate int64, adviceT
|
8755
|
8804
|
if execution_state > 0 {
|
8756
|
8805
|
if cost_type > 0 {
|
8757
|
8806
|
if len(execution_frequency) > 0 {
|
8758
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 and execution_state = ? and is_settle = ? and execution_frequency = ?"
|
8759
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, execution_state, cost_type, execution_frequency)
|
|
8807
|
+ if len(keyword) > 0 {
|
|
8808
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 and execution_state = ? and is_settle = ? and execution_frequency = ? and advice_name like ?"
|
|
8809
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, execution_state, cost_type, execution_frequency, keyword)
|
|
8810
|
+ } else {
|
|
8811
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 and execution_state = ? and is_settle = ? and execution_frequency = ?"
|
|
8812
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, execution_state, cost_type, execution_frequency)
|
|
8813
|
+ }
|
|
8814
|
+
|
8760
|
8815
|
} else {
|
8761
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 and execution_state = ? and is_settle = ?"
|
8762
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, execution_state, cost_type)
|
|
8816
|
+ if len(keyword) > 0 {
|
|
8817
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 and execution_state = ? and is_settle = ? and advice_name like ?"
|
|
8818
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, execution_state, cost_type, keyword)
|
|
8819
|
+ } else {
|
|
8820
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 and execution_state = ? and is_settle = ?"
|
|
8821
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, execution_state, cost_type)
|
|
8822
|
+ }
|
|
8823
|
+
|
8763
|
8824
|
}
|
8764
|
8825
|
|
8765
|
8826
|
} else {
|
8766
|
8827
|
if len(execution_frequency) > 0 {
|
8767
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 and execution_state = ? and execution_frequency = ?"
|
8768
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, execution_state, execution_frequency)
|
|
8828
|
+ if len(keyword) > 0 {
|
|
8829
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 and execution_state = ? and execution_frequency = ? and advice_name like ?"
|
|
8830
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, execution_state, execution_frequency, keyword)
|
|
8831
|
+ } else {
|
|
8832
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 and execution_state = ? and execution_frequency = ?"
|
|
8833
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, execution_state, execution_frequency)
|
|
8834
|
+ }
|
|
8835
|
+
|
8769
|
8836
|
} else {
|
8770
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 and execution_state = ?"
|
8771
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, execution_state)
|
|
8837
|
+ if len(keyword) > 0 {
|
|
8838
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 and execution_state = ? and advice_name like ?"
|
|
8839
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, execution_state, keyword)
|
|
8840
|
+ } else {
|
|
8841
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 and execution_state = ?"
|
|
8842
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, execution_state)
|
|
8843
|
+ }
|
|
8844
|
+
|
8772
|
8845
|
}
|
8773
|
8846
|
|
8774
|
8847
|
}
|
8775
|
8848
|
|
8776
|
8849
|
} else {
|
8777
|
8850
|
if cost_type > 0 {
|
8778
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 and is_settle = ? "
|
8779
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, cost_type)
|
|
8851
|
+ if len(keyword) > 0 {
|
|
8852
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 and is_settle = ? and advice_name like ?"
|
|
8853
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, cost_type, keyword)
|
|
8854
|
+ } else {
|
|
8855
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 and is_settle = ? "
|
|
8856
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, cost_type)
|
|
8857
|
+ }
|
|
8858
|
+
|
8780
|
8859
|
} else {
|
8781
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 "
|
8782
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID)
|
|
8860
|
+ if len(keyword) > 0 {
|
|
8861
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 and advice_name like ?"
|
|
8862
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, keyword)
|
|
8863
|
+ } else {
|
|
8864
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 "
|
|
8865
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID)
|
|
8866
|
+ }
|
|
8867
|
+
|
8783
|
8868
|
}
|
8784
|
8869
|
|
8785
|
8870
|
}
|
|
@@ -8791,20 +8876,44 @@ func MobileGetLongScheduleDoctorAdvices(orgID int64, scheduleDate int64, adviceT
|
8791
|
8876
|
if execution_state > 0 {
|
8792
|
8877
|
if cost_type > 0 {
|
8793
|
8878
|
if len(execution_frequency) > 0 {
|
8794
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and patient_id = ? and execution_state = ? and is_settle = ? and execution_frequency = ?"
|
8795
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, patient_id, execution_state, cost_type, execution_frequency)
|
|
8879
|
+ if len(keyword) > 0 {
|
|
8880
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and patient_id = ? and execution_state = ? and is_settle = ? and execution_frequency = ? and advice_name like ?"
|
|
8881
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, patient_id, execution_state, cost_type, execution_frequency, keyword)
|
|
8882
|
+ } else {
|
|
8883
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and patient_id = ? and execution_state = ? and is_settle = ? and execution_frequency = ?"
|
|
8884
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, patient_id, execution_state, cost_type, execution_frequency)
|
|
8885
|
+ }
|
|
8886
|
+
|
8796
|
8887
|
} else {
|
8797
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and patient_id = ? and execution_state = ? and is_settle = ?"
|
8798
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, patient_id, execution_state, cost_type)
|
|
8888
|
+ if len(keyword) > 0 {
|
|
8889
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and patient_id = ? and execution_state = ? and is_settle = ? and advice_name like ?"
|
|
8890
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, patient_id, execution_state, cost_type, keyword)
|
|
8891
|
+ } else {
|
|
8892
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and patient_id = ? and execution_state = ? and is_settle = ?"
|
|
8893
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, patient_id, execution_state, cost_type)
|
|
8894
|
+ }
|
|
8895
|
+
|
8799
|
8896
|
}
|
8800
|
8897
|
|
8801
|
8898
|
} else {
|
8802
|
8899
|
if len(execution_frequency) > 0 {
|
8803
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and patient_id = ? and execution_state = ? and execution_frequency = ?"
|
8804
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, patient_id, execution_state, execution_frequency)
|
|
8900
|
+ if len(keyword) > 0 {
|
|
8901
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and patient_id = ? and execution_state = ? and execution_frequency = ? and advice_name like ?"
|
|
8902
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, patient_id, execution_state, execution_frequency, keyword)
|
|
8903
|
+ } else {
|
|
8904
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and patient_id = ? and execution_state = ? and execution_frequency = ?"
|
|
8905
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, patient_id, execution_state, execution_frequency)
|
|
8906
|
+ }
|
|
8907
|
+
|
8805
|
8908
|
} else {
|
8806
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and patient_id = ? and execution_state = ?"
|
8807
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, patient_id, execution_state)
|
|
8909
|
+ if len(keyword) > 0 {
|
|
8910
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and patient_id = ? and execution_state = ? and advice_name like ?"
|
|
8911
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, patient_id, execution_state, keyword)
|
|
8912
|
+ } else {
|
|
8913
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and patient_id = ? and execution_state = ?"
|
|
8914
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, patient_id, execution_state)
|
|
8915
|
+ }
|
|
8916
|
+
|
8808
|
8917
|
}
|
8809
|
8918
|
|
8810
|
8919
|
}
|
|
@@ -8812,20 +8921,44 @@ func MobileGetLongScheduleDoctorAdvices(orgID int64, scheduleDate int64, adviceT
|
8812
|
8921
|
} else {
|
8813
|
8922
|
if cost_type > 0 {
|
8814
|
8923
|
if len(execution_frequency) > 0 {
|
8815
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and patient_id = ? and is_settle = ?and execution_frequency = ?"
|
8816
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, patient_id, cost_type, execution_frequency)
|
|
8924
|
+ if len(keyword) > 0 {
|
|
8925
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and patient_id = ? and is_settle = ?and execution_frequency = ? and advice_name like ?"
|
|
8926
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, patient_id, cost_type, execution_frequency, keyword)
|
|
8927
|
+ } else {
|
|
8928
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and patient_id = ? and is_settle = ?and execution_frequency = ?"
|
|
8929
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, patient_id, cost_type, execution_frequency)
|
|
8930
|
+ }
|
|
8931
|
+
|
8817
|
8932
|
} else {
|
8818
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and patient_id = ? and is_settle = ?"
|
8819
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, patient_id, cost_type)
|
|
8933
|
+ if len(keyword) > 0 {
|
|
8934
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and patient_id = ? and is_settle = ? and advice_name like ?"
|
|
8935
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, patient_id, cost_type, keyword)
|
|
8936
|
+ } else {
|
|
8937
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and patient_id = ? and is_settle = ?"
|
|
8938
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, patient_id, cost_type)
|
|
8939
|
+ }
|
|
8940
|
+
|
8820
|
8941
|
}
|
8821
|
8942
|
|
8822
|
8943
|
} else {
|
8823
|
8944
|
if len(execution_frequency) > 0 {
|
8824
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and patient_id = ? and execution_frequency = ?"
|
8825
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, patient_id, execution_frequency)
|
|
8945
|
+ if len(keyword) > 0 {
|
|
8946
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and patient_id = ? and execution_frequency = ? and advice_name like ?"
|
|
8947
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, patient_id, execution_frequency, keyword)
|
|
8948
|
+ } else {
|
|
8949
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and patient_id = ? and execution_frequency = ?"
|
|
8950
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, patient_id, execution_frequency)
|
|
8951
|
+ }
|
|
8952
|
+
|
8826
|
8953
|
} else {
|
8827
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and patient_id = ?"
|
8828
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, patient_id)
|
|
8954
|
+ if len(keyword) > 0 {
|
|
8955
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and patient_id = ? and advice_name like ?"
|
|
8956
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, patient_id, keyword)
|
|
8957
|
+ } else {
|
|
8958
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and patient_id = ?"
|
|
8959
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, patient_id)
|
|
8960
|
+ }
|
|
8961
|
+
|
8829
|
8962
|
}
|
8830
|
8963
|
|
8831
|
8964
|
}
|
|
@@ -8836,20 +8969,44 @@ func MobileGetLongScheduleDoctorAdvices(orgID int64, scheduleDate int64, adviceT
|
8836
|
8969
|
if execution_state > 0 {
|
8837
|
8970
|
if cost_type > 0 {
|
8838
|
8971
|
if len(execution_frequency) > 0 {
|
8839
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and execution_state=? and is_settle = ?and execution_frequency = ?"
|
8840
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, execution_state, cost_type, execution_frequency)
|
|
8972
|
+ if len(keyword) > 0 {
|
|
8973
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and execution_state=? and is_settle = ?and execution_frequency = ? and advice_name like ?"
|
|
8974
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, execution_state, cost_type, execution_frequency, keyword)
|
|
8975
|
+ } else {
|
|
8976
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and execution_state=? and is_settle = ?and execution_frequency = ?"
|
|
8977
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, execution_state, cost_type, execution_frequency)
|
|
8978
|
+ }
|
|
8979
|
+
|
8841
|
8980
|
} else {
|
8842
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and execution_state=? and is_settle = ?"
|
8843
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, execution_state, cost_type)
|
|
8981
|
+ if len(keyword) > 0 {
|
|
8982
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and execution_state=? and is_settle = ? and advice_name like ?"
|
|
8983
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, execution_state, cost_type, keyword)
|
|
8984
|
+ } else {
|
|
8985
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and execution_state=? and is_settle = ?"
|
|
8986
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, execution_state, cost_type)
|
|
8987
|
+ }
|
|
8988
|
+
|
8844
|
8989
|
}
|
8845
|
8990
|
|
8846
|
8991
|
} else {
|
8847
|
8992
|
if len(execution_frequency) > 0 {
|
8848
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and execution_state=?and execution_frequency = ?"
|
8849
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, execution_state, execution_frequency)
|
|
8993
|
+ if len(keyword) > 0 {
|
|
8994
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and execution_state=?and execution_frequency = ? and advice_name like ?"
|
|
8995
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, execution_state, execution_frequency, keyword)
|
|
8996
|
+ } else {
|
|
8997
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and execution_state=?and execution_frequency = ?"
|
|
8998
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, execution_state, execution_frequency)
|
|
8999
|
+ }
|
|
9000
|
+
|
8850
|
9001
|
} else {
|
8851
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and execution_state=?"
|
8852
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, execution_state)
|
|
9002
|
+ if len(keyword) > 0 {
|
|
9003
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and execution_state=? and advice_name like ?"
|
|
9004
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, execution_state, keyword)
|
|
9005
|
+ } else {
|
|
9006
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and execution_state=?"
|
|
9007
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, execution_state)
|
|
9008
|
+ }
|
|
9009
|
+
|
8853
|
9010
|
}
|
8854
|
9011
|
|
8855
|
9012
|
}
|
|
@@ -8857,20 +9014,44 @@ func MobileGetLongScheduleDoctorAdvices(orgID int64, scheduleDate int64, adviceT
|
8857
|
9014
|
} else {
|
8858
|
9015
|
if cost_type > 0 {
|
8859
|
9016
|
if len(execution_frequency) > 0 {
|
8860
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and is_settle = ? and execution_frequency = ?"
|
8861
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, cost_type, execution_frequency)
|
|
9017
|
+ if len(keyword) > 0 {
|
|
9018
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and is_settle = ? and execution_frequency = ? and advice_name like ?"
|
|
9019
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, cost_type, execution_frequency, keyword)
|
|
9020
|
+ } else {
|
|
9021
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and is_settle = ? and execution_frequency = ?"
|
|
9022
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, cost_type, execution_frequency)
|
|
9023
|
+ }
|
|
9024
|
+
|
8862
|
9025
|
} else {
|
8863
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and is_settle = ? "
|
8864
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, cost_type)
|
|
9026
|
+ if len(keyword) > 0 {
|
|
9027
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and is_settle = ? and advice_name like ?"
|
|
9028
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, cost_type, keyword)
|
|
9029
|
+ } else {
|
|
9030
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and is_settle = ? "
|
|
9031
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, cost_type)
|
|
9032
|
+ }
|
|
9033
|
+
|
8865
|
9034
|
}
|
8866
|
9035
|
|
8867
|
9036
|
} else {
|
8868
|
9037
|
if len(execution_frequency) > 0 {
|
8869
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and execution_frequency = ?"
|
8870
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, execution_frequency)
|
|
9038
|
+ if len(keyword) > 0 {
|
|
9039
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and execution_frequency = ? and advice_name like ?"
|
|
9040
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, execution_frequency, keyword)
|
|
9041
|
+ } else {
|
|
9042
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and execution_frequency = ?"
|
|
9043
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, execution_frequency)
|
|
9044
|
+ }
|
|
9045
|
+
|
8871
|
9046
|
} else {
|
8872
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? "
|
8873
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId)
|
|
9047
|
+ if len(keyword) > 0 {
|
|
9048
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? and advice_name like ?"
|
|
9049
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId, keyword)
|
|
9050
|
+ } else {
|
|
9051
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND advice_doctor = ? "
|
|
9052
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, adminUserId)
|
|
9053
|
+ }
|
|
9054
|
+
|
8874
|
9055
|
}
|
8875
|
9056
|
|
8876
|
9057
|
}
|
|
@@ -8884,20 +9065,44 @@ func MobileGetLongScheduleDoctorAdvices(orgID int64, scheduleDate int64, adviceT
|
8884
|
9065
|
if execution_state > 0 {
|
8885
|
9066
|
if cost_type > 0 {
|
8886
|
9067
|
if len(execution_frequency) > 0 {
|
8887
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0 and patient_id = ? and execution_state = ? and is_settle = ?and execution_frequency = ?"
|
8888
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, execution_state, cost_type, execution_frequency)
|
|
9068
|
+ if len(keyword) > 0 {
|
|
9069
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0 and patient_id = ? and execution_state = ? and is_settle = ?and execution_frequency = ? and advice_name like ?"
|
|
9070
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, execution_state, cost_type, execution_frequency, keyword)
|
|
9071
|
+ } else {
|
|
9072
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0 and patient_id = ? and execution_state = ? and is_settle = ?and execution_frequency = ?"
|
|
9073
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, execution_state, cost_type, execution_frequency)
|
|
9074
|
+ }
|
|
9075
|
+
|
8889
|
9076
|
} else {
|
8890
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0 and patient_id = ? and execution_state = ? and is_settle = ?"
|
8891
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, execution_state, cost_type)
|
|
9077
|
+ if len(keyword) > 0 {
|
|
9078
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0 and patient_id = ? and execution_state = ? and is_settle = ? and advice_name like ?"
|
|
9079
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, execution_state, cost_type, keyword)
|
|
9080
|
+ } else {
|
|
9081
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0 and patient_id = ? and execution_state = ? and is_settle = ?"
|
|
9082
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, execution_state, cost_type)
|
|
9083
|
+ }
|
|
9084
|
+
|
8892
|
9085
|
}
|
8893
|
9086
|
|
8894
|
9087
|
} else {
|
8895
|
9088
|
if len(execution_frequency) > 0 {
|
8896
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0 and patient_id = ? and execution_state = ? and execution_frequency = ?"
|
8897
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, execution_state, execution_frequency)
|
|
9089
|
+ if len(keyword) > 0 {
|
|
9090
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0 and patient_id = ? and execution_state = ? and execution_frequency = ? and advice_name like ?"
|
|
9091
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, execution_state, execution_frequency, keyword)
|
|
9092
|
+ } else {
|
|
9093
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0 and patient_id = ? and execution_state = ? and execution_frequency = ?"
|
|
9094
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, execution_state, execution_frequency)
|
|
9095
|
+ }
|
|
9096
|
+
|
8898
|
9097
|
} else {
|
8899
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0 and patient_id = ? and execution_state = ?"
|
8900
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, execution_state)
|
|
9098
|
+ if len(keyword) > 0 {
|
|
9099
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0 and patient_id = ? and execution_state = ? and advice_name like ?"
|
|
9100
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, execution_state, keyword)
|
|
9101
|
+ } else {
|
|
9102
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0 and patient_id = ? and execution_state = ?"
|
|
9103
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, execution_state)
|
|
9104
|
+ }
|
|
9105
|
+
|
8901
|
9106
|
}
|
8902
|
9107
|
|
8903
|
9108
|
}
|
|
@@ -8905,20 +9110,44 @@ func MobileGetLongScheduleDoctorAdvices(orgID int64, scheduleDate int64, adviceT
|
8905
|
9110
|
} else {
|
8906
|
9111
|
if cost_type > 0 {
|
8907
|
9112
|
if len(execution_frequency) > 0 {
|
8908
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0 and patient_id = ? and is_settle = ? and execution_frequency = ?"
|
8909
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, cost_type, execution_frequency)
|
|
9113
|
+ if len(keyword) > 0 {
|
|
9114
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0 and patient_id = ? and is_settle = ? and execution_frequency = ? and advice_name like ?"
|
|
9115
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, cost_type, execution_frequency, keyword)
|
|
9116
|
+ } else {
|
|
9117
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0 and patient_id = ? and is_settle = ? and execution_frequency = ?"
|
|
9118
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, cost_type, execution_frequency)
|
|
9119
|
+ }
|
|
9120
|
+
|
8910
|
9121
|
} else {
|
8911
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0 and patient_id = ? and is_settle = ?"
|
8912
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, cost_type)
|
|
9122
|
+ if len(keyword) > 0 {
|
|
9123
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0 and patient_id = ? and is_settle = ? and advice_name like ?"
|
|
9124
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, cost_type, keyword)
|
|
9125
|
+ } else {
|
|
9126
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0 and patient_id = ? and is_settle = ?"
|
|
9127
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, cost_type)
|
|
9128
|
+ }
|
|
9129
|
+
|
8913
|
9130
|
}
|
8914
|
9131
|
|
8915
|
9132
|
} else {
|
8916
|
9133
|
if len(execution_frequency) > 0 {
|
8917
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0 and patient_id = ? and execution_frequency = ?"
|
8918
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, execution_frequency)
|
|
9134
|
+ if len(keyword) > 0 {
|
|
9135
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0 and patient_id = ? and execution_frequency = ? and advice_name like ?"
|
|
9136
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, execution_frequency, keyword)
|
|
9137
|
+ } else {
|
|
9138
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0 and patient_id = ? and execution_frequency = ?"
|
|
9139
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, execution_frequency)
|
|
9140
|
+ }
|
|
9141
|
+
|
8919
|
9142
|
} else {
|
8920
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0 and patient_id = ?"
|
8921
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id)
|
|
9143
|
+ if len(keyword) > 0 {
|
|
9144
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0 and patient_id = ? and advice_name like ?"
|
|
9145
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id, keyword)
|
|
9146
|
+ } else {
|
|
9147
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0 and patient_id = ?"
|
|
9148
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, patient_id)
|
|
9149
|
+ }
|
|
9150
|
+
|
8922
|
9151
|
}
|
8923
|
9152
|
|
8924
|
9153
|
}
|
|
@@ -8929,20 +9158,44 @@ func MobileGetLongScheduleDoctorAdvices(orgID int64, scheduleDate int64, adviceT
|
8929
|
9158
|
|
8930
|
9159
|
if cost_type > 0 {
|
8931
|
9160
|
if len(execution_frequency) > 0 {
|
8932
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1AND execution_staff = 0 and execution_state = ? and is_settle = ? and execution_frequency = ?"
|
8933
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, execution_state, cost_type, execution_frequency)
|
|
9161
|
+ if len(keyword) > 0 {
|
|
9162
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1AND execution_staff = 0 and execution_state = ? and is_settle = ? and execution_frequency = ? and advice_name like ?"
|
|
9163
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, execution_state, cost_type, execution_frequency, keyword)
|
|
9164
|
+ } else {
|
|
9165
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1AND execution_staff = 0 and execution_state = ? and is_settle = ? and execution_frequency = ?"
|
|
9166
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, execution_state, cost_type, execution_frequency)
|
|
9167
|
+ }
|
|
9168
|
+
|
8934
|
9169
|
} else {
|
8935
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1AND execution_staff = 0 and execution_state = ? and is_settle = ?"
|
8936
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, execution_state, cost_type)
|
|
9170
|
+ if len(keyword) > 0 {
|
|
9171
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1AND execution_staff = 0 and execution_state = ? and is_settle = ? and advice_name like ?"
|
|
9172
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, execution_state, cost_type, keyword)
|
|
9173
|
+ } else {
|
|
9174
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1AND execution_staff = 0 and execution_state = ? and is_settle = ?"
|
|
9175
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, execution_state, cost_type)
|
|
9176
|
+ }
|
|
9177
|
+
|
8937
|
9178
|
}
|
8938
|
9179
|
|
8939
|
9180
|
} else {
|
8940
|
9181
|
if len(execution_frequency) > 0 {
|
8941
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0 and execution_state = ? and execution_frequency = ?"
|
8942
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, execution_state, execution_frequency)
|
|
9182
|
+ if len(keyword) > 0 {
|
|
9183
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0 and execution_state = ? and execution_frequency = ? and advice_name like ?"
|
|
9184
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, execution_state, execution_frequency, keyword)
|
|
9185
|
+ } else {
|
|
9186
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0 and execution_state = ? and execution_frequency = ?"
|
|
9187
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, execution_state, execution_frequency)
|
|
9188
|
+ }
|
|
9189
|
+
|
8943
|
9190
|
} else {
|
8944
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0 and execution_state = ?"
|
8945
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, execution_state)
|
|
9191
|
+ if len(keyword) > 0 {
|
|
9192
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0 and execution_state = ? and advice_name like ?"
|
|
9193
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, execution_state, keyword)
|
|
9194
|
+ } else {
|
|
9195
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0 and execution_state = ?"
|
|
9196
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, execution_state)
|
|
9197
|
+ }
|
|
9198
|
+
|
8946
|
9199
|
}
|
8947
|
9200
|
|
8948
|
9201
|
}
|
|
@@ -8951,20 +9204,44 @@ func MobileGetLongScheduleDoctorAdvices(orgID int64, scheduleDate int64, adviceT
|
8951
|
9204
|
|
8952
|
9205
|
if cost_type > 0 {
|
8953
|
9206
|
if len(execution_frequency) > 0 {
|
8954
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0 and is_settle = ? and execution_frequency = ?"
|
8955
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, cost_type, execution_frequency)
|
|
9207
|
+ if len(keyword) > 0 {
|
|
9208
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0 and is_settle = ? and execution_frequency = ? and advice_name like ?"
|
|
9209
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, cost_type, execution_frequency, keyword)
|
|
9210
|
+ } else {
|
|
9211
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0 and is_settle = ? and execution_frequency = ?"
|
|
9212
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, cost_type, execution_frequency)
|
|
9213
|
+ }
|
|
9214
|
+
|
8956
|
9215
|
} else {
|
8957
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0 and is_settle = ?"
|
8958
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, cost_type)
|
|
9216
|
+ if len(keyword) > 0 {
|
|
9217
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0 and is_settle = ? and advice_name like ?"
|
|
9218
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, cost_type, keyword)
|
|
9219
|
+ } else {
|
|
9220
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0 and is_settle = ?"
|
|
9221
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, cost_type)
|
|
9222
|
+ }
|
|
9223
|
+
|
8959
|
9224
|
}
|
8960
|
9225
|
|
8961
|
9226
|
} else {
|
8962
|
9227
|
if len(execution_frequency) > 0 {
|
8963
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0 and execution_frequency = ?"
|
8964
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, execution_frequency)
|
|
9228
|
+ if len(keyword) > 0 {
|
|
9229
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0 and execution_frequency = ? and advice_name like ?"
|
|
9230
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, execution_frequency, keyword)
|
|
9231
|
+ } else {
|
|
9232
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0 and execution_frequency = ?"
|
|
9233
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, execution_frequency)
|
|
9234
|
+ }
|
|
9235
|
+
|
8965
|
9236
|
} else {
|
8966
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0"
|
8967
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID)
|
|
9237
|
+ if len(keyword) > 0 {
|
|
9238
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0 and advice_name like ?"
|
|
9239
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, keyword)
|
|
9240
|
+ } else {
|
|
9241
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND execution_staff = 0"
|
|
9242
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID)
|
|
9243
|
+ }
|
|
9244
|
+
|
8968
|
9245
|
}
|
8969
|
9246
|
|
8970
|
9247
|
}
|