SysQueryVehicleUrlService.java 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package com.ydtech.modules.admin.service;
  2. import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  3. import com.baomidou.mybatisplus.extension.service.IService;
  4. import com.ydtech.modules.admin.model.po.SysQueryVehicleUrl;
  5. import com.ydtech.modules.admin.model.vo.SysQueryVehicleConfigSaveVo;
  6. import org.springframework.transaction.annotation.Transactional;
  7. import java.util.List;
  8. import java.util.stream.Collectors;
  9. /**
  10. * @author Administrator
  11. * @description 针对表【sys_query_vehicle_url(配置链接)】的数据库操作Service
  12. * @createDate 2024-08-16 10:20:52
  13. */
  14. public interface SysQueryVehicleUrlService extends IService<SysQueryVehicleUrl> {
  15. /**
  16. * 删除配置链接信息
  17. *
  18. * @param configId 配置id
  19. * @return 成功失败
  20. */
  21. default boolean deleteByConfigId(Integer configId) {
  22. LambdaQueryWrapper<SysQueryVehicleUrl> wrapper = new LambdaQueryWrapper<>();
  23. wrapper.eq(SysQueryVehicleUrl::getConfigId, configId);
  24. return remove(wrapper);
  25. }
  26. /**
  27. *
  28. * @param configId 配置id
  29. * @param sysQueryVehicleUrlDTOList 配置列表
  30. * @return
  31. */
  32. @Transactional
  33. default boolean saveVehicleUrlDTOs(Integer configId, List<SysQueryVehicleConfigSaveVo.SysQueryVehicleUrlDTO> sysQueryVehicleUrlDTOList){
  34. List<SysQueryVehicleUrl> sysQueryVehicleUrls = sysQueryVehicleUrlDTOList.stream()
  35. .map(x -> x.toSysQueryVehicleConfig(configId))
  36. .collect(Collectors.toList());
  37. return saveBatch(sysQueryVehicleUrls);
  38. }
  39. }