package cn.com.ctop.common.module.service.impl;

import cn.com.ctop.common.module.entity.Product;
import cn.com.ctop.common.module.mapper.ProductMapper;
import cn.com.ctop.common.module.service.IProductService;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

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

/**
 * 产品表
 *
 * @author jeecg-boot
 * @version V1.0
 * @date 2020-09-08
 */
@Service
public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> implements IProductService {
    @Autowired
    private ProductMapper productMapper;

    @Override
    public String getUserNameByUserId(String userId) {
        return productMapper.getUserNameByUserId(userId);
    }

    @Override
    public List<JSONObject> getProductByMap(Map<Long, Long> productIdMap) {
        return productMapper.getProductByMap(productIdMap);
    }
    @Override
    public IPage<Product> getUserProductList(Page<Product> page, String userId, String productName){
        return productMapper.getUserProductList(page,userId,productName);
    }
}
