package com.usky.fire.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.usky.fire.domain.DemFireStation;
import com.usky.fire.domain.DemHighRise;
import com.usky.fire.mapper.DemFireStationMapper;
import com.usky.fire.service.DemFireStationService;
import com.usky.common.mybatis.core.AbstractCrudService;
import com.usky.fire.service.vo.DemFireStationVO;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 消防站 服务实现类
 * </p>
 *
 * @author han
 * @since 2023-03-31
 */
@Service
public class DemFireStationServiceImpl extends AbstractCrudService<DemFireStationMapper, DemFireStation> implements DemFireStationService {
    @Override
    public List<DemFireStation> demFireStationList(DemFireStationVO demFireStationVO) {
        LambdaQueryWrapper<DemFireStation> query = Wrappers.lambdaQuery();
        query.eq(StringUtils.isNotBlank(demFireStationVO.getStreetTown()),DemFireStation::getStreetTown, demFireStationVO.getStreetTown());
        query.in(DemFireStation::getStationType, demFireStationVO.getStationType());
        List<DemFireStation> list = this.list(query);
        return list;
    }
}
