package com.tuoheng.admin.service.airDataType;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tuoheng.admin.entity.domain.AirDataType;
import com.tuoheng.admin.enums.AirDataTypeEnum;
import com.tuoheng.admin.enums.MarkEnum;
import com.tuoheng.admin.mapper.AirDataTypeMapper;
import com.tuoheng.common.core.common.BaseServiceImpl;
import com.tuoheng.common.core.utils.JsonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author ChengWang
 * @Date 2023/5/23
 */
@Service
@Slf4j
public class AirDataTypeServiceImpl extends BaseServiceImpl<AirDataTypeMapper, AirDataType> implements IAirDataTypeService {

    @Autowired
    private AirDataTypeMapper airDataTypeMapper;

    /**
     * 查询大气数据类型列表
     * @return
     */
    @Override
    public JsonResult getDataTypeList() {
        List<AirDataType> airDataTypeList = airDataTypeMapper.selectList(new LambdaQueryWrapper<AirDataType>()
                .eq(AirDataType::getMark, MarkEnum.VALID.getCode())
                .eq(AirDataType::getIsShow, AirDataTypeEnum.IMAGE.getCode()));

        return JsonResult.success(airDataTypeList);
    }
}
