package com.chushang.inspection.project.service.impl;

import com.chushang.inspection.project.service.InspectionDetailService;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chushang.inspection.project.po.InspectionDetail;
import com.chushang.inspection.project.mapper.InspectionDetailMapper;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
  * @auther: zhao
  * @date: 2024/6/18 15:39
  */
@Service
@CacheConfig(cacheNames = "inspection_config")
public class InspectionDetailServiceImpl extends ServiceImpl<InspectionDetailMapper, InspectionDetail> implements InspectionDetailService {

    @Override
    @CacheEvict(allEntries = true)
    public void saveEntity(InspectionDetail detail) {
        save(detail);
    }

    @Override
    @CacheEvict(allEntries = true)
    public void updateByEntityId(InspectionDetail detail) {
        updateById(detail);
    }

    @Override
    @CacheEvict(allEntries = true)
    @Transactional
    public void removeByEntityIds(List<Long> ids) {
        removeByIds(ids);
    }
}
