package com.bonus.canteen.core.device.door.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bonus.canteen.core.device.door.mapper.DcAutoRuleTriggerMapper;
import com.bonus.canteen.core.device.door.model.DcAutoRuleTrigger;
import com.bonus.canteen.core.device.door.service.DcAutoRuleTriggerService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DcAutoRuleTriggerServiceImpl extends ServiceImpl<DcAutoRuleTriggerMapper, DcAutoRuleTrigger> implements DcAutoRuleTriggerService {

   @Override
   public List<DcAutoRuleTrigger> getByTriggerType(String triggerType) {
      return this.list(Wrappers.lambdaQuery(DcAutoRuleTrigger.class).
              eq(DcAutoRuleTrigger::getTriggerType, triggerType));
   }
}
