<update id="batchUpdate" parameterType="java.util.Map">
UPDATE TB_DOOR_DOOR SET
CONTROLLERID=#{newsn,jdbcType=NUMERIC}
WHERE CONTROLLERID in
<foreach item="controllersn" index="index" collection="snList" open="(" separator="," close=")">
#{controllersn}
</foreach>
</update>
servrice 层:传送:
@Override
public void batchUpdate(List<String> snlist, String newsn) {
// TODO Auto-generated method stub
HashMap<String, Object> hashmap=new HashMap<String, Object>(256);
hashmap.put("snList", snlist);
hashmap.put("newsn", newsn);
this.doordao.updateByKey("batchUpdate", newsn);
}
业务流程层:
List<String> doorlist=new ArrayList<String>(256);
doorlist.add(sn);
this.doorService.batchUpdate(doorlist, newsn);