# OccJumpAlertFilterConfigServiceImpl.java

    package cloud.wconnect.rateshop.service.revenue.impl;

    import cloud.wconnect.commonlib.util.DateTimeUtils;
    import cloud.wconnect.rateshop.entity.revenue.OccJumpAlertFilterConfig;
    import cloud.wconnect.rateshop.mapper.revenue.OccJumpAlertFilterConfigMapper;
    import cloud.wconnect.rateshop.pojo.dto.revenue.OccJumpAlertFilterConfigDTO;
    import cloud.wconnect.rateshop.service.revenue.IOccJumpAlertFilterConfigService;
    import com.baomidou.dynamic.datasource.annotation.DS;
    import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
    import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
    import org.springframework.stereotype.Service;

    /**
     * <p>
     * occ jump alert 过滤配置 服务实现类
     * </p>
     *
     * @author zc
     * @since 2024-04-16
     */
    @Service
    @DS("rate_shop")
    public class OccJumpAlertFilterConfigServiceImpl extends ServiceImpl<OccJumpAlertFilterConfigMapper, OccJumpAlertFilterConfig> implements IOccJumpAlertFilterConfigService {

        /**
         * 获取指定资产的 occ 过滤配置
         *
         * @param propertyId 资产 id
         * @return 过滤配置
         * @author zc
         * @date 2024/4/16
         */
        @Override
        public OccJumpAlertFilterConfig getFilterConfig(int propertyId) {
            return getOne(new LambdaQueryWrapper<OccJumpAlertFilterConfig>()
                    .eq(OccJumpAlertFilterConfig::getPropertyId, propertyId));
        }

        /**
         * 保存指定资产的 occ 过滤配置
         *
         * @param propertyId      资产 id
         * @param userId          用户 id
         * @param filterConfigDTO 过滤配置 DTO
         * @author zc
         * @date 2024/4/16
         */
        @Override
        public void saveFilterConfig(int propertyId, int userId, OccJumpAlertFilterConfigDTO filterConfigDTO) {
            baseMapper.insertOrUpdateByUniqueKey(new OccJumpAlertFilterConfig()
                    .setPropertyId(propertyId)
                    .setMinValue(filterConfigDTO.getMinValue())
                    .setMaxValue(filterConfigDTO.getMaxValue())
                    .setUpdatedBy(userId)
                    .setUpdatedTime(DateTimeUtils.nowTimestamp()));
        }

        /**
         * 删除指定资产的 occ 过滤配置
         *
         * @param propertyId 资产 id
         * @author zc
         * @date 2024/4/16
         */
        @Override
        public void deleteFilterConfig(int propertyId) {
            remove(new LambdaQueryWrapper<OccJumpAlertFilterConfig>()
                    .eq(OccJumpAlertFilterConfig::getPropertyId, propertyId));
        }
    }