|
@@ -4519,10 +4519,13 @@ func GetFistMonitorSix(orgid int64, patient_id int64, dialysis_date int64) (reco
|
4519
|
4519
|
return record, err
|
4520
|
4520
|
}
|
4521
|
4521
|
|
4522
|
|
-func MobileGetScheduleDoctorAdvicesOne(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) {
|
|
4522
|
+func MobileGetScheduleDoctorAdvicesOne(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) {
|
4523
|
4523
|
|
4524
|
4524
|
var vms []*MScheduleDoctorAdviceVM
|
|
4525
|
+
|
|
4526
|
+ keyword = "%" + keyword + "%"
|
4525
|
4527
|
adviceWhere := ""
|
|
4528
|
+
|
4526
|
4529
|
adviceCondition := []interface{}{}
|
4527
|
4530
|
if adviceType == 0 {
|
4528
|
4531
|
if patientType == 0 {
|
|
@@ -4530,20 +4533,47 @@ func MobileGetScheduleDoctorAdvicesOne(orgID int64, scheduleDate int64, adviceTy
|
4530
|
4533
|
if execution_state > 0 {
|
4531
|
4534
|
if cost_type > 0 {
|
4532
|
4535
|
if len(execution_frequency) > 0 {
|
4533
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ? and is_settle = ? and execution_frequency = ?"
|
4534
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, cost_type, execution_frequency)
|
|
4536
|
+ if len(keyword) > 0 {
|
|
4537
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ? and is_settle = ? and execution_frequency = ? and advice_name like ?"
|
|
4538
|
+
|
|
4539
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, cost_type, execution_frequency, keyword)
|
|
4540
|
+ } else {
|
|
4541
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ? and is_settle = ? and execution_frequency = ?"
|
|
4542
|
+
|
|
4543
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, cost_type, execution_frequency)
|
|
4544
|
+ }
|
|
4545
|
+
|
4535
|
4546
|
} else {
|
4536
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ? and is_settle = ?"
|
4537
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, cost_type)
|
|
4547
|
+
|
|
4548
|
+ if len(keyword) > 0 {
|
|
4549
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ? and is_settle = ? and advice_name like ?"
|
|
4550
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, cost_type, keyword)
|
|
4551
|
+ } else {
|
|
4552
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ? and is_settle = ?"
|
|
4553
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, cost_type)
|
|
4554
|
+ }
|
|
4555
|
+
|
4538
|
4556
|
}
|
4539
|
4557
|
|
4540
|
4558
|
} else {
|
4541
|
4559
|
if len(execution_frequency) > 0 {
|
4542
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ? and execution_frequency = ?"
|
4543
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, execution_frequency)
|
|
4560
|
+ if len(keyword) > 0 {
|
|
4561
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ? and execution_frequency = ? and advice_name like ?"
|
|
4562
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, execution_frequency, keyword)
|
|
4563
|
+ } else {
|
|
4564
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ? and execution_frequency = ?"
|
|
4565
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, execution_frequency)
|
|
4566
|
+ }
|
|
4567
|
+
|
4544
|
4568
|
} else {
|
4545
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ?"
|
4546
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state)
|
|
4569
|
+ if len(keyword) > 0 {
|
|
4570
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ? and advice_name like ?"
|
|
4571
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, keyword)
|
|
4572
|
+ } else {
|
|
4573
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ?"
|
|
4574
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state)
|
|
4575
|
+ }
|
|
4576
|
+
|
4547
|
4577
|
}
|
4548
|
4578
|
|
4549
|
4579
|
}
|
|
@@ -4563,8 +4593,14 @@ func MobileGetScheduleDoctorAdvicesOne(orgID int64, scheduleDate int64, adviceTy
|
4563
|
4593
|
adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_frequency = ?"
|
4564
|
4594
|
adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_frequency)
|
4565
|
4595
|
} else {
|
4566
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and patient_id = ?"
|
4567
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id)
|
|
4596
|
+ if len(keyword) > 0 {
|
|
4597
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and patient_id = ? and advice_name like ?"
|
|
4598
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, keyword)
|
|
4599
|
+ } else {
|
|
4600
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and patient_id = ?"
|
|
4601
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id)
|
|
4602
|
+ }
|
|
4603
|
+
|
4568
|
4604
|
}
|
4569
|
4605
|
|
4570
|
4606
|
}
|
|
@@ -4575,20 +4611,44 @@ func MobileGetScheduleDoctorAdvicesOne(orgID int64, scheduleDate int64, adviceTy
|
4575
|
4611
|
if execution_state > 0 {
|
4576
|
4612
|
if cost_type > 0 {
|
4577
|
4613
|
if len(execution_frequency) > 0 {
|
4578
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and execution_state= ? and is_settle = ? and execution_frequency = ?"
|
4579
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state, cost_type, execution_frequency)
|
|
4614
|
+ if len(keyword) > 0 {
|
|
4615
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and execution_state= ? and is_settle = ? and execution_frequency = ? and advice_name like ?"
|
|
4616
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state, cost_type, execution_frequency, keyword)
|
|
4617
|
+ } else {
|
|
4618
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and execution_state= ? and is_settle = ? and execution_frequency = ?"
|
|
4619
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state, cost_type, execution_frequency)
|
|
4620
|
+ }
|
|
4621
|
+
|
4580
|
4622
|
} else {
|
4581
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and execution_state= ? and is_settle = ?"
|
4582
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state, cost_type)
|
|
4623
|
+ if len(keyword) > 0 {
|
|
4624
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and execution_state= ? and is_settle = ? and advice_name like ?"
|
|
4625
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state, cost_type, keyword)
|
|
4626
|
+ } else {
|
|
4627
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and execution_state= ? and is_settle = ?"
|
|
4628
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state, cost_type)
|
|
4629
|
+ }
|
|
4630
|
+
|
4583
|
4631
|
}
|
4584
|
4632
|
|
4585
|
4633
|
} else {
|
4586
|
4634
|
if len(execution_frequency) > 0 {
|
4587
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and execution_state= ? and execution_frequency = ?"
|
4588
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state, execution_frequency)
|
|
4635
|
+ if len(keyword) > 0 {
|
|
4636
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and execution_state= ? and execution_frequency = ? and advice_name like ?"
|
|
4637
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state, execution_frequency, keyword)
|
|
4638
|
+ } else {
|
|
4639
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and execution_state= ? and execution_frequency = ?"
|
|
4640
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state, execution_frequency)
|
|
4641
|
+ }
|
|
4642
|
+
|
4589
|
4643
|
} else {
|
4590
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and execution_state= ?"
|
4591
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state)
|
|
4644
|
+ if len(keyword) > 0 {
|
|
4645
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and execution_state= ? and advice_name like ?"
|
|
4646
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state, keyword)
|
|
4647
|
+ } else {
|
|
4648
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and execution_state= ?"
|
|
4649
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state)
|
|
4650
|
+ }
|
|
4651
|
+
|
4592
|
4652
|
}
|
4593
|
4653
|
|
4594
|
4654
|
}
|
|
@@ -4596,20 +4656,44 @@ func MobileGetScheduleDoctorAdvicesOne(orgID int64, scheduleDate int64, adviceTy
|
4596
|
4656
|
} else {
|
4597
|
4657
|
if cost_type > 0 {
|
4598
|
4658
|
if len(execution_frequency) > 0 {
|
4599
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and is_settle = ? and execution_frequency = ?"
|
4600
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, cost_type, execution_frequency)
|
|
4659
|
+ if len(keyword) > 0 {
|
|
4660
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and is_settle = ? and execution_frequency = ? and advice_name like ?"
|
|
4661
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, cost_type, execution_frequency, keyword)
|
|
4662
|
+ } else {
|
|
4663
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and is_settle = ? and execution_frequency = ?"
|
|
4664
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, cost_type, execution_frequency)
|
|
4665
|
+ }
|
|
4666
|
+
|
4601
|
4667
|
} else {
|
4602
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and is_settle = ?"
|
4603
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, cost_type)
|
|
4668
|
+ if len(keyword) > 0 {
|
|
4669
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and is_settle = ? and advice_name like ?"
|
|
4670
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, cost_type, keyword)
|
|
4671
|
+ } else {
|
|
4672
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and is_settle = ?"
|
|
4673
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, cost_type)
|
|
4674
|
+ }
|
|
4675
|
+
|
4604
|
4676
|
}
|
4605
|
4677
|
|
4606
|
4678
|
} else {
|
4607
|
4679
|
if len(execution_frequency) > 0 {
|
4608
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and execution_frequency = ?"
|
4609
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_frequency)
|
|
4680
|
+ if len(keyword) > 0 {
|
|
4681
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and execution_frequency = ? and advice_name like ?"
|
|
4682
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_frequency, keyword)
|
|
4683
|
+ } else {
|
|
4684
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and execution_frequency = ?"
|
|
4685
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_frequency)
|
|
4686
|
+ }
|
|
4687
|
+
|
4610
|
4688
|
} else {
|
4611
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1)"
|
4612
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate)
|
|
4689
|
+ if len(keyword) > 0 {
|
|
4690
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and advice_name like ?"
|
|
4691
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, keyword)
|
|
4692
|
+ } else {
|
|
4693
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1)"
|
|
4694
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate)
|
|
4695
|
+ }
|
|
4696
|
+
|
4613
|
4697
|
}
|
4614
|
4698
|
|
4615
|
4699
|
}
|
|
@@ -4623,20 +4707,44 @@ func MobileGetScheduleDoctorAdvicesOne(orgID int64, scheduleDate int64, adviceTy
|
4623
|
4707
|
if execution_state > 0 {
|
4624
|
4708
|
if cost_type > 0 {
|
4625
|
4709
|
if len(execution_frequency) > 0 {
|
4626
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ? and is_settle = ? and execution_frequency = ?"
|
4627
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, execution_state, cost_type, execution_frequency)
|
|
4710
|
+ if len(keyword) > 0 {
|
|
4711
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ? and is_settle = ? and execution_frequency = ? and advice_name like ?"
|
|
4712
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, execution_state, cost_type, execution_frequency, keyword)
|
|
4713
|
+ } else {
|
|
4714
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ? and is_settle = ? and execution_frequency = ?"
|
|
4715
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, execution_state, cost_type, execution_frequency)
|
|
4716
|
+ }
|
|
4717
|
+
|
4628
|
4718
|
} else {
|
4629
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ? and is_settle = ?"
|
4630
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, execution_state, cost_type)
|
|
4719
|
+ if len(keyword) > 0 {
|
|
4720
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ? and is_settle = ? and advice_name like ?"
|
|
4721
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, execution_state, cost_type, keyword)
|
|
4722
|
+ } else {
|
|
4723
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ? and is_settle = ?"
|
|
4724
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, execution_state, cost_type)
|
|
4725
|
+ }
|
|
4726
|
+
|
4631
|
4727
|
}
|
4632
|
4728
|
|
4633
|
4729
|
} else {
|
4634
|
4730
|
if len(execution_frequency) > 0 {
|
4635
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ? and execution_frequency = ?"
|
4636
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, execution_state, execution_frequency)
|
|
4731
|
+ if len(keyword) > 0 {
|
|
4732
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ? and execution_frequency = ? and advice_name like ?"
|
|
4733
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, execution_state, execution_frequency, keyword)
|
|
4734
|
+ } else {
|
|
4735
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ? and execution_frequency = ?"
|
|
4736
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, execution_state, execution_frequency)
|
|
4737
|
+ }
|
|
4738
|
+
|
4637
|
4739
|
} else {
|
4638
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ?"
|
4639
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, execution_state)
|
|
4740
|
+ if len(keyword) > 0 {
|
|
4741
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ? and advice_name like ?"
|
|
4742
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, execution_state, keyword)
|
|
4743
|
+ } else {
|
|
4744
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ?"
|
|
4745
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, execution_state)
|
|
4746
|
+ }
|
|
4747
|
+
|
4640
|
4748
|
}
|
4641
|
4749
|
|
4642
|
4750
|
}
|
|
@@ -4644,20 +4752,44 @@ func MobileGetScheduleDoctorAdvicesOne(orgID int64, scheduleDate int64, adviceTy
|
4644
|
4752
|
} else {
|
4645
|
4753
|
if cost_type > 0 {
|
4646
|
4754
|
if len(execution_frequency) > 0 {
|
4647
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and is_settle=? and execution_frequency = ?"
|
4648
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, cost_type, execution_frequency)
|
|
4755
|
+ if len(keyword) > 0 {
|
|
4756
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and is_settle=? and execution_frequency = ? and advice_name like ?"
|
|
4757
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, cost_type, execution_frequency, keyword)
|
|
4758
|
+ } else {
|
|
4759
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and is_settle=? and execution_frequency = ?"
|
|
4760
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, cost_type, execution_frequency)
|
|
4761
|
+ }
|
|
4762
|
+
|
4649
|
4763
|
} else {
|
4650
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and is_settle=?"
|
4651
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, cost_type)
|
|
4764
|
+ if len(keyword) > 0 {
|
|
4765
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and is_settle=? and advice_name like ?"
|
|
4766
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, cost_type, keyword)
|
|
4767
|
+ } else {
|
|
4768
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and is_settle=?"
|
|
4769
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, cost_type)
|
|
4770
|
+ }
|
|
4771
|
+
|
4652
|
4772
|
}
|
4653
|
4773
|
|
4654
|
4774
|
} else {
|
4655
|
4775
|
if len(execution_frequency) > 0 {
|
4656
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_frequency = ?"
|
4657
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, execution_frequency)
|
|
4776
|
+ if len(keyword) > 0 {
|
|
4777
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_frequency = ? and advice_name like ?"
|
|
4778
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, execution_frequency, keyword)
|
|
4779
|
+ } else {
|
|
4780
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_frequency = ?"
|
|
4781
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, execution_frequency)
|
|
4782
|
+ }
|
|
4783
|
+
|
4658
|
4784
|
} else {
|
4659
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ?"
|
4660
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id)
|
|
4785
|
+ if len(keyword) > 0 {
|
|
4786
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and advice_name like ?"
|
|
4787
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, keyword)
|
|
4788
|
+ } else {
|
|
4789
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ?"
|
|
4790
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id)
|
|
4791
|
+ }
|
|
4792
|
+
|
4661
|
4793
|
}
|
4662
|
4794
|
|
4663
|
4795
|
}
|
|
@@ -4668,20 +4800,44 @@ func MobileGetScheduleDoctorAdvicesOne(orgID int64, scheduleDate int64, adviceTy
|
4668
|
4800
|
if execution_state > 0 {
|
4669
|
4801
|
if cost_type > 0 {
|
4670
|
4802
|
if len(execution_frequency) > 0 {
|
4671
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and execution_state = ? and is_settle=? and execution_frequency = ?"
|
4672
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, execution_state, cost_type, execution_frequency)
|
|
4803
|
+ if len(keyword) > 0 {
|
|
4804
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and execution_state = ? and is_settle=? and execution_frequency = ? and advice_name like ?"
|
|
4805
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, execution_state, cost_type, execution_frequency, keyword)
|
|
4806
|
+ } else {
|
|
4807
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and execution_state = ? and is_settle=? and execution_frequency = ?"
|
|
4808
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, execution_state, cost_type, execution_frequency)
|
|
4809
|
+ }
|
|
4810
|
+
|
4673
|
4811
|
} else {
|
4674
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and execution_state = ? and is_settle=?"
|
4675
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, execution_state, cost_type)
|
|
4812
|
+ if len(keyword) > 0 {
|
|
4813
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and execution_state = ? and is_settle=? and advice_name like ?"
|
|
4814
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, execution_state, cost_type, keyword)
|
|
4815
|
+ } else {
|
|
4816
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and execution_state = ? and is_settle=?"
|
|
4817
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, execution_state, cost_type)
|
|
4818
|
+ }
|
|
4819
|
+
|
4676
|
4820
|
}
|
4677
|
4821
|
|
4678
|
4822
|
} else {
|
4679
|
4823
|
if len(execution_frequency) > 0 {
|
4680
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and execution_state = ? and execution_frequency = ?"
|
4681
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, execution_state, execution_frequency)
|
|
4824
|
+ if len(keyword) > 0 {
|
|
4825
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and execution_state = ? and execution_frequency = ? and advice_name like ?"
|
|
4826
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, execution_state, execution_frequency, keyword)
|
|
4827
|
+ } else {
|
|
4828
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and execution_state = ? and execution_frequency = ?"
|
|
4829
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, execution_state, execution_frequency)
|
|
4830
|
+ }
|
|
4831
|
+
|
4682
|
4832
|
} else {
|
4683
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and execution_state = ?"
|
4684
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, execution_state)
|
|
4833
|
+ if len(keyword) > 0 {
|
|
4834
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and execution_state = ? and advice_name like ?"
|
|
4835
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, execution_state, keyword)
|
|
4836
|
+ } else {
|
|
4837
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and execution_state = ?"
|
|
4838
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, execution_state)
|
|
4839
|
+ }
|
|
4840
|
+
|
4685
|
4841
|
}
|
4686
|
4842
|
|
4687
|
4843
|
}
|
|
@@ -4689,20 +4845,44 @@ func MobileGetScheduleDoctorAdvicesOne(orgID int64, scheduleDate int64, adviceTy
|
4689
|
4845
|
} else {
|
4690
|
4846
|
if cost_type > 0 {
|
4691
|
4847
|
if len(execution_frequency) > 0 {
|
4692
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and is_settle=? and execution_frequency = ?"
|
4693
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, cost_type, execution_frequency)
|
|
4848
|
+ if len(keyword) > 0 {
|
|
4849
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and is_settle=? and execution_frequency = ? and advice_name like ?"
|
|
4850
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, cost_type, execution_frequency, keyword)
|
|
4851
|
+ } else {
|
|
4852
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and is_settle=? and execution_frequency = ?"
|
|
4853
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, cost_type, execution_frequency)
|
|
4854
|
+ }
|
|
4855
|
+
|
4694
|
4856
|
} else {
|
4695
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and is_settle=?"
|
4696
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, cost_type)
|
|
4857
|
+ if len(keyword) > 0 {
|
|
4858
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and is_settle=? and advice_name like ?"
|
|
4859
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, cost_type, keyword)
|
|
4860
|
+ } else {
|
|
4861
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and is_settle=?"
|
|
4862
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, cost_type)
|
|
4863
|
+ }
|
|
4864
|
+
|
4697
|
4865
|
}
|
4698
|
4866
|
|
4699
|
4867
|
} else {
|
4700
|
4868
|
if len(execution_frequency) > 0 {
|
4701
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and execution_frequency = ?"
|
4702
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, execution_frequency)
|
|
4869
|
+ if len(keyword) > 0 {
|
|
4870
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and execution_frequency = ? and advice_name like ?"
|
|
4871
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, execution_frequency, keyword)
|
|
4872
|
+ } else {
|
|
4873
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and execution_frequency = ?"
|
|
4874
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, execution_frequency)
|
|
4875
|
+ }
|
|
4876
|
+
|
4703
|
4877
|
} else {
|
4704
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1)"
|
4705
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId)
|
|
4878
|
+ if len(keyword) > 0 {
|
|
4879
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and advice_name like ?"
|
|
4880
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, keyword)
|
|
4881
|
+ } else {
|
|
4882
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1)"
|
|
4883
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId)
|
|
4884
|
+ }
|
|
4885
|
+
|
4706
|
4886
|
}
|
4707
|
4887
|
|
4708
|
4888
|
}
|
|
@@ -4716,20 +4896,44 @@ func MobileGetScheduleDoctorAdvicesOne(orgID int64, scheduleDate int64, adviceTy
|
4716
|
4896
|
if execution_state > 0 {
|
4717
|
4897
|
if cost_type > 0 {
|
4718
|
4898
|
if len(execution_frequency) > 0 {
|
4719
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?) and execution_state = ? and is_settle=? and execution_frequency = ?"
|
4720
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, cost_type, execution_frequency)
|
|
4899
|
+ if len(keyword) > 0 {
|
|
4900
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?) and execution_state = ? and is_settle=? and execution_frequency = ? and advice_name like ?"
|
|
4901
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, cost_type, execution_frequency, keyword)
|
|
4902
|
+ } else {
|
|
4903
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?) and execution_state = ? and is_settle=? and execution_frequency = ?"
|
|
4904
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, cost_type, execution_frequency)
|
|
4905
|
+ }
|
|
4906
|
+
|
4721
|
4907
|
} else {
|
4722
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?) and execution_state = ? and is_settle=?"
|
4723
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, cost_type)
|
|
4908
|
+ if len(keyword) > 0 {
|
|
4909
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?) and execution_state = ? and is_settle=? and advice_name like ?"
|
|
4910
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, cost_type, keyword)
|
|
4911
|
+ } else {
|
|
4912
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?) and execution_state = ? and is_settle=?"
|
|
4913
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, cost_type)
|
|
4914
|
+ }
|
|
4915
|
+
|
4724
|
4916
|
}
|
4725
|
4917
|
|
4726
|
4918
|
} else {
|
4727
|
4919
|
if len(execution_frequency) > 0 {
|
4728
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?) and execution_state = ?and execution_frequency = ?"
|
4729
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, execution_frequency)
|
|
4920
|
+ if len(keyword) > 0 {
|
|
4921
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?) and execution_state = ?and execution_frequency = ? and advice_name like ?"
|
|
4922
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, execution_frequency, keyword)
|
|
4923
|
+ } else {
|
|
4924
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?) and execution_state = ?and execution_frequency = ?"
|
|
4925
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, execution_frequency)
|
|
4926
|
+ }
|
|
4927
|
+
|
4730
|
4928
|
} else {
|
4731
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?) and execution_state = ?"
|
4732
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state)
|
|
4929
|
+ if len(keyword) > 0 {
|
|
4930
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?) and execution_state = ? and advice_name like ?"
|
|
4931
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, keyword)
|
|
4932
|
+ } else {
|
|
4933
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?) and execution_state = ?"
|
|
4934
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state)
|
|
4935
|
+ }
|
|
4936
|
+
|
4733
|
4937
|
}
|
4734
|
4938
|
|
4735
|
4939
|
}
|
|
@@ -4737,20 +4941,44 @@ func MobileGetScheduleDoctorAdvicesOne(orgID int64, scheduleDate int64, adviceTy
|
4737
|
4941
|
} else {
|
4738
|
4942
|
if cost_type > 0 {
|
4739
|
4943
|
if len(execution_frequency) > 0 {
|
4740
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?) and is_settle=? and execution_frequency = ?"
|
4741
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, cost_type, execution_frequency)
|
|
4944
|
+ if len(keyword) > 0 {
|
|
4945
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?) and is_settle=? and execution_frequency = ? and advice_name like ?"
|
|
4946
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, cost_type, execution_frequency, keyword)
|
|
4947
|
+ } else {
|
|
4948
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?) and is_settle=? and execution_frequency = ?"
|
|
4949
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, cost_type, execution_frequency)
|
|
4950
|
+ }
|
|
4951
|
+
|
4742
|
4952
|
} else {
|
4743
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?) and is_settle=?"
|
4744
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, cost_type)
|
|
4953
|
+ if len(keyword) > 0 {
|
|
4954
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?) and is_settle=? and advice_name like ?"
|
|
4955
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, cost_type, keyword)
|
|
4956
|
+ } else {
|
|
4957
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?) and is_settle=?"
|
|
4958
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, cost_type)
|
|
4959
|
+ }
|
|
4960
|
+
|
4745
|
4961
|
}
|
4746
|
4962
|
|
4747
|
4963
|
} else {
|
4748
|
4964
|
if len(execution_frequency) > 0 {
|
4749
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?)and execution_frequency = ?"
|
4750
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_frequency)
|
|
4965
|
+ if len(keyword) > 0 {
|
|
4966
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?)and execution_frequency = ? and advice_name like ?"
|
|
4967
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_frequency, keyword)
|
|
4968
|
+ } else {
|
|
4969
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?)and execution_frequency = ?"
|
|
4970
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_frequency)
|
|
4971
|
+ }
|
|
4972
|
+
|
4751
|
4973
|
} else {
|
4752
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?)"
|
4753
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id)
|
|
4974
|
+ if len(keyword) > 0 {
|
|
4975
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?) and advice_name like ?"
|
|
4976
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, keyword)
|
|
4977
|
+ } else {
|
|
4978
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?)"
|
|
4979
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id)
|
|
4980
|
+ }
|
|
4981
|
+
|
4754
|
4982
|
}
|
4755
|
4983
|
|
4756
|
4984
|
}
|
|
@@ -4761,20 +4989,44 @@ func MobileGetScheduleDoctorAdvicesOne(orgID int64, scheduleDate int64, adviceTy
|
4761
|
4989
|
if execution_state > 0 {
|
4762
|
4990
|
if cost_type > 0 {
|
4763
|
4991
|
if len(execution_frequency) > 0 {
|
4764
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and execution_state = ? and is_settle=? and execution_frequency = ?"
|
4765
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state, cost_type, execution_frequency)
|
|
4992
|
+ if len(keyword) > 0 {
|
|
4993
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and execution_state = ? and is_settle=? and execution_frequency = ? and advice_name like ?"
|
|
4994
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state, cost_type, execution_frequency, keyword)
|
|
4995
|
+ } else {
|
|
4996
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and execution_state = ? and is_settle=? and execution_frequency = ?"
|
|
4997
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state, cost_type, execution_frequency)
|
|
4998
|
+ }
|
|
4999
|
+
|
4766
|
5000
|
} else {
|
4767
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and execution_state = ? and is_settle=?"
|
4768
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state, cost_type)
|
|
5001
|
+ if len(keyword) > 0 {
|
|
5002
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and execution_state = ? and is_settle=? and advice_name like ?"
|
|
5003
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state, cost_type, keyword)
|
|
5004
|
+ } else {
|
|
5005
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and execution_state = ? and is_settle=?"
|
|
5006
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state, cost_type)
|
|
5007
|
+ }
|
|
5008
|
+
|
4769
|
5009
|
}
|
4770
|
5010
|
|
4771
|
5011
|
} else {
|
4772
|
5012
|
if len(execution_frequency) > 0 {
|
4773
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and execution_state = ? and execution_frequency = ?"
|
4774
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state, execution_frequency)
|
|
5013
|
+ if len(keyword) > 0 {
|
|
5014
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and execution_state = ? and execution_frequency = ? and advice_name like ?"
|
|
5015
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state, execution_frequency, keyword)
|
|
5016
|
+ } else {
|
|
5017
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and execution_state = ? and execution_frequency = ?"
|
|
5018
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state, execution_frequency)
|
|
5019
|
+ }
|
|
5020
|
+
|
4775
|
5021
|
} else {
|
4776
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and execution_state = ?"
|
4777
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state)
|
|
5022
|
+ if len(keyword) > 0 {
|
|
5023
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and execution_state = ? and advice_name like ?"
|
|
5024
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state, keyword)
|
|
5025
|
+ } else {
|
|
5026
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and execution_state = ?"
|
|
5027
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state)
|
|
5028
|
+ }
|
|
5029
|
+
|
4778
|
5030
|
}
|
4779
|
5031
|
|
4780
|
5032
|
}
|
|
@@ -4782,20 +5034,44 @@ func MobileGetScheduleDoctorAdvicesOne(orgID int64, scheduleDate int64, adviceTy
|
4782
|
5034
|
} else {
|
4783
|
5035
|
if cost_type > 0 {
|
4784
|
5036
|
if len(execution_frequency) > 0 {
|
4785
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and is_settle = ? and execution_frequency = ?"
|
4786
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, cost_type, execution_frequency)
|
|
5037
|
+ if len(keyword) > 0 {
|
|
5038
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and is_settle = ? and execution_frequency = ? and advice_name like ?"
|
|
5039
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, cost_type, execution_frequency, keyword)
|
|
5040
|
+ } else {
|
|
5041
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and is_settle = ? and execution_frequency = ?"
|
|
5042
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, cost_type, execution_frequency)
|
|
5043
|
+ }
|
|
5044
|
+
|
4787
|
5045
|
} else {
|
4788
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and is_settle = ?"
|
4789
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, cost_type)
|
|
5046
|
+ if len(keyword) > 0 {
|
|
5047
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and is_settle = ? and advice_name like ?"
|
|
5048
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, cost_type, keyword)
|
|
5049
|
+ } else {
|
|
5050
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and is_settle = ?"
|
|
5051
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, cost_type)
|
|
5052
|
+ }
|
|
5053
|
+
|
4790
|
5054
|
}
|
4791
|
5055
|
|
4792
|
5056
|
} else {
|
4793
|
5057
|
if len(execution_frequency) > 0 {
|
4794
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and execution_frequency = ?"
|
4795
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_frequency)
|
|
5058
|
+ if len(keyword) > 0 {
|
|
5059
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and execution_frequency = ? and advice_name like ?"
|
|
5060
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_frequency, keyword)
|
|
5061
|
+ } else {
|
|
5062
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and execution_frequency = ?"
|
|
5063
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_frequency)
|
|
5064
|
+ }
|
|
5065
|
+
|
4796
|
5066
|
} else {
|
4797
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1)"
|
4798
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate)
|
|
5067
|
+ if len(keyword) > 0 {
|
|
5068
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and advice_name like ?"
|
|
5069
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, keyword)
|
|
5070
|
+ } else {
|
|
5071
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1)"
|
|
5072
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate)
|
|
5073
|
+ }
|
|
5074
|
+
|
4799
|
5075
|
}
|
4800
|
5076
|
|
4801
|
5077
|
}
|
|
@@ -4812,20 +5088,44 @@ func MobileGetScheduleDoctorAdvicesOne(orgID int64, scheduleDate int64, adviceTy
|
4812
|
5088
|
if execution_state > 0 {
|
4813
|
5089
|
if cost_type > 0 {
|
4814
|
5090
|
if len(execution_frequency) > 0 {
|
4815
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? and execution_state = ? and is_settle = ? and execution_frequency = ?"
|
4816
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, cost_type, execution_frequency)
|
|
5091
|
+ if len(keyword) > 0 {
|
|
5092
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? and execution_state = ? and is_settle = ? and execution_frequency = ? and advice_name like ?"
|
|
5093
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, cost_type, execution_frequency, keyword)
|
|
5094
|
+ } else {
|
|
5095
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? and execution_state = ? and is_settle = ? and execution_frequency = ?"
|
|
5096
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, cost_type, execution_frequency)
|
|
5097
|
+ }
|
|
5098
|
+
|
4817
|
5099
|
} else {
|
4818
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? and execution_state = ? and is_settle = ?"
|
4819
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, cost_type)
|
|
5100
|
+ if len(keyword) > 0 {
|
|
5101
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? and execution_state = ? and is_settle = ? and advice_name like ?"
|
|
5102
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, cost_type, keyword)
|
|
5103
|
+ } else {
|
|
5104
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? and execution_state = ? and is_settle = ?"
|
|
5105
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, cost_type)
|
|
5106
|
+ }
|
|
5107
|
+
|
4820
|
5108
|
}
|
4821
|
5109
|
|
4822
|
5110
|
} else {
|
4823
|
5111
|
if len(execution_frequency) > 0 {
|
4824
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? and execution_state = ? and execution_frequency = ?"
|
4825
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, execution_frequency)
|
|
5112
|
+ if len(keyword) > 0 {
|
|
5113
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? and execution_state = ? and execution_frequency = ? and advice_name like ?"
|
|
5114
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, execution_frequency, keyword)
|
|
5115
|
+ } else {
|
|
5116
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? and execution_state = ? and execution_frequency = ?"
|
|
5117
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, execution_frequency)
|
|
5118
|
+ }
|
|
5119
|
+
|
4826
|
5120
|
} else {
|
4827
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? and execution_state = ?"
|
4828
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state)
|
|
5121
|
+ if len(keyword) > 0 {
|
|
5122
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? and execution_state = ? and advice_name like ?"
|
|
5123
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, keyword)
|
|
5124
|
+ } else {
|
|
5125
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? and execution_state = ?"
|
|
5126
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state)
|
|
5127
|
+ }
|
|
5128
|
+
|
4829
|
5129
|
}
|
4830
|
5130
|
|
4831
|
5131
|
}
|
|
@@ -4833,20 +5133,35 @@ func MobileGetScheduleDoctorAdvicesOne(orgID int64, scheduleDate int64, adviceTy
|
4833
|
5133
|
} else {
|
4834
|
5134
|
if cost_type > 0 {
|
4835
|
5135
|
if len(execution_frequency) > 0 {
|
4836
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? and is_settle = ? and execution_frequency = ?"
|
4837
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, cost_type, execution_frequency)
|
|
5136
|
+ if len(keyword) > 0 {
|
|
5137
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? and is_settle = ? and execution_frequency = ? and advice_name like ?"
|
|
5138
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, cost_type, execution_frequency, keyword)
|
|
5139
|
+ } else {
|
|
5140
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? and is_settle = ? and execution_frequency = ?"
|
|
5141
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, cost_type, execution_frequency)
|
|
5142
|
+ }
|
|
5143
|
+
|
4838
|
5144
|
} else {
|
4839
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? and is_settle = ? "
|
4840
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, cost_type)
|
|
5145
|
+ if len(keyword) > 0 {
|
|
5146
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? and is_settle = ? and advice_name like ? "
|
|
5147
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, cost_type, keyword)
|
|
5148
|
+ } else {
|
|
5149
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? and is_settle = ? "
|
|
5150
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, cost_type)
|
|
5151
|
+ }
|
|
5152
|
+
|
4841
|
5153
|
}
|
4842
|
5154
|
|
4843
|
5155
|
} else {
|
4844
|
5156
|
if len(execution_frequency) > 0 {
|
4845
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? and execution_frequency = ?"
|
4846
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_frequency)
|
4847
|
|
- } else {
|
4848
|
|
- adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? "
|
4849
|
|
- adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id)
|
|
5157
|
+ if len(keyword) > 0 {
|
|
5158
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? and advice_name like ?"
|
|
5159
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, keyword)
|
|
5160
|
+ } else {
|
|
5161
|
+ adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? "
|
|
5162
|
+ adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id)
|
|
5163
|
+ }
|
|
5164
|
+
|
4850
|
5165
|
}
|
4851
|
5166
|
|
4852
|
5167
|
}
|