From 9663ede17e832eb313407791ae5c1c0e0052fc69 Mon Sep 17 00:00:00 2001
From: wuxw7 <wuxw7@asiainfo.com>
Date: 星期五, 13 七月 2018 01:00:06 +0800
Subject: [PATCH] 评论服务开发完成
---
CommentService/src/main/java/com/java110/comment/dao/impl/CommentServiceDaoImpl.java | 740 +++++++++++---------------------------------------------
1 files changed, 149 insertions(+), 591 deletions(-)
diff --git a/CommentService/src/main/java/com/java110/comment/dao/impl/CommentServiceDaoImpl.java b/CommentService/src/main/java/com/java110/comment/dao/impl/CommentServiceDaoImpl.java
index cebbed3..d709f72 100644
--- a/CommentService/src/main/java/com/java110/comment/dao/impl/CommentServiceDaoImpl.java
+++ b/CommentService/src/main/java/com/java110/comment/dao/impl/CommentServiceDaoImpl.java
@@ -17,404 +17,120 @@
* 鍟嗗搧鏈嶅姟 涓庢暟鎹簱浜や簰
* Created by wuxw on 2017/4/5.
*/
-@Service("shopServiceDaoImpl")
+@Service("commentServiceDaoImpl")
//@Transactional
public class CommentServiceDaoImpl extends BaseServiceDao implements ICommentServiceDao {
private final static Logger logger = LoggerFactory.getLogger(CommentServiceDaoImpl.class);
+
+
+
+
+
/**
- * 鍟嗗搧淇℃伅灏佽
- * @param businessShopInfo 鍟嗗搧淇℃伅 灏佽
+ * 淇濆瓨璇勮淇℃伅
+ * @param comment
* @throws DAOException
*/
@Override
- public void saveBusinessShopInfo(Map businessShopInfo) throws DAOException {
- businessShopInfo.put("month", DateUtil.getCurrentMonth());
- // 鏌ヨbusiness_user 鏁版嵁鏄惁宸茬粡瀛樺湪
- logger.debug("淇濆瓨鍟嗗搧淇℃伅 鍏ュ弬 businessShopInfo : {}",businessShopInfo);
- int saveFlag = sqlSessionTemplate.insert("shopServiceDaoImpl.saveBusinessShopInfo",businessShopInfo);
+ public void saveCommentInstance(Map comment) throws DAOException {
+ comment.put("month", DateUtil.getCurrentMonth());
+ logger.debug("淇濆瓨璇勮璁板綍淇℃伅 鍏ュ弬 comment : {}",comment);
+
+ int saveFlag = sqlSessionTemplate.insert("commentServiceDaoImpl.saveCommentInstance",comment);
if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨鍟嗗搧鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(businessShopInfo));
+ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨璇勮鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(comment));
}
}
/**
- * 鍟嗗搧灞炴�т俊鎭垎瑁�
- * @param businessShopAttr 鍟嗗搧灞炴�т俊鎭皝瑁�
+ * 淇濆瓨璇勮淇℃伅
+ * @param subComment
* @throws DAOException
*/
@Override
- public void saveBusinessShopAttr(Map businessShopAttr) throws DAOException {
- businessShopAttr.put("month", DateUtil.getCurrentMonth());
- // 鏌ヨbusiness_user 鏁版嵁鏄惁宸茬粡瀛樺湪
- logger.debug("淇濆瓨鍟嗗搧灞炴�т俊鎭� 鍏ュ弬 businessShopAttr : {}",businessShopAttr);
+ public void saveSubCommentInstance(Map subComment) throws DAOException {
+ subComment.put("month", DateUtil.getCurrentMonth());
+ logger.debug("淇濆瓨璇勮璁板綍淇℃伅 鍏ュ弬 subComment : {}",subComment);
- int saveFlag = sqlSessionTemplate.insert("shopServiceDaoImpl.saveBusinessShopAttr",businessShopAttr);
+ int saveFlag = sqlSessionTemplate.insert("commentServiceDaoImpl.saveSubCommentInstance",subComment);
if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨鍟嗗搧灞炴�ф暟鎹け璐ワ細"+ JSONObject.toJSONString(businessShopAttr));
+ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨璇勮鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(subComment));
}
}
- /**
- * 鍟嗗搧灞炴�у弬鏁颁繚瀛�
- * @param businessShopAttrParam 鍟嗗搧灞炴�у弬鏁颁俊鎭皝瑁�
- * @throws DAOException
- */
- @Override
- public void saveBusinessShopAttrParam(Map businessShopAttrParam) throws DAOException {
- businessShopAttrParam.put("month", DateUtil.getCurrentMonth());
- // 鏌ヨbusiness_user 鏁版嵁鏄惁宸茬粡瀛樺湪
- logger.debug("淇濆瓨鍟嗗搧灞炴�у弬鏁颁俊鎭� 鍏ュ弬 businessShopAttr : {}",businessShopAttrParam);
-
- int saveFlag = sqlSessionTemplate.insert("shopServiceDaoImpl.saveBusinessShopAttrParam",businessShopAttrParam);
-
- if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨鍟嗗搧灞炴�у弬鏁版暟鎹け璐ワ細"+ JSONObject.toJSONString(businessShopAttrParam));
- }
- }
-
- /**
- * 淇濆瓨鍟嗗搧鐓х墖淇℃伅
- * @param businessShopPhoto 鍟嗗搧鐓х墖
- * @throws DAOException
- */
- @Override
- public void saveBusinessShopPhoto(Map businessShopPhoto) throws DAOException {
- businessShopPhoto.put("month", DateUtil.getCurrentMonth());
- logger.debug("淇濆瓨鍟嗗搧鐓х墖淇℃伅 鍏ュ弬 businessShopPhoto : {}",businessShopPhoto);
-
- int saveFlag = sqlSessionTemplate.insert("shopServiceDaoImpl.saveBusinessShopPhoto",businessShopPhoto);
-
- if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨鍟嗗搧鐓х墖鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(businessShopPhoto));
- }
- }
-
- /**
- * 淇濆瓨鍟嗗搧璇佷欢淇℃伅
- * @param businessShopPreferential 鍟嗗搧璇佷欢
- * @throws DAOException
- */
- @Override
- public void saveBusinessShopPreferential(Map businessShopPreferential) throws DAOException {
- businessShopPreferential.put("month", DateUtil.getCurrentMonth());
- logger.debug("淇濆瓨鍟嗗搧浼樻儬淇℃伅 鍏ュ弬 businessShopPreferential : {}",businessShopPreferential);
-
- int saveFlag = sqlSessionTemplate.insert("shopServiceDaoImpl.saveBusinessShopPreferential",businessShopPreferential);
-
- if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨鍟嗗搧璇佷欢鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(businessShopPreferential));
- }
- }
-
- /**
- * 淇濆瓨 鍟嗗搧鎻忚堪淇℃伅
- * @param businessShopDesc 鍟嗗搧 鎻忚堪淇℃伅
- * @throws DAOException
- */
- @Override
- public void saveBusinessShopDesc(Map businessShopDesc) throws DAOException {
- businessShopDesc.put("month", DateUtil.getCurrentMonth());
- logger.debug("淇濆瓨鍟嗗搧鎻忚堪淇℃伅 鍏ュ弬 businessShopDesc : {}",businessShopDesc);
-
- int saveFlag = sqlSessionTemplate.insert("shopServiceDaoImpl.saveBusinessShopDesc",businessShopDesc);
-
- if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨鍟嗗搧鎻忚堪鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(businessShopDesc));
- }
- }
-
- /**
- * 淇濆瓨鍟嗗搧鐩綍
- * @param businessShopCatalog 鍟嗗搧鐩綍
- * @throws DAOException
- */
- @Override
- public void saveBusinessShopCatalog(Map businessShopCatalog) throws DAOException {
- businessShopCatalog.put("month", DateUtil.getCurrentMonth());
- logger.debug("淇濆瓨鍟嗗搧鐩綍淇℃伅 鍏ュ弬 businessShopCatalog : {}",businessShopCatalog);
-
- int saveFlag = sqlSessionTemplate.insert("shopServiceDaoImpl.saveBusinessShopCatalog",businessShopCatalog);
-
- if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨鍟嗗搧鐩綍鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(businessShopCatalog));
- }
- }
-
- /**
- * 鏌ヨ鍟嗗搧淇℃伅
- * @param info bId 淇℃伅
- * @return 鍟嗗搧淇℃伅
- * @throws DAOException
- */
- @Override
- public Map getBusinessShopInfo(Map info) throws DAOException {
-
- logger.debug("鏌ヨ鍟嗗搧淇℃伅 鍏ュ弬 info : {}",info);
-
- List<Map> businessShopInfos = sqlSessionTemplate.selectList("shopServiceDaoImpl.getBusinessShopInfo",info);
- if(businessShopInfos == null){
- return null;
- }
- if(businessShopInfos.size() >1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"鏍规嵁鏉′欢鏌ヨ鏈夊鏉℃暟鎹�,鏁版嵁寮傚父锛岃妫�鏌ワ細businessShopInfos锛�"+ JSONObject.toJSONString(info));
- }
-
- return businessShopInfos.get(0);
- }
-
- /**
- * 鏌ヨ鍟嗗搧灞炴��
- * @param info bId 淇℃伅
- * @return 鍟嗗搧灞炴��
- * @throws DAOException
- */
- @Override
- public List<Map> getBusinessShopAttrs(Map info) throws DAOException {
- logger.debug("鏌ヨ鍟嗗搧灞炴�т俊鎭� 鍏ュ弬 info : {}",info);
-
- List<Map> businessShopAttrs = sqlSessionTemplate.selectList("shopServiceDaoImpl.getBusinessShopAttrs",info);
-
- return businessShopAttrs;
- }
-
- /**
- * 鏌ヨ鍟嗗搧灞炴�у弬鏁颁俊鎭�
- * @param info bId 淇℃伅
- * @return 鍟嗗搧灞炴�у弬鏁颁俊鎭�
- * @throws DAOException
- */
- @Override
- public List<Map> getBusinessShopAttrParams(Map info) throws DAOException {
- logger.debug("鏌ヨ鍟嗗搧灞炴�у弬鏁颁俊鎭� 鍏ュ弬 info : {}",info);
-
- List<Map> businessShopAttrParams = sqlSessionTemplate.selectList("shopServiceDaoImpl.getBusinessShopAttrParams",info);
-
- return businessShopAttrParams;
- }
-
- /**
- * 鏌ヨ鍟嗗搧鐓х墖
- * @param info bId 淇℃伅
- * @return
- * @throws DAOException
- */
- @Override
- public List<Map> getBusinessShopPhoto(Map info) throws DAOException {
- logger.debug("鏌ヨ鍟嗗搧鐓х墖淇℃伅 鍏ュ弬 info : {}",info);
-
- List<Map> businessShopPhotos = sqlSessionTemplate.selectList("shopServiceDaoImpl.getBusinessShopPhoto",info);
-
- return businessShopPhotos;
- }
-
- /**
- * 鏌ヨ鍟嗗搧浼樻儬
- * @param info bId 淇℃伅
- * @return
- * @throws DAOException
- */
- @Override
- public Map getBusinessShopPreferential(Map info) throws DAOException {
- logger.debug("鏌ヨ鍟嗗搧璇佷欢淇℃伅 鍏ュ弬 info : {}",info);
-
- List<Map> businessShopPreferentiales = sqlSessionTemplate.selectList("shopServiceDaoImpl.getBusinessShopPreferential",info);
- if(businessShopPreferentiales == null){
- return null;
- }
- if(businessShopPreferentiales.size() >1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"鏍规嵁鏉′欢鏌ヨ鏈夊鏉℃暟鎹�,鏁版嵁寮傚父锛岃妫�鏌ワ細businessShopPreferentiales锛�"+ JSONObject.toJSONString(info));
- }
-
- return businessShopPreferentiales.get(0);
- }
-
- /**
- * 鏌ヨ鍟嗗搧鎻忚堪
- * @param info bId 淇℃伅
- * @return
- * @throws DAOException
- */
- @Override
- public Map getBusinessShopDesc(Map info) throws DAOException {
- logger.debug("鏌ヨ鍟嗗搧璇佷欢淇℃伅 鍏ュ弬 info : {}",info);
-
- List<Map> businessShopDesces = sqlSessionTemplate.selectList("shopServiceDaoImpl.getBusinessShopDesc",info);
- if(businessShopDesces == null){
- return null;
- }
- if(businessShopDesces.size() >1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"鏍规嵁鏉′欢鏌ヨ鏈夊鏉℃暟鎹�,鏁版嵁寮傚父锛岃妫�鏌ワ細businessShopDesces锛�"+ JSONObject.toJSONString(info));
- }
-
- return businessShopDesces.get(0);
- }
-
- /**
- * 鏌ヨ鍟嗗搧鐩綍
- * @param info bId 淇℃伅
- * @return
- * @throws DAOException
- */
- @Override
- public Map getBusinessShopCatalog(Map info) throws DAOException {
- logger.debug("鏌ヨ鍟嗗搧璇佷欢淇℃伅 鍏ュ弬 info : {}",info);
-
- List<Map> businessShopCatalogs = sqlSessionTemplate.selectList("shopServiceDaoImpl.getBusinessShopCatalog",info);
- if(businessShopCatalogs == null){
- return null;
- }
- if(businessShopCatalogs.size() >1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"鏍规嵁鏉′欢鏌ヨ鏈夊鏉℃暟鎹�,鏁版嵁寮傚父锛岃妫�鏌ワ細businessShopCatalogs锛�"+ JSONObject.toJSONString(info));
- }
-
- return businessShopCatalogs.get(0);
- }
-
- /**
- * 淇濆瓨鍟嗗搧淇℃伅 鍒� instance
- * @param info bId 淇℃伅
- * @throws DAOException
- */
- @Override
- public void saveShopInfoInstance(Map info) throws DAOException {
- logger.debug("淇濆瓨鍟嗗搧淇℃伅Instance 鍏ュ弬 info : {}",info);
-
- int saveFlag = sqlSessionTemplate.insert("shopServiceDaoImpl.saveShopInfoInstance",info);
-
- if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨鍟嗗搧淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
- }
- }
-
- @Override
- public void saveShopAttrsInstance(Map info) throws DAOException {
- logger.debug("淇濆瓨鍟嗗搧灞炴�т俊鎭疘nstance 鍏ュ弬 info : {}",info);
-
- int saveFlag = sqlSessionTemplate.insert("shopServiceDaoImpl.saveShopAttrsInstance",info);
-
- if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨鍟嗗搧灞炴�т俊鎭疘nstance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
- }
- }
-
- /**
- * 淇濆瓨 鍟嗗搧灞炴�� 鍙傛暟 鑷� business
- * @param info b_id
- * @throws DAOException
- */
- @Override
- public void saveShopAttrParamsInstance(Map info) throws DAOException {
- logger.debug("淇濆瓨鍟嗗搧灞炴�у弬鏁颁俊鎭疘nstance 鍏ュ弬 info : {}",info);
-
- int saveFlag = sqlSessionTemplate.insert("shopServiceDaoImpl.saveShopAttrParamsInstance",info);
-
- if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨鍟嗗搧灞炴�у弬鏁颁俊鎭疘nstance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
- }
- }
-
- @Override
- public void saveShopPhotoInstance(Map info) throws DAOException {
- logger.debug("淇濆瓨鍟嗗搧鐓х墖淇℃伅Instance 鍏ュ弬 info : {}",info);
-
- int saveFlag = sqlSessionTemplate.insert("shopServiceDaoImpl.saveShopPhotoInstance",info);
-
- if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨鍟嗗搧鐓х墖淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
- }
- }
-
- @Override
- public void saveShopPreferentialInstance(Map info) throws DAOException {
- logger.debug("淇濆瓨鍟嗗搧璇佷欢淇℃伅Instance 鍏ュ弬 info : {}",info);
-
- int saveFlag = sqlSessionTemplate.insert("shopServiceDaoImpl.saveShopPreferentialInstance",info);
-
- if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨鍟嗗搧璇佷欢淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
- }
- }
-
- @Override
- public void saveShopDescInstance(Map info) throws DAOException {
- logger.debug("淇濆瓨鍟嗗搧鎻忚堪淇℃伅Instance 鍏ュ弬 info : {}",info);
-
- int saveFlag = sqlSessionTemplate.insert("shopServiceDaoImpl.saveShopDescInstance",info);
-
- if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨鍟嗗搧璇佷欢淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
- }
- }
-
- @Override
- public void saveShopCatalogInstance(Map info) throws DAOException {
- logger.debug("淇濆瓨鍟嗗搧鐩綍淇℃伅Instance 鍏ュ弬 info : {}",info);
-
- int saveFlag = sqlSessionTemplate.insert("shopServiceDaoImpl.saveShopCatalogInstance",info);
-
- if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨鍟嗗搧鐩綍淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
- }
- }
-
-
- /**
- * 淇濆瓨璐拱璁板綍
- * @param businessBuyShop
- * @throws DAOException
- */
- @Override
- public void saveBuyShopInstance(Map businessBuyShop) throws DAOException {
- businessBuyShop.put("month", DateUtil.getCurrentMonth());
- logger.debug("淇濆瓨鍟嗗搧璐拱璁板綍淇℃伅 鍏ュ弬 businessBuyShop : {}",businessBuyShop);
-
- int saveFlag = sqlSessionTemplate.insert("shopServiceDaoImpl.saveBuyShopInstance",businessBuyShop);
-
- if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨鍟嗗搧璐拱璁板綍鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(businessBuyShop));
- }
- }
/**
* 璐拱鍟嗗搧灞炴�т繚瀛�
- * @param businessBuyShopAttr
+ * @param subCommentAttr
* @throws DAOException
*/
@Override
- public void saveBuyShopAttrInstance(Map businessBuyShopAttr) throws DAOException {
- businessBuyShopAttr.put("month", DateUtil.getCurrentMonth());
- logger.debug("淇濆瓨鍟嗗搧璐拱璁板綍灞炴�т俊鎭� 鍏ュ弬 businessBuyShopAttr : {}",businessBuyShopAttr);
+ public void saveSubCommentAttrInstance(Map subCommentAttr) throws DAOException {
+ subCommentAttr.put("month", DateUtil.getCurrentMonth());
+ logger.debug("淇濆瓨璇勮灞炴�т俊鎭� 鍏ュ弬 subCommentAttr : {}",subCommentAttr);
- int saveFlag = sqlSessionTemplate.insert("shopServiceDaoImpl.saveBuyShopAttrInstance",businessBuyShopAttr);
+ int saveFlag = sqlSessionTemplate.insert("commentServiceDaoImpl.saveSubCommentAttrInstance",subCommentAttr);
if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨鍟嗗搧璐拱璁板綍灞炴�ф暟鎹け璐ワ細"+ JSONObject.toJSONString(businessBuyShopAttr));
+ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨璇勮灞炴�ф暟鎹け璐ワ細"+ JSONObject.toJSONString(subCommentAttr));
}
}
+
/**
- * 鏌ヨ鍟嗗搧淇℃伅锛坕nstance锛�
+ * 璇勮鏌ヨ锛坕nstance锛�
* @param info bId 淇℃伅
* @return
* @throws DAOException
*/
@Override
- public Map getShopInfo(Map info) throws DAOException {
- logger.debug("鏌ヨ鍟嗗搧淇℃伅 鍏ュ弬 info : {}",info);
+ public Map getComment(Map info) throws DAOException {
+ logger.debug("鏌ヨ璇勮淇℃伅 鍏ュ弬 info : {}",info);
- List<Map> businessShopInfos = sqlSessionTemplate.selectList("shopServiceDaoImpl.getShopInfo",info);
- if(businessShopInfos == null || businessShopInfos.size() == 0){
+ List<Map> comments = sqlSessionTemplate.selectList("commentServiceDaoImpl.getComment",info);
+ if(comments == null || comments.size() == 0){
return null;
}
- if(businessShopInfos.size() >1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"鏍规嵁鏉′欢鏌ヨ鏈夊鏉℃暟鎹�,鏁版嵁寮傚父锛岃妫�鏌ワ細getShopInfo锛�"+ JSONObject.toJSONString(info));
+ if(comments.size() >1){
+ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"鏍规嵁鏉′欢鏌ヨ鏈夊鏉℃暟鎹�,鏁版嵁寮傚父锛岃妫�鏌ワ細getShopCatalog锛�"+ JSONObject.toJSONString(info));
}
+ return comments.get(0);
+ }
- return businessShopInfos.get(0);
+ /**
+ * 璇勮鍐呭鏌ヨ锛坕nstance锛�
+ * @param info bId 淇℃伅
+ * @return
+ * @throws DAOException
+ */
+ @Override
+ public Map getSubComment(Map info) throws DAOException {
+ logger.debug("鏌ヨ璇勮淇℃伅 鍏ュ弬 info : {}",info);
+
+ List<Map> subComments = sqlSessionTemplate.selectList("commentServiceDaoImpl.getSubComment",info);
+ if(subComments == null || subComments.size() == 0){
+ return null;
+ }
+ return subComments.get(0);
+ }
+
+ /**
+ * 璇勮鍐呭鏌ヨ锛坕nstance锛�
+ * @param info bId 淇℃伅
+ * @return
+ * @throws DAOException
+ */
+ @Override
+ public List<Map> getSubComments(Map info) throws DAOException {
+ logger.debug("鏌ヨ璇勮淇℃伅 鍏ュ弬 info : {}",info);
+
+ List<Map> subComments = sqlSessionTemplate.selectList("commentServiceDaoImpl.getSubComment",info);
+
+ return subComments;
}
/**
@@ -424,264 +140,42 @@
* @throws DAOException
*/
@Override
- public List<Map> getShopAttrs(Map info) throws DAOException {
- logger.debug("鏌ヨ鍟嗗搧灞炴�т俊鎭� 鍏ュ弬 info : {}",info);
+ public List<Map> getSubCommentAttrs(Map info) throws DAOException {
+ logger.debug("鏌ヨ璇勮灞炴�т俊鎭� 鍏ュ弬 info : {}",info);
- List<Map> shopAttrs = sqlSessionTemplate.selectList("shopServiceDaoImpl.getShopAttrs",info);
+ List<Map> subCommentAttrs = sqlSessionTemplate.selectList("commentServiceDaoImpl.getSubCommentAttrs",info);
- return shopAttrs;
+ return subCommentAttrs;
}
-
/**
- * 鍟嗗搧灞炴�у弬鏁版煡璇紙instance锛�
- * @param info bId 淇℃伅
- * @return
- * @throws DAOException
- */
- @Override
- public List<Map> getShopAttrParams(Map info) throws DAOException {
- logger.debug("鏌ヨ鍟嗗搧灞炴�у弬鏁颁俊鎭� 鍏ュ弬 info : {}",info);
-
- List<Map> shopAttrParams = sqlSessionTemplate.selectList("shopServiceDaoImpl.getShopAttrParams",info);
-
- return shopAttrParams;
- }
-
- /**
- * 鍟嗗搧鐓х墖鏌ヨ锛坕nstance锛�
- * @param info bId 淇℃伅
- * @return
- * @throws DAOException
- */
- @Override
- public List<Map> getShopPhoto(Map info) throws DAOException {
- logger.debug("鏌ヨ鍟嗗搧鐓х墖淇℃伅 鍏ュ弬 info : {}",info);
-
- List<Map> shopPhotos = sqlSessionTemplate.selectList("shopServiceDaoImpl.getShopPhoto",info);
-
- return shopPhotos;
- }
-
- /**
- * 鍟嗗搧浼樻儬鏌ヨ锛坕nstance锛�
- * @param info bId 淇℃伅
- * @return
- * @throws DAOException
- */
- @Override
- public Map getShopPreferential(Map info) throws DAOException {
- logger.debug("鏌ヨ鍟嗗搧璇佷欢淇℃伅 鍏ュ弬 info : {}",info);
-
- List<Map> shopPreferentiales = sqlSessionTemplate.selectList("shopServiceDaoImpl.getShopPreferential",info);
- if(shopPreferentiales == null || shopPreferentiales.size() == 0){
- return null;
- }
- if(shopPreferentiales.size() >1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"鏍规嵁鏉′欢鏌ヨ鏈夊鏉℃暟鎹�,鏁版嵁寮傚父锛岃妫�鏌ワ細getShopInfo锛�"+ JSONObject.toJSONString(info));
- }
- return shopPreferentiales.get(0);
- }
-
- /**
- * 鍟嗗搧鎻忚堪鏌ヨ锛坕nstance锛�
- * @param info bId 淇℃伅
- * @return
- * @throws DAOException
- */
- @Override
- public Map getShopDesc(Map info) throws DAOException {
- logger.debug("鏌ヨ鍟嗗搧璇佷欢淇℃伅 鍏ュ弬 info : {}",info);
-
- List<Map> shopDesces = sqlSessionTemplate.selectList("shopServiceDaoImpl.getShopDesc",info);
- if(shopDesces == null || shopDesces.size() == 0){
- return null;
- }
- if(shopDesces.size() >1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"鏍规嵁鏉′欢鏌ヨ鏈夊鏉℃暟鎹�,鏁版嵁寮傚父锛岃妫�鏌ワ細getShopInfo锛�"+ JSONObject.toJSONString(info));
- }
- return shopDesces.get(0);
- }
-
- /**
- * 鍟嗗搧鐩綍鏌ヨ锛坕nstance锛�
- * @param info bId 淇℃伅
- * @return
- * @throws DAOException
- */
- @Override
- public Map getShopCatalog(Map info) throws DAOException {
- logger.debug("鏌ヨ鍟嗗搧鐩綍淇℃伅 鍏ュ弬 info : {}",info);
-
- List<Map> shopCatalogs = sqlSessionTemplate.selectList("shopServiceDaoImpl.getShopCatalog",info);
- if(shopCatalogs == null || shopCatalogs.size() == 0){
- return null;
- }
- if(shopCatalogs.size() >1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"鏍规嵁鏉′欢鏌ヨ鏈夊鏉℃暟鎹�,鏁版嵁寮傚父锛岃妫�鏌ワ細getShopCatalog锛�"+ JSONObject.toJSONString(info));
- }
- return shopCatalogs.get(0);
- }
-
- /**
- * 鍟嗗搧鎻忚堪鏌ヨ锛坕nstance锛�
- * @param info bId 淇℃伅
- * @return
- * @throws DAOException
- */
- @Override
- public Map getBuyShop(Map info) throws DAOException {
- logger.debug("鏌ヨ鍟嗗搧璐拱淇℃伅 鍏ュ弬 info : {}",info);
-
- List<Map> getBuyShops = sqlSessionTemplate.selectList("shopServiceDaoImpl.getBuyShop",info);
- if(getBuyShops == null || getBuyShops.size() == 0){
- return null;
- }
- if(getBuyShops.size() >1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"鏍规嵁鏉′欢鏌ヨ鏈夊鏉℃暟鎹�,鏁版嵁寮傚父锛岃妫�鏌ワ細getShopCatalog锛�"+ JSONObject.toJSONString(info));
- }
- return getBuyShops.get(0);
- }
-
- /**
- * 鍟嗗搧灞炴�ф煡璇紙instance锛�
- * @param info bId 淇℃伅
- * @return
- * @throws DAOException
- */
- @Override
- public List<Map> getBuyShopAttrs(Map info) throws DAOException {
- logger.debug("鏌ヨ鍟嗗搧璐拱灞炴�т俊鎭� 鍏ュ弬 info : {}",info);
-
- List<Map> buyShopAttrs = sqlSessionTemplate.selectList("shopServiceDaoImpl.getBuyShopAttrs",info);
-
- return buyShopAttrs;
- }
-
- /**
- * 淇敼鍟嗗搧淇℃伅
+ * 淇敼璇勮淇℃伅
* @param info 淇敼淇℃伅
* @throws DAOException
*/
@Override
- public void updateShopInfoInstance(Map info) throws DAOException {
- logger.debug("淇敼鍟嗗搧淇℃伅Instance 鍏ュ弬 info : {}",info);
+ public void updateCommentInstance(Map info) throws DAOException {
+ logger.debug("淇敼璇勮淇℃伅Instance 鍏ュ弬 info : {}",info);
- int saveFlag = sqlSessionTemplate.update("shopServiceDaoImpl.updateShopInfoInstance",info);
+ int saveFlag = sqlSessionTemplate.update("commentServiceDaoImpl.updateCommentInstance",info);
if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇敼鍟嗗搧淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
+ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇敼璇勮淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
}
}
/**
- * 淇敼鍟嗗搧灞炴�т俊鎭紙instance锛�
+ * 淇敼璇勮淇℃伅
* @param info 淇敼淇℃伅
* @throws DAOException
*/
@Override
- public void updateShopAttrInstance(Map info) throws DAOException {
- logger.debug("淇敼鍟嗗搧灞炴�т俊鎭疘nstance 鍏ュ弬 info : {}",info);
+ public void updateSubCommentInstance(Map info) throws DAOException {
+ logger.debug("淇敼璇勮淇℃伅Instance 鍏ュ弬 info : {}",info);
- int saveFlag = sqlSessionTemplate.update("shopServiceDaoImpl.updateShopAttrInstance",info);
+ int saveFlag = sqlSessionTemplate.update("commentServiceDaoImpl.updateSubCommentInstance",info);
if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇敼鍟嗗搧灞炴�т俊鎭疘nstance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
- }
- }
-
- /**
- * 淇敼鍟嗗搧灞炴�у弬鏁帮紙instance锛�
- * @param info 淇敼淇℃伅
- * @throws DAOException
- */
- @Override
- public void updateShopAttrParamInstance(Map info) throws DAOException {
- logger.debug("淇敼鍟嗗搧灞炴�у弬鏁颁俊鎭疘nstance 鍏ュ弬 info : {}",info);
-
- int saveFlag = sqlSessionTemplate.update("shopServiceDaoImpl.updateShopAttrParamInstance",info);
-
- if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇敼鍟嗗搧灞炴�у弬鏁颁俊鎭疘nstance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
- }
- }
-
- /**
- * 淇敼 鍟嗗搧鐓х墖淇℃伅
- * @param info 淇敼淇℃伅
- * @throws DAOException
- */
- @Override
- public void updateShopPhotoInstance(Map info) throws DAOException {
- logger.debug("淇敼鍟嗗搧鐓х墖淇℃伅Instance 鍏ュ弬 info : {}",info);
-
- int saveFlag = sqlSessionTemplate.update("shopServiceDaoImpl.updateShopPhotoInstance",info);
-
- if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇敼鍟嗗搧鐓х墖淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
- }
- }
-
- /**
- * 淇敼鍟嗗搧璇佷欢淇℃伅
- * @param info 淇敼淇℃伅
- * @throws DAOException
- */
- @Override
- public void updateShopPreferentialInstance(Map info) throws DAOException {
- logger.debug("淇敼鍟嗗搧璇佷欢淇℃伅Instance 鍏ュ弬 info : {}",info);
-
- int saveFlag = sqlSessionTemplate.update("shopServiceDaoImpl.updateShopPreferentialInstance",info);
-
- if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇敼鍟嗗搧璇佷欢淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
- }
- }
-
- /**
- * 淇敼鍟嗗搧鎻忚堪淇℃伅
- * @param info 淇敼淇℃伅
- * @throws DAOException
- */
- @Override
- public void updateShopDescInstance(Map info) throws DAOException {
- logger.debug("淇敼鍟嗗搧鎻忚堪淇℃伅Instance 鍏ュ弬 info : {}",info);
-
- int saveFlag = sqlSessionTemplate.update("shopServiceDaoImpl.updateShopDescInstance",info);
-
- if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇敼鍟嗗搧鎻忚堪淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
- }
- }
-
- /**
- * 淇敼鍟嗗搧鎻忚堪淇℃伅
- * @param info 淇敼淇℃伅
- * @throws DAOException
- */
- @Override
- public void updateShopCatalogInstance(Map info) throws DAOException {
- logger.debug("淇敼鍟嗗搧鐩綍淇℃伅Instance 鍏ュ弬 info : {}",info);
-
- int saveFlag = sqlSessionTemplate.update("shopServiceDaoImpl.updateShopCatalogInstance",info);
-
- if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇敼鍟嗗搧鐩綍淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
- }
- }
-
- /**
- * 淇敼鍟嗗搧璐拱淇℃伅
- * @param info 淇敼淇℃伅
- * @throws DAOException
- */
- @Override
- public void updateBuyShopInstance(Map info) throws DAOException {
- logger.debug("淇敼鍟嗗搧璐拱淇℃伅Instance 鍏ュ弬 info : {}",info);
-
- int saveFlag = sqlSessionTemplate.update("shopServiceDaoImpl.updateBuyShopInstance",info);
-
- if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇敼鍟嗗搧璐拱淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
+ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇敼璇勮淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
}
}
@@ -691,13 +185,77 @@
* @throws DAOException
*/
@Override
- public void updateBuyShopAttrInstance(Map info) throws DAOException {
- logger.debug("淇敼鍟嗗搧璐拱灞炴�т俊鎭疘nstance 鍏ュ弬 info : {}",info);
+ public void updateSubCommentAttrInstance(Map info) throws DAOException {
+ logger.debug("淇敼璇勪环灞炴�т俊鎭疘nstance 鍏ュ弬 info : {}",info);
- int saveFlag = sqlSessionTemplate.update("shopServiceDaoImpl.updateBuyShopAttrInstance",info);
+ int saveFlag = sqlSessionTemplate.update("commentServiceDaoImpl.updateSubCommentAttrInstance",info);
if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇敼鍟嗗搧璐拱灞炴�т俊鎭疘nstance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
+ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇敼璇勪环灞炴�т俊鎭疘nstance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
+ }
+ }
+
+ @Override
+ public void saveSubCommentPhotoInstance(Map subCommentPhoto) throws DAOException {
+ subCommentPhoto.put("month", DateUtil.getCurrentMonth());
+ logger.debug("淇濆瓨璇勮鐓х墖淇℃伅 鍏ュ弬 subCommentPhoto : {}",subCommentPhoto);
+
+ int saveFlag = sqlSessionTemplate.insert("commentServiceDaoImpl.saveSubCommentPhotoInstance",subCommentPhoto);
+
+ if(saveFlag < 1){
+ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨璇勮鐓х墖鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(subCommentPhoto));
+ }
+ }
+
+ @Override
+ public List<Map> getSubCommentPhotos(Map info) throws DAOException {
+ logger.debug("鏌ヨ璇勮鐓х墖淇℃伅 鍏ュ弬 info : {}",info);
+
+ List<Map> subCommentPhotos = sqlSessionTemplate.selectList("commentServiceDaoImpl.getSubCommentPhotos",info);
+
+ return subCommentPhotos;
+ }
+
+ @Override
+ public void updateSubCommentPhotoInstance(Map info) throws DAOException {
+ logger.debug("淇敼璇勪环鐓х墖淇℃伅Instance 鍏ュ弬 info : {}",info);
+
+ int saveFlag = sqlSessionTemplate.update("commentServiceDaoImpl.updateSubCommentPhotoInstance",info);
+
+ if(saveFlag < 1){
+ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇敼璇勪环鐓х墖淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
+ }
+ }
+
+ @Override
+ public void saveCommentScoreInstance(Map commentScore) throws DAOException {
+ commentScore.put("month", DateUtil.getCurrentMonth());
+ logger.debug("淇濆瓨璇勮鍒嗘暟淇℃伅 鍏ュ弬 subCommentScore : {}",commentScore);
+
+ int saveFlag = sqlSessionTemplate.insert("commentServiceDaoImpl.saveCommentScoreInstance",commentScore);
+
+ if(saveFlag < 1){
+ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨璇勮鍒嗘暟鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(commentScore));
+ }
+ }
+
+ @Override
+ public List<Map> getCommentScores(Map info) throws DAOException {
+ logger.debug("鏌ヨ璇勮鍒嗘暟淇℃伅 鍏ュ弬 info : {}",info);
+
+ List<Map> subCommentScores = sqlSessionTemplate.selectList("commentServiceDaoImpl.getCommentScores",info);
+
+ return subCommentScores;
+ }
+
+ @Override
+ public void updateCommentScoreInstance(Map info) throws DAOException {
+ logger.debug("淇敼璇勪环鍒嗘暟淇℃伅Instance 鍏ュ弬 info : {}",info);
+
+ int saveFlag = sqlSessionTemplate.update("commentServiceDaoImpl.updateCommentScoreInstance",info);
+
+ if(saveFlag < 1){
+ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇敼璇勪环鍒嗘暟淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
}
}
}
--
Gitblit v1.8.0