MyBatis的SQL语句映射文件详解(三)----多参数传递的几种方式
Mapping.java
int deleteByIds(@Param("ids")List<Integer> ids,@Param("tablename")String tablename);
mapping.xml
<update id="deleteByIds" parameterType="map">
UPDATE ${tablename} SET STATE = 0 WHERE ID in
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</update>
更多内容请访问:IT源点
注意:本文归作者所有,未经作者允许,不得转载