CustomerMgrServiceImpl.java 1.56 KB
package com.glsx.service.impl;

import com.glsx.mapper.PlatformCustomerMapper;
import com.glsx.model.PlatformCustomer;
import com.glsx.service.CustomerMgrService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CustomerMgrServiceImpl implements CustomerMgrService {
    /**
     * 日志
     */
    private final static Logger LOGGER = LoggerFactory.getLogger(CustomerMgrServiceImpl.class);

    @Resource
    private PlatformCustomerMapper customerMapper;

    @Override
    public List<PlatformCustomer> getCustomerMgrList() {
        return customerMapper.getCustomerMgrList();
    }

    @Override
    public int reset(int id) {
        PlatformCustomer customer = new PlatformCustomer();
        customer.setId(id);
        customer.setPassword("12345678");
        return customerMapper.updateByPrimaryKeySelective(customer);
    }

    @Override
    public int startAndStop(int id, int status) {
        PlatformCustomer customer = new PlatformCustomer();
        customer.setId(id);
        customer.setStatus(status);
        return customerMapper.updateByPrimaryKeySelective(customer);
    }

    @Override
    public int getCustomerCount() {
        return customerMapper.getCustomerCount();
    }

    @Override
    public int register(PlatformCustomer customer) {
        return customerMapper.insertSelective(customer);
    }

    @Override
    public int login(PlatformCustomer customer) {
        return customerMapper.login(customer);
    }
}