public static Long getMaxOrderId() { Region region = Region.find("order by id desc").first(); Long orderId = 1L; if (UtilValidate.isNotEmpty(region)) { orderId = region.orderid + 1; } return orderId; }
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; }