AgentInfoServiceImpl.java 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. package com.iamberry.wechat.service.agentInfo;
  2. import com.iamberry.wechat.core.entity.agentInfo.AgentConfig;
  3. import com.iamberry.wechat.core.entity.agentInfo.AgentTooth;
  4. import com.iamberry.wechat.face.agentInfo.AgentInfoService;
  5. import com.iamberry.wechat.service.mapper.AgentInfoMapper;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.stereotype.Service;
  8. import java.util.List;
  9. /**
  10. * Created by liuzhiwei on 2017/10/11.
  11. */
  12. @Service
  13. public class AgentInfoServiceImpl implements AgentInfoService {
  14. @Autowired
  15. private AgentInfoMapper agentInfoMapper;
  16. @Override
  17. public List<AgentConfig> listAgentConfig(AgentConfig config) {
  18. return agentInfoMapper.listAgentConfig(config);
  19. }
  20. @Override
  21. public Integer listAgentConfigCount(AgentConfig config) {
  22. int count = agentInfoMapper.listAgentConfigCount(config);
  23. return count = count % config.getPage().getPageSize() == 0? count/config.getPage().getPageSize():(count/config.getPage().getPageSize())+1;
  24. }
  25. @Override
  26. public List<AgentTooth> listAgentTooth(AgentTooth agentTooth) {
  27. return agentInfoMapper.listAgentTooth(agentTooth);
  28. }
  29. @Override
  30. public Integer addAgentConfigList(List<AgentConfig> list) {
  31. return agentInfoMapper.addAgentConfigList(list);
  32. }
  33. @Override
  34. public Integer updateAgentConfig(AgentConfig config) {
  35. return agentInfoMapper.updateAgentConfig(config);
  36. }
  37. @Override
  38. public AgentTooth getAgentTooth(AgentTooth agentTooth) {
  39. return agentInfoMapper.getAgentTooth(agentTooth);
  40. }
  41. @Override
  42. public AgentConfig getAgentConfig(AgentConfig config) {
  43. return agentInfoMapper.getAgentConfig(config);
  44. }
  45. @Override
  46. public Integer updateAgentTooth(AgentTooth agentTooth) {
  47. return agentInfoMapper.updateAgentTooth(agentTooth);
  48. }
  49. @Override
  50. public Integer updateAgentOpenId(AgentTooth agentTooth) {
  51. return agentInfoMapper.updateAgentOpenId(agentTooth);
  52. }
  53. @Override
  54. public List<AgentTooth> selectAllAgentinfo(AgentTooth agentTooth) {
  55. return agentInfoMapper.selectAllAgentinfo(agentTooth);
  56. }
  57. @Override
  58. public Integer selectAllAgentinfoCount(AgentTooth agentTooth) {
  59. int count = agentInfoMapper.selectAllAgentinfoCount(agentTooth);
  60. return count = count % agentTooth.getPage().getPageSize() == 0? count/agentTooth.getPage().getPageSize():(count/agentTooth.getPage().getPageSize())+1;
  61. }
  62. @Override
  63. public Integer addAgentinfo(AgentTooth agentTooth) {
  64. return agentInfoMapper.addAgentinfo(agentTooth);
  65. }
  66. }