首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

ibatis动态传到表名、字段名

2012-08-22 
ibatis动态传入表名、字段名?javaMapString,Object params new HashMapString,Object()params.put(

ibatis动态传入表名、字段名

?java

    Map<String,Object> params = new HashMap<String,Object>();        params.put("tableName", tableName);        params.put("sidFieldName", sidFieldName);        params.put("lastDateFiledName", lastDateFiledName);        params.put("serviceDateFiledName", serviceDateFiledName);        params.put("uidFieldName", uidFieldName);        params.put("1", userType);        params.put("2", uid);getSqlMapClientTemplate().update("updateUserType" , params);

?sqlmap.xml

 <update id="updateUserType" parameterClass="map">    <![CDATA[      update /*99*/ $tableName$ SET $sidFieldName$ = #1# , $lastDateFiledName$ = sysdate,$serviceDateFiledName$ = sysdate WHERE $uidFieldName$ = #2#    ]]>  </update>
?

热点排行