controller
public void getData() {
try {
Object obj=userMapper.getInfo("tableName");
} catch (IOException e) {
e.printStackTrace();
}
}
mapper
Object getInfo(@Param("tableName")String tableName);
- 注解一定要加 @Param("tableName")
xml
<select id="getInfo" resultType="java.util.Map">
SELECT * FROM ${tableName};
</select>

3506

被折叠的 条评论
为什么被折叠?



