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 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 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 wrapper = new QueryWrapper<>(); wrapper.in("point_id", Arrays.asList(ids)); baseDao.delete(wrapper); } }