拉流代理通用通道默认在线

结构优化
648540858 2024-01-20 06:47:36 +08:00
parent 3a6e098f7b
commit bc0ee2bf13
3 changed files with 7 additions and 0 deletions

View File

@ -628,6 +628,7 @@ public class CommonGbChannel {
commonGbChannel.setCommonGbName(streamProxy.getName()); commonGbChannel.setCommonGbName(streamProxy.getName());
commonGbChannel.setCommonGbLongitude(streamProxy.getLongitude()); commonGbChannel.setCommonGbLongitude(streamProxy.getLongitude());
commonGbChannel.setCommonGbLatitude(streamProxy.getLatitude()); commonGbChannel.setCommonGbLatitude(streamProxy.getLatitude());
commonGbChannel.setCommonGbStatus(true);
commonGbChannel.setCreateTime(DateUtil.getNow()); commonGbChannel.setCreateTime(DateUtil.getNow());
commonGbChannel.setUpdateTime(DateUtil.getNow()); commonGbChannel.setUpdateTime(DateUtil.getNow());
return commonGbChannel; return commonGbChannel;

View File

@ -28,6 +28,7 @@ public class MybatisConfig {
if (userSetting.getSqlLog()){ if (userSetting.getSqlLog()){
config.setLogImpl(StdOutImpl.class); config.setLogImpl(StdOutImpl.class);
} }
// 自动将数据库中的下划线转换为驼峰格式
config.setMapUnderscoreToCamelCase(true); config.setMapUnderscoreToCamelCase(true);
sqlSessionFactory.setConfiguration(config); sqlSessionFactory.setConfiguration(config);
return sqlSessionFactory.getObject(); return sqlSessionFactory.getObject();

View File

@ -95,6 +95,11 @@ public class CommonGbChannelServiceImpl implements ICommonGbChannelService {
@Override @Override
public int add(CommonGbChannel channel) { public int add(CommonGbChannel channel) {
CommonGbChannel commonGbChannel = commonGbChannelMapper.queryByDeviceID(channel.getCommonGbDeviceID());
if (commonGbChannel != null) {
channel.setCommonGbId(commonGbChannel.getCommonGbId());
return update(channel);
}
int result = commonGbChannelMapper.add(channel); int result = commonGbChannelMapper.add(channel);
if (result == 0) { if (result == 0) {
return 0; return 0;