diff --git a/html/index.js b/html/index.js
new file mode 100644
index 0000000..9d0762d
--- /dev/null
+++ b/html/index.js
@@ -0,0 +1,24 @@
+
+function changeSingedType(detailTable,detailField,changeField,errValue,rightValue){
+ let detailIndexStr = WfForm.getDetailAllRowIndexStr(detailTable)
+ let changeFieldId = WfForm.convertFieldNameToId(changeField)
+ if(detailIndexStr == null){
+ return
+ }
+ let detailIndexArr = detailIndexStr.split(",");
+ let detailFieldId = WfForm.convertFieldNameToId(detailField, detailTable);
+ let n = 0;
+ detailIndexArr.forEach(item=>{
+ console.log(item)
+ let fieldId = detailFieldId + "_" + item
+ let value = WfForm.getFieldValue(fieldId);
+ console.log(value)
+ if(value == null || value == ""){
+ WfForm.changeFieldValue(changeFieldId, {value:errValue});
+ }
+ n ++
+ })
+ if(n == detaiIndexArr.length){
+ WfForm.changeFieldValue(changeFieldId, {value:rightValue});
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/aiyh/utils/Util.java b/src/main/java/aiyh/utils/Util.java
index 1136641..f94c200 100644
--- a/src/main/java/aiyh/utils/Util.java
+++ b/src/main/java/aiyh/utils/Util.java
@@ -614,6 +614,10 @@ public class Util extends weaver.general.Util {
//处理字符串
for (int i = 0, l = charArray.length; i < l; i++) {
if (charArray[i] >= 65 && charArray[i] <= 90) {
+ if(i==0){
+ buffer.append(charArray[i] += 32);
+ continue;
+ }
buffer.append("_").append(charArray[i] += 32);
} else {
buffer.append(charArray[i]);
@@ -1749,4 +1753,28 @@ public class Util extends weaver.general.Util {
}
return obj;
}
+
+ /**
+ * 获取完整的错误信息
+ * @param throwable 异常
+ * @return 完整堆栈信息
+ */
+ public static String getErrString(Throwable throwable){
+ StringWriter stringWriter = new StringWriter();
+ throwable.printStackTrace(new PrintWriter(stringWriter,true));
+ new Thread(() -> {
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }finally {
+ try {
+ stringWriter.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ });
+ return stringWriter.getBuffer().toString();
+ }
}
diff --git a/src/main/java/aiyh/utils/annotation/recordset/CaseConversion.java b/src/main/java/aiyh/utils/annotation/recordset/CaseConversion.java
new file mode 100644
index 0000000..d10900a
--- /dev/null
+++ b/src/main/java/aiyh/utils/annotation/recordset/CaseConversion.java
@@ -0,0 +1,14 @@
+package aiyh.utils.annotation.recordset;
+
+import java.lang.annotation.*;
+
+/**
+ * @author @author EBU7-dev1-ay
+ * create 2021/12/21 0021 15:25
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.METHOD)
+@Documented
+public @interface CaseConversion {
+ boolean value() default true;
+}
diff --git a/src/main/java/aiyh/utils/annotation/recordset/Delete.java b/src/main/java/aiyh/utils/annotation/recordset/Delete.java
new file mode 100644
index 0000000..3101586
--- /dev/null
+++ b/src/main/java/aiyh/utils/annotation/recordset/Delete.java
@@ -0,0 +1,16 @@
+package aiyh.utils.annotation.recordset;
+
+import java.lang.annotation.*;
+
+/**
+ * @author @author EBU7-dev1-ay
+ * create 2021/12/19 0019 15:08
+ */
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.METHOD)
+@Documented
+public @interface Delete {
+ String value() default "";
+ boolean custom() default false;
+}
diff --git a/src/main/java/aiyh/utils/annotation/recordset/Insert.java b/src/main/java/aiyh/utils/annotation/recordset/Insert.java
new file mode 100644
index 0000000..b8fa244
--- /dev/null
+++ b/src/main/java/aiyh/utils/annotation/recordset/Insert.java
@@ -0,0 +1,16 @@
+package aiyh.utils.annotation.recordset;
+
+import java.lang.annotation.*;
+
+/**
+ * @author @author EBU7-dev1-ay
+ * create 2021/12/19 0019 15:08
+ */
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.METHOD)
+@Documented
+public @interface Insert {
+ String value() default "" ;
+ boolean custom() default false;
+}
diff --git a/src/main/java/aiyh/utils/annotation/recordset/ParamMapper.java b/src/main/java/aiyh/utils/annotation/recordset/ParamMapper.java
new file mode 100644
index 0000000..75f3e80
--- /dev/null
+++ b/src/main/java/aiyh/utils/annotation/recordset/ParamMapper.java
@@ -0,0 +1,15 @@
+package aiyh.utils.annotation.recordset;
+
+import java.lang.annotation.*;
+
+/**
+ * @author @author EBU7-dev1-ay
+ * create 2021/12/19 0019 15:20
+ */
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.PARAMETER)
+@Documented
+public @interface ParamMapper {
+ String value();
+}
diff --git a/src/main/java/aiyh/utils/annotation/recordset/Select.java b/src/main/java/aiyh/utils/annotation/recordset/Select.java
new file mode 100644
index 0000000..25388c6
--- /dev/null
+++ b/src/main/java/aiyh/utils/annotation/recordset/Select.java
@@ -0,0 +1,18 @@
+package aiyh.utils.annotation.recordset;
+
+import java.lang.annotation.*;
+
+/**
+ * @author @author EBU7-dev1-ay
+ * create 2021/12/19 0019 15:08
+ */
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.METHOD)
+@Documented
+public @interface Select {
+// sql
+ String value() default "";
+// sql是否是在参数中
+ boolean custom() default false;
+}
diff --git a/src/main/java/aiyh/utils/annotation/recordset/SqlMapper.java b/src/main/java/aiyh/utils/annotation/recordset/SqlMapper.java
new file mode 100644
index 0000000..e0360bc
--- /dev/null
+++ b/src/main/java/aiyh/utils/annotation/recordset/SqlMapper.java
@@ -0,0 +1,15 @@
+package aiyh.utils.annotation.recordset;
+
+import java.lang.annotation.*;
+
+/**
+ * @author @author EBU7-dev1-ay
+ * create 2021/12/19 0019 15:01
+ */
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+@Documented
+public @interface SqlMapper {
+
+}
diff --git a/src/main/java/aiyh/utils/annotation/recordset/SqlString.java b/src/main/java/aiyh/utils/annotation/recordset/SqlString.java
new file mode 100644
index 0000000..ad0de4e
--- /dev/null
+++ b/src/main/java/aiyh/utils/annotation/recordset/SqlString.java
@@ -0,0 +1,13 @@
+package aiyh.utils.annotation.recordset;
+
+import java.lang.annotation.*;
+
+/**
+ * @author @author EBU7-dev1-ay
+ * create 2021/12/19 0019 15:31
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.PARAMETER)
+@Documented
+public @interface SqlString {
+}
diff --git a/src/main/java/aiyh/utils/annotation/recordset/Update.java b/src/main/java/aiyh/utils/annotation/recordset/Update.java
new file mode 100644
index 0000000..8e44950
--- /dev/null
+++ b/src/main/java/aiyh/utils/annotation/recordset/Update.java
@@ -0,0 +1,16 @@
+package aiyh.utils.annotation.recordset;
+
+import java.lang.annotation.*;
+
+/**
+ * @author @author EBU7-dev1-ay
+ * create 2021/12/19 0019 15:08
+ */
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.METHOD)
+@Documented
+public @interface Update {
+ String value() default "";
+ boolean custom() default false;
+}
diff --git a/src/main/java/aiyh/utils/excention/BindingException.java b/src/main/java/aiyh/utils/excention/BindingException.java
new file mode 100644
index 0000000..9ac8c92
--- /dev/null
+++ b/src/main/java/aiyh/utils/excention/BindingException.java
@@ -0,0 +1,13 @@
+package aiyh.utils.excention;
+
+/**
+ * @author EBU7-dev1-ayh
+ * create 2021/12/19 0019 14:51
+ */
+
+
+public class BindingException extends RuntimeException{
+ public BindingException(String msg){
+ super(msg);
+ }
+}
diff --git a/src/main/java/aiyh/utils/excention/MethodNotFindException.java b/src/main/java/aiyh/utils/excention/MethodNotFindException.java
new file mode 100644
index 0000000..ddbf522
--- /dev/null
+++ b/src/main/java/aiyh/utils/excention/MethodNotFindException.java
@@ -0,0 +1,13 @@
+package aiyh.utils.excention;
+
+/**
+ * @author EBU7-dev1-ayh
+ * create 2021/12/19 0019 19:33
+ */
+
+
+public class MethodNotFindException extends RuntimeException{
+ public MethodNotFindException(String msg){
+ super(msg);
+ }
+}
diff --git a/src/main/java/aiyh/utils/excention/ParseSqlException.java b/src/main/java/aiyh/utils/excention/ParseSqlException.java
new file mode 100644
index 0000000..a8a955a
--- /dev/null
+++ b/src/main/java/aiyh/utils/excention/ParseSqlException.java
@@ -0,0 +1,13 @@
+package aiyh.utils.excention;
+
+/**
+ * @author EBU7-dev1-ayh
+ * create 2021/12/21 0021 10:33
+ */
+
+
+public class ParseSqlException extends RuntimeException{
+ public ParseSqlException(String message) {
+ super(message);
+ }
+}
diff --git a/src/main/java/aiyh/utils/excention/TypeNonsupportException.java b/src/main/java/aiyh/utils/excention/TypeNonsupportException.java
new file mode 100644
index 0000000..4059569
--- /dev/null
+++ b/src/main/java/aiyh/utils/excention/TypeNonsupportException.java
@@ -0,0 +1,13 @@
+package aiyh.utils.excention;
+
+/**
+ * @author EBU7-dev1-ayh
+ * create 2021/12/19 0019 19:24
+ */
+
+
+public class TypeNonsupportException extends RuntimeException{
+ public TypeNonsupportException(String msg){
+ super(msg);
+ }
+}
diff --git a/src/main/java/aiyh/utils/recordset/BooleanTypeHandler.java b/src/main/java/aiyh/utils/recordset/BooleanTypeHandler.java
new file mode 100644
index 0000000..d8e0863
--- /dev/null
+++ b/src/main/java/aiyh/utils/recordset/BooleanTypeHandler.java
@@ -0,0 +1,21 @@
+package aiyh.utils.recordset;
+
+import weaver.conn.RecordSet;
+
+/**
+ * @author EBU7-dev1-ayh
+ * create 2021/12/21 0021 13:34
+ */
+
+
+public class BooleanTypeHandler implements TypeHandler{
+ @Override
+ public Object getValue(RecordSet rs, String fieldName) {
+ return rs.getBoolean(fieldName);
+ }
+
+ @Override
+ public Object getValue(RecordSet rs, int index) {
+ return rs.getBoolean(index);
+ }
+}
diff --git a/src/main/java/aiyh/utils/recordset/DataTypeHandler.java b/src/main/java/aiyh/utils/recordset/DataTypeHandler.java
new file mode 100644
index 0000000..ed9fc25
--- /dev/null
+++ b/src/main/java/aiyh/utils/recordset/DataTypeHandler.java
@@ -0,0 +1,27 @@
+package aiyh.utils.recordset;
+
+import weaver.conn.RecordSet;
+
+import java.util.Date;
+
+/**
+ * @author EBU7-dev1-ayh
+ * create 2021/12/21 0021 13:35
+ */
+
+
+public class DataTypeHandler implements TypeHandler{
+ @Override
+ public Object getValue(RecordSet rs, String fieldName) {
+ String dataString = rs.getString(fieldName);
+ Date date = new Date(dataString);
+ return date;
+ }
+
+ @Override
+ public Object getValue(RecordSet rs, int index) {
+ String dataString = rs.getString(index);
+ Date date = new Date(dataString);
+ return date;
+ }
+}
diff --git a/src/main/java/aiyh/utils/recordset/IntegerTypeHandler.java b/src/main/java/aiyh/utils/recordset/IntegerTypeHandler.java
new file mode 100644
index 0000000..e2def61
--- /dev/null
+++ b/src/main/java/aiyh/utils/recordset/IntegerTypeHandler.java
@@ -0,0 +1,21 @@
+package aiyh.utils.recordset;
+
+import weaver.conn.RecordSet;
+
+/**
+ * @author EBU7-dev1-ayh
+ * create 2021/12/21 0021 13:10
+ */
+
+
+public class IntegerTypeHandler implements TypeHandler{
+ @Override
+ public Object getValue(RecordSet rs, String fieldName) {
+ return rs.getInt(fieldName);
+ }
+
+ @Override
+ public Object getValue(RecordSet rs, int index) {
+ return rs.getInt(index);
+ }
+}
diff --git a/src/main/java/aiyh/utils/recordset/RecordsetUtil.java b/src/main/java/aiyh/utils/recordset/RecordsetUtil.java
new file mode 100644
index 0000000..6f5a612
--- /dev/null
+++ b/src/main/java/aiyh/utils/recordset/RecordsetUtil.java
@@ -0,0 +1,125 @@
+package aiyh.utils.recordset;
+
+import aiyh.utils.annotation.recordset.*;
+import aiyh.utils.excention.BindingException;
+import aiyh.utils.sqlUtil.sqlResult.impl.PrepSqlResultImpl;
+import aiyh.utils.zwl.common.ToolUtil;
+import weaver.conn.RecordSet;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+
+/**
+ * @author EBU7-dev1-ayh
+ * create 2021/12/19 0019 14:39
+ */
+
+
+public class RecordsetUtil implements InvocationHandler {
+
+ private final ToolUtil toolUtil = new ToolUtil();
+
+ public T getMapper(Class tClass) {
+ if (tClass == null) {
+ throw new BindingException("class is null!");
+ }
+ if (tClass.getAnnotation(SqlMapper.class) == null) {
+ throw new BindingException("can not find SqlMapper annotation!");
+ }
+ return (T) Proxy.newProxyInstance(tClass.getClassLoader(), new Class[]{tClass}, this);
+ }
+
+
+ @Override
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+
+ SqlHandler sqlHandler = new SqlHandler();
+ toolUtil.writeDebuggerLog(String.format("%s===>Preparing to parse SQL", proxy.getClass().getName()));
+ RecordSet rs = new RecordSet();
+ 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.getArgs().isEmpty()) {
+ rs.executeQuery(handler.getSqlStr());
+ } else {
+ rs.executeQuery(handler.getSqlStr(), handler.getArgs());
+ }
+ 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);
+ Class> returnType = method.getReturnType();
+ boolean b;
+ if (handler.getArgs().isEmpty()) {
+ b = rs.executeUpdate(handler.getSqlStr());
+ } else {
+ b = rs.executeUpdate(handler.getSqlStr(), handler.getArgs());
+ }
+ 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);
+ Class> returnType = method.getReturnType();
+ boolean b;
+ if (handler.getArgs().isEmpty()) {
+ b = rs.executeUpdate(handler.getSqlStr());
+ } else {
+ b = rs.executeUpdate(handler.getSqlStr(), handler.getArgs());
+ }
+ 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);
+ Class> returnType = method.getReturnType();
+ boolean b;
+ if (handler.getArgs().isEmpty()) {
+ b = rs.executeUpdate(handler.getSqlStr());
+ } else {
+ b = rs.executeUpdate(handler.getSqlStr(), handler.getArgs());
+ }
+ if (returnType.equals(void.class)) {
+ return null;
+ }
+ if (returnType.equals(boolean.class) || returnType.equals(Boolean.class)) {
+ return b;
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/src/main/java/aiyh/utils/recordset/ResultMapper.java b/src/main/java/aiyh/utils/recordset/ResultMapper.java
new file mode 100644
index 0000000..efe7c36
--- /dev/null
+++ b/src/main/java/aiyh/utils/recordset/ResultMapper.java
@@ -0,0 +1,206 @@
+package aiyh.utils.recordset;
+
+import aiyh.utils.Util;
+import aiyh.utils.annotation.recordset.CaseConversion;
+import aiyh.utils.excention.TypeNonsupportException;
+import weaver.conn.RecordSet;
+
+import java.beans.BeanInfo;
+import java.beans.Introspector;
+import java.beans.PropertyDescriptor;
+import java.lang.reflect.*;
+import java.util.*;
+
+/**
+ * @author EBU7-dev1-ayh
+ * create 2021/12/21 0021 11:03
+ */
+
+
+public class ResultMapper {
+
+ private static Map, TypeHandler> typeHandler = new HashMap<>();
+
+ static {
+ IntegerTypeHandler integerTypeHandler = new IntegerTypeHandler();
+ typeHandler.put(String.class, new StringTypeHandler());
+ typeHandler.put(Integer.class, integerTypeHandler);
+ typeHandler.put(int.class, integerTypeHandler);
+ typeHandler.put(byte.class, integerTypeHandler);
+ typeHandler.put(short.class, integerTypeHandler);
+ typeHandler.put(long.class, integerTypeHandler);
+ typeHandler.put(Long.class, integerTypeHandler);
+ typeHandler.put(Boolean.class, new BooleanTypeHandler());
+ typeHandler.put(boolean.class, new BooleanTypeHandler());
+ typeHandler.put(Date.class, new StringTypeHandler());
+ }
+
+ public T mapperResult(RecordSet rs, Method method, Class tClass) {
+ if (tClass.equals(void.class)) {
+ return null;
+ }
+ try {
+ if (tClass.equals(List.class)) {
+ tClass = (Class) ArrayList.class;
+ }
+ if (tClass.equals(Map.class)) {
+ tClass = (Class) HashMap.class;
+ }
+ if (ResultMapper.typeHandler.containsKey(tClass)) {
+ rs.next();
+ return (T) ResultMapper.typeHandler.get(tClass).getValue(rs, 1);
+ }
+ T t = tClass.newInstance();
+ if (t instanceof Collection) {
+// 集合求出泛型
+ //获取返回值的类型
+ Type genericReturnType = method.getGenericReturnType();
+ Type actualTypeArgument = ((ParameterizedType) genericReturnType).getActualTypeArguments()[0];
+ Class> rawType = this.getRawType(actualTypeArgument);
+ if (rawType.equals(Map.class)) {
+ rawType = HashMap.class;
+ }
+ while (rs.next()) {
+ Object o = rawType.newInstance();
+ Object object = getObject(rs, o,method);
+ ((Collection super Object>) t).add(object);
+ }
+ return t;
+ }
+ if (t instanceof Map) {
+// map
+ Type genericReturnType = method.getGenericReturnType();
+ Type actualTypeArgument = ((ParameterizedType) genericReturnType).getActualTypeArguments()[0];
+ Class> rawType = this.getRawType(actualTypeArgument);
+ if (rawType.equals(List.class)) {
+ rawType = (Class) ArrayList.class;
+ }
+ if (rawType.equals(Map.class)) {
+ rawType = HashMap.class;
+ }
+ Object o = rawType.newInstance();
+ if (o instanceof Map || o instanceof Collection) {
+ throw new TypeNonsupportException("An unsupported return type!");
+ }
+ rs.next();
+ return (T) getObject(rs, t,method);
+ }
+
+ if (t.getClass().isArray()) {
+ throw new TypeNonsupportException("An unsupported return type!");
+ }
+ return (T) getObject(rs, t,method);
+
+ } catch (InstantiationException | IllegalAccessException e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ public Object getObject(RecordSet rs, Object o,Method method) {
+ CaseConversion annotation = method.getAnnotation(CaseConversion.class);
+ boolean enable = annotation == null ? true : annotation.value();
+ String[] columnName = rs.getColumnName();
+ String[] columnTypeName = rs.getColumnTypeName();
+ try {
+ for (int i = 0; i < columnName.length; i++) {
+ String columnType = columnTypeName[i];
+ if (o instanceof Map) {
+ if ("int".equalsIgnoreCase(columnType) ||
+ "long".equalsIgnoreCase(columnType) ||
+ "number".equalsIgnoreCase(columnType) ||
+ "MEDIUMINT".equalsIgnoreCase(columnType) ||
+ "TINYINT".equalsIgnoreCase(columnType) ||
+ "SMALLINT".equalsIgnoreCase(columnType) ||
+ "BIGINT".equalsIgnoreCase(columnType) ||
+ "INTEGER".equalsIgnoreCase(columnType)) {
+ if(enable){
+ ((Map super Object, ? super Object>) o).put(Util.toCamelCase(columnName[i]), rs.getInt(i + 1));
+ continue;
+ }
+ ((Map super Object, ? super Object>) o).put(columnName[i], rs.getInt(i + 1));
+ continue;
+ }
+ if ("FLOAT".equalsIgnoreCase(columnType) ||
+ "DOUBLE".equalsIgnoreCase(columnType) ||
+ "DECIMAL".equalsIgnoreCase(columnType)) {
+ if(enable){
+ ((Map super Object, ? super Object>) o).put(Util.toCamelCase(columnName[i]), rs.getFloat(i + 1));
+ continue;
+ }
+ ((Map super Object, ? super Object>) o).put(columnName[i], rs.getFloat(i + 1));
+ continue;
+ }
+ if(enable){
+ ((Map super Object, ? super Object>) o).put(Util.toCamelCase(columnName[i]), rs.getString(i + 1));
+ }
+ ((Map super Object, ? super Object>) o).put(columnName[i], rs.getString(i + 1));
+ continue;
+ }
+ if (o instanceof Collection) {
+ throw new TypeNonsupportException("An unsupported return type!");
+ }
+ if (o instanceof Number) {
+ if ("int".equalsIgnoreCase(columnType) ||
+ "long".equalsIgnoreCase(columnType) ||
+ "number".equalsIgnoreCase(columnType) ||
+ "MEDIUMINT".equalsIgnoreCase(columnType) ||
+ "TINYINT".equalsIgnoreCase(columnType) ||
+ "SMALLINT".equalsIgnoreCase(columnType) ||
+ "BIGINT".equalsIgnoreCase(columnType) ||
+ "INTEGER".equalsIgnoreCase(columnType)) {
+ return rs.getInt(i + 1);
+ }
+ if ("FLOAT".equalsIgnoreCase(columnType) ||
+ "DOUBLE".equalsIgnoreCase(columnType) ||
+ "DECIMAL".equalsIgnoreCase(columnType)) {
+ return rs.getFloat(i + 1);
+ }
+ }
+ if (o instanceof String) {
+ return rs.getString(i + 1);
+ }
+ if (o instanceof Boolean) {
+ return rs.getBoolean(i + 1);
+ }
+ BeanInfo beanInfo = Introspector.getBeanInfo(o.getClass(), Object.class);
+ PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors();
+ for (PropertyDescriptor propertyDescriptor : propertyDescriptors) {
+ Class> propertyType = propertyDescriptor.getPropertyType();
+ Object value = null;
+ if(enable){
+ value = ResultMapper.typeHandler.get(propertyType).getValue(rs, Util.toUnderlineCase(propertyDescriptor.getName()));
+ }else {
+ value = ResultMapper.typeHandler.get(propertyType).getValue(rs, propertyDescriptor.getName());
+ }
+ propertyDescriptor.getWriteMethod().invoke(o, value);
+ }
+
+ }
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return o;
+ }
+
+ public Class> getRawType(Type type) {
+ if (type instanceof Class) {
+ return (Class) type;
+ } else if (type instanceof ParameterizedType) {
+ ParameterizedType parameterizedType = (ParameterizedType) type;
+ Type rawType = parameterizedType.getRawType();
+ return (Class) rawType;
+ } else if (type instanceof GenericArrayType) {
+ Type componentType = ((GenericArrayType) type).getGenericComponentType();
+ return Array.newInstance(getRawType(componentType), 0).getClass();
+ } else if (type instanceof TypeVariable) {
+ return Object.class;
+ } else if (type instanceof WildcardType) {
+ return getRawType(((WildcardType) type).getUpperBounds()[0]);
+ } else {
+ String className = type == null ? "null" : type.getClass().getName();
+ throw new IllegalArgumentException("Expected a Class, ParameterizedType, or GenericArrayType, but <" + type + "> is of type " + className);
+ }
+ }
+}
diff --git a/src/main/java/aiyh/utils/recordset/SqlHandler.java b/src/main/java/aiyh/utils/recordset/SqlHandler.java
new file mode 100644
index 0000000..f8fce8b
--- /dev/null
+++ b/src/main/java/aiyh/utils/recordset/SqlHandler.java
@@ -0,0 +1,233 @@
+package aiyh.utils.recordset;
+
+import aiyh.utils.annotation.recordset.ParamMapper;
+import aiyh.utils.annotation.recordset.SqlString;
+import aiyh.utils.excention.BindingException;
+import aiyh.utils.excention.MethodNotFindException;
+import aiyh.utils.excention.ParseSqlException;
+import aiyh.utils.sqlUtil.sqlResult.impl.PrepSqlResultImpl;
+import org.apache.commons.lang3.StringUtils;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Parameter;
+import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @author EBU7-dev1-ayh
+ * create 2021/12/19 0019 15:28
+ */
+
+
+public class SqlHandler {
+
+ List