CustomerInfoBasicService.java 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. package com.ygj.yuemum.service.customer;
  2. import com.github.pagehelper.PageHelper;
  3. import com.ygj.yuemum.dao.customer.CustomerInfoBasicDao;
  4. import com.ygj.yuemum.domain.customer.CustomerInfoBasic;
  5. import com.ygj.yuemum.domain.customer.dto.CustomerInfoBasicDto;
  6. import org.springframework.stereotype.Service;
  7. import javax.annotation.Resource;
  8. import java.util.HashMap;
  9. import java.util.List;
  10. import java.util.Map;
  11. /**
  12. * customer_info_basic
  13. * @author zrz
  14. * @date 2020/06/17
  15. */
  16. @Service
  17. public class CustomerInfoBasicService {
  18. @Resource
  19. private CustomerInfoBasicDao customerInfoBasicDao;
  20. public int insert(CustomerInfoBasic customerInfoBasic) {
  21. return customerInfoBasicDao.insert(customerInfoBasic);
  22. }
  23. public int delete(int id) {
  24. int ret = customerInfoBasicDao.delete(id);
  25. return ret;
  26. }
  27. public int update(CustomerInfoBasic customerInfoBasic) {
  28. int ret = customerInfoBasicDao.update(customerInfoBasic);
  29. return ret;
  30. }
  31. public CustomerInfoBasic load(int id) {
  32. return customerInfoBasicDao.load(id);
  33. }
  34. public Map<String,Object> pageList(int offset, int pagesize) {
  35. List<CustomerInfoBasic> pageList = customerInfoBasicDao.pageList(offset, pagesize);
  36. int totalCount = customerInfoBasicDao.pageListCount(offset, pagesize);
  37. // result
  38. Map<String, Object> result = new HashMap<String, Object>();
  39. result.put("pageList", pageList);
  40. result.put("totalCount", totalCount);
  41. return result;
  42. }
  43. public List<CustomerInfoBasic> selectByPageNumSize(CustomerInfoBasicDto customerInfoBasic) {
  44. PageHelper.startPage(customerInfoBasic.getPage(), customerInfoBasic.getLimit());
  45. return customerInfoBasicDao.selectByPageNumSize(customerInfoBasic);
  46. }
  47. }