|
|
@ -9,6 +9,8 @@ import com.github.yulichang.toolkit.JoinWrappers;
|
|
|
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
|
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
|
|
|
import org.dromara.dms.domain.DmsBaseDeviceCategory;
|
|
|
|
|
|
|
|
import org.dromara.dms.domain.DmsBaseDeviceType;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.dromara.dms.domain.bo.BaseAlarmTypeBo;
|
|
|
|
import org.dromara.dms.domain.bo.BaseAlarmTypeBo;
|
|
|
|
import org.dromara.dms.domain.vo.BaseAlarmTypeVo;
|
|
|
|
import org.dromara.dms.domain.vo.BaseAlarmTypeVo;
|
|
|
@ -39,7 +41,7 @@ public class BaseAlarmTypeServiceImpl implements IBaseAlarmTypeService {
|
|
|
|
* @return 报警类型
|
|
|
|
* @return 报警类型
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public BaseAlarmTypeVo queryById(Long alarmTypeId){
|
|
|
|
public BaseAlarmTypeVo queryById(Long alarmTypeId) {
|
|
|
|
return baseMapper.selectVoById(alarmTypeId);
|
|
|
|
return baseMapper.selectVoById(alarmTypeId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -72,14 +74,18 @@ public class BaseAlarmTypeServiceImpl implements IBaseAlarmTypeService {
|
|
|
|
private MPJLambdaWrapper<BaseAlarmType> buildQueryWrapper(BaseAlarmTypeBo bo) {
|
|
|
|
private MPJLambdaWrapper<BaseAlarmType> buildQueryWrapper(BaseAlarmTypeBo bo) {
|
|
|
|
Map<String, Object> params = bo.getParams();
|
|
|
|
Map<String, Object> params = bo.getParams();
|
|
|
|
MPJLambdaWrapper<BaseAlarmType> lqw = JoinWrappers.lambda(BaseAlarmType.class)
|
|
|
|
MPJLambdaWrapper<BaseAlarmType> lqw = JoinWrappers.lambda(BaseAlarmType.class)
|
|
|
|
.selectAll(BaseAlarmType.class)
|
|
|
|
.selectAll(BaseAlarmType.class)
|
|
|
|
.eq(bo.getAlarmTypeId() != null, BaseAlarmType::getAlarmTypeId, bo.getAlarmTypeId())
|
|
|
|
.select(DmsBaseDeviceCategory::getDeviceCategoryName)
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getAlarmTypeCode()), BaseAlarmType::getAlarmTypeCode, bo.getAlarmTypeCode())
|
|
|
|
.select(DmsBaseDeviceType::getDeviceTypeName)
|
|
|
|
.like(StringUtils.isNotBlank(bo.getAlarmTypeName()), BaseAlarmType::getAlarmTypeName, bo.getAlarmTypeName())
|
|
|
|
.leftJoin(DmsBaseDeviceCategory.class, DmsBaseDeviceCategory::getDeviceCategoryId, BaseAlarmType::getDeviceCategoryId)
|
|
|
|
.eq(bo.getDeviceCategoryId() != null, BaseAlarmType::getDeviceCategoryId, bo.getDeviceCategoryId())
|
|
|
|
.leftJoin(DmsBaseDeviceType.class, DmsBaseDeviceType::getDeviceTypeId, BaseAlarmType::getDeviceTypeId)
|
|
|
|
.eq(bo.getDeviceTypeId() != null, BaseAlarmType::getDeviceTypeId, bo.getDeviceTypeId())
|
|
|
|
.eq(bo.getAlarmTypeId() != null, BaseAlarmType::getAlarmTypeId, bo.getAlarmTypeId())
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getTypeStatus()), BaseAlarmType::getTypeStatus, bo.getTypeStatus())
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getAlarmTypeCode()), BaseAlarmType::getAlarmTypeCode, bo.getAlarmTypeCode())
|
|
|
|
.orderByAsc(BaseAlarmType::getCreateTime);
|
|
|
|
.like(StringUtils.isNotBlank(bo.getAlarmTypeName()), BaseAlarmType::getAlarmTypeName, bo.getAlarmTypeName())
|
|
|
|
|
|
|
|
.eq(bo.getDeviceCategoryId() != null, BaseAlarmType::getDeviceCategoryId, bo.getDeviceCategoryId())
|
|
|
|
|
|
|
|
.eq(bo.getDeviceTypeId() != null, BaseAlarmType::getDeviceTypeId, bo.getDeviceTypeId())
|
|
|
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getTypeStatus()), BaseAlarmType::getTypeStatus, bo.getTypeStatus())
|
|
|
|
|
|
|
|
.orderByAsc(BaseAlarmType::getCreateTime);
|
|
|
|
return lqw;
|
|
|
|
return lqw;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -116,7 +122,7 @@ public class BaseAlarmTypeServiceImpl implements IBaseAlarmTypeService {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 保存前的数据校验
|
|
|
|
* 保存前的数据校验
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private void validEntityBeforeSave(BaseAlarmType entity){
|
|
|
|
private void validEntityBeforeSave(BaseAlarmType entity) {
|
|
|
|
//TODO 做一些数据校验,如唯一约束
|
|
|
|
//TODO 做一些数据校验,如唯一约束
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -129,7 +135,7 @@ public class BaseAlarmTypeServiceImpl implements IBaseAlarmTypeService {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
|
|
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
|
|
|
if(isValid){
|
|
|
|
if (isValid) {
|
|
|
|
//TODO 做一些业务上的校验,判断是否需要校验
|
|
|
|
//TODO 做一些业务上的校验,判断是否需要校验
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return baseMapper.deleteByIds(ids) > 0;
|
|
|
|
return baseMapper.deleteByIds(ids) > 0;
|
|
|
|