|
@@ -2090,12 +2090,11 @@ func GetNewDialysisWeightDetailTableTen(
|
2090
|
2090
|
user_org_id int64,
|
2091
|
2091
|
start_time int64,
|
2092
|
2092
|
end_time int64,
|
2093
|
|
- addType, dryType, afterType, page, limit int64,
|
2094
|
|
-) ([]DialysisDataTwo, int64, error) {
|
|
2093
|
+ addType, dryType, afterType, page, limit int64, keyword string) ([]DialysisDataTwo, int64, error) {
|
2095
|
2094
|
offset := (page - 1) * limit
|
2096
|
2095
|
//var dialysisData []DialysisDataTwo
|
2097
|
2096
|
var total int64
|
2098
|
|
-
|
|
2097
|
+ keyword = "%" + keyword + "%"
|
2099
|
2098
|
// 构建基本查询
|
2100
|
2099
|
query := readDb.Table("xt_assessment_before_dislysis b").
|
2101
|
2100
|
Select(`
|
|
@@ -2159,7 +2158,7 @@ func GetNewDialysisWeightDetailTableTen(
|
2159
|
2158
|
ELSE '其他'
|
2160
|
2159
|
END AS weight_status
|
2161
|
2160
|
`).
|
2162
|
|
- Joins("left JOIN xt_patients p ON p.id = b.patient_id").
|
|
2161
|
+ Joins("JOIN xt_patients p ON p.id = b.patient_id and p.name like ?", keyword).
|
2163
|
2162
|
Joins("left JOIN xt_assessment_after_dislysis a ON p.id = a.patient_id AND b.assessment_date = a.assessment_date AND a.status = 1").
|
2164
|
2163
|
Where("b.user_org_id = ?", user_org_id).
|
2165
|
2164
|
Where("b.assessment_date >= ?", start_time).
|