VisitingCustomersServiceImpl.java 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. package com.kede.visitingCustomers.service.impl;
  2. import java.util.HashMap;
  3. import java.util.Map;
  4. import org.springframework.beans.factory.annotation.Autowired;
  5. import org.springframework.stereotype.Service;
  6. import com.kede.common.dao.VisitingCustomersMapper;
  7. import com.kede.common.model.VisitingCustomers;
  8. import com.kede.core.mybatis.BaseMybatisDao;
  9. import com.kede.core.mybatis.page.Pagination;
  10. import com.kede.recruitment.bo.OutRecruitment;
  11. import com.kede.visitingCustomers.bo.InputVisitingCustomers;
  12. import com.kede.visitingCustomers.bo.OutVisitingCustomers;
  13. import com.kede.visitingCustomers.service.VisitingCustomersService;
  14. @Service
  15. public class VisitingCustomersServiceImpl extends BaseMybatisDao<VisitingCustomersMapper> implements VisitingCustomersService {
  16. @Autowired
  17. private VisitingCustomersMapper visitingCustomersMapper;
  18. @Override
  19. public int addVisitingCustomers(VisitingCustomers vc) {
  20. return visitingCustomersMapper.insertSelective(vc);
  21. }
  22. @Override
  23. public int updateVisitingCustomers(VisitingCustomers vc) {
  24. VisitingCustomers v=new VisitingCustomers();
  25. v.setId(vc.getId());
  26. v.setStatus(vc.getStatus());
  27. v.setRemark(vc.getRemark());
  28. return visitingCustomersMapper.updateByPrimaryKeySelective(v);
  29. }
  30. @Override
  31. public int deleteVisitingCustomers(Integer id) {
  32. return visitingCustomersMapper.deleteByPrimaryKey(id);
  33. }
  34. @SuppressWarnings("unchecked")
  35. @Override
  36. public Pagination<OutVisitingCustomers> listVisitingCustomers(InputVisitingCustomers vc) {
  37. Map<String, Object> params=new HashMap<>();
  38. params.put("startTime", vc.getStartTime());
  39. params.put("endTime", vc.getEndTime()+" 23:59:59");
  40. params.put("name", vc.getName());
  41. return (Pagination<OutVisitingCustomers>) findPage("findVisitingCustomersList", "findVisitingCustomersCount", params, vc.getPageNo(), vc.getPageSize());
  42. }
  43. }