master
erzhongxmu 2020-04-25 16:44:13 +08:00
parent 6719151bb6
commit 756ec57b90
2 changed files with 21 additions and 16 deletions

View File

@ -1,5 +1,6 @@
package org.jeecgframework.core.common.dao.jdbc; package org.jeecgframework.core.common.dao.jdbc;
import java.math.BigInteger;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -89,10 +90,14 @@ public class SimpleJdbcTemplate {
try{ try{
Assert.hasText(sql,"sql语句不正确!"); Assert.hasText(sql,"sql语句不正确!");
if(parameters!=null){ if(parameters!=null&&parameters.size()>0){
return namedJdbcTemplate.queryForObject(sql, parameters,long.class); Object res = namedJdbcTemplate.queryForObject(sql, parameters,BigInteger.class);
BigInteger a = new BigInteger(res.toString());
return a.longValue();
}else{ }else{
return jdbcTemplate.queryForObject(sql,long.class); Object res = jdbcTemplate.queryForObject(sql,BigInteger.class);
BigInteger a = new BigInteger(res.toString());
return a.longValue();
} }
}catch (Exception e) { }catch (Exception e) {