service层
Map<Object,Object> map = new HashMap<Object,Object>();
List list = new ArrayList();
list.add("kiki");
String status = "5";
map.put("list", list);
map.put("status", status);
tempDao.updateTempList(map);
mapper
<update id="updateTempListStatus" parameterType="map" >
update temp_list set status='1' where id in
<foreach collection="tempList" item="ent" separator="," open="(" close=")">
#{ent.id,jdbcType=VARCHAR}
</foreach>
and status = #{status,jdbcType=VARCHAR}
</update>
本文介绍了一种使用Java实现的Service层方法,通过Map传递列表和状态信息,并利用Mapper更新数据库中特定记录的状态。具体操作涉及创建Map对象存储列表和状态值,然后调用DAO层的updateTempList方法进行更新。
6424

被折叠的 条评论
为什么被折叠?



