作者 陈志颖

fix:共创项目搜索条件补充

... ... @@ -15,6 +15,8 @@ type SearchCooperationProjectQuery struct {
PageSize int64 `cname:"页面大小" json:"pageSize,omitempty"`
// 共创项目名称
CooperationProjectName string `cname:"共创项目名称" json:"cooperationProjectName,omitempty"`
// 共创项目编号
CooperationProjectNumber string `cname:"共创项目编号" json:"cooperationProjectNumber,omitempty"`
// 部门名称
DepartmentName string `cname:"部门名称" json:"departmentName,omitempty"`
// 共创项目状态,根据共创项目状态筛选项目数据
... ...
... ... @@ -243,6 +243,9 @@ func (repository *CooperationProjectRepository) Find(queryOptions map[string]int
if cooperationProjectName, ok := queryOptions["cooperationProjectName"]; ok && cooperationProjectName != "" {
query.Where("cooperation_project_name like ?", fmt.Sprintf("%%%s%%", cooperationProjectName))
}
if cooperationProjectNumber, ok := queryOptions["cooperationProjectNumber"]; ok && cooperationProjectNumber != "" {
query.Where("cooperation_project_number ilike ?", fmt.Sprintf("%%%s%%", cooperationProjectNumber))
}
if companyId, ok := queryOptions["companyId"]; ok && companyId.(int64) != 0 {
query.Where("company->>'companyId' = '?'", companyId)
}
... ...