liulingling.177216
2024-08-26 349f1cfc5fa77fbc636d542df0d8050fddec48c2
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
package com.dingzhuo.energy.basic.data.enerInfoManage.service.impl;
 
import java.util.List;
 
import com.dingzhuo.energy.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dingzhuo.energy.basic.data.enerInfoManage.mapper.SysProductMapper;
import com.dingzhuo.energy.basic.data.enerInfoManage.domain.SysProduct;
import com.dingzhuo.energy.basic.data.enerInfoManage.service.ISysProductService;
 
/**
 * 产品Service业务层处理
 *
 * @author sys
 * @date 2020-02-19
 */
@Service
public class SysProductServiceImpl implements ISysProductService
{
    @Autowired
    private SysProductMapper sysProductMapper;
 
    /**
     * 查询产品
     *
     * @param productid 产品ID
     * @return 产品
     */
    @Override
    public SysProduct selectSysProductById(Integer productid)
    {
        return sysProductMapper.selectSysProductById(productid);
    }
 
    /**
     * 查询产品列表
     *
     * @param sysProduct 产品
     * @return 产品
     */
    @Override
    public List<SysProduct> selectSysProductList(SysProduct sysProduct)
    {
        return sysProductMapper.selectSysProductList(sysProduct);
    }
 
    /**
     * 新增产品
     *
     * @param sysProduct 产品
     * @return 结果
     */
    @Override
    public int insertSysProduct(SysProduct sysProduct)
    {
        //获取当前登录人
        String nowMan = SecurityUtils.getUsername();
        sysProduct.setModMan(nowMan);
        sysProduct.setOprMan(nowMan);
        return sysProductMapper.insertSysProduct(sysProduct);
    }
 
    /**
     * 修改产品
     *
     * @param sysProduct 产品
     * @return 结果
     */
    @Override
    public int updateSysProduct(SysProduct sysProduct)
    {
        String nowMan = SecurityUtils.getUsername();
        sysProduct.setModMan(nowMan);
        return sysProductMapper.updateSysProduct(sysProduct);
    }
 
    /**
     * 批量删除产品
     *
     * @param productids 需要删除的产品ID
     * @return 结果
     */
    @Override
    public int deleteSysProductByIds(Integer[] productids)
    {
        return sysProductMapper.deleteSysProductByIds(productids);
    }
 
    /**
     * 删除产品信息
     *
     * @param productid 产品ID
     * @return 结果
     */
    @Override
    public int deleteSysProductById(Integer productid)
    {
        return sysProductMapper.deleteSysProductById(productid);
    }
 
 
    //校验no和name 唯一
    @Override
    public Integer selectCountByName(SysProduct sysProduct) {
        return sysProductMapper.selectCountByName(sysProduct);
    }
 
    @Override
    public Integer selectCountByNo(SysProduct sysProduct) {
        return sysProductMapper.selectCountByNo(sysProduct);
    }
 
    @Override
    public Integer selectIdByName(SysProduct sysProduct) {
        return sysProductMapper.selectIdByName(sysProduct);
    }
 
    @Override
    public Integer selectIdByNo(SysProduct sysProduct) {
        return sysProductMapper.selectIdByNo(sysProduct);
    }
}