1.场景描述
我的 mapper.xml文件中查询Oracle数据的写法如下:
<select id="selectCountBetweenTime" parameterType="java.util.Map" resultType="int">
select count(*) from CHAIN_ORDER where
SELLER_NAME LIKE CONCAT('%', #{platform, jdbcType=VARCHAR}, '%')
<![CDATA[and PAY_TIME >= #{beginTime, jdbcType=TIMESTAMP}
and PAY_TIME < #{endTime, jdbcType=TIMESTAMP}]]>
</select>
2.故障现象
2019-06-21 17:54:18.722 [ERROR] [Saturn-OrderCountMonitorJob-14-thread-1] druid.sql.Statement [statementLogError-149] -{conn-10010, pstmt-20000} execute error. select count(*) from CHAIN_ORDER where
SELLER_NAME LIKE CONCAT('%', ?, '%')
and PAY_TIME >= ?
and PAY_TIME < ?
java.sql.SQLSyntaxErrorException: ORA-00909: 参数个数无效