package com.kede.visitingCustomers.service.impl; import java.util.HashMap; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.kede.common.dao.VisitingCustomersMapper; import com.kede.common.model.VisitingCustomers; import com.kede.core.mybatis.BaseMybatisDao; import com.kede.core.mybatis.page.Pagination; import com.kede.recruitment.bo.OutRecruitment; import com.kede.visitingCustomers.bo.InputVisitingCustomers; import com.kede.visitingCustomers.bo.OutVisitingCustomers; import com.kede.visitingCustomers.service.VisitingCustomersService; @Service public class VisitingCustomersServiceImpl extends BaseMybatisDao implements VisitingCustomersService { @Autowired private VisitingCustomersMapper visitingCustomersMapper; @Override public int addVisitingCustomers(VisitingCustomers vc) { return visitingCustomersMapper.insertSelective(vc); } @Override public int updateVisitingCustomers(VisitingCustomers vc) { VisitingCustomers v=new VisitingCustomers(); v.setId(vc.getId()); v.setStatus(vc.getStatus()); v.setRemark(vc.getRemark()); return visitingCustomersMapper.updateByPrimaryKeySelective(v); } @Override public int deleteVisitingCustomers(Integer id) { return visitingCustomersMapper.deleteByPrimaryKey(id); } @SuppressWarnings("unchecked") @Override public Pagination listVisitingCustomers(InputVisitingCustomers vc) { Map params=new HashMap<>(); params.put("startTime", vc.getStartTime()); params.put("endTime", vc.getEndTime()+" 23:59:59"); params.put("name", vc.getName()); return (Pagination) findPage("findVisitingCustomersList", "findVisitingCustomersCount", params, vc.getPageNo(), vc.getPageSize()); } }