|
@@ -484,7 +484,14 @@ public class BasicBaseDao implements ApplicationContextAware,
|
|
public Map<String, Object> executeQueryMap(String sql, Object o) throws Exception {
|
|
public Map<String, Object> executeQueryMap(String sql, Object o) throws Exception {
|
|
JdbcParamsModel jdbcParamsModel = commonParseSql(sql, o);
|
|
JdbcParamsModel jdbcParamsModel = commonParseSql(sql, o);
|
|
long start = System.currentTimeMillis();
|
|
long start = System.currentTimeMillis();
|
|
- Map<String, Object> map = this.jdbcTemplate.queryForMap(jdbcParamsModel.getSql(), jdbcParamsModel.getObjects());
|
|
|
|
|
|
+ Map<String, Object> map = null;
|
|
|
|
+ try {
|
|
|
|
+ map = this.jdbcTemplate.queryForMap(jdbcParamsModel.getSql(), jdbcParamsModel.getObjects());
|
|
|
|
+ } catch (EmptyResultDataAccessException e) {
|
|
|
|
+
|
|
|
|
+ } catch (IncorrectResultSizeDataAccessException e) {
|
|
|
|
+ logger.error("数据异常,只要查询一个,但是结果集是多个!", e);
|
|
|
|
+ }
|
|
long time = System.currentTimeMillis() - start;
|
|
long time = System.currentTimeMillis() - start;
|
|
logger.debug(" SQL 执行耗时 : " + time);
|
|
logger.debug(" SQL 执行耗时 : " + time);
|
|
return map;
|
|
return map;
|