1、报错详情
Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Incorrect parameters in the call to stored function 'CAST'
; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Incorrect parameters in the call to stored function 'CAST'
at org.springframework.jdbc.support.SQLExceptionSubclassTranslator.doTranslate(SQLExceptionSubclassTranslator.java:93)
2、报错sql代码块
AND prs.ACTUAL_MONTHLY!='' AND prs.ACTUAL_MONTHLY IS NOT NULL and cast (prs.ACTUAL_MONTHLY as SIGNED) between 1 and ${month}
3、解决办法
删除cast后空格,例如:cast(field as type)