VVT789
2025-03-17 78484feacbdc86a09560c7939a6158eb908c674c
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
package com.zhitan.productoutput.services.impl;
 
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhitan.common.utils.DateUtils;
import com.zhitan.common.utils.StringUtils;
import com.zhitan.productoutput.domain.ProductOutput;
import com.zhitan.productoutput.mapper.ProductOutputMapper;
import com.zhitan.productoutput.services.IProductOutputService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.List;
 
/**
 * 产品产量Service业务层处理
 *
 * @author ZhiTan
 * @date 2024-10-08
 */
@Service
public class ProductOutputServiceImpl extends ServiceImpl<ProductOutputMapper, ProductOutput> implements IProductOutputService {
    @Autowired
    private ProductOutputMapper productOutputMapper;
 
    /**
     * 查询产品产量
     *
     * @param nodeId 产品产量主键
     * @return 产品产量
     */
    @Override
    public ProductOutput selectProductOutputById(String nodeId) {
        return productOutputMapper.selectProductOutputById(nodeId);
    }
 
    /**
     * 查询产品产量列表
     *
     * @param productOutput 产品产量
     * @return 产品产量
     */
    @Override
    public List<ProductOutput> selectProductOutputList(ProductOutput productOutput) {
        return productOutputMapper.selectProductOutputList(productOutput);
    }
 
    /**
     * 新增产品产量
     *
     * @param productOutput 产品产量
     * @return 结果
     */
    @Override
    public int insertProductOutput(ProductOutput productOutput) {
        productOutput.setCreateTime(DateUtils.getNowDate());
        return productOutputMapper.insertProductOutput(productOutput);
    }
 
    /**
     * 修改产品产量
     *
     * @param productOutput 产品产量
     * @return 结果
     */
    @Override
    public int updateProductOutput(ProductOutput productOutput) {
                productOutput.setUpdateTime(DateUtils.getNowDate());
        return productOutputMapper.updateProductOutput(productOutput);
    }
 
    /**
     * 批量删除产品产量
     *
     * @param nodeIds 需要删除的产品产量主键
     * @return 结果
     */
    @Override
    public int deleteProductOutputByIds(String[] nodeIds) {
        return productOutputMapper.deleteProductOutputByIds(nodeIds);
    }
 
    /**
     * 删除产品产量信息
     *
     * @param nodeId 产品产量主键
     * @return 结果
     */
    @Override
    public int deleteProductOutputById(String nodeId) {
        return productOutputMapper.deleteProductOutputById(nodeId);
    }
 
    @Override
    public Page<ProductOutput> selectProductOutputPage(ProductOutput productOutput, Long pageNum, Long pageSize) {
        LambdaQueryWrapper<ProductOutput> wrapper = new LambdaQueryWrapper<>();
        wrapper.like(StringUtils.isNotEmpty(productOutput.getName()),ProductOutput::getName,productOutput.getName());
        wrapper.between(StringUtils.isNotEmpty(productOutput.getBeginTime()),ProductOutput::getDataTime,productOutput.getBeginTime(),productOutput.getEndTime());
        wrapper.eq(StringUtils.isNotEmpty(productOutput.getDataType()),ProductOutput::getDataType,productOutput.getDataType());
        wrapper.like(StringUtils.isNotEmpty(productOutput.getDataTime()),ProductOutput::getDataTime,productOutput.getDataTime());
        wrapper.eq(StringUtils.isNotEmpty(productOutput.getProductType()),ProductOutput::getProductType,productOutput.getProductType());
        wrapper.eq(StringUtils.isNotEmpty(productOutput.getNodeId()),ProductOutput::getNodeId,productOutput.getNodeId());
        wrapper.eq(StringUtils.isNotEmpty(productOutput.getTimeType()),ProductOutput::getTimeType,productOutput.getTimeType());
        wrapper.orderByDesc(ProductOutput::getCreateTime);
        Page<ProductOutput> page = productOutputMapper.selectPage(new Page<ProductOutput>(pageNum, pageSize), wrapper);
        return page;
    }
}