浏览 7222 次
锁定老帖子 主题:ibatis传入list
该帖已经被评为新手帖
|
|
---|---|
作者 | 正文 |
发表时间:2009-01-08
最后修改:2009-01-08
List<Map<String , Object>> groupList = new ArrayList<Map<String , Object>>(); List<Map<String , Object>> depList = new ArrayList<Map<String , Object>>(); List<Map<String , Object>> personList = new ArrayList<Map<String , Object>>(); HashMap paramMap = new HashMap(); paramMap.put("groupList", paramGroupList); paramMap.put("depList", paramGroupList); paramMap.put("empList", paramPersonList); groupList = menuListBO.getGroupAuthList(paramMap); depList = menuListBO.getDepAuthList(paramMap); personList = menuListBO.getPersonList(paramMap); <select id="selectDepAuthList" resultClass="dmap" parameterClass="java.util.HashMap"> SELECT * FROM tt_dept <dynamic prepend="where"> <isNotNull prepend="and"> dept_id IN <iterate property="depList" open="(" close=")" conjunction=","> #depList[]# </iterate> </isNotNull> </dynamic> </select> 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |
发表时间:2009-01-09
.....前面省略
List<Long> list = new ArrayList<Long>(); for (int i = 0; i < temp.length; i++) { list.add(i, Long.parseLong(temp[i])); } goodsService.updateSaleMore(list); ------------------------------------------------------------ xml <!-- 批量修改 --> <update id="UpdateSaleOff" parameterClass="java.util.List"> update b2c_tbl_goods set is_on_sale = 0 where <iterate conjunction="," open="goods_id in (" close=")" > #[]# </iterate> </update> ——————————————————-———————————————————— DAO SqlMapClient client = SqlMap.getSqlmap(); client.update("UpdateSaleOff", list); |
|
返回顶楼 | |
发表时间:2009-01-09
引用 <!-- 批量修改 -->
<update id="UpdateSaleOff" parameterClass="java.util.List"> update b2c_tbl_goods set is_on_sale = 0 where <iterate conjunction="," open="goods_id in (" close=")" > #[]# </iterate> </update> |
|
返回顶楼 | |
发表时间:2009-01-09
看你这贴和看官方文档(还有中文版的)有什么区别?
|
|
返回顶楼 | |
发表时间:2009-01-10
这。。。。
|
|
返回顶楼 | |