lxw
2023-07-29 d1675cea759f0090c43860efabdeb9448d25c41d
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
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.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;
 
    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);
    }
}