wangmengzhao
2023-12-01 cbdf1e550c73c90c01ec0c792eb7bfe96dcc910f
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
package com.ruoyi.iot.service.impl;
 
import com.ruoyi.iot.domain.DeviceOrderTime;
import com.ruoyi.iot.mapper.DeviceOrderTimeMapper;
import com.ruoyi.iot.service.IDeviceOrderTimeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import javax.annotation.Resource;
import java.util.List;
 
/**
 * @author wmz
 * @version v1.0
 * @ClassName DeviceOrderTimeServiceImpl
 * @description 设备订单超时业务层处理
 * @createTime 2023/11/30 14:52
 */
@Service
public class DeviceOrderTimeServiceImpl implements IDeviceOrderTimeService {
 
    @Resource
    private DeviceOrderTimeMapper deviceOrderTimeMapper;
 
    /**
     * 根据登录的联营商查询接单超时的时间间隔
     *
     * @param deviceOrderTime
     * @return
     * @throws Exception
     */
    @Override
    public List<DeviceOrderTime> selectReceiveTimeoutById(DeviceOrderTime deviceOrderTime) throws Exception {
        return deviceOrderTimeMapper.selectReceiveTimeoutById(deviceOrderTime);
    }
 
    /**
     * 根据登录的联营商查询接单完成的时间间隔
     *
     * @param deviceOrderTime
     * @return
     * @throws Exception
     */
    @Override
    public List<DeviceOrderTime> selectFinishTimeoutById(DeviceOrderTime deviceOrderTime) throws Exception {
        return deviceOrderTimeMapper.selectFinishTimeoutById(deviceOrderTime);
    }
 
    /**
     * 根据登录的用户id查询设备订单超时时间间隔信息
     *
     * @param id
     * @param orderType
     * @return
     * @throws Exception
     */
    @Override
    public DeviceOrderTime selectDeviceOrderTimeByUserId(int id, int orderType) throws Exception {
        return deviceOrderTimeMapper.selectDeviceOrderTimeByUserId(id, orderType);
    }
 
    public static void main(String[] args) throws Exception{
        IDeviceOrderTimeService iDeviceOrderTimeService = new DeviceOrderTimeServiceImpl();
        DeviceOrderTime deviceOrderTime = iDeviceOrderTimeService.selectDeviceOrderTimeByUserId(14, 1);
        System.out.println(deviceOrderTime);
    }
    /**
     * 初次登录的用户如果表中没有数据就添加数据
     *
     * @param deviceOrderTime
     * @return
     * @throws Exception
     */
    @Override
    public int insertDeviceOrderTimeout(DeviceOrderTime deviceOrderTime) throws Exception {
        return deviceOrderTimeMapper.insertDeviceOrderTimeout(deviceOrderTime);
    }
 
    /**
     * 根据登录的联营商输入的已接单超时时间间隔和已完成的超时时间间隔修改
     *
     * @param orderTime
     * @return
     * @throws Exception
     */
    @Override
    public int updateDeviceOrderTimeoutById(DeviceOrderTime orderTime) throws Exception {
        return deviceOrderTimeMapper.updateDeviceOrderTimeoutById(orderTime);
    }
}