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