设备缓存增加iotModelCode
This commit is contained in:
parent
633566bda8
commit
2a1a768d18
@ -8,6 +8,7 @@ import com.das.modules.equipment.mapper.SysEquipmentMapper;
|
|||||||
import com.das.modules.equipment.mapper.SysIotModelMapper;
|
import com.das.modules.equipment.mapper.SysIotModelMapper;
|
||||||
import jakarta.annotation.PostConstruct;
|
import jakarta.annotation.PostConstruct;
|
||||||
import jakarta.annotation.PreDestroy;
|
import jakarta.annotation.PreDestroy;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@ -16,6 +17,7 @@ import java.util.Collections;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
public class EquipmentCacheImpl implements EquipmentCache {
|
public class EquipmentCacheImpl implements EquipmentCache {
|
||||||
@Autowired
|
@Autowired
|
||||||
@ -46,8 +48,10 @@ public class EquipmentCacheImpl implements EquipmentCache {
|
|||||||
deviceInfoCache.setMadeinFactory(equipment.getMadeinFactory());
|
deviceInfoCache.setMadeinFactory(equipment.getMadeinFactory());
|
||||||
deviceInfoCache.setParentDeviceId(equipment.getParentEquipmentId());
|
deviceInfoCache.setParentDeviceId(equipment.getParentEquipmentId());
|
||||||
deviceInfoCache.setIotModelId(equipment.getIotModelId());
|
deviceInfoCache.setIotModelId(equipment.getIotModelId());
|
||||||
String iotModelCode = sysIotModelMapper.getIotModel(equipment.getIotModelId());
|
String iotModelCode = sysIotModelMapper.getIodModelCode(equipment.getIotModelId());
|
||||||
|
log.debug("iotModelId: {}", equipment.getIotModelId());
|
||||||
if (StrUtil.isNotBlank(iotModelCode)){
|
if (StrUtil.isNotBlank(iotModelCode)){
|
||||||
|
log.debug("iotModelCode: {}", iotModelCode);
|
||||||
deviceInfoCache.setIotModelCode(iotModelCode);
|
deviceInfoCache.setIotModelCode(iotModelCode);
|
||||||
}
|
}
|
||||||
//创建Code索引
|
//创建Code索引
|
||||||
|
@ -31,6 +31,8 @@ public interface SysIotModelMapper extends BaseMapper<SysIotModel> {
|
|||||||
|
|
||||||
String getIotModel(Long id);
|
String getIotModel(Long id);
|
||||||
|
|
||||||
|
String getIodModelCode(Long id);
|
||||||
|
|
||||||
List<SysIotModelField> getAllIotModelField(Long id);
|
List<SysIotModelField> getAllIotModelField(Long id);
|
||||||
|
|
||||||
SysIotModelVo selectIotModelByCode(String code);
|
SysIotModelVo selectIotModelByCode(String code);
|
||||||
|
@ -77,6 +77,10 @@
|
|||||||
select sim.iot_model_code from sys_iot_model sim left join sys_equipment se on sim.id = se.iot_model_id
|
select sim.iot_model_code from sys_iot_model sim left join sys_equipment se on sim.id = se.iot_model_id
|
||||||
where se.id = #{id}
|
where se.id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getIodModelCode" resultType="java.lang.String">
|
||||||
|
select sim.iot_model_code from sys_iot_model sim where sim.id = #{id}
|
||||||
|
</select>
|
||||||
<select id="getAllIotModelField" resultType="com.das.modules.equipment.entity.SysIotModelField">
|
<select id="getAllIotModelField" resultType="com.das.modules.equipment.entity.SysIotModelField">
|
||||||
select simf.attribute_name as attributeName, simf.attribute_code as attributeCode,simf.highspeed as highSpeed,simf.datatype as dataType,simf.attribute_type as attributeType,simf.level as level,simf.stateDesc as stateDesc from sys_iot_model_field simf where simf.iot_model_id = #{id} order by simf.attribute_code
|
select simf.attribute_name as attributeName, simf.attribute_code as attributeCode,simf.highspeed as highSpeed,simf.datatype as dataType,simf.attribute_type as attributeType,simf.level as level,simf.stateDesc as stateDesc from sys_iot_model_field simf where simf.iot_model_id = #{id} order by simf.attribute_code
|
||||||
</select>
|
</select>
|
||||||
|
Loading…
Reference in New Issue
Block a user