package com.iailab.module.any.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.any.dao.AnyProcCardDao;
|
import com.iailab.module.any.dto.AnyProcCardDTO;
|
import com.iailab.module.any.entity.AnyProcCardEntity;
|
import com.iailab.module.any.service.AnyProcCardService;
|
import org.springframework.stereotype.Service;
|
|
/**
|
* @author PanZhibao
|
* @Description
|
* @createTime 2024年06月25日
|
*/
|
@Service
|
public class AnyProcCardServiceImpl extends BaseServiceImpl<AnyProcCardDao, AnyProcCardEntity> implements AnyProcCardService {
|
|
@Override
|
public AnyProcCardDTO getByCode(String code) {
|
QueryWrapper<AnyProcCardEntity> wrapper = new QueryWrapper<>();
|
wrapper.eq("code", code);
|
AnyProcCardEntity entity = baseDao.selectOne(wrapper);
|
return ConvertUtils.sourceToTarget(entity, AnyProcCardDTO.class);
|
|
}
|
|
@Override
|
public void updateByCode(AnyProcCardDTO dto) {
|
AnyProcCardEntity entity = new AnyProcCardEntity();
|
entity.setAlarmInfo(dto.getAlarmInfo());
|
entity.setAnyTime(dto.getAnyTime());
|
QueryWrapper<AnyProcCardEntity> wrapper = new QueryWrapper<>();
|
wrapper.eq("code", dto.getCode());
|
baseDao.update(entity, wrapper);
|
}
|
}
|