From 28c643cc4d3142503dfa5234777399586e8364e9 Mon Sep 17 00:00:00 2001
From: wuxw <928255095@qq.com>
Date: 星期六, 30 三月 2019 11:41:36 +0800
Subject: [PATCH] 添加员工服务端bug修复

---
 java110-service/src/main/java/com/java110/service/dao/impl/QueryServiceDAOImpl.java |   24 +++++++++++++++++++++---
 1 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/java110-service/src/main/java/com/java110/service/dao/impl/QueryServiceDAOImpl.java b/java110-service/src/main/java/com/java110/service/dao/impl/QueryServiceDAOImpl.java
index 2900eb6..4b8e1c3 100644
--- a/java110-service/src/main/java/com/java110/service/dao/impl/QueryServiceDAOImpl.java
+++ b/java110-service/src/main/java/com/java110/service/dao/impl/QueryServiceDAOImpl.java
@@ -2,8 +2,11 @@
 
 import com.java110.common.util.StringUtil;
 import com.java110.core.base.dao.BaseServiceDao;
+import com.java110.entity.order.ServiceBusiness;
 import com.java110.entity.service.ServiceSql;
 import com.java110.service.dao.IQueryServiceDAO;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -16,6 +19,8 @@
 @Service("queryServiceDAOImpl")
 @Transactional
 public class QueryServiceDAOImpl extends BaseServiceDao implements IQueryServiceDAO {
+
+    private final static Logger logger = LoggerFactory.getLogger(QueryServiceDAOImpl.class);
 
     /**
      *  闃叉sql娉ㄥ叆 鏀归�犳垚鐩存帴鐢╬repareStatement 棰勫鐞唖ql
@@ -44,7 +49,7 @@
             while(rs.next()){
                 Map<String,Object> map = new HashMap<String,Object>();
                 for(int i = 0 ; i < rsmd.getColumnCount() ; i++){
-                    String col_name = rsmd.getColumnName(i+1);
+                    String col_name = rsmd.getColumnLabel(i+1);
                     Object col_value = rs.getObject(col_name);
                     if(col_value == null){
                         col_value = "";
@@ -60,8 +65,12 @@
         }finally{
             try {
                 //conn.close();
-                ps.close();
-                rs.close();
+                if( ps!=null) {
+                    ps.close();
+                }
+                if(rs != null) {
+                    rs.close();
+                }
             } catch (SQLException e) {
                 e.printStackTrace();
             }
@@ -155,4 +164,13 @@
     public List<ServiceSql> qureyServiceSqlAll() {
         return sqlSessionTemplate.selectList("queryServiceDAOImpl.qureyServiceSqlAll");
     }
+
+
+    /**
+     * 鏌ヨ鏈嶅姟涓氬姟淇℃伅
+     * @return
+     */
+    public List<ServiceBusiness> qureyServiceBusiness(){
+        return sqlSessionTemplate.selectList("queryServiceDAOImpl.queryServiceBusiness");
+    }
 }

--
Gitblit v1.8.0