MYSQL自定义函数 参数问题
各路豪杰,请上眼:
CREATE FUNCTION `getChildList`(rootId INT)...... 自定义函数
mysql> select * from xxx
-> where FIND_IN_SET(id, getChildList(1));
上面这条语句可以正确执行,但是getChildList()中的参数是写死的,
请问有无办法通过前台将值传过来,就像Oracle中的占位符一样(getChildLst( ? ));
最终达到这样的效果:
String loop_SQL = select * from xxxx where FIND_IN_SET(id, getChildList( XXXX ));
public List<xxxx> loopList(Integer id) {
return JdbcTemplate().query(loop_SQL);