nnnjjj123
2021-01-28 71b6b716361c52af290493d365a328fc1a3467e2
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
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.equipment.service.impl;
 
import com.baomidou.dynamic.datasource.annotation.DS;
import org.springblade.common.cache.SysCache;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.node.ForestNodeMerger;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringPool;
import org.springblade.modules.equipment.entity.Equipment;
import org.springblade.modules.equipment.vo.EquipmentVO;
import org.springblade.modules.equipment.mapper.EquipmentMapper;
import org.springblade.modules.equipment.service.IEquipmentService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.modules.equipment.vo.EquipmentVOS;
import org.springblade.modules.system.entity.Dept;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
 
import java.util.List;
import java.util.Map;
 
/**
 *  服务实现类
 *
 * @author BladeX
 * @since 2020-07-01
 */
@Service
@DS("slaves")
public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment> implements IEquipmentService {
    private static final String PARENT_ID = "parentId";
 
    @Override
    public List<EquipmentVO> selectEquipmentPage(String deviceName, String addvcd, String dtype, String devicestate) {
        return baseMapper.selectEquipmentPage(deviceName,addvcd,dtype,devicestate);
    }
 
 
 
    @Override
    public List<EquipmentVOS> tree() {
        return ForestNodeMerger.merge(baseMapper.tree());
    }
 
    @Override
    public void updateOne(Equipment equipment) {
        baseMapper.updateOne(equipment);
    }
 
    @Override
    public void updateClinent(Equipment equipment) {
        baseMapper.updateClinent(equipment);
    }
 
    @Override
    public void s(Equipment equipment) {
        baseMapper.s(equipment);
    }
 
    @Override
    public void updataType(String arr) {
        baseMapper.updataType(arr);
    }
 
    @Override
    public void updataTypeC(String arr) {
        baseMapper.updataTypeC(arr);
    }
 
    @Override
    public List<EquipmentVOS> lazyList(Long parentId, Map<String, Object> param) {
        // 判断点击搜索但是没有查询条件的情况
        if (Func.isEmpty(param.get(PARENT_ID)) && param.size() == 1) {
            parentId = 0L;
        }
        // 判断点击搜索带有查询条件的情况
        if (Func.isEmpty(param.get(PARENT_ID)) && param.size() > 1 && Func.toLong(parentId) == 0L) {
            parentId = null;
        }
        return baseMapper.lazyList(parentId, param);
    }
 
    @Override
    public EquipmentVOS selectInfo(Equipment equipment) {
        return baseMapper.selectInfo(equipment);
    }
 
    @Override
    public List<Map<String, Object>>  selectInfos(String deviceNumber) {
        return baseMapper.selectInfos(deviceNumber);
    }
 
    @Override
    public List<EquipmentVOS> selectList(String deviceType) {
        return baseMapper.selectList(deviceType);
    }
 
    @Override
    public void updateChannel(String heartbeat, String deviceNumber) {
        baseMapper.updateChannel(heartbeat, deviceNumber);
    }
 
}