| package com.zy.acs.manager.manager.service.impl; | 
|   | 
| import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 
| import com.zy.acs.manager.manager.entity.Bus; | 
| import com.zy.acs.manager.manager.enums.BusStsType; | 
| import com.zy.acs.manager.manager.mapper.BusMapper; | 
| import com.zy.acs.manager.manager.service.BusService; | 
| import com.zy.acs.framework.common.Cools; | 
| import org.springframework.stereotype.Service; | 
|   | 
| import java.util.ArrayList; | 
| import java.util.List; | 
|   | 
| @Service("busService") | 
| public class BusServiceImpl extends ServiceImpl<BusMapper, Bus> implements BusService { | 
|   | 
|     @Override | 
|     public Bus selectByUuid(String uuid) { | 
|         return this.getOne(new LambdaQueryWrapper<Bus>().eq(Bus::getUuid, uuid)); | 
|     } | 
|   | 
|     @Override | 
|     public List<Bus> selectBySts(BusStsType busStsType) { | 
|         return this.selectBySts(busStsType, null); | 
|     } | 
|   | 
|     @Override | 
|     public List<Bus> selectInSts(BusStsType... busStsTypes) { | 
|         List<Long> params = new ArrayList<>(); | 
|         for (BusStsType busStsType : busStsTypes) { | 
|             params.add(busStsType.val()); | 
|         } | 
|         return this.list(new LambdaQueryWrapper<Bus>().in(Bus::getBusSts, params)); | 
|     } | 
|   | 
|     @Override | 
|     public List<Bus> selectBySts(BusStsType busStsType, String memo) { | 
|         LambdaQueryWrapper<Bus> wrapper = new LambdaQueryWrapper<>(); | 
|         wrapper.eq(Bus::getBusSts, busStsType.val()); | 
|         if (!Cools.isEmpty(memo)) { | 
|             wrapper.eq(Bus::getMemo, memo); | 
|         } | 
|         return this.list(wrapper); | 
|     } | 
|   | 
| } |