diff --git a/.gitignore b/.gitignore
index 530ce3c..a85a048 100644
--- a/.gitignore
+++ b/.gitignore
@@ -43,6 +43,7 @@ DirectoryV2.xml
src/main/resources/WEB-INF/sqllog/
java.io.tempdir/
ecology-9-dev.iml
+src/test/resources/font
diff --git a/src/main/java/aiyh/utils/Util.java b/src/main/java/aiyh/utils/Util.java
index 9e9a5dc..1696df5 100644
--- a/src/main/java/aiyh/utils/Util.java
+++ b/src/main/java/aiyh/utils/Util.java
@@ -1976,6 +1976,43 @@ public class Util extends weaver.general.Util {
return recordsetUtil.getMapper(t);
}
+ /**
+ *
getTransMapper 获取事务对象mapper
+ * 2022/12/21 22:45
+ * ************************************************************
+ *
+ * @param t 类
+ * @param 代理类
+ * @return T
+ * @author youHong.ai ******************************************
+ */
+ public static T getTransMapper(Class t) {
+ return recordsetUtil.getMapper(t, false);
+ }
+
+ /**
+ * commitTransMapper 提交事务mapper的事务
+ * 2022/12/21 22:46
+ * ************************************************************
+ *
+ * @return boolean 是否提交成功
+ * @author youHong.ai ******************************************
+ */
+ public static boolean commitTransMapper() {
+ return recordsetUtil.getRsManager().commit();
+ }
+
+ /**
+ * rollbackTransMapper 回滚事务mapper 的事务
+ * 2022/12/21 22:46
+ * ************************************************************
+ *
+ * @return boolean 是否回滚成功
+ * @author youHong.ai ******************************************
+ */
+ public static boolean rollbackTransMapper() {
+ return recordsetUtil.getRsManager().rollback();
+ }
/**
* join方法
diff --git a/src/main/java/aiyh/utils/recordset/BooleanTypeHandler.java b/src/main/java/aiyh/utils/recordset/BooleanTypeHandler.java
index 2a1bae5..76fcc92 100644
--- a/src/main/java/aiyh/utils/recordset/BooleanTypeHandler.java
+++ b/src/main/java/aiyh/utils/recordset/BooleanTypeHandler.java
@@ -6,23 +6,33 @@ import aiyh.utils.excention.CustomerException;
import com.google.common.base.Strings;
import org.jetbrains.annotations.NotNull;
import weaver.conn.RecordSet;
+import weaver.conn.RecordSetTrans;
import java.lang.reflect.Field;
/**
- * @author EBU7-dev1-ayh
- * create 2021/12/21 0021 13:34
+ * @author EBU7-dev1-ayh create 2021/12/21 0021 13:34
*/
-public class BooleanTypeHandler implements TypeHandler{
+public class BooleanTypeHandler implements TypeHandler {
@Override
public Object getValue(RecordSet rs, String fieldName, Field declaredField) {
return getBoolean(declaredField, rs.getString(fieldName));
}
@Override
- public Object getValue(RecordSet rs, int index,Field declaredField) {
+ public Object getValue(RecordSet rs, int index, Field declaredField) {
+ return getBoolean(declaredField, rs.getString(index));
+ }
+
+ @Override
+ public Object getValue(RecordSetTrans rs, String fieldName, Field declaredField) {
+ return getBoolean(declaredField, rs.getString(fieldName));
+ }
+
+ @Override
+ public Object getValue(RecordSetTrans rs, int index, Field declaredField) {
return getBoolean(declaredField, rs.getString(index));
}
@@ -58,7 +68,7 @@ public class BooleanTypeHandler implements TypeHandler{
} else {
return defaultValue;
}
- }else {
+ } else {
return defaultValue;
}
} catch (Exception e) {
diff --git a/src/main/java/aiyh/utils/recordset/DataTypeHandler.java b/src/main/java/aiyh/utils/recordset/DataTypeHandler.java
index dfb18e8..2e6fa85 100644
--- a/src/main/java/aiyh/utils/recordset/DataTypeHandler.java
+++ b/src/main/java/aiyh/utils/recordset/DataTypeHandler.java
@@ -4,14 +4,14 @@ import aiyh.utils.annotation.DateFormatAn;
import aiyh.utils.excention.TypeNonsupportException;
import com.ibm.icu.text.SimpleDateFormat;
import weaver.conn.RecordSet;
+import weaver.conn.RecordSetTrans;
import java.lang.reflect.Field;
import java.text.ParseException;
import java.util.Date;
/**
- * @author EBU7-dev1-ayh
- * create 2021/12/21 0021 13:35
+ * @author EBU7-dev1-ayh create 2021/12/21 0021 13:35
*/
@@ -53,4 +53,42 @@ public class DataTypeHandler implements TypeHandler {
}
return date;
}
+
+ @Override
+ public Object getValue(RecordSetTrans rs, String fieldName, Field declaredField) {
+ if (declaredField == null) {
+ throw new TypeNonsupportException("An error occurred while trying to convert the query result field to type Date!");
+ }
+ DateFormatAn annotation = declaredField.getAnnotation(DateFormatAn.class);
+ Date date = null;
+ if (annotation != null) {
+ String value = annotation.value();
+ try {
+ date = new SimpleDateFormat(value).parse(rs.getString(fieldName));
+ } catch (ParseException e) {
+ e.printStackTrace();
+ throw new TypeNonsupportException("Failed to convert [" + rs.getString(fieldName) + "] to a Date object as [" + value + "]!!");
+ }
+ }
+ return date;
+ }
+
+ @Override
+ public Object getValue(RecordSetTrans rs, int index, Field declaredField) {
+ if (declaredField == null) {
+ throw new TypeNonsupportException("An error occurred while trying to convert the query result field to type Date!");
+ }
+ DateFormatAn annotation = declaredField.getAnnotation(DateFormatAn.class);
+ Date date = null;
+ if (annotation != null) {
+ String value = annotation.value();
+ try {
+ date = new SimpleDateFormat(value).parse(rs.getString(index));
+ } catch (ParseException e) {
+ e.printStackTrace();
+ throw new TypeNonsupportException("Failed to convert [" + rs.getString(index) + "] to a Date object as [" + value + "]!!");
+ }
+ }
+ return date;
+ }
}
diff --git a/src/main/java/aiyh/utils/recordset/FloatTypeHandler.java b/src/main/java/aiyh/utils/recordset/FloatTypeHandler.java
index 474895f..7eda059 100644
--- a/src/main/java/aiyh/utils/recordset/FloatTypeHandler.java
+++ b/src/main/java/aiyh/utils/recordset/FloatTypeHandler.java
@@ -2,6 +2,7 @@ package aiyh.utils.recordset;
import aiyh.utils.Util;
import weaver.conn.RecordSet;
+import weaver.conn.RecordSetTrans;
import java.lang.reflect.Field;
@@ -15,13 +16,25 @@ import java.lang.reflect.Field;
public class FloatTypeHandler implements TypeHandler {
@Override
public Object getValue(RecordSet rs, String fieldName, Field declaredField) {
- String string = Util.null2DefaultStr(rs.getString(fieldName),"0.0");
+ String string = Util.null2DefaultStr(rs.getString(fieldName), "0.0");
return Float.parseFloat(string);
}
@Override
public Object getValue(RecordSet rs, int index, Field declaredField) {
- String string = Util.null2DefaultStr(rs.getString(index),"0.0");
+ String string = Util.null2DefaultStr(rs.getString(index), "0.0");
+ return Float.parseFloat(string);
+ }
+
+ @Override
+ public Object getValue(RecordSetTrans rs, String fieldName, Field declaredField) {
+ String string = Util.null2DefaultStr(rs.getString(fieldName), "0.0");
+ return Float.parseFloat(string);
+ }
+
+ @Override
+ public Object getValue(RecordSetTrans rs, int index, Field declaredField) {
+ String string = Util.null2DefaultStr(rs.getString(index), "0.0");
return Float.parseFloat(string);
}
}
diff --git a/src/main/java/aiyh/utils/recordset/IntegerTypeHandler.java b/src/main/java/aiyh/utils/recordset/IntegerTypeHandler.java
index 2eceae7..48c3b5c 100644
--- a/src/main/java/aiyh/utils/recordset/IntegerTypeHandler.java
+++ b/src/main/java/aiyh/utils/recordset/IntegerTypeHandler.java
@@ -2,30 +2,48 @@ package aiyh.utils.recordset;
import aiyh.utils.Util;
import weaver.conn.RecordSet;
+import weaver.conn.RecordSetTrans;
import java.lang.reflect.Field;
/**
- * @author EBU7-dev1-ayh
- * create 2021/12/21 0021 13:10
+ * @author EBU7-dev1-ayh create 2021/12/21 0021 13:10
*/
-public class IntegerTypeHandler implements TypeHandler{
+public class IntegerTypeHandler implements TypeHandler {
@Override
public Object getValue(RecordSet rs, String fieldName, Field declaredField) {
- String string = Util.null2DefaultStr(rs.getString(fieldName),"-1");
- if(string.contains(".")){
- string = string.substring(0,string.indexOf("."));
+ String string = Util.null2DefaultStr(rs.getString(fieldName), "-1");
+ if (string.contains(".")) {
+ string = string.substring(0, string.indexOf("."));
}
return Integer.parseInt(string);
}
@Override
- public Object getValue(RecordSet rs, int index,Field declaredField) {
- String string = Util.null2DefaultStr(rs.getString(index),"-1");
- if(string.contains(".")){
- string = string.substring(0,string.indexOf("."));
+ public Object getValue(RecordSet rs, int index, Field declaredField) {
+ String string = Util.null2DefaultStr(rs.getString(index), "-1");
+ if (string.contains(".")) {
+ string = string.substring(0, string.indexOf("."));
+ }
+ return Integer.parseInt(string);
+ }
+
+ @Override
+ public Object getValue(RecordSetTrans rs, String fieldName, Field declaredField) {
+ String string = Util.null2DefaultStr(rs.getString(fieldName), "-1");
+ if (string.contains(".")) {
+ string = string.substring(0, string.indexOf("."));
+ }
+ return Integer.parseInt(string);
+ }
+
+ @Override
+ public Object getValue(RecordSetTrans rs, int index, Field declaredField) {
+ String string = Util.null2DefaultStr(rs.getString(index), "-1");
+ if (string.contains(".")) {
+ string = string.substring(0, string.indexOf("."));
}
return Integer.parseInt(string);
}
diff --git a/src/main/java/aiyh/utils/recordset/RecordsetUtil.java b/src/main/java/aiyh/utils/recordset/RecordsetUtil.java
index 9b2c5f5..e82a60f 100644
--- a/src/main/java/aiyh/utils/recordset/RecordsetUtil.java
+++ b/src/main/java/aiyh/utils/recordset/RecordsetUtil.java
@@ -7,10 +7,13 @@ import aiyh.utils.excention.CustomerException;
import aiyh.utils.sqlUtil.sqlResult.impl.BatchSqlResultImpl;
import aiyh.utils.sqlUtil.sqlResult.impl.PrepSqlResultImpl;
import weaver.conn.RecordSet;
+import weaver.conn.RecordSetTrans;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
+import java.util.ArrayList;
+import java.util.List;
/**
* @author EBU7-dev1-ayh create 2021/12/19 0019 14:39
@@ -19,24 +22,43 @@ import java.lang.reflect.Proxy;
public class RecordsetUtil implements InvocationHandler {
- private final RecordSet recordSet = new RecordSet();
- private final RecordSet rs = new RecordSet();
+ public static final String SQL_LOG = "sql_log";
+ private final RsThreadLocalManager rsManager = new RsThreadLocalManager();
+
+ private boolean autoCommit = true;
public T getMapper(Class tClass) {
+ return getMapper(tClass, true);
+ }
+
+ public T getMapper(Class tClass, boolean autoCommit) {
if (tClass == null) {
throw new BindingException("class is null!");
}
if (tClass.getAnnotation(SqlMapper.class) == null) {
throw new BindingException("can not find SqlMapper annotation!");
}
+ this.autoCommit = autoCommit;
return (T) Proxy.newProxyInstance(tClass.getClassLoader(), new Class[]{tClass}, this);
}
@Override
public Object invoke(Object proxy, Method method, Object[] args) {
+ if (autoCommit) {
+ return invokeRs(proxy, method, args);
+ }
+ return invokeRsTrans(proxy, method, args);
+ }
+
+ private Object invokeRs(Object proxy, Method method, Object[] args) {
+ RecordSet rs = rsManager.getRs();
+ if (rs == null) {
+ rsManager.setRecordSet();
+ rs = rsManager.getRs();
+ }
SqlHandler sqlHandler = new SqlHandler();
ResultMapper resultMapper = new ResultMapper();
Select select = method.getAnnotation(Select.class);
@@ -48,7 +70,7 @@ public class RecordsetUtil implements InvocationHandler {
if (!handler.getSqlStr().trim().toLowerCase().startsWith("select ")) {
throw new CustomerException("The sql statement does not match, the @Select annotation can only getDataId the select statement, please check whether the sql statement matches!");
}
- Util.getLogger("sql_log").info("解析sql===>" + handler);
+ Util.getLogger(SQL_LOG).info("解析sql===>" + handler);
if (handler.getArgs().isEmpty()) {
rs.executeQuery(handler.getSqlStr());
} else {
@@ -57,7 +79,6 @@ public class RecordsetUtil implements InvocationHandler {
return resultMapper.mapperResult(rs, method, method.getReturnType());
}
Update update = method.getAnnotation(Update.class);
-
if (update != null) {
// 查询
String sql = update.value();
@@ -66,13 +87,13 @@ public class RecordsetUtil implements InvocationHandler {
if (!handler.getSqlStr().trim().toLowerCase().startsWith("update ")) {
throw new CustomerException("The sql statement does not match, the @Update annotation can only getDataId the update statement, please check whether the sql statement matches!");
}
- Util.getLogger("sql_log").info(handler.toString());
+ Util.getLogger(SQL_LOG).info(handler.toString());
Class> returnType = method.getReturnType();
boolean b;
if (handler.getArgs().isEmpty()) {
- b = recordSet.executeUpdate(handler.getSqlStr());
+ b = rs.executeUpdate(handler.getSqlStr());
} else {
- b = recordSet.executeUpdate(handler.getSqlStr(), handler.getArgs());
+ b = rs.executeUpdate(handler.getSqlStr(), handler.getArgs());
}
if (returnType.equals(void.class)) {
return null;
@@ -97,13 +118,13 @@ public class RecordsetUtil implements InvocationHandler {
if (!handler.getSqlStr().trim().toLowerCase().startsWith("insert ")) {
throw new CustomerException("The sql statement does not match, the @Insert annotation can only getDataId the insert statement, please check whether the sql statement matches!");
}
- Util.getLogger("sql_log").info(handler.toString());
+ Util.getLogger(SQL_LOG).info(handler.toString());
Class> returnType = method.getReturnType();
boolean b;
if (handler.getArgs().isEmpty()) {
- b = recordSet.executeUpdate(handler.getSqlStr());
+ b = rs.executeUpdate(handler.getSqlStr());
} else {
- b = recordSet.executeUpdate(handler.getSqlStr(), handler.getArgs());
+ b = rs.executeUpdate(handler.getSqlStr(), handler.getArgs());
}
if (returnType.equals(void.class)) {
return null;
@@ -121,13 +142,13 @@ public class RecordsetUtil implements InvocationHandler {
if (!handler.getSqlStr().trim().toLowerCase().startsWith("delete ")) {
throw new CustomerException("The sql statement does not match, the @Delete annotation can only getDataId the delete statement, please check whether the sql statement matches!");
}
- Util.getLogger("sql_log").info(handler.toString());
+ Util.getLogger(SQL_LOG).info(handler.toString());
Class> returnType = method.getReturnType();
boolean b;
if (handler.getArgs().isEmpty()) {
- b = recordSet.executeUpdate(handler.getSqlStr());
+ b = rs.executeUpdate(handler.getSqlStr());
} else {
- b = recordSet.executeUpdate(handler.getSqlStr(), handler.getArgs());
+ b = rs.executeUpdate(handler.getSqlStr(), handler.getArgs());
}
if (returnType.equals(void.class)) {
return null;
@@ -143,14 +164,14 @@ public class RecordsetUtil implements InvocationHandler {
Class> returnType = method.getReturnType();
boolean custom = batchInsert.custom();
BatchSqlResultImpl batchSqlResult = sqlHandler.handlerBatch(sql, custom, method, args);
- Util.getLogger("sql_log").info(batchSqlResult.toString());
+ Util.getLogger(SQL_LOG).info(batchSqlResult.toString());
if (batchSqlResult.getBatchList().isEmpty()) {
throw new CustomerException("getDataId batch sql error , batch sql args is empty!");
}
if (!batchSqlResult.getSqlStr().trim().toLowerCase().startsWith("insert ")) {
throw new CustomerException("The sql statement does not match, the @Insert annotation can only getDataId the insert statement, please check whether the sql statement matches!");
}
- boolean b = recordSet.executeBatchSql(batchSqlResult.getSqlStr(), batchSqlResult.getBatchList());
+ boolean b = rs.executeBatchSql(batchSqlResult.getSqlStr(), batchSqlResult.getBatchList());
if (returnType.equals(void.class)) {
return null;
}
@@ -166,14 +187,14 @@ public class RecordsetUtil implements InvocationHandler {
Class> returnType = method.getReturnType();
boolean custom = batchUpdate.custom();
BatchSqlResultImpl batchSqlResult = sqlHandler.handlerBatch(sql, custom, method, args);
- Util.getLogger("sql_log").info(batchSqlResult.toString());
+ Util.getLogger(SQL_LOG).info(batchSqlResult.toString());
if (batchSqlResult.getBatchList().isEmpty()) {
throw new CustomerException("getDataId batch sql error , batch sql args is empty!");
}
if (!batchSqlResult.getSqlStr().trim().toLowerCase().startsWith("update ")) {
throw new CustomerException("The sql statement does not match, the @Update annotation can only getDataId the update statement, please check whether the sql statement matches!");
}
- boolean b = recordSet.executeBatchSql(batchSqlResult.getSqlStr(), batchSqlResult.getBatchList());
+ boolean b = rs.executeBatchSql(batchSqlResult.getSqlStr(), batchSqlResult.getBatchList());
if (returnType.equals(void.class)) {
return null;
}
@@ -189,14 +210,14 @@ public class RecordsetUtil implements InvocationHandler {
Class> returnType = method.getReturnType();
boolean custom = batchDelete.custom();
BatchSqlResultImpl batchSqlResult = sqlHandler.handlerBatch(sql, custom, method, args);
- Util.getLogger("sql_log").info(batchSqlResult.toString());
+ Util.getLogger(SQL_LOG).info(batchSqlResult.toString());
if (batchSqlResult.getBatchList().isEmpty()) {
throw new CustomerException("getDataId batch sql error , batch sql args is empty!");
}
if (!batchSqlResult.getSqlStr().trim().toLowerCase().startsWith("delete ")) {
throw new CustomerException("The sql statement does not match, the @Delete annotation can only getDataId the delete statement, please check whether the sql statement matches!");
}
- boolean b = recordSet.executeBatchSql(batchSqlResult.getSqlStr(), batchSqlResult.getBatchList());
+ boolean b = rs.executeBatchSql(batchSqlResult.getSqlStr(), batchSqlResult.getBatchList());
if (returnType.equals(void.class)) {
return null;
}
@@ -208,4 +229,255 @@ public class RecordsetUtil implements InvocationHandler {
throw new CustomerException("该方法没有添加注解!请检查是否正确添加注解!@Select、@Update、@Insert、@Delete、@BatchUpdate、@BatchInsert、@BatchDelete");
}
+ private Object invokeRsTrans(Object proxy, Method method, Object[] args) {
+ RecordSetTrans rs = rsManager.getTrans();
+ if (rs == null) {
+ rsManager.setRecordSetTrans();
+ rs = rsManager.getTrans();
+ }
+ SqlHandler sqlHandler = new SqlHandler();
+ ResultMapper resultMapper = new ResultMapper();
+ Select select = method.getAnnotation(Select.class);
+ if (select != null) {
+ // 查询
+ String sql = select.value();
+ boolean custom = select.custom();
+ PrepSqlResultImpl handler = sqlHandler.handler(sql, custom, method, args);
+ if (!handler.getSqlStr().trim().toLowerCase().startsWith("select ")) {
+ throw new CustomerException("The sql statement does not match, the @Select annotation can only getDataId the select statement, please check whether the sql statement matches!");
+ }
+ Util.getLogger(SQL_LOG).info("解析sql===>" + handler);
+ try {
+ if (handler.getArgs().isEmpty()) {
+ rs.executeQuery(handler.getSqlStr());
+ } else {
+ rs.executeQuery(handler.getSqlStr(), handler.getArgs());
+ }
+ } catch (Exception e) {
+ Util.getLogger(SQL_LOG).error("execute sql error! " + Util.getErrString(e));
+ throw new CustomerException("execute sql error!" + e.getMessage());
+ }
+ return resultMapper.mapperResult(rs, method, method.getReturnType());
+ }
+
+ Update update = method.getAnnotation(Update.class);
+ if (update != null) {
+ // 查询
+ String sql = update.value();
+ boolean custom = update.custom();
+ PrepSqlResultImpl handler = sqlHandler.handler(sql, custom, method, args);
+ if (!handler.getSqlStr().trim().toLowerCase().startsWith("update ")) {
+ throw new CustomerException("The sql statement does not match, the @Update annotation can only getDataId the update statement, please check whether the sql statement matches!");
+ }
+ Util.getLogger(SQL_LOG).info(handler.toString());
+ Class> returnType = method.getReturnType();
+ boolean b;
+ try {
+ if (handler.getArgs().isEmpty()) {
+ b = rs.executeUpdate(handler.getSqlStr());
+ } else {
+ b = rs.executeUpdate(handler.getSqlStr(), handler.getArgs());
+ }
+ } catch (Exception e) {
+ Util.getLogger(SQL_LOG).error("execute sql error! " + Util.getErrString(e));
+ throw new CustomerException("execute sql error!" + e.getMessage());
+ }
+ if (returnType.equals(void.class)) {
+ return null;
+ }
+ if (returnType.equals(int.class) || returnType.equals(Integer.class)) {
+ if (b) {
+ return 1;
+ } else {
+ return 0;
+ }
+ }
+ if (returnType.equals(boolean.class) || returnType.equals(Boolean.class)) {
+ return b;
+ }
+ }
+ Insert insert = method.getAnnotation(Insert.class);
+ if (insert != null) {
+ // 查询
+ String sql = insert.value();
+ boolean custom = insert.custom();
+ PrepSqlResultImpl handler = sqlHandler.handler(sql, custom, method, args);
+ if (!handler.getSqlStr().trim().toLowerCase().startsWith("insert ")) {
+ throw new CustomerException("The sql statement does not match, the @Insert annotation can only getDataId the insert statement, please check whether the sql statement matches!");
+ }
+ Util.getLogger(SQL_LOG).info(handler.toString());
+ Class> returnType = method.getReturnType();
+ boolean b;
+ try {
+ if (handler.getArgs().isEmpty()) {
+ b = rs.executeUpdate(handler.getSqlStr());
+ } else {
+ b = rs.executeUpdate(handler.getSqlStr(), handler.getArgs());
+ }
+ } catch (Exception e) {
+ Util.getLogger(SQL_LOG).error("execute sql error! " + Util.getErrString(e));
+ throw new CustomerException("execute sql error!" + e.getMessage());
+ }
+ if (returnType.equals(void.class)) {
+ return null;
+ }
+ if (returnType.equals(boolean.class) || returnType.equals(Boolean.class)) {
+ return b;
+ }
+ }
+ Delete delete = method.getAnnotation(Delete.class);
+ if (delete != null) {
+ // 查询
+ String sql = delete.value();
+ boolean custom = delete.custom();
+ PrepSqlResultImpl handler = sqlHandler.handler(sql, custom, method, args);
+ if (!handler.getSqlStr().trim().toLowerCase().startsWith("delete ")) {
+ throw new CustomerException("The sql statement does not match, the @Delete annotation can only getDataId the delete statement, please check whether the sql statement matches!");
+ }
+ Util.getLogger(SQL_LOG).info(handler.toString());
+ Class> returnType = method.getReturnType();
+ boolean b;
+ try {
+ if (handler.getArgs().isEmpty()) {
+ b = rs.executeUpdate(handler.getSqlStr());
+ } else {
+ b = rs.executeUpdate(handler.getSqlStr(), handler.getArgs());
+ }
+ } catch (Exception e) {
+ Util.getLogger(SQL_LOG).error("execute sql error! " + Util.getErrString(e));
+ throw new CustomerException("execute sql error!" + e.getMessage());
+ }
+ if (returnType.equals(void.class)) {
+ return null;
+ }
+ if (returnType.equals(boolean.class) || returnType.equals(Boolean.class)) {
+ return b;
+ }
+ }
+ boolean hasBatchInsert = method.isAnnotationPresent(BatchInsert.class);
+ if (hasBatchInsert) {
+ BatchInsert batchInsert = method.getAnnotation(BatchInsert.class);
+ String sql = batchInsert.value();
+ Class> returnType = method.getReturnType();
+ boolean custom = batchInsert.custom();
+ BatchSqlResultImpl batchSqlResult = sqlHandler.handlerBatch(sql, custom, method, args);
+ Util.getLogger(SQL_LOG).info(batchSqlResult.toString());
+ List batchList = batchSqlResult.getBatchList();
+ if (batchList.isEmpty()) {
+ throw new CustomerException("getDataId batch sql error , batch sql args is empty!");
+ }
+ List> batchListTrans = new ArrayList<>();
+ for (List list : batchList) {
+ List