“linengliang”
2023-10-17 be5874cff6e319d9f9c7e84cd19f778b8fa3e93b
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
package org.jeecg.modules.eam.service.impl;
 
import org.jeecg.modules.eam.entity.EquipmentMaintenancePlan;
import org.jeecg.modules.eam.entity.MaintenanceStandardDetail;
import org.jeecg.modules.eam.mapper.EquipmentMaintenancePlanDetailMapper;
import org.jeecg.modules.eam.mapper.EquipmentMaintenancePlanMapper;
import org.jeecg.modules.eam.service.IEquipmentMaintenancePlanService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.io.Serializable;
import java.util.Collection;
import java.util.List;
 
/**
 * @Description: 保养计划
 * @Author: jeecg-boot
 * @Date:   2023-10-16
 * @Version: V1.0
 */
@Service
public class EquipmentMaintenancePlanServiceImpl extends ServiceImpl<EquipmentMaintenancePlanMapper, EquipmentMaintenancePlan> implements IEquipmentMaintenancePlanService {
 
    @Autowired
    private EquipmentMaintenancePlanMapper equipmentMaintenancePlanMapper;
    @Autowired
    private EquipmentMaintenancePlanDetailMapper equipmentMaintenancePlanDetailMapper;
 
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void delMain(String id) {
        equipmentMaintenancePlanDetailMapper.deleteByMainId(id);
        equipmentMaintenancePlanMapper.deleteById(id);
    }
 
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void delBatchMain(Collection<? extends Serializable> idList) {
        for(Serializable id:idList) {
            equipmentMaintenancePlanDetailMapper.deleteByMainId(id.toString());
            equipmentMaintenancePlanMapper.deleteById(id);
        }
    }
 
    @Override
    public List<MaintenanceStandardDetail> getCycle(String mainId, String type) {
        return baseMapper.getCycle(mainId,type);
    }
 
}