日期:2014-05-17  浏览次数:20675 次

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用的蛮少。