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

结构优化
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.setCommonGbLongitude(streamProxy.getLongitude());
commonGbChannel.setCommonGbLatitude(streamProxy.getLatitude());
commonGbChannel.setCommonGbStatus(true);
commonGbChannel.setCreateTime(DateUtil.getNow());
commonGbChannel.setUpdateTime(DateUtil.getNow());
return commonGbChannel;

View File

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

View File

@ -95,6 +95,11 @@ public class CommonGbChannelServiceImpl implements ICommonGbChannelService {
@Override
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);
if (result == 0) {
return 0;