fg电池监控平台的达梦数据库版本
whycxzp
2024-11-12 92ba7a968c67e8c8a64efea1759929649189f390
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
package com.whyc.service;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.whyc.mapper.FBOTestDataInfMapper;
import com.whyc.mapper.FBOTestDataMapper;
import com.whyc.pojo.FBOTestDataInf;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
 
import javax.annotation.Resource;
import java.sql.Wrapper;
import java.util.List;
 
@Service
public class FBOTestDataInfService {
 
    @Resource
    private FBOTestDataInfMapper mapper;
 
    @Resource
    private FBOTestDataInfMapper dataInfMapper;
 
    @Resource
    private FBOTestDataMapper dataMapper;
 
    @Autowired
    private SubTablePageInfoService subService;
 
    public List<FBOTestDataInf> getList(Integer battGroupId) {
        QueryWrapper<FBOTestDataInf> wrapper = Wrappers.query();
        wrapper.eq("BattGroupId",battGroupId).orderByAsc("test_starttime");
        return mapper.selectList(wrapper);
    }
 
    @Transactional
    public void delete(Integer battGroupId, Integer testRecordCount) {
        //删除testdata_inf数据
        UpdateWrapper<FBOTestDataInf> wrapper = Wrappers.update();
        wrapper.eq("BattGroupId",battGroupId).eq("test_record_count",testRecordCount);
        dataInfMapper.delete(wrapper);
        //删除data表数据
        //dataMapper.delete(battGroupId,testRecordCount);
        subService.delete(battGroupId,testRecordCount);
    }
}