From 4ee86eb0f4984bf3ede3196ad8c5fe95e8c5a504 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期三, 15 六月 2022 19:05:02 +0800
Subject: [PATCH] 优化代码
---
service-store/src/main/java/com/java110/store/dao/impl/StoreServiceDaoImpl.java | 321 ++++++++++++++++++++++++++++++++--------------------
1 files changed, 197 insertions(+), 124 deletions(-)
diff --git a/service-store/src/main/java/com/java110/store/dao/impl/StoreServiceDaoImpl.java b/service-store/src/main/java/com/java110/store/dao/impl/StoreServiceDaoImpl.java
old mode 100644
new mode 100755
index 3ad9a4d..d3d7060
--- a/service-store/src/main/java/com/java110/store/dao/impl/StoreServiceDaoImpl.java
+++ b/service-store/src/main/java/com/java110/store/dao/impl/StoreServiceDaoImpl.java
@@ -1,13 +1,13 @@
package com.java110.store.dao.impl;
import com.alibaba.fastjson.JSONObject;
+import com.java110.core.base.dao.BaseServiceDao;
+import com.java110.store.dao.IStoreServiceDao;
import com.java110.utils.constant.ResponseConstant;
import com.java110.utils.exception.DAOException;
import com.java110.utils.util.DateUtil;
-import com.java110.core.base.dao.BaseServiceDao;
-import com.java110.store.dao.IStoreServiceDao;
import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import com.java110.core.log.LoggerFactory;
import org.springframework.stereotype.Service;
import java.util.List;
@@ -25,6 +25,7 @@
/**
* 鍟嗘埛淇℃伅灏佽
+ *
* @param businessStoreInfo 鍟嗘埛淇℃伅 灏佽
* @throws DAOException
*/
@@ -32,16 +33,17 @@
public void saveBusinessStoreInfo(Map businessStoreInfo) throws DAOException {
businessStoreInfo.put("month", DateUtil.getCurrentMonth());
// 鏌ヨbusiness_user 鏁版嵁鏄惁宸茬粡瀛樺湪
- logger.debug("淇濆瓨鍟嗘埛淇℃伅 鍏ュ弬 businessStoreInfo : {}",businessStoreInfo);
- int saveFlag = sqlSessionTemplate.insert("storeServiceDaoImpl.saveBusinessStoreInfo",businessStoreInfo);
+ logger.debug("淇濆瓨鍟嗘埛淇℃伅 鍏ュ弬 businessStoreInfo : {}", businessStoreInfo);
+ int saveFlag = sqlSessionTemplate.insert("storeServiceDaoImpl.saveBusinessStoreInfo", businessStoreInfo);
- if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨鍟嗘埛鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(businessStoreInfo));
+ if (saveFlag < 1) {
+ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇濆瓨鍟嗘埛鏁版嵁澶辫触锛�" + JSONObject.toJSONString(businessStoreInfo));
}
}
/**
* 鍟嗘埛灞炴�т俊鎭垎瑁�
+ *
* @param businessStoreAttr 鍟嗘埛灞炴�т俊鎭皝瑁�
* @throws DAOException
*/
@@ -49,51 +51,54 @@
public void saveBusinessStoreAttr(Map businessStoreAttr) throws DAOException {
businessStoreAttr.put("month", DateUtil.getCurrentMonth());
// 鏌ヨbusiness_user 鏁版嵁鏄惁宸茬粡瀛樺湪
- logger.debug("淇濆瓨鍟嗘埛灞炴�т俊鎭� 鍏ュ弬 businessStoreAttr : {}",businessStoreAttr);
+ logger.debug("淇濆瓨鍟嗘埛灞炴�т俊鎭� 鍏ュ弬 businessStoreAttr : {}", businessStoreAttr);
- int saveFlag = sqlSessionTemplate.insert("storeServiceDaoImpl.saveBusinessStoreAttr",businessStoreAttr);
+ int saveFlag = sqlSessionTemplate.insert("storeServiceDaoImpl.saveBusinessStoreAttr", businessStoreAttr);
- if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨鍟嗘埛灞炴�ф暟鎹け璐ワ細"+ JSONObject.toJSONString(businessStoreAttr));
+ if (saveFlag < 1) {
+ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇濆瓨鍟嗘埛灞炴�ф暟鎹け璐ワ細" + JSONObject.toJSONString(businessStoreAttr));
}
}
/**
* 淇濆瓨鍟嗘埛鐓х墖淇℃伅
+ *
* @param businessStorePhoto 鍟嗘埛鐓х墖
* @throws DAOException
*/
@Override
public void saveBusinessStorePhoto(Map businessStorePhoto) throws DAOException {
businessStorePhoto.put("month", DateUtil.getCurrentMonth());
- logger.debug("淇濆瓨鍟嗘埛鐓х墖淇℃伅 鍏ュ弬 businessStorePhoto : {}",businessStorePhoto);
+ logger.debug("淇濆瓨鍟嗘埛鐓х墖淇℃伅 鍏ュ弬 businessStorePhoto : {}", businessStorePhoto);
- int saveFlag = sqlSessionTemplate.insert("storeServiceDaoImpl.saveBusinessStorePhoto",businessStorePhoto);
+ int saveFlag = sqlSessionTemplate.insert("storeServiceDaoImpl.saveBusinessStorePhoto", businessStorePhoto);
- if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨鍟嗘埛鐓х墖鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(businessStorePhoto));
+ if (saveFlag < 1) {
+ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇濆瓨鍟嗘埛鐓х墖鏁版嵁澶辫触锛�" + JSONObject.toJSONString(businessStorePhoto));
}
}
/**
* 淇濆瓨鍟嗘埛璇佷欢淇℃伅
+ *
* @param businessStoreCerdentials 鍟嗘埛璇佷欢
* @throws DAOException
*/
@Override
public void saveBusinessStoreCerdentials(Map businessStoreCerdentials) throws DAOException {
businessStoreCerdentials.put("month", DateUtil.getCurrentMonth());
- logger.debug("淇濆瓨鍟嗘埛璇佷欢淇℃伅 鍏ュ弬 businessStoreCerdentials : {}",businessStoreCerdentials);
+ logger.debug("淇濆瓨鍟嗘埛璇佷欢淇℃伅 鍏ュ弬 businessStoreCerdentials : {}", businessStoreCerdentials);
- int saveFlag = sqlSessionTemplate.insert("storeServiceDaoImpl.saveBusinessStoreCerdentials",businessStoreCerdentials);
+ int saveFlag = sqlSessionTemplate.insert("storeServiceDaoImpl.saveBusinessStoreCerdentials", businessStoreCerdentials);
- if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨鍟嗘埛璇佷欢鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(businessStoreCerdentials));
+ if (saveFlag < 1) {
+ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇濆瓨鍟嗘埛璇佷欢鏁版嵁澶辫触锛�" + JSONObject.toJSONString(businessStoreCerdentials));
}
}
/**
* 鏌ヨ鍟嗘埛淇℃伅
+ *
* @param info bId 淇℃伅
* @return 鍟嗘埛淇℃伅
* @throws DAOException
@@ -101,14 +106,18 @@
@Override
public Map getBusinessStoreInfo(Map info) throws DAOException {
- logger.debug("鏌ヨ鍟嗘埛淇℃伅 鍏ュ弬 info : {}",info);
+ logger.debug("鏌ヨ鍟嗘埛淇℃伅 鍏ュ弬 info : {}", info);
- List<Map> businessStoreInfos = sqlSessionTemplate.selectList("storeServiceDaoImpl.getBusinessStoreInfo",info);
- if(businessStoreInfos == null){
+ 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));
+ if (businessStoreInfos.size() > 1) {
+ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "鏍规嵁鏉′欢鏌ヨ鏈夊鏉℃暟鎹�,鏁版嵁寮傚父锛岃妫�鏌ワ細businessStoreInfos锛�" + JSONObject.toJSONString(info));
+ }
+
+ if (businessStoreInfos == null || businessStoreInfos.size() < 1) {
+ return null;
}
return businessStoreInfos.get(0);
@@ -116,114 +125,119 @@
/**
* 鏌ヨ鍟嗘埛灞炴��
+ *
* @param info bId 淇℃伅
* @return 鍟嗘埛灞炴��
* @throws DAOException
*/
@Override
public List<Map> getBusinessStoreAttrs(Map info) throws DAOException {
- logger.debug("鏌ヨ鍟嗘埛灞炴�т俊鎭� 鍏ュ弬 info : {}",info);
+ logger.debug("鏌ヨ鍟嗘埛灞炴�т俊鎭� 鍏ュ弬 info : {}", info);
- List<Map> businessStoreAttrs = sqlSessionTemplate.selectList("storeServiceDaoImpl.getBusinessStoreAttrs",info);
+ List<Map> businessStoreAttrs = sqlSessionTemplate.selectList("storeServiceDaoImpl.getBusinessStoreAttrs", info);
return businessStoreAttrs;
}
/**
* 鏌ヨ鍟嗘埛鐓х墖
+ *
* @param info bId 淇℃伅
* @return
* @throws DAOException
*/
@Override
public List<Map> getBusinessStorePhoto(Map info) throws DAOException {
- logger.debug("鏌ヨ鍟嗘埛鐓х墖淇℃伅 鍏ュ弬 info : {}",info);
+ logger.debug("鏌ヨ鍟嗘埛鐓х墖淇℃伅 鍏ュ弬 info : {}", info);
- List<Map> businessStorePhotos = sqlSessionTemplate.selectList("storeServiceDaoImpl.getBusinessStorePhoto",info);
+ List<Map> businessStorePhotos = sqlSessionTemplate.selectList("storeServiceDaoImpl.getBusinessStorePhoto", info);
return businessStorePhotos;
}
/**
* 鏌ヨ鍟嗘埛璇佷欢
+ *
* @param info bId 淇℃伅
* @return
* @throws DAOException
*/
@Override
public List<Map> getBusinessStoreCerdentials(Map info) throws DAOException {
- logger.debug("鏌ヨ鍟嗘埛璇佷欢淇℃伅 鍏ュ弬 info : {}",info);
+ logger.debug("鏌ヨ鍟嗘埛璇佷欢淇℃伅 鍏ュ弬 info : {}", info);
- List<Map> businessStoreCerdentialses = sqlSessionTemplate.selectList("storeServiceDaoImpl.getBusinessStoreCerdentials",info);
+ List<Map> businessStoreCerdentialses = sqlSessionTemplate.selectList("storeServiceDaoImpl.getBusinessStoreCerdentials", info);
return businessStoreCerdentialses;
}
/**
* 淇濆瓨鍟嗘埛淇℃伅 鍒� instance
- * @param info bId 淇℃伅
+ *
+ * @param info bId 淇℃伅
* @throws DAOException
*/
@Override
public void saveStoreInfoInstance(Map info) throws DAOException {
- logger.debug("淇濆瓨鍟嗘埛淇℃伅Instance 鍏ュ弬 info : {}",info);
+ logger.debug("淇濆瓨鍟嗘埛淇℃伅Instance 鍏ュ弬 info : {}", info);
- int saveFlag = sqlSessionTemplate.insert("storeServiceDaoImpl.saveStoreInfoInstance",info);
+ int saveFlag = sqlSessionTemplate.insert("storeServiceDaoImpl.saveStoreInfoInstance", info);
- if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨鍟嗘埛淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
+ if (saveFlag < 1) {
+ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇濆瓨鍟嗘埛淇℃伅Instance鏁版嵁澶辫触锛�" + JSONObject.toJSONString(info));
}
}
@Override
public void saveStoreAttrsInstance(Map info) throws DAOException {
- logger.debug("淇濆瓨鍟嗘埛灞炴�т俊鎭疘nstance 鍏ュ弬 info : {}",info);
+ logger.debug("淇濆瓨鍟嗘埛灞炴�т俊鎭疘nstance 鍏ュ弬 info : {}", info);
- int saveFlag = sqlSessionTemplate.insert("storeServiceDaoImpl.saveStoreAttrsInstance",info);
+ int saveFlag = sqlSessionTemplate.insert("storeServiceDaoImpl.saveStoreAttrsInstance", info);
- if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨鍟嗘埛灞炴�т俊鎭疘nstance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
+ if (saveFlag < 1) {
+ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇濆瓨鍟嗘埛灞炴�т俊鎭疘nstance鏁版嵁澶辫触锛�" + JSONObject.toJSONString(info));
}
}
@Override
public void saveStorePhotoInstance(Map info) throws DAOException {
- logger.debug("淇濆瓨鍟嗘埛鐓х墖淇℃伅Instance 鍏ュ弬 info : {}",info);
+ logger.debug("淇濆瓨鍟嗘埛鐓х墖淇℃伅Instance 鍏ュ弬 info : {}", info);
- int saveFlag = sqlSessionTemplate.insert("storeServiceDaoImpl.saveStorePhotoInstance",info);
+ int saveFlag = sqlSessionTemplate.insert("storeServiceDaoImpl.saveStorePhotoInstance", info);
- if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨鍟嗘埛鐓х墖淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
+ if (saveFlag < 1) {
+ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇濆瓨鍟嗘埛鐓х墖淇℃伅Instance鏁版嵁澶辫触锛�" + JSONObject.toJSONString(info));
}
}
@Override
public void saveStoreCerdentialsInstance(Map info) throws DAOException {
- logger.debug("淇濆瓨鍟嗘埛璇佷欢淇℃伅Instance 鍏ュ弬 info : {}",info);
+ logger.debug("淇濆瓨鍟嗘埛璇佷欢淇℃伅Instance 鍏ュ弬 info : {}", info);
- int saveFlag = sqlSessionTemplate.insert("storeServiceDaoImpl.saveStoreCerdentialsInstance",info);
+ int saveFlag = sqlSessionTemplate.insert("storeServiceDaoImpl.saveStoreCerdentialsInstance", info);
- if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨鍟嗘埛璇佷欢淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
+ if (saveFlag < 1) {
+ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇濆瓨鍟嗘埛璇佷欢淇℃伅Instance鏁版嵁澶辫触锛�" + JSONObject.toJSONString(info));
}
}
/**
* 鏌ヨ鍟嗘埛淇℃伅锛坕nstance锛�
+ *
* @param info bId 淇℃伅
* @return
* @throws DAOException
*/
@Override
public Map getStoreInfo(Map info) throws DAOException {
- logger.debug("鏌ヨ鍟嗘埛淇℃伅 鍏ュ弬 info : {}",info);
+ logger.debug("鏌ヨ鍟嗘埛淇℃伅 鍏ュ弬 info : {}", info);
- List<Map> businessStoreInfos = sqlSessionTemplate.selectList("storeServiceDaoImpl.getStoreInfo",info);
- if(businessStoreInfos == null || businessStoreInfos.size() == 0){
+ 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));
+ if (businessStoreInfos.size() > 1) {
+ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "鏍规嵁鏉′欢鏌ヨ鏈夊鏉℃暟鎹�,鏁版嵁寮傚父锛岃妫�鏌ワ細getStoreInfo锛�" + JSONObject.toJSONString(info));
}
return businessStoreInfos.get(0);
@@ -231,160 +245,170 @@
/**
* 鍟嗘埛灞炴�ф煡璇紙instance锛�
+ *
* @param info bId 淇℃伅
* @return
* @throws DAOException
*/
@Override
public List<Map> getStoreAttrs(Map info) throws DAOException {
- logger.debug("鏌ヨ鍟嗘埛灞炴�т俊鎭� 鍏ュ弬 info : {}",info);
+ logger.debug("鏌ヨ鍟嗘埛灞炴�т俊鎭� 鍏ュ弬 info : {}", info);
- List<Map> storeAttrs = sqlSessionTemplate.selectList("storeServiceDaoImpl.getStoreAttrs",info);
+ List<Map> storeAttrs = sqlSessionTemplate.selectList("storeServiceDaoImpl.getStoreAttrs", info);
return storeAttrs;
}
/**
* 鍟嗘埛鐓х墖鏌ヨ锛坕nstance锛�
+ *
* @param info bId 淇℃伅
* @return
* @throws DAOException
*/
@Override
public List<Map> getStorePhoto(Map info) throws DAOException {
- logger.debug("鏌ヨ鍟嗘埛鐓х墖淇℃伅 鍏ュ弬 info : {}",info);
+ logger.debug("鏌ヨ鍟嗘埛鐓х墖淇℃伅 鍏ュ弬 info : {}", info);
- List<Map> storePhotos = sqlSessionTemplate.selectList("storeServiceDaoImpl.getStorePhoto",info);
+ List<Map> storePhotos = sqlSessionTemplate.selectList("storeServiceDaoImpl.getStorePhoto", info);
return storePhotos;
}
/**
* 鍟嗘埛璇佷欢鏌ヨ锛坕nstance锛�
+ *
* @param info bId 淇℃伅
* @return
* @throws DAOException
*/
@Override
public List<Map> getStoreCerdentials(Map info) throws DAOException {
- logger.debug("鏌ヨ鍟嗘埛璇佷欢淇℃伅 鍏ュ弬 info : {}",info);
+ logger.debug("鏌ヨ鍟嗘埛璇佷欢淇℃伅 鍏ュ弬 info : {}", info);
- List<Map> storeCerdentialses = sqlSessionTemplate.selectList("storeServiceDaoImpl.getStoreCerdentials",info);
+ List<Map> storeCerdentialses = sqlSessionTemplate.selectList("storeServiceDaoImpl.getStoreCerdentials", info);
return storeCerdentialses;
}
/**
* 淇敼鍟嗘埛淇℃伅
+ *
* @param info 淇敼淇℃伅
* @throws DAOException
*/
@Override
public void updateStoreInfoInstance(Map info) throws DAOException {
- logger.debug("淇敼鍟嗘埛淇℃伅Instance 鍏ュ弬 info : {}",info);
+ logger.debug("淇敼鍟嗘埛淇℃伅Instance 鍏ュ弬 info : {}", info);
- int saveFlag = sqlSessionTemplate.update("storeServiceDaoImpl.updateStoreInfoInstance",info);
+ int saveFlag = sqlSessionTemplate.update("storeServiceDaoImpl.updateStoreInfoInstance", info);
- if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇敼鍟嗘埛淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
+ if (saveFlag < 1) {
+ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇敼鍟嗘埛淇℃伅Instance鏁版嵁澶辫触锛�" + JSONObject.toJSONString(info));
}
}
/**
* 淇敼鍟嗘埛灞炴�т俊鎭紙instance锛�
+ *
* @param info 淇敼淇℃伅
* @throws DAOException
*/
@Override
public void updateStoreAttrInstance(Map info) throws DAOException {
- logger.debug("淇敼鍟嗘埛灞炴�т俊鎭疘nstance 鍏ュ弬 info : {}",info);
+ logger.debug("淇敼鍟嗘埛灞炴�т俊鎭疘nstance 鍏ュ弬 info : {}", info);
- int saveFlag = sqlSessionTemplate.update("storeServiceDaoImpl.updateStoreAttrInstance",info);
+ int saveFlag = sqlSessionTemplate.update("storeServiceDaoImpl.updateStoreAttrInstance", info);
- if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇敼鍟嗘埛灞炴�т俊鎭疘nstance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
+ if (saveFlag < 1) {
+ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇敼鍟嗘埛灞炴�т俊鎭疘nstance鏁版嵁澶辫触锛�" + JSONObject.toJSONString(info));
}
}
/**
* 淇敼 鍟嗘埛鐓х墖淇℃伅
+ *
* @param info 淇敼淇℃伅
* @throws DAOException
*/
@Override
public void updateStorePhotoInstance(Map info) throws DAOException {
- logger.debug("淇敼鍟嗘埛鐓х墖淇℃伅Instance 鍏ュ弬 info : {}",info);
+ logger.debug("淇敼鍟嗘埛鐓х墖淇℃伅Instance 鍏ュ弬 info : {}", info);
- int saveFlag = sqlSessionTemplate.update("storeServiceDaoImpl.updateStorePhotoInstance",info);
+ int saveFlag = sqlSessionTemplate.update("storeServiceDaoImpl.updateStorePhotoInstance", info);
- if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇敼鍟嗘埛鐓х墖淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
+ if (saveFlag < 1) {
+ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇敼鍟嗘埛鐓х墖淇℃伅Instance鏁版嵁澶辫触锛�" + JSONObject.toJSONString(info));
}
}
/**
* 淇敼鍟嗘埛璇佷欢淇℃伅
+ *
* @param info 淇敼淇℃伅
* @throws DAOException
*/
@Override
public void updateStoreCerdentailsInstance(Map info) throws DAOException {
- logger.debug("淇敼鍟嗘埛璇佷欢淇℃伅Instance 鍏ュ弬 info : {}",info);
+ logger.debug("淇敼鍟嗘埛璇佷欢淇℃伅Instance 鍏ュ弬 info : {}", info);
- int saveFlag = sqlSessionTemplate.update("storeServiceDaoImpl.updateStoreCerdentailsInstance",info);
+ int saveFlag = sqlSessionTemplate.update("storeServiceDaoImpl.updateStoreCerdentailsInstance", info);
- if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇敼鍟嗘埛璇佷欢淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
+ if (saveFlag < 1) {
+ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇敼鍟嗘埛璇佷欢淇℃伅Instance鏁版嵁澶辫触锛�" + JSONObject.toJSONString(info));
}
}
/**
* 鍟嗘埛鎴愬憳鍔犲叆淇℃伅
+ *
* @param businessMemberStore 鍟嗘埛鎴愬憳淇℃伅 灏佽
* @throws DAOException 鎿嶄綔鏁版嵁搴撳紓甯�
*/
- public void saveBusinessMemberStore(Map businessMemberStore) throws DAOException{
- logger.debug("鍟嗘埛鎴愬憳鍔犲叆 鍏ュ弬 businessMemberStore : {}",businessMemberStore);
+ public void saveBusinessMemberStore(Map businessMemberStore) throws DAOException {
+ logger.debug("鍟嗘埛鎴愬憳鍔犲叆 鍏ュ弬 businessMemberStore : {}", businessMemberStore);
- int saveFlag = sqlSessionTemplate.insert("storeServiceDaoImpl.saveBusinessMemberStore",businessMemberStore);
+ int saveFlag = sqlSessionTemplate.insert("storeServiceDaoImpl.saveBusinessMemberStore", businessMemberStore);
- if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"鍟嗘埛鎴愬憳鍔犲叆澶辫触锛�"+ JSONObject.toJSONString(businessMemberStore));
+ if (saveFlag < 1) {
+ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "鍟嗘埛鎴愬憳鍔犲叆澶辫触锛�" + JSONObject.toJSONString(businessMemberStore));
}
}
/**
* 鎴愬憳鍔犲叆 淇濆瓨淇℃伅鑷砳nstance
+ *
* @param info
* @throws DAOException
*/
@Override
public void saveMemberStoreInstance(Map info) throws DAOException {
- logger.debug("鍟嗘埛鎴愬憳鍔犲叆Instance 鍏ュ弬 info : {}",info);
+ logger.debug("鍟嗘埛鎴愬憳鍔犲叆Instance 鍏ュ弬 info : {}", info);
- int saveFlag = sqlSessionTemplate.insert("storeServiceDaoImpl.saveMemberStoreInstance",info);
+ int saveFlag = sqlSessionTemplate.insert("storeServiceDaoImpl.saveMemberStoreInstance", info);
- if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨鍟嗘埛鐓х墖淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
+ if (saveFlag < 1) {
+ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇濆瓨鍟嗘埛鐓х墖淇℃伅Instance鏁版嵁澶辫触锛�" + JSONObject.toJSONString(info));
}
}
/**
* 鏌ヨ鍟嗘埛鎴愬憳鍔犲叆淇℃伅锛坆usiness杩囩▼锛�
* 鏍规嵁bId 鏌ヨ鍟嗘埛淇℃伅
+ *
* @param info bId 淇℃伅
* @return 鍟嗘埛淇℃伅
* @throws DAOException
*/
- public Map getBusinessMemberStore(Map info) throws DAOException{
- logger.debug("鏌ヨ鍟嗘埛鎴愬憳鍔犲叆淇℃伅 鍏ュ弬 info : {}",info);
+ public Map getBusinessMemberStore(Map info) throws DAOException {
+ logger.debug("鏌ヨ鍟嗘埛鎴愬憳鍔犲叆淇℃伅 鍏ュ弬 info : {}", info);
- List<Map> businessMemberStores = sqlSessionTemplate.selectList("storeServiceDaoImpl.getBusinessMemberStore",info);
- if(businessMemberStores == null || businessMemberStores.size() == 0){
+ List<Map> businessMemberStores = sqlSessionTemplate.selectList("storeServiceDaoImpl.getBusinessMemberStore", info);
+ if (businessMemberStores == null || businessMemberStores.size() == 0) {
return null;
}
- if(businessMemberStores.size() >1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"鏍规嵁鏉′欢鏌ヨ鏈夊鏉℃暟鎹�,鏁版嵁寮傚父锛岃妫�鏌ワ細businessMemberStore锛�"+ JSONObject.toJSONString(info));
+ if (businessMemberStores.size() > 1) {
+ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "鏍规嵁鏉′欢鏌ヨ鏈夊鏉℃暟鎹�,鏁版嵁寮傚父锛岃妫�鏌ワ細businessMemberStore锛�" + JSONObject.toJSONString(info));
}
return businessMemberStores.get(0);
@@ -393,127 +417,176 @@
/**
* 鏌ヨ鍟嗘埛鎴愬憳鍔犲叆淇℃伅锛坕nstance杩囩▼锛�
* 鏍规嵁bId 鏌ヨ鍟嗘埛淇℃伅
+ *
* @param info bId 淇℃伅
* @return 鍟嗘埛淇℃伅
* @throws DAOException
*/
- public Map getMemberStore(Map info) throws DAOException{
- logger.debug("鏌ヨ鍟嗘埛鎴愬憳鍔犲叆淇℃伅 鍏ュ弬 info : {}",info);
+ public Map getMemberStore(Map info) throws DAOException {
+ logger.debug("鏌ヨ鍟嗘埛鎴愬憳鍔犲叆淇℃伅 鍏ュ弬 info : {}", info);
- List<Map> memberStores = sqlSessionTemplate.selectList("storeServiceDaoImpl.getMemberStore",info);
- if(memberStores == null || memberStores.size() == 0){
+ List<Map> memberStores = sqlSessionTemplate.selectList("storeServiceDaoImpl.getMemberStore", info);
+ if (memberStores == null || memberStores.size() == 0) {
return null;
}
- if(memberStores.size() >1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"鏍规嵁鏉′欢鏌ヨ鏈夊鏉℃暟鎹�,鏁版嵁寮傚父锛岃妫�鏌ワ細getMemberStore锛�"+ JSONObject.toJSONString(info));
+ if (memberStores.size() > 1) {
+ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "鏍规嵁鏉′欢鏌ヨ鏈夊鏉℃暟鎹�,鏁版嵁寮傚父锛岃妫�鏌ワ細getMemberStore锛�" + JSONObject.toJSONString(info));
}
return memberStores.get(0);
}
+
/**
* 淇敼鍟嗘埛鎴愬憳鍔犲叆淇℃伅
+ *
* @param info 淇敼淇℃伅
* @throws DAOException
*/
- public void updateMemberStoreInstance(Map info) throws DAOException{
- logger.debug("淇敼鍟嗘埛鎴愬憳鍔犲叆淇℃伅Instance 鍏ュ弬 info : {}",info);
+ public void updateMemberStoreInstance(Map info) throws DAOException {
+ logger.debug("淇敼鍟嗘埛鎴愬憳鍔犲叆淇℃伅Instance 鍏ュ弬 info : {}", info);
- int saveFlag = sqlSessionTemplate.update("storeServiceDaoImpl.updateMemberStoreInstance",info);
+ int saveFlag = sqlSessionTemplate.update("storeServiceDaoImpl.updateMemberStoreInstance", info);
- if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇敼鍟嗘埛鎴愬憳鍔犲叆淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
+ if (saveFlag < 1) {
+ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇敼鍟嗘埛鎴愬憳鍔犲叆淇℃伅Instance鏁版嵁澶辫触锛�" + JSONObject.toJSONString(info));
}
}
/**
* 淇濆瓨鐗╀笟鐢ㄦ埛淇℃伅
+ *
* @param info
* @throws DAOException
*/
- public void saveBusinessStoreUser(Map info) throws DAOException{
+ public void saveBusinessStoreUser(Map info) throws DAOException {
info.put("month", DateUtil.getCurrentMonth());
- logger.debug("淇濆瓨鐗╀笟鐢ㄦ埛淇℃伅鍏ュ弬 info : {}",info);
+ logger.debug("淇濆瓨鐗╀笟鐢ㄦ埛淇℃伅鍏ュ弬 info : {}", info);
- int saveFlag = sqlSessionTemplate.insert("storeServiceDaoImpl.saveBusinessStoreUser",info);
+ int saveFlag = sqlSessionTemplate.insert("storeServiceDaoImpl.saveBusinessStoreUser", info);
- if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨鍟嗘埛鐢ㄦ埛淇℃伅鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
+ if (saveFlag < 1) {
+ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇濆瓨鍟嗘埛鐢ㄦ埛淇℃伅鏁版嵁澶辫触锛�" + JSONObject.toJSONString(info));
}
}
/**
* 鏌ヨ鐗╀笟鐢ㄦ埛淇℃伅
+ *
* @param info bId 淇℃伅
* @return 鐗╀笟鐓х墖
* @throws DAOException
*/
- public List<Map> getBusinessStoreUser(Map info) throws DAOException{
- logger.debug("鏌ヨ鍟嗘埛鐢ㄦ埛淇℃伅 鍏ュ弬 info : {}",info);
+ public List<Map> getBusinessStoreUser(Map info) throws DAOException {
+ logger.debug("鏌ヨ鍟嗘埛鐢ㄦ埛淇℃伅 鍏ュ弬 info : {}", info);
- List<Map> businessPropertyUsers = sqlSessionTemplate.selectList("storeServiceDaoImpl.getBusinessStoreUser",info);
+ List<Map> businessPropertyUsers = sqlSessionTemplate.selectList("storeServiceDaoImpl.getBusinessStoreUser", info);
return businessPropertyUsers;
}
/**
* 淇濆瓨 鐗╀笟鐢ㄦ埛淇℃伅 Business鏁版嵁鍒� Instance涓�
+ *
* @param info
* @throws DAOException
*/
- public void saveStoreUserInstance(Map info) throws DAOException{
- logger.debug("淇濆瓨鍟嗘埛鐢ㄦ埛淇℃伅Instance 鍏ュ弬 info : {}",info);
+ public void saveStoreUserInstance(Map info) throws DAOException {
+ logger.debug("淇濆瓨鍟嗘埛鐢ㄦ埛淇℃伅Instance 鍏ュ弬 info : {}", info);
- int saveFlag = sqlSessionTemplate.insert("storeServiceDaoImpl.saveStoreUserInstance",info);
+ int saveFlag = sqlSessionTemplate.insert("storeServiceDaoImpl.saveStoreUserInstance", info);
- if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨鍟嗘埛鐢ㄦ埛淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
+ if (saveFlag < 1) {
+ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇濆瓨鍟嗘埛鐢ㄦ埛淇℃伅Instance鏁版嵁澶辫触锛�" + JSONObject.toJSONString(info));
}
}
/**
* 鏌ヨ鐗╀笟鐢ㄦ埛淇℃伅锛坕nstance 杩囩▼锛�
+ *
* @param info bId 淇℃伅
* @return 鐗╀笟鐓х墖
* @throws DAOException
*/
- public List<Map> getStoreUser(Map info) throws DAOException{
- logger.debug("鏌ヨ鍟嗘埛鐢ㄦ埛淇℃伅 鍏ュ弬 info : {}",info);
+ public List<Map> getStoreUser(Map info) throws DAOException {
+ logger.debug("鏌ヨ鍟嗘埛鐢ㄦ埛淇℃伅 鍏ュ弬 info : {}", info);
- List<Map> propertyUsers = sqlSessionTemplate.selectList("storeServiceDaoImpl.getStoreUser",info);
+ List<Map> propertyUsers = sqlSessionTemplate.selectList("storeServiceDaoImpl.getStoreUser", info);
return propertyUsers;
}
/**
* 淇敼鐗╀笟鐢ㄦ埛淇℃伅
+ *
* @param info 淇敼淇℃伅
* @throws DAOException
*/
- public void updateStoreUserInstance(Map info) throws DAOException{
- logger.debug("淇敼鍟嗘埛鐢ㄦ埛淇℃伅Instance 鍏ュ弬 info : {}",info);
+ public void updateStoreUserInstance(Map info) throws DAOException {
+ logger.debug("淇敼鍟嗘埛鐢ㄦ埛淇℃伅Instance 鍏ュ弬 info : {}", info);
- int saveFlag = sqlSessionTemplate.update("storeServiceDaoImpl.updateStoreUserInstance",info);
+ int saveFlag = sqlSessionTemplate.update("storeServiceDaoImpl.updateStoreUserInstance", info);
- if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇敼鍟嗘埛鐢ㄦ埛淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
+ if (saveFlag < 1) {
+ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇敼鍟嗘埛鐢ㄦ埛淇℃伅Instance鏁版嵁澶辫触锛�" + JSONObject.toJSONString(info));
}
}
@Override
public List<Map> getStores(Map info) throws DAOException {
- logger.debug("鏌ヨ鍟嗘埛淇℃伅 鍏ュ弬 info : {}",info);
+ logger.debug("鏌ヨ鍟嗘埛淇℃伅 鍏ュ弬 info : {}", info);
- List<Map> propertyUsers = sqlSessionTemplate.selectList("storeServiceDaoImpl.getStores",info);
+ List<Map> propertyUsers = sqlSessionTemplate.selectList("storeServiceDaoImpl.getStores", info);
return propertyUsers;
}
- public int getStoreCount(Map info) throws DAOException{
+ public int getStoreCount(Map info) throws DAOException {
List<Map> stores = sqlSessionTemplate.selectList("storeServiceDaoImpl.getStoreCount", info);
if (stores.size() < 1) {
return 0;
}
return Integer.parseInt(stores.get(0).get("count").toString());
}
+
+ /**
+ * 鏌ヨ鍛樺伐鍜屽晢鎴蜂俊鎭〃
+ *
+ * @param info
+ * @return
+ * @throws DAOException
+ */
+ @Override
+ public List<Map> getStoreUserInfo(Map info) throws DAOException {
+ List<Map> storeUserInfos = sqlSessionTemplate.selectList("storeServiceDaoImpl.getStoreUserInfo", info);
+ return storeUserInfos;
+ }
+
+ @Override
+ public List<Map> getStoreStaffs(Map info) throws DAOException {
+ List<Map> storeUserInfos = sqlSessionTemplate.selectList("storeServiceDaoImpl.getStoreStaffs", info);
+ return storeUserInfos;
+ }
+
+ @Override
+ public int getStoreStaffCount(Map info) throws DAOException {
+ List<Map> storeUserInfos = sqlSessionTemplate.selectList("storeServiceDaoImpl.getStoreStaffCount", info);
+ if (storeUserInfos.size() < 1) {
+ return 0;
+ }
+ return Integer.parseInt(storeUserInfos.get(0).get("count").toString());
+ }
+
+ /**
+ * 淇敼 鍟嗘埛淇℃伅
+ *
+ * @param info
+ * @return
+ * @throws DAOException
+ */
+ @Override
+ public int updateStore(Map info) throws DAOException {
+ int saveFlag = sqlSessionTemplate.update("storeServiceDaoImpl.updateStore", info);
+ return saveFlag;
+ }
}
--
Gitblit v1.8.0