mybatis 或 mybatis-plus执行原生sql
1、用${}的方式执行执行sql
@Autowired MyDbMapper myDbMapper; @Override public List<Map> nativeSql(String nativeSql) { return myDbMapper.nativeSql(nativeSql); }
@Autowired
MyDbMapper myDbMapper;
@Override
public List<Map> nativeSql(String nativeSql) {
return myDbMapper.nativeSql(nativeSql);
}
注意:有注入风险