|
...
|
...
|
@@ -9,6 +9,7 @@ import com.ruoyi.common.core.domain.Message; |
|
|
|
import com.ruoyi.common.core.domain.ApiName;
|
|
|
|
import com.ruoyi.common.core.domain.DeviceCommandApi;
|
|
|
|
import com.ruoyi.common.core.domain.DeviceCommandApiParameter;
|
|
|
|
import com.zhonglai.luhui.dao.service.PublicService;
|
|
|
|
import com.zhonglai.luhui.device.service.IIotDeviceService;
|
|
|
|
import com.zhonglai.luhui.rocketmq.service.RocketMqService;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
...
|
...
|
@@ -28,8 +29,9 @@ public class IotTerminalServiceImpl implements IIotTerminalService |
|
|
|
{
|
|
|
|
@Autowired
|
|
|
|
private IotTerminalMapper iotTerminalMapper;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
private IIotDeviceService iotDeviceService;
|
|
|
|
private PublicService publicService;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
protected RocketMqService rocketMqService;
|
|
...
|
...
|
@@ -140,4 +142,20 @@ public class IotTerminalServiceImpl implements IIotTerminalService |
|
|
|
public List<IotTerminal> selectNotUserIotTerminalListByImei(String device_id) {
|
|
|
|
return iotTerminalMapper.selectNotUserIotTerminalListByImei(device_id);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int batchUpName(List<String> ids, List<String> names) {
|
|
|
|
StringBuffer sql = new StringBuffer("UPDATE `mqtt_broker`.`iot_terminal` SET `name` = CASE");
|
|
|
|
StringBuffer where = new StringBuffer(" where id in(");
|
|
|
|
for (int i=0;i<ids.size();i++)
|
|
|
|
{
|
|
|
|
sql.append(" WHEN id='"+ids.get(i)+"' THEN '"+names.get(i)+"'");
|
|
|
|
where.append("'"+ids.get(i)+"',");
|
|
|
|
}
|
|
|
|
sql.append(" END ");
|
|
|
|
where.append("'"+ids.get(0)+"'");
|
|
|
|
where.append(")");
|
|
|
|
publicService.updateBySql(sql.append(where).toString());
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|