AccountWithdrawalApplyServiceDaoImpl.java 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. package com.java110.acct.dao.impl;
  2. import com.alibaba.fastjson.JSONObject;
  3. import com.java110.utils.constant.ResponseConstant;
  4. import com.java110.utils.exception.DAOException;
  5. import com.java110.utils.util.DateUtil;
  6. import com.java110.core.base.dao.BaseServiceDao;
  7. import com.java110.acct.dao.IAccountWithdrawalApplyServiceDao;
  8. import org.slf4j.Logger;
  9. import org.slf4j.LoggerFactory;
  10. import org.springframework.stereotype.Service;
  11. import org.springframework.transaction.annotation.Transactional;
  12. import java.util.List;
  13. import java.util.Map;
  14. /**
  15. * 账户提现服务 与数据库交互
  16. * Created by wuxw on 2017/4/5.
  17. */
  18. @Service("accountWithdrawalApplyServiceDaoImpl")
  19. //@Transactional
  20. public class AccountWithdrawalApplyServiceDaoImpl extends BaseServiceDao implements IAccountWithdrawalApplyServiceDao {
  21. private static Logger logger = LoggerFactory.getLogger(AccountWithdrawalApplyServiceDaoImpl.class);
  22. /**
  23. * 保存账户提现信息 到 instance
  24. * @param info bId 信息
  25. * @throws DAOException DAO异常
  26. */
  27. @Override
  28. public void saveAccountWithdrawalApplyInfo(Map info) throws DAOException {
  29. logger.debug("保存账户提现信息Instance 入参 info : {}",info);
  30. int saveFlag = sqlSessionTemplate.insert("accountWithdrawalApplyServiceDaoImpl.saveAccountWithdrawalApplyInfo",info);
  31. if(saveFlag < 1){
  32. throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存账户提现信息Instance数据失败:"+ JSONObject.toJSONString(info));
  33. }
  34. }
  35. /**
  36. * 查询账户提现信息(instance)
  37. * @param info bId 信息
  38. * @return List<Map>
  39. * @throws DAOException DAO异常
  40. */
  41. @Override
  42. public List<Map> getAccountWithdrawalApplyInfo(Map info) throws DAOException {
  43. logger.debug("查询账户提现信息 入参 info : {}",info);
  44. List<Map> businessAccountWithdrawalApplyInfos = sqlSessionTemplate.selectList("accountWithdrawalApplyServiceDaoImpl.getAccountWithdrawalApplyInfo",info);
  45. return businessAccountWithdrawalApplyInfos;
  46. }
  47. /**
  48. * 修改账户提现信息
  49. * @param info 修改信息
  50. * @throws DAOException DAO异常
  51. */
  52. @Override
  53. public void updateAccountWithdrawalApplyInfo(Map info) throws DAOException {
  54. logger.debug("修改账户提现信息Instance 入参 info : {}",info);
  55. int saveFlag = sqlSessionTemplate.update("accountWithdrawalApplyServiceDaoImpl.updateAccountWithdrawalApplyInfo",info);
  56. if(saveFlag < 1){
  57. throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改账户提现信息Instance数据失败:"+ JSONObject.toJSONString(info));
  58. }
  59. }
  60. /**
  61. * 查询账户提现数量
  62. * @param info 账户提现信息
  63. * @return 账户提现数量
  64. */
  65. @Override
  66. public int queryAccountWithdrawalApplysCount(Map info) {
  67. logger.debug("查询账户提现数据 入参 info : {}",info);
  68. List<Map> businessAccountWithdrawalApplyInfos = sqlSessionTemplate.selectList("accountWithdrawalApplyServiceDaoImpl.queryAccountWithdrawalApplysCount", info);
  69. if (businessAccountWithdrawalApplyInfos.size() < 1) {
  70. return 0;
  71. }
  72. return Integer.parseInt(businessAccountWithdrawalApplyInfos.get(0).get("count").toString());
  73. }
  74. /**
  75. * 查询账户提现信息(instance)
  76. * @param info bId 信息
  77. * @return List<Map>
  78. * @throws DAOException DAO异常
  79. */
  80. @Override
  81. public List<Map> listStateWithdrawalApplys(Map info) throws DAOException {
  82. logger.debug("查询账户提现信息 入参 info : {}",info);
  83. List<Map> businessAccountWithdrawalApplyInfos = sqlSessionTemplate.selectList("accountWithdrawalApplyServiceDaoImpl.listStateWithdrawalApplys",info);
  84. return businessAccountWithdrawalApplyInfos;
  85. }
  86. /**
  87. * 查询账户提现数量
  88. * @param info 账户提现信息
  89. * @return 账户提现数量
  90. */
  91. @Override
  92. public int listStateWithdrawalApplysCount(Map info) {
  93. logger.debug("查询账户提现数据 入参 info : {}",info);
  94. List<Map> businessAccountWithdrawalApplyInfos = sqlSessionTemplate.selectList("accountWithdrawalApplyServiceDaoImpl.listStateWithdrawalApplysCount", info);
  95. if (businessAccountWithdrawalApplyInfos.size() < 1) {
  96. return 0;
  97. }
  98. return Integer.parseInt(businessAccountWithdrawalApplyInfos.get(0).get("count").toString());
  99. }
  100. }