mybatis使用函数 再group by 传参报错

### Cause: java.sql.SQLSyntaxErrorException: ORA-00979: 不是 GROUP BY 表达式
; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: ORA-00979: 不是 GROUP BY 表达式
【mybatis使用函数 再group by 传参报错】错误配置:
SELECT fun_TimeDimension(SEND_TIME,#{grant} ) AS SEND_TIME,sum(total) as total FROM T_TRAFFICPARAMMSG
WHERE
TO_DATE (
SEND_TIME,
'yyyy-mm-dd hh24:mi:ss'
) > = TO_DATE (
#{startTime},
'yyyy-mm-dd hh24:mi:ss'
)
AND TO_DATE (
SEND_TIME,
'yyyy-mm-dd hh24:mi:ss'
) < = TO_DATE (
#{endTime},
'yyyy-mm-dd hh24:mi:ss'
)
and DIRECTION = #{director}
group by fun_TimeDimension(SEND_TIME,#{grant} )
ORDER BY SEND_TIME asc


--------------正确配置
SELECT fun_TimeDimension(SEND_TIME,${grant} ) AS SEND_TIME,sum(total) as total FROM T_TRAFFICPARAMMSG
WHERE
TO_DATE (
SEND_TIME,
'yyyy-mm-dd hh24:mi:ss'
) > = TO_DATE (
#{startTime},
'yyyy-mm-dd hh24:mi:ss'
)
AND TO_DATE (
SEND_TIME,
'yyyy-mm-dd hh24:mi:ss'
) < = TO_DATE (
#{endTime},
'yyyy-mm-dd hh24:mi:ss'
)
and DIRECTION = #{director}
group by fun_TimeDimension(SEND_TIME,${grant} )
ORDER BY SEND_TIME asc
把#{grant} 改成 ${grant}

    推荐阅读