IntegralRuleFeeV1ServiceDaoImpl.java 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /*
  2. * Copyright 2017-2020 吴学文 and java110 team.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package com.java110.acct.dao.impl;
  17. import com.alibaba.fastjson.JSONObject;
  18. import com.java110.utils.constant.ResponseConstant;
  19. import com.java110.utils.exception.DAOException;
  20. import com.java110.utils.util.DateUtil;
  21. import com.java110.core.base.dao.BaseServiceDao;
  22. import com.java110.acct.dao.IIntegralRuleFeeV1ServiceDao;
  23. import org.slf4j.Logger;
  24. import org.slf4j.LoggerFactory;
  25. import org.springframework.stereotype.Service;
  26. import org.springframework.transaction.annotation.Transactional;
  27. import java.util.List;
  28. import java.util.Map;
  29. /**
  30. * 类表述:
  31. * add by 吴学文 at 2022-12-11 22:15:21 mail: 928255095@qq.com
  32. * open source address: https://gitee.com/wuxw7/MicroCommunity
  33. * 官网:http://www.homecommunity.cn
  34. * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
  35. * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
  36. */
  37. @Service("integralRuleFeeV1ServiceDaoImpl")
  38. public class IntegralRuleFeeV1ServiceDaoImpl extends BaseServiceDao implements IIntegralRuleFeeV1ServiceDao {
  39. private static Logger logger = LoggerFactory.getLogger(IntegralRuleFeeV1ServiceDaoImpl.class);
  40. /**
  41. * 保存积分规则费用信息 到 instance
  42. * @param info bId 信息
  43. * @throws DAOException DAO异常
  44. */
  45. @Override
  46. public int saveIntegralRuleFeeInfo(Map info) throws DAOException {
  47. logger.debug("保存 saveIntegralRuleFeeInfo 入参 info : {}",info);
  48. int saveFlag = sqlSessionTemplate.insert("integralRuleFeeV1ServiceDaoImpl.saveIntegralRuleFeeInfo",info);
  49. return saveFlag;
  50. }
  51. /**
  52. * 查询积分规则费用信息(instance)
  53. * @param info bId 信息
  54. * @return List<Map>
  55. * @throws DAOException DAO异常
  56. */
  57. @Override
  58. public List<Map> getIntegralRuleFeeInfo(Map info) throws DAOException {
  59. logger.debug("查询 getIntegralRuleFeeInfo 入参 info : {}",info);
  60. List<Map> infos = sqlSessionTemplate.selectList("integralRuleFeeV1ServiceDaoImpl.getIntegralRuleFeeInfo",info);
  61. return infos;
  62. }
  63. /**
  64. * 修改积分规则费用信息
  65. * @param info 修改信息
  66. * @throws DAOException DAO异常
  67. */
  68. @Override
  69. public int updateIntegralRuleFeeInfo(Map info) throws DAOException {
  70. logger.debug("修改 updateIntegralRuleFeeInfo 入参 info : {}",info);
  71. int saveFlag = sqlSessionTemplate.update("integralRuleFeeV1ServiceDaoImpl.updateIntegralRuleFeeInfo",info);
  72. return saveFlag;
  73. }
  74. /**
  75. * 查询积分规则费用数量
  76. * @param info 积分规则费用信息
  77. * @return 积分规则费用数量
  78. */
  79. @Override
  80. public int queryIntegralRuleFeesCount(Map info) {
  81. logger.debug("查询 queryIntegralRuleFeesCount 入参 info : {}",info);
  82. List<Map> businessIntegralRuleFeeInfos = sqlSessionTemplate.selectList("integralRuleFeeV1ServiceDaoImpl.queryIntegralRuleFeesCount", info);
  83. if (businessIntegralRuleFeeInfos.size() < 1) {
  84. return 0;
  85. }
  86. return Integer.parseInt(businessIntegralRuleFeeInfos.get(0).get("count").toString());
  87. }
  88. }