public static String getRegionName(Long id) { String regionname = ""; Region region = Region.findById(id); if (UtilValidate.isNotEmpty(region)) { regionname = region.regionname; } return regionname; }
/** * 删除 * * @param id * @return */ public static boolean deleteInfo(Long id) { Region info = Region.findById(id); boolean success = false; if (UtilValidate.isNotEmpty(info)) { // info.delete(); info.delete_flag = 1; success = info.save().isPersistent(); } return success; }
public static String getParentStr(Long parentId) { String parentStr = ""; if (parentId == 0 || parentId == null) { parentStr = "0,"; } else { Region region = Region.findById(parentId); parentStr = region.parentstr + parentId + ","; } return parentStr; }