package com.ruoyi.school.salary.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.school.order.domain.ScOrder;
import com.ruoyi.school.order.service.IScOrderService;
import com.ruoyi.school.salary.domain.ScCommissionPlans;
import com.ruoyi.school.salary.mapper.ScCommissionPlansMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ScCommissionPlansService extends ServiceImpl<ScCommissionPlansMapper, ScCommissionPlans> {

    @Autowired
    private  IScOrderService scOrderService;;
    public boolean isUsed(Integer id){
        //校验是否已经使用
        int i= scOrderService.count(new QueryWrapper<ScOrder>().eq("commission_plans_id",id));
        return i>0?true:false;
    }
}
