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.PropertyPayReductionHouseLog;
import com.yuchen.saas.park.service.mapper.property.PropertyPayReductionHouseLogMapper;
import com.yuchen.saas.park.service.service.property.IPropertyPayReductionHouseLogService;
import org.nest.springwrap.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 减免活动-缴费减免-范围(记录当时的选择,目前界面显示用) 服务实现类
 * </p>
 *
 * @author cxj
 * @since 2023-12-22
 */
@Service
public class PropertyPayReductionHouseLogServiceImpl extends BaseServiceImpl<PropertyPayReductionHouseLogMapper, PropertyPayReductionHouseLog> implements IPropertyPayReductionHouseLogService {

    @Override
    public Boolean removeByPayReductionId(Long payReductionId) {
        LambdaQueryWrapper<PropertyPayReductionHouseLog> queryWrapper = Wrappers.lambdaQuery();
        queryWrapper.eq(PropertyPayReductionHouseLog::getPayReductionId,payReductionId);
        return remove(queryWrapper);
    }

    @Override
    public List<PropertyPayReductionHouseLog> listByPayReductionId(Long payReductionId) {
        LambdaQueryWrapper<PropertyPayReductionHouseLog> queryWrapper = Wrappers.lambdaQuery();
        queryWrapper.eq(PropertyPayReductionHouseLog::getPayReductionId,payReductionId);
        return list(queryWrapper);
    }
}
