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 implements DeviceRunStateService { @Override public QueryWrapper getWrapper(Map params){ String id = (String)params.get("id"); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), "id", id); return wrapper; } @Override public void insertRunState(Map tMap) { int id = baseDao.getId(); if(id == 0){ baseDao.insertRunState(tMap); }else{ tMap.put("id",id); baseDao.updateRunState(tMap); } } }