From 05683f2b2bdbdbe21cf17ad523c21ab338bd1c54 Mon Sep 17 00:00:00 2001
From: wuxw <928255095@qq.com>
Date: 星期二, 19 七月 2022 21:49:55 +0800
Subject: [PATCH] 优化添加设备 功能
---
service-user/src/main/java/com/java110/user/dao/impl/OwnerAttrServiceDaoImpl.java | 63 +++++++++++++++++++------------
1 files changed, 38 insertions(+), 25 deletions(-)
diff --git a/service-user/src/main/java/com/java110/user/dao/impl/OwnerAttrServiceDaoImpl.java b/service-user/src/main/java/com/java110/user/dao/impl/OwnerAttrServiceDaoImpl.java
old mode 100644
new mode 100755
index c0adeae..4595e9a
--- a/service-user/src/main/java/com/java110/user/dao/impl/OwnerAttrServiceDaoImpl.java
+++ b/service-user/src/main/java/com/java110/user/dao/impl/OwnerAttrServiceDaoImpl.java
@@ -1,15 +1,14 @@
package com.java110.user.dao.impl;
import com.alibaba.fastjson.JSONObject;
+import com.java110.core.base.dao.BaseServiceDao;
+import com.java110.user.dao.IOwnerAttrServiceDao;
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.user.dao.IOwnerAttrServiceDao;
import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import com.java110.core.log.LoggerFactory;
import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
@@ -26,6 +25,7 @@
/**
* 涓氫富灞炴�т俊鎭皝瑁�
+ *
* @param businessOwnerAttrInfo 涓氫富灞炴�т俊鎭� 灏佽
* @throws DAOException DAO寮傚父
*/
@@ -33,17 +33,18 @@
public void saveBusinessOwnerAttrInfo(Map businessOwnerAttrInfo) throws DAOException {
businessOwnerAttrInfo.put("month", DateUtil.getCurrentMonth());
// 鏌ヨbusiness_user 鏁版嵁鏄惁宸茬粡瀛樺湪
- logger.debug("淇濆瓨涓氫富灞炴�т俊鎭� 鍏ュ弬 businessOwnerAttrInfo : {}",businessOwnerAttrInfo);
- int saveFlag = sqlSessionTemplate.insert("ownerAttrServiceDaoImpl.saveBusinessOwnerAttrInfo",businessOwnerAttrInfo);
+ logger.debug("淇濆瓨涓氫富灞炴�т俊鎭� 鍏ュ弬 businessOwnerAttrInfo : {}", businessOwnerAttrInfo);
+ int saveFlag = sqlSessionTemplate.insert("ownerAttrServiceDaoImpl.saveBusinessOwnerAttrInfo", businessOwnerAttrInfo);
- if(saveFlag < 1){
- throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨涓氫富灞炴�ф暟鎹け璐ワ細"+ JSONObject.toJSONString(businessOwnerAttrInfo));
+ if (saveFlag < 1) {
+ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "淇濆瓨涓氫富灞炴�ф暟鎹け璐ワ細" + JSONObject.toJSONString(businessOwnerAttrInfo));
}
}
/**
* 鏌ヨ涓氫富灞炴�т俊鎭�
+ *
* @param info bId 淇℃伅
* @return 涓氫富灞炴�т俊鎭�
* @throws DAOException DAO寮傚父
@@ -51,43 +52,44 @@
@Override
public List<Map> getBusinessOwnerAttrInfo(Map info) throws DAOException {
- logger.debug("鏌ヨ涓氫富灞炴�т俊鎭� 鍏ュ弬 info : {}",info);
+ logger.debug("鏌ヨ涓氫富灞炴�т俊鎭� 鍏ュ弬 info : {}", info);
- List<Map> businessOwnerAttrInfos = sqlSessionTemplate.selectList("ownerAttrServiceDaoImpl.getBusinessOwnerAttrInfo",info);
+ List<Map> businessOwnerAttrInfos = sqlSessionTemplate.selectList("ownerAttrServiceDaoImpl.getBusinessOwnerAttrInfo", info);
return businessOwnerAttrInfos;
}
-
/**
* 淇濆瓨涓氫富灞炴�т俊鎭� 鍒� instance
- * @param info bId 淇℃伅
+ *
+ * @param info bId 淇℃伅
* @throws DAOException DAO寮傚父
*/
@Override
public void saveOwnerAttrInfoInstance(Map info) throws DAOException {
- logger.debug("淇濆瓨涓氫富灞炴�т俊鎭疘nstance 鍏ュ弬 info : {}",info);
+ logger.debug("淇濆瓨涓氫富灞炴�т俊鎭疘nstance 鍏ュ弬 info : {}", info);
- int saveFlag = sqlSessionTemplate.insert("ownerAttrServiceDaoImpl.saveOwnerAttrInfoInstance",info);
+ int saveFlag = sqlSessionTemplate.insert("ownerAttrServiceDaoImpl.saveOwnerAttrInfoInstance", 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));
}
}
/**
* 鏌ヨ涓氫富灞炴�т俊鎭紙instance锛�
+ *
* @param info bId 淇℃伅
* @return List<Map>
* @throws DAOException DAO寮傚父
*/
@Override
public List<Map> getOwnerAttrInfo(Map info) throws DAOException {
- logger.debug("鏌ヨ涓氫富灞炴�т俊鎭� 鍏ュ弬 info : {}",info);
+ logger.debug("鏌ヨ涓氫富灞炴�т俊鎭� 鍏ュ弬 info : {}", info);
- List<Map> businessOwnerAttrInfos = sqlSessionTemplate.selectList("ownerAttrServiceDaoImpl.getOwnerAttrInfo",info);
+ List<Map> businessOwnerAttrInfos = sqlSessionTemplate.selectList("ownerAttrServiceDaoImpl.getOwnerAttrInfo", info);
return businessOwnerAttrInfos;
}
@@ -95,28 +97,31 @@
/**
* 淇敼涓氫富灞炴�т俊鎭�
+ *
* @param info 淇敼淇℃伅
* @throws DAOException DAO寮傚父
*/
@Override
- public void updateOwnerAttrInfoInstance(Map info) throws DAOException {
- logger.debug("淇敼涓氫富灞炴�т俊鎭疘nstance 鍏ュ弬 info : {}",info);
+ public int updateOwnerAttrInfoInstance(Map info) throws DAOException {
+ logger.debug("淇敼涓氫富灞炴�т俊鎭疘nstance 鍏ュ弬 info : {}", info);
- int saveFlag = sqlSessionTemplate.update("ownerAttrServiceDaoImpl.updateOwnerAttrInfoInstance",info);
+ int saveFlag = sqlSessionTemplate.update("ownerAttrServiceDaoImpl.updateOwnerAttrInfoInstance", 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));
}
+ return saveFlag;
}
- /**
+ /**
* 鏌ヨ涓氫富灞炴�ф暟閲�
+ *
* @param info 涓氫富灞炴�т俊鎭�
* @return 涓氫富灞炴�ф暟閲�
*/
@Override
public int queryOwnerAttrsCount(Map info) {
- logger.debug("鏌ヨ涓氫富灞炴�ф暟鎹� 鍏ュ弬 info : {}",info);
+ logger.debug("鏌ヨ涓氫富灞炴�ф暟鎹� 鍏ュ弬 info : {}", info);
List<Map> businessOwnerAttrInfos = sqlSessionTemplate.selectList("ownerAttrServiceDaoImpl.queryOwnerAttrsCount", info);
if (businessOwnerAttrInfos.size() < 1) {
@@ -126,5 +131,13 @@
return Integer.parseInt(businessOwnerAttrInfos.get(0).get("count").toString());
}
+ @Override
+ public int saveOwnerAttr(Map beanCovertMap) {
+ logger.debug("淇濆瓨涓氫富灞炴�т俊鎭� 鍏ュ弬 info : {}", beanCovertMap);
+
+ int saveFlag = sqlSessionTemplate.insert("ownerAttrServiceDaoImpl.saveOwnerAttr", beanCovertMap);
+ return saveFlag;
+ }
+
}
--
Gitblit v1.8.0