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

import com.glsx.mapper.PlatformCustomerMapper;
import com.glsx.mapper.PlatformDeviceMapper;
import com.glsx.model.PlatformCustomer;
import com.glsx.service.CustomerMgrService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

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

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();
    }
}