XiaoRuby
2023-08-17 95bd45377f1e04b448d407e3af4ee2707b90a24b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package com.yuanchu.mom.service.impl;
 
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yuanchu.mom.pojo.Product;
import com.yuanchu.mom.pojo.dto.ProductDto;
import com.yuanchu.mom.service.ProductService;
import com.yuanchu.mom.mapper.ProductMapper;
import org.springframework.stereotype.Service;
 
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
 
/**
* @author Administrator
* @description 针对表【product】的数据库操作Service实现
* @createDate 2023-07-26 16:00:44
*/
@Service
public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> implements ProductService{
 
    @Resource
    private ProductMapper productMapper;
 
    @Override
    public List<ProductDto> selectTreeProduct(String specifications, String project) {
        return productMapper.selectTreeProduct(specifications, project);
    }
 
    @Override
    public List<Map<String, Object>> selectProductList(Integer specificationsId) {
        LambdaQueryWrapper<Product> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(Product::getSpecificationsId, specificationsId);
        wrapper.select(Product::getName, Product::getFather, Product::getRequired, Product::getInternal, Product::getUnit);
        return productMapper.selectMaps(wrapper);
    }
}