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

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yuchen.saas.park.api.entity.property.PropertyBillSub;
import com.yuchen.saas.park.service.mapper.property.PropertyBillSubMapper;
import org.nest.springwrap.core.tool.utils.Func;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class PropertyBillSubService extends ServiceImpl<PropertyBillSubMapper, PropertyBillSub> {


    public List<PropertyBillSub> listByBillId(List<Long> billIdList) {
        if (Func.isEmpty(billIdList)) {
            return new ArrayList<>();
        }
        return this.lambdaQuery().in(PropertyBillSub::getBillId,billIdList).list();
    }

    public PropertyBillSub getByBillId(Long billId) {
        return this.lambdaQuery().eq(PropertyBillSub::getBillId,billId).last("limit 1").one();
    }


}
