批量更新
<update id="checkedAll">
UPDATE b_person SET
per_state = '02'
where id in(
<foreach separator="," collection="list" item="item" index="index">
#{item.id}
</foreach>
)
</update>
同样的批量循环删除
这里使用逻辑删除
<update id="delList">
update b_room
set del_flag = '1'
where id in(
<foreach separator="," collection="list" item="c" index="index">
#{c.id}
</foreach>
)
</update>
DAO中的参数形式如下
/**
* 批量删除
*
* @param list
*/
public void delList(List list);
实体对象BEAN中时间注解写法
/**
* 提交时间: 提交时间
*/
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
protected java.util.Date submitTime;