w1100n
This site is best viewed in Google Chrome
wiloon, 5/7/2014 9:01 | Tag:

http://m.blog.csdn.net/blog/wuqinfei_cs/12873135 映射 /* <!– 将表字段与实体属性一一对应 –> <resultMap type=”com.hehe.mybatis.domain.User” id=”userMap”> <id column=”id” property=”id”/> <result column=”name” property=”username”/> <result column=”address” property=”uaddress”/> </resultMap> <select id=”selectUserById” parameterType=”string” resultMap=”userMap”> select * from user where id = #{id} </select>

wiloon, 1/24/2013 14:22 | Tag:

http://springsfeng.iteye.com/blog/1634234 参考:http://luoyu-ds.iteye.com/blog/1517607   如果要动态传入表名,字段名之类的参数替换SQL语句中的占位副,需要将SQL语句执行改成非预编译的,即: Xml代码   <update id=”editIssuedData” parameterType=”map”<span style=”color: #ff0000;”> statementType=”STATEMENT”</span> >     <![DATA[         updata user_info_t set <span style=”color: #ff0000;”>${field} = ${value}</span>  where id=<span style=”color: #ff0000;”> ${id}</span>     ]]> </update> 同时参数Map中需做下面处理: Java代码   Map<String, Object> map = new HashMap<String, Object>();         map.put(“field”, Constant.ISSUED_PLAN_COLUMN_NAME.get(field));        <span style=”color: #ff0000;”> map.put(“value”, “‘”+value+”‘”);  </span>         map.put(“id”, id);  

辽ICP备14012896