|
@@ -181,6 +181,21 @@ func (repository *CooperationApplicationRepository) Find(queryOptions map[string |
|
@@ -181,6 +181,21 @@ func (repository *CooperationApplicationRepository) Find(queryOptions map[string |
181
|
var cooperationApplicationModels []*models.CooperationApplication
|
181
|
var cooperationApplicationModels []*models.CooperationApplication
|
182
|
cooperationApplications := make([]*domain.CooperationApplication, 0)
|
182
|
cooperationApplications := make([]*domain.CooperationApplication, 0)
|
183
|
query := sqlbuilder.BuildQuery(tx.Model(&cooperationApplicationModels), queryOptions)
|
183
|
query := sqlbuilder.BuildQuery(tx.Model(&cooperationApplicationModels), queryOptions)
|
|
|
184
|
+ if cooperationProjectNumber, ok := queryOptions["cooperationProjectNumber"]; ok && cooperationProjectNumber != "" {
|
|
|
185
|
+ query.Where("cooperation_project_number like ?", fmt.Sprintf("%%%s%%", cooperationProjectNumber))
|
|
|
186
|
+ }
|
|
|
187
|
+ //TODO 共创项目名称查询
|
|
|
188
|
+ if cooperationProjectName, ok := queryOptions["cooperationProjectName"]; ok && cooperationProjectName != "" {
|
|
|
189
|
+ query.Join("LEFT JOIN cooperation_projects AS a").
|
|
|
190
|
+ JoinOn("a.cooperation_project_number = cooperation_application.cooperation_project_number").
|
|
|
191
|
+ Where("a.cooperation_project_name like ?", fmt.Sprintf("%%%s%%", cooperationProjectName))
|
|
|
192
|
+ }
|
|
|
193
|
+ if applicantName, ok := queryOptions["applicantName"]; ok && applicantName != "" {
|
|
|
194
|
+ query.Where(`(cooperation_application.cooperation_application_applicant->>'userName')::text LIKE ?`, fmt.Sprintf("%%%s%%", applicantName))
|
|
|
195
|
+ }
|
|
|
196
|
+ if cooperationApplicationStatus, ok := queryOptions["cooperationApplicationStatus"]; ok && cooperationApplicationStatus.(int32) != 0 {
|
|
|
197
|
+
|
|
|
198
|
+ }
|
184
|
query.SetOffsetAndLimit(20)
|
199
|
query.SetOffsetAndLimit(20)
|
185
|
query.SetOrderDirect("cooperation_application_id", "DESC")
|
200
|
query.SetOrderDirect("cooperation_application_id", "DESC")
|
186
|
if count, err := query.SelectAndCount(); err != nil {
|
201
|
if count, err := query.SelectAndCount(); err != nil {
|