From 27b5764e57339e9ce2576e74a456d2f7a62e043a Mon Sep 17 00:00:00 2001 From: qi_liang Date: Thu, 27 Jun 2019 16:03:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/panda/jdbc/helper/DataBaseHelper.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/panda-jdbc/src/main/java/org/panda/jdbc/helper/DataBaseHelper.java b/panda-jdbc/src/main/java/org/panda/jdbc/helper/DataBaseHelper.java index e597a50..52f5e2f 100644 --- a/panda-jdbc/src/main/java/org/panda/jdbc/helper/DataBaseHelper.java +++ b/panda-jdbc/src/main/java/org/panda/jdbc/helper/DataBaseHelper.java @@ -210,6 +210,12 @@ public class DataBaseHelper { return rowNum; } + /** + * 新增数据 + * @param obj + * @param abstractDbBuiler + * @return + */ public static boolean insertEntity(Object obj, AbstractDbBuiler abstractDbBuiler) { Map fieldMap = BeanUtil.getFieldValue(obj); String sql = abstractDbBuiler.insertSql(obj, fieldMap); @@ -217,6 +223,13 @@ public class DataBaseHelper { return executeUpdate(sql, params) == 1; } + /** + * 更新数据 + * @param obj + * @param abstractDbBuiler + * @param id + * @return + */ public static boolean updateEntity(Object obj, AbstractDbBuiler abstractDbBuiler, Long id) { Map fieldMap = BeanUtil.getFieldValue(obj); String sql = abstractDbBuiler.insertSql(obj, fieldMap); @@ -227,6 +240,13 @@ public class DataBaseHelper { return executeUpdate(sql, params) == 1; } + /** + * 删除数据 + * @param obj + * @param abstractDbBuiler + * @param id + * @return + */ public static boolean deleteEntity(Object obj, AbstractDbBuiler abstractDbBuiler, Long id) { Map fieldMap = BeanUtil.getFieldValue(obj); String sql = abstractDbBuiler.deleteSql(obj, fieldMap);