| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- package com.goafanti.admin.service.impl;
- import java.util.HashMap;
- import java.util.Map;
- import org.apache.commons.lang3.StringUtils;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Service;
- import com.goafanti.core.mybatis.BaseMybatisDao;
- import com.goafanti.admin.service.CustomerService;
- import com.goafanti.common.dao.CustomerMapper;
- import com.goafanti.common.model.Customer;
- import com.goafanti.core.mybatis.page.Pagination;
- import com.goafanti.core.shiro.token.TokenManager;
- @Service
- public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implements CustomerService {
- @Autowired
- private CustomerMapper customerMapper ;
- @Override
- public int addCustomer(Customer cus) {
- int res = customerMapper.insertCustomer(cus);
- return res;
- }
-
-
- @Override
- public int deleteCustomer(String id) {
- int res = customerMapper.deleteByPrimaryKey(id);
- return res;
- }
-
-
- @SuppressWarnings("unchecked")
- @Override
- public Pagination<Customer> findCustomerByPage(String companyName ,Integer customerTyp ,String province ,String customerName ,String telNum ,
- String customerStatue ,String CompanyIntention ,String fllowSituation ,Integer pageNo, Integer pageSize) {
- return (Pagination<Customer>) findPage("findSearchCustomerListByPage", "findSearchCustomerCount",
- buildListParams(companyName, customerTyp, province, customerName, telNum, customerStatue, CompanyIntention,
- fllowSituation, TokenManager.getUserId()),
- pageNo, pageSize);
- }
-
-
- private Map<String, Object> buildListParams(String companyName, Integer customerTyp,String province,String customerName,String telNum,
- String customerStatue,String CompanyIntention,String fllowSituation,String aid) {
- Map<String, Object> params = new HashMap<>();
- if (null != companyName) {
- params.put("companyName", companyName);
- }
- if (null!=customerTyp) {
- params.put("customerTyp", customerTyp);
- }
- if (StringUtils.isNotBlank(province)) {
- params.put("province", province);
- }
- if (StringUtils.isNotBlank(customerName)) {
- params.put("customerName", customerName);
- }
- if (null!=customerStatue ) {
- params.put("customerStatue", customerStatue);
- }
- if (StringUtils.isNotBlank(CompanyIntention)) {
- params.put("CompanyIntention", CompanyIntention);
- }
- if (StringUtils.isNotBlank(fllowSituation)) {
- params.put("fllowSituation", fllowSituation);
- }
- if (StringUtils.isNotBlank(aid)) {
- params.put("aid", aid);
- }
-
- return params;
- }
-
- }
|