package com.diagbot.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.diagbot.client.UserServiceClient;
import com.diagbot.dto.LantoneProductDTO;
import com.diagbot.dto.LantoneProductOrgDTO;
import com.diagbot.dto.ProductLineDTO;
import com.diagbot.entity.LantoneProduct;
import com.diagbot.mapper.LantoneProductMapper;
import com.diagbot.service.LantoneProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 朗通产品表 服务实现类
 * </p>
 *
 * @author gaodm
 * @since 2018-09-18
 */
@Service
public class LantoneProductServiceImpl extends ServiceImpl<LantoneProductMapper, LantoneProduct> implements LantoneProductService {
    @Autowired
    private UserServiceClient userServiceClient;

    /**
     * @Description: 显示朗通产品线
     * @Author: wangyu
     * @Date: 13:29 2018/9/18
     */
    @Override
    public List<ProductLineDTO> productLines() {
        return baseMapper.productLines();
    }

    /**
     * @Description: 显示朗通产品线
     * @Author: wangyu
     * @Date: 13:29 2018/9/18
     */
    @Override
    public List<ProductLineDTO> productLinesB() {
        return baseMapper.productLinesB();
    }

    /**
     * @Description: 查询朗通所有产品线
     * @Author: wangyu
     * @Date: 17:05 2018/9/18
     */
    @Override
    public IPage<LantoneProductDTO> selectProduct(Page<LantoneProduct> page, String name) {
        return baseMapper.selectProduct(page, name);
    }

    @Override
    public IPage<LantoneProduct> opendedProduct(Page page, Map map) {
        return baseMapper.opendedProduct(page, map);
    }

    @Override
    public List<LantoneProductOrgDTO> opendedProductByUserId(Long userId) {
        return baseMapper.opendedProductByUserId(userId);
    }

    @Override
    public LantoneProduct selectProductByName(String productName) {
        return baseMapper.selectProductByName(productName);
    }
}
