From 3f07ab2e03e501ae55d1d1b0d031daf50c8e13e5 Mon Sep 17 00:00:00 2001 From: dongyukun <1208714201@qq.com> Date: 星期二, 10 十二月 2024 17:27:44 +0800 Subject: [PATCH] common依赖排除父类 --- iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/coalquality/modules/detection/service/impl/QualityQuickItemServiceImpl.java | 77 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 77 insertions(+), 0 deletions(-) diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/coalquality/modules/detection/service/impl/QualityQuickItemServiceImpl.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/coalquality/modules/detection/service/impl/QualityQuickItemServiceImpl.java new file mode 100644 index 0000000..78326c2 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/coalquality/modules/detection/service/impl/QualityQuickItemServiceImpl.java @@ -0,0 +1,77 @@ +package com.iailab.module.pms.coalquality.modules.detection.service.impl; + + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.iailab.framework.common.service.impl.BaseServiceImpl; +import com.iailab.framework.common.util.object.ConvertUtils; +import com.iailab.module.pms.coalquality.modules.detection.dao.QualityQuickItemDao; +import com.iailab.module.pms.coalquality.modules.detection.dto.QualityQuickItemDTO; +import com.iailab.module.pms.coalquality.modules.detection.entity.QualityQuickItemEntity; +import com.iailab.module.pms.coalquality.modules.detection.service.QualityQuickItemService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * @author DongYukun + * @Description + * @createTime 2023年12月27日 9:53:00 + */ +@Slf4j +@Service +public class QualityQuickItemServiceImpl extends BaseServiceImpl<QualityQuickItemDao, QualityQuickItemEntity> + implements QualityQuickItemService { + + @Override + public QualityQuickItemDTO get(String id) { + QualityQuickItemEntity entity = baseDao.selectById(id); + + return ConvertUtils.sourceToTarget(entity, QualityQuickItemDTO.class); + } + + @Override + public void save(QualityQuickItemDTO dto) { + QualityQuickItemEntity entity = ConvertUtils.sourceToTarget(dto, QualityQuickItemEntity.class); + insert(entity); + } + + @Override + public void update(QualityQuickItemDTO dto) { + QualityQuickItemEntity entity = ConvertUtils.sourceToTarget(dto, QualityQuickItemEntity.class); + + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public List<QualityQuickItemDTO> queryList(Map<String, Object> params) { + List<QualityQuickItemEntity> list = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(list, QualityQuickItemDTO.class); + } + + @Override + public void deleteByLsh(String lsh) { + baseDao.deleteByLsh(lsh); + } + + private QueryWrapper<QualityQuickItemEntity> getWrapper(Map<String, Object> params) { + String lsh = (String) params.get("lsh"); + + QueryWrapper<QualityQuickItemEntity> wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(lsh), "lsh", lsh).orderByAsc("lsh"); + + return wrapper; + } + +} -- Gitblit v1.9.3