@Override public void saveUserOperationDataListsMap(Map dataListsMap) { Collection<UserOperationInParam> deleteList = BatchUtils.to(UserOperationInParam.class).getDeleteEntities(dataListsMap); Collection<UserOperationInParam> insertList = BatchUtils.to(UserOperationInParam.class).getInsertEntities(dataListsMap); Collection<UserOperationInParam> updateList = BatchUtils.to(UserOperationInParam.class).getModifiedEntities(dataListsMap); if (updateList != null && updateList.size() > 0) { for (UserOperationInParam inParam : updateList) { UserOperation entity = convertUserOperationInParamToEntity(inParam); userOperationDao.update(entity); } // userOperationDao.updateAll(updateList); } if (insertList != null && insertList.size() > 0) { for (UserOperationInParam inParam : insertList) { UserOperation entity = convertUserOperationInParamToEntity(inParam); userOperationDao.save(entity); inParam.setId(entity.getId()); } // userOperationDao.saveAll(insertList); } if (deleteList != null && deleteList.size() > 0) { for (UserOperationInParam inParam : deleteList) { UserOperation entity = new UserOperation(); entity.setId(inParam.getId()); userOperationDao.remove(entity); } // userOperationDao.removeAll(deleteList); } }
@Override public List<UserOperationInParam> findUserOperationByParams(Map params) { if (params == null) { params = new HashMap(); } List<UserOperation> temp = userOperationDao.findUserOperationByParams(params); return convertUserOperationToInParam(temp); }
@Override public DaoPage findUserOperationByParams(Map params, Integer pageIndex, Integer pageSize) { if (params == null) { params = new HashMap(); } DaoPage daoPage = userOperationDao.findUserOperationByParams(params, pageIndex, pageSize); daoPage.setResult(convertUserOperationToInParam((List<UserOperation>) daoPage.getResult())); return daoPage; }