From e0b86ecb9040b56bad93356263805baff76442b4 Mon Sep 17 00:00:00 2001 From: 潘志宝 <979469083@qq.com> Date: 星期五, 29 十一月 2024 17:24:30 +0800 Subject: [PATCH] Timestamp --- iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/impl/DaCumulatePointServiceImpl.java | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 55 insertions(+), 0 deletions(-) diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/impl/DaCumulatePointServiceImpl.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/impl/DaCumulatePointServiceImpl.java new file mode 100644 index 0000000..baf5e69 --- /dev/null +++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/impl/DaCumulatePointServiceImpl.java @@ -0,0 +1,55 @@ +package com.iailab.module.data.point.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.data.point.dao.DaCumulatePointDao; +import com.iailab.module.data.point.dto.DaCumulatePointDTO; +import com.iailab.module.data.point.entity.DaCumulatePointEntity; +import com.iailab.module.data.point.service.DaCumulatePointService; +import org.springframework.stereotype.Service; + +import java.util.Arrays; + +/** + * @author PanZhibao + * @Description + * @createTime 2024年11月28日 + */ +@Service +public class DaCumulatePointServiceImpl extends BaseServiceImpl<DaCumulatePointDao, DaCumulatePointEntity> implements DaCumulatePointService { + + @Override + public void add(DaCumulatePointDTO dto, String pointId) { + DaCumulatePointEntity entity = ConvertUtils.sourceToTarget(dto, DaCumulatePointEntity.class); + entity.setPointId(pointId); + baseDao.insert(entity); + } + + @Override + public DaCumulatePointDTO getByPoint(String pointId) { + QueryWrapper<DaCumulatePointEntity> wrapper = new QueryWrapper<>(); + wrapper.eq("point_id", pointId); + DaCumulatePointEntity entity = baseDao.selectOne(wrapper); + return ConvertUtils.sourceToTarget(entity, DaCumulatePointDTO.class); + } + + @Override + public void update(DaCumulatePointDTO dto) { + DaCumulatePointEntity entity = ConvertUtils.sourceToTarget(dto, DaCumulatePointEntity.class); + this.updateById(entity); + } + + @Override + public void deleteBatch(String[] ids) { + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public void deleteByPoint(String[] ids) { + QueryWrapper<DaCumulatePointEntity> wrapper = new QueryWrapper<>(); + wrapper.in("point_id", Arrays.asList(ids)); + baseDao.delete(wrapper); + } + +} \ No newline at end of file -- Gitblit v1.9.3