package com.usky.fire.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.usky.fire.domain.DemBuildScoreRisk;
import com.usky.fire.mapper.DemBuildScoreRiskMapper;
import com.usky.fire.service.DemBuildScoreRiskService;
import com.usky.common.mybatis.core.AbstractCrudService;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 建筑评分风险类型 服务实现类
 * </p>
 *
 * @author JCB
 * @since 2022-09-06
 */
@Service
public class DemBuildScoreRiskServiceImpl extends AbstractCrudService<DemBuildScoreRiskMapper, DemBuildScoreRisk> implements DemBuildScoreRiskService {

    @Override
    public List<Object> demBuildScoreRiskList(){
        List<Object> list = new ArrayList<>();
        List<DemBuildScoreRisk> list1 = this.list();
        if (CollectionUtils.isNotEmpty(list1)){
            for (int i = 0; i < list1.size(); i++) {
                Map<String, Object> map = new HashMap<>();
                map.put("id",list1.get(i).getId());
                map.put("riskTypeName",list1.get(i).getRiskTypeName());
                list.add(map);
            }
        }
        return list;
    }

}
