mybatis中对List使用in语法,foreach语法

service中代码

    public Integer deleteAlarmCountResultLogical(String deleted, ArrayList idList){
        HashMap map = new HashMap<>(4);

        map.put(”ids“,idList);
        map.put(”status“,deleted);
        return mapper.deleteAlarmCountResultLogical(map);
    }

mapper中接口代码

Integer deleteAlarmCountResultLogical(Map map);

xml文件中写法:

    update alarm_count_result set

    
        status = #{status}
    
    where id in
    
    
        #{listItem}
    

 

你可能感兴趣的:(mybatis)