| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zy.acs.framework.common.Cools; |
| | | import com.zy.acs.manager.manager.entity.Sta; |
| | | import com.zy.acs.manager.manager.enums.StaTypeType; |
| | | import com.zy.acs.manager.manager.enums.StatusType; |
| | | import com.zy.acs.manager.manager.mapper.StaMapper; |
| | | import com.zy.acs.manager.manager.service.StaService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service("staService") |
| | | public class StaServiceImpl extends ServiceImpl<StaMapper, Sta> implements StaService { |
| | | |
| | | @Override |
| | | public Sta selectByStaNo(String staNo) { |
| | | return this.getOne(new LambdaQueryWrapper<Sta>().eq(Sta::getStaNo, staNo)); |
| | | return this.getOne(new LambdaQueryWrapper<Sta>() |
| | | .eq(Sta::getStaNo, staNo).eq(Sta::getStatus, StatusType.ENABLE.val)); |
| | | } |
| | | |
| | | @Override |
| | | public Sta selectByCode(Long codeId, StaTypeType type) { |
| | | if (Cools.isEmpty(codeId, type)) { |
| | | return null; |
| | | } |
| | | List<Sta> list = this.list(new LambdaQueryWrapper<Sta>() |
| | | .eq(Sta::getCode, codeId).eq(Sta::getStaType, type.val()).eq(Sta::getStatus, StatusType.ENABLE.val)); |
| | | return list.stream().findFirst().orElse(null); |
| | | } |
| | | |
| | | } |