废话不多。
mapper
@Select("${sqlStr}")
List<MyTest> dynamicSql(@Param("sqlStr")String sql);
测试
@Autowired
MyTestMapper myTestMapper;
@Test
public void DynamicSql()
{
String sql="select * from myTest";
List<MyTest> list = myTestMapper.dynamicSql(sql);
}