guoyuji
2024-01-30 f20b176a682080c7358578d11d1176aa88bb4efc
north-glass-erp/src/main/java/com/example/erp/service/sd/ProductService.java
@@ -6,14 +6,26 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
@DS("erp_sd")
@DS("sd")
public class ProductService {
    @Autowired
    ProductMapper productMapper;
    public List<Product> defaultDateProduct() {
        return productMapper.defaultProduct();
    public Map<String,Object> defaultDateProduct(Integer pageNum, Integer pageSize, List<String> glassType, Product product) {
        Integer offset = (pageNum-1)*pageSize;
        String glassTypeId = null;
        if(glassType.size()>1){
            glassTypeId = glassType.get(1);
        }
        Map<String,Object> map = new HashMap<>();
        map.put("data",productMapper.defaultProduct(offset,pageSize,glassTypeId,product));
        map.put("total",productMapper.getPageTotal(offset,pageSize,glassTypeId,product));
        return map;
    }
}