if (modelJson != null) {
List<Map<String, Object>> infos = (List<Map<String, Object>>)JSONUtils.fromJSON(modelJson, List.class);
List<DBPropertiesBean> beans = new ArrayList<DBPropertiesBean>();
boolean ret = false;
for (Map<String, Object> info: infos) {
DBPropertiesBean bean = mapper.mapFromRow(info, DBPropertiesBean.class);
if ("update/".equals(pattern)) {
if (bean.getPropertyId() == null) {
// insert
if (bean.getUniq() != null && bean.getName() != null) {
DbAccess.propertiesAccess.insert(bean);
ret = true;
}
} else {
// update
DbAccess.propertiesAccess.updateByPrimaryKey(bean, bean.getPropertyId());
ret = true;
}
} else if (bean.getPropertyId() != null) {
// delete
DbAccess.propertiesAccess.deleteByPrimaryKey(bean.getPropertyId());
ret = true;
}
if (ret) {
beans.add(bean);
}