读书人

mybatis 传入表名参数怎么判断呢

发布时间: 2012-05-16 11:12:12 作者: rapoo

mybatis 传入表名参数,如何判断呢?
比如有 3张表 A,B,C,我要选择性查询这3张表,在java后台传入一个参数name,到xml里,怎么判断?
贴上xml
代码:

XML code
<select id="getOtherList" resultType="map">    select ${colName}  from $tableName$  <where>    dept_id=#{deptID}  </where> </select>



[解决办法]
mybatis有if的xml标签,也就是动态标签,你查查看吧,mybatis用的蛮少。

读书人网 >Java Web开发

热点推荐