一个参数传两次,占位符名称相同,参数要怎么设呢?
Sql sql = Sqls.create("select IFNULL(MAX(x.id)+1,@placeId*1000+1) from tm_term x where x.id like '@placeId%' ");
sql.params().set("placeId", placeId).set("placeId", placeId);
org.nutz.dao.DaoException: !Nutz SQL Error: 'select IFNULL(MAX(x.id)+1,350104000001*1000+1) from tm_term x where x.id like '350104000001%''
PreparedStatement:
'select IFNULL(MAX(x.id)+1,?*1000+1) from tm_term x where x.id like '?%''
CaseMessage=Parameter index out of range (2 > number of parameters, which is 1).
at org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:104)
at org.nutz.plugins.cache.dao.CachedNutDaoExecutor._exec(CachedNutDaoExecutor.java:317)
at org.nutz.plugins.cache.dao.CachedNutDaoExecutor.exec(CachedNutDaoExecutor.java:187)