package com.yuchen.saas.park.service.service.property.impl;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yuchen.saas.park.api.entity.property.PropertyDirectReductionHouseLog;
import com.yuchen.saas.park.service.mapper.property.PropertyDirectReductionHouseLogMapper;
import com.yuchen.saas.park.service.service.property.IPropertyDirectReductionHouseLogService;
import org.nest.springwrap.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 减免活动-直接减免-范围(记录当时的选择,目前界面显示用) 服务实现类
 * </p>
 *
 * @author cxj
 * @since 2023-12-20
 */
@Service
public class PropertyDirectReductionHouseLogServiceImpl extends BaseServiceImpl<PropertyDirectReductionHouseLogMapper, PropertyDirectReductionHouseLog> implements IPropertyDirectReductionHouseLogService {

    @Override
    public Boolean removeByDirectReductionId(Long directReductionId) {
        LambdaQueryWrapper<PropertyDirectReductionHouseLog> queryWrapper = Wrappers.lambdaQuery();
        queryWrapper.eq(PropertyDirectReductionHouseLog::getDirectReductionId,directReductionId);
        return remove(queryWrapper);
    }

    @Override
    public List<PropertyDirectReductionHouseLog> listByDirectReductionId(Long directReductionId) {
        LambdaQueryWrapper<PropertyDirectReductionHouseLog> queryWrapper = Wrappers.lambdaQuery();
        queryWrapper.eq(PropertyDirectReductionHouseLog::getDirectReductionId,directReductionId);
        return list(queryWrapper);
    }
}
