我正在使用Grails 2.3.4并且在命名查询时遇到问题。 例如:
def c = Party.createCriteria()
completedSearchList = c.list(max: params.max, offset: params.offset){
if(params.searchText) {
or {
ilike("FirstName", "%${params.searchText}%")
ilike("pDate", "%${params.searchText}%")
"in"("user",users)
}
and {
eq("status","COMP")
}
and {
eq("projectID",session.projectID)
}
}
}
目标是通过参数值将搜索值写入搜索字段,并使用Grails条件进行搜索。
但我收到的错误信息如下:
Stacktrace follows:Message: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')) and (this_.status='COMP') and (this_.projectid='bacrt') limit 10' at line 1