From de501ece0f348b034be3d36d4271b0fa24675fce Mon Sep 17 00:00:00 2001
From: wuxw <928255095@qq.com>
Date: 星期日, 05 五月 2019 10:26:29 +0800
Subject: [PATCH] 加入房屋属性

---
 java110-code-generator/src/main/resources/template/ServiceDaoImpl.txt |   51 ++++++++++++++++++++++++++++-----------------------
 1 files changed, 28 insertions(+), 23 deletions(-)

diff --git a/java110-code-generator/src/main/resources/template/ServiceDaoImpl.txt b/java110-code-generator/src/main/resources/template/ServiceDaoImpl.txt
index c6b3c61..2c53b30 100644
--- a/java110-code-generator/src/main/resources/template/ServiceDaoImpl.txt
+++ b/java110-code-generator/src/main/resources/template/ServiceDaoImpl.txt
@@ -22,12 +22,12 @@
 //@Transactional
 public class StoreServiceDaoImpl extends BaseServiceDao implements IStoreServiceDao {
 
-    private final static Logger logger = LoggerFactory.getLogger(StoreServiceDaoImpl.class);
+    private static Logger logger = LoggerFactory.getLogger(StoreServiceDaoImpl.class);
 
     /**
      * 鍟嗘埛淇℃伅灏佽
      * @param businessStoreInfo 鍟嗘埛淇℃伅 灏佽
-     * @throws DAOException
+     * @throws DAOException DAO寮傚父
      */
     @Override
     public void saveBusinessStoreInfo(Map businessStoreInfo) throws DAOException {
@@ -46,22 +46,16 @@
      * 鏌ヨ鍟嗘埛淇℃伅
      * @param info bId 淇℃伅
      * @return 鍟嗘埛淇℃伅
-     * @throws DAOException
+     * @throws DAOException DAO寮傚父
      */
     @Override
-    public Map getBusinessStoreInfo(Map info) throws DAOException {
+    public List<Map> getBusinessStoreInfo(Map info) throws DAOException {
 
         logger.debug("鏌ヨ鍟嗘埛淇℃伅 鍏ュ弬 info : {}",info);
 
         List<Map> businessStoreInfos = sqlSessionTemplate.selectList("storeServiceDaoImpl.getBusinessStoreInfo",info);
-        if(businessStoreInfos == null){
-            return null;
-        }
-        if(businessStoreInfos.size() >1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"鏍规嵁鏉′欢鏌ヨ鏈夊鏉℃暟鎹�,鏁版嵁寮傚父锛岃妫�鏌ワ細businessStoreInfos锛�"+ JSONObject.toJSONString(info));
-        }
 
-        return businessStoreInfos.get(0);
+        return businessStoreInfos;
     }
 
 
@@ -69,7 +63,7 @@
     /**
      * 淇濆瓨鍟嗘埛淇℃伅 鍒� instance
      * @param info   bId 淇℃伅
-     * @throws DAOException
+     * @throws DAOException DAO寮傚父
      */
     @Override
     public void saveStoreInfoInstance(Map info) throws DAOException {
@@ -86,29 +80,23 @@
     /**
      * 鏌ヨ鍟嗘埛淇℃伅锛坕nstance锛�
      * @param info bId 淇℃伅
-     * @return
-     * @throws DAOException
+     * @return List<Map>
+     * @throws DAOException DAO寮傚父
      */
     @Override
-    public Map getStoreInfo(Map info) throws DAOException {
+    public List<Map> getStoreInfo(Map info) throws DAOException {
         logger.debug("鏌ヨ鍟嗘埛淇℃伅 鍏ュ弬 info : {}",info);
 
         List<Map> businessStoreInfos = sqlSessionTemplate.selectList("storeServiceDaoImpl.getStoreInfo",info);
-        if(businessStoreInfos == null || businessStoreInfos.size() == 0){
-            return null;
-        }
-        if(businessStoreInfos.size() >1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"鏍规嵁鏉′欢鏌ヨ鏈夊鏉℃暟鎹�,鏁版嵁寮傚父锛岃妫�鏌ワ細getStoreInfo锛�"+ JSONObject.toJSONString(info));
-        }
 
-        return businessStoreInfos.get(0);
+        return businessStoreInfos;
     }
 
 
     /**
      * 淇敼鍟嗘埛淇℃伅
      * @param info 淇敼淇℃伅
-     * @throws DAOException
+     * @throws DAOException DAO寮傚父
      */
     @Override
     public void updateStoreInfoInstance(Map info) throws DAOException {
@@ -121,5 +109,22 @@
         }
     }
 
+     /**
+     * 鏌ヨ鍟嗘埛鏁伴噺
+     * @param info 鍟嗘埛淇℃伅
+     * @return 鍟嗘埛鏁伴噺
+     */
+    @Override
+    public int queryStoresCount(Map info) {
+        logger.debug("鏌ヨ鍟嗘埛鏁版嵁 鍏ュ弬 info : {}",info);
+
+        List<Map> businessStoreInfos = sqlSessionTemplate.selectList("storeServiceDaoImpl.queryStoresCount", info);
+        if (businessStoreInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessStoreInfos.get(0).get("count").toString());
+    }
+
 
 }

--
Gitblit v1.8.0