// String[] selectHids 业主需要关联的房屋id// list<HouseInfo> houseList 业主已经关联的房屋集合// pname 业主名称(已知)publicvoidchangeHouseRecord(String pname, String[] selectHids,List<houseList> houseList){
List<ChangeRecord> recordList =newArrayList<>();// 添加关联int flag =1;for(String hid: selectHids){for(HouseInfo info: houseList){
flag =1;if(hid.equals(info.getHid())){
flag =0;break;}}if(0== flag){continue;}
ChangeRecord record =newChangeRecord();
record .setId(Utils.getId);
record .setHid(hid);
record .setPName(pname);
record .setUpdateContent("房屋业主设置为"+pname);
record .setUpdateTime(newSimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(newDate()));
recordList .add(record );}// 取消关联
flag =1;for(HouseInfo info : houseList){for(String hid: selectHids){
flag =1;if(info.getHid().equals(hid)){
flag =0;break;}}if(0== flag){continue;}
HouseInfob record =newHouseInfo();
record .setId(Utils.getId);
record .setHid(info.getHid());
record .setPname(pname);
record .setUpdateContent("取消房屋与"+pname+"的绑定");
record .setUpdateTime(newSimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(newDate()));
recordList .add(bRecord);}if(0== recordList .size()){
logger.info("| 业主房屋变更记录更新:【0】条记录发生改变!");return;}int count = recordMapper.insertRecordBatch(recordList );
logger.info("| 业主房屋变更记录更新:【"+count+"】条记录发生改变!");}