|
|
|
|
@ -59,6 +59,14 @@ public class BaseDeviceParamServiceImpl implements IBaseDeviceParamService
|
|
|
|
|
@Override
|
|
|
|
|
public int insertBaseDeviceParam(BaseDeviceParam baseDeviceParam)
|
|
|
|
|
{
|
|
|
|
|
String paramCode = baseDeviceParam.getParamCode();
|
|
|
|
|
int count = baseDeviceParamMapper.countByParamCode(paramCode, null);
|
|
|
|
|
System.out.println(count + paramCode);
|
|
|
|
|
// 校验参数编号唯一
|
|
|
|
|
if (count > 0)
|
|
|
|
|
{
|
|
|
|
|
throw new ServiceException("参数编号已存在:" + paramCode);
|
|
|
|
|
}
|
|
|
|
|
return baseDeviceParamMapper.insertBaseDeviceParam(baseDeviceParam);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -71,6 +79,13 @@ public class BaseDeviceParamServiceImpl implements IBaseDeviceParamService
|
|
|
|
|
@Override
|
|
|
|
|
public int updateBaseDeviceParam(BaseDeviceParam baseDeviceParam)
|
|
|
|
|
{
|
|
|
|
|
String paramCode = baseDeviceParam.getParamCode();
|
|
|
|
|
int count = baseDeviceParamMapper.countByParamCode(paramCode, baseDeviceParam.getObjId());
|
|
|
|
|
System.out.println(count + paramCode + baseDeviceParam.getObjId());
|
|
|
|
|
if (count > 0)
|
|
|
|
|
{
|
|
|
|
|
throw new ServiceException("参数编号已存在:" + baseDeviceParam.getParamCode());
|
|
|
|
|
}
|
|
|
|
|
return baseDeviceParamMapper.updateBaseDeviceParam(baseDeviceParam);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|