Commit cc01fa73 authored by yanzg's avatar yanzg

身份证识别

parent 8e6704e0
......@@ -73,7 +73,16 @@ public class ArrayHelper {
* @return
*/
public static boolean isArrayOrList(Object val) {
return val != null && (val instanceof Collection || val.getClass().isArray());
return val != null && (val instanceof List || val.getClass().isArray());
}
/**
* 判断对象是否是数组或者List
*
* @param val
* @return
*/
public static boolean isArrayOrCollection(Object val) {
return val != null && (val instanceof List || val.getClass().isArray());
}
......@@ -125,7 +134,7 @@ public class ArrayHelper {
* @return
*/
public static Collection getCollection(Object val) {
boolean isArray = isArrayOrList(val);
boolean isArray = isArrayOrCollection(val);
Collection list;
// 判断处理
if (val instanceof Collection) {
......
......@@ -695,7 +695,7 @@ public abstract class BaseDaoSql {
sql = getSqlCodeParameter(paras, sql, name, (SqlCodeParameter) val);
} else {
// 判断是否为数组
boolean isArray = ArrayHelper.isArrayOrList(val);
boolean isArray = ArrayHelper.isArrayOrCollection(val);
if (isArray) {
sql = getListSql(paras, sql, name, val);
} else {
......@@ -736,8 +736,6 @@ public abstract class BaseDaoSql {
*/
private String getListSql(List<Object> paras, String sql, String name, Object val) {
Collection list = ArrayHelper.getCollection(val);
int length = list.size();
// 进行循环
StringBuilder sb = new StringBuilder();
int i = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment