package com.iailab.module.device.service.impl;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.iailab.framework.common.service.impl.CrudServiceImpl;
|
import com.iailab.module.device.dao.DeviceRunStateDao;
|
import com.iailab.module.device.dto.DeviceRunStateDTO;
|
import com.iailab.module.device.entity.DeviceRunStateEntity;
|
import com.iailab.module.device.service.DeviceRunStateService;
|
import org.apache.commons.lang3.StringUtils;
|
import org.springframework.stereotype.Service;
|
|
import java.util.Map;
|
|
/**
|
* 设备运行状态表
|
*
|
* @author lirm ${email}
|
* @since 1.0.0 2024-05-22
|
*/
|
@Service
|
public class DeviceRunStateServiceImpl extends CrudServiceImpl<DeviceRunStateDao, DeviceRunStateEntity, DeviceRunStateDTO> implements DeviceRunStateService {
|
|
@Override
|
public QueryWrapper<DeviceRunStateEntity> getWrapper(Map<String, Object> params){
|
String id = (String)params.get("id");
|
|
QueryWrapper<DeviceRunStateEntity> wrapper = new QueryWrapper<>();
|
wrapper.eq(StringUtils.isNotBlank(id), "id", id);
|
|
return wrapper;
|
}
|
|
|
@Override
|
public void insertRunState(Map<String, Integer> tMap) {
|
int id = baseDao.getId();
|
if(id == 0){
|
baseDao.insertRunState(tMap);
|
}else{
|
tMap.put("id",id);
|
baseDao.updateRunState(tMap);
|
}
|
}
|
}
|