package com.elephant.framework.galaxy.aroad.module.szgl.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.elephant.framework.galaxy.aroad.module.szgl.service.SzglService;
import com.elephant.framework.galaxy.aroad.module.zhjs.entity.ZhjsGcxm;
import com.elephant.framework.galaxy.aroad.module.zhjs.entity.ZhjsGcxmShape;
import com.elephant.framework.galaxy.aroad.module.zhjs.mapper.ZhjsGcxmShapeMapper;
import com.elephant.framework.galaxy.aroad.module.zhyh.entity.ZhyhDzxgcglGcxx;
import com.elephant.framework.galaxy.aroad.module.zhyh.mapper.ZhyhDzxgcglGcxxMapper;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * 数字公路-观测站
 *
 * @author zyw
 * @date 2019-05-13 11:08:50
 */
@Service
@AllArgsConstructor
public class SzglServiceImpl extends ServiceImpl<ZhjsGcxmShapeMapper, ZhjsGcxmShape> implements SzglService {

    private final ZhjsGcxmShapeMapper zhjsGcxmShapeMapper;
    private final ZhyhDzxgcglGcxxMapper zhyhDzxgcglGcxxMapper;

    @Override
    public List<Object> getJYlsForQS(String lxbh, double zxzh) {

        List<ZhjsGcxmShape> jsxms = zhjsGcxmShapeMapper.getJYlsForQS(lxbh,zxzh);
        List<ZhyhDzxgcglGcxx> dzxxms = zhyhDzxgcglGcxxMapper.getJYlsForQS(lxbh,zxzh);
        List<Object> list = new ArrayList<>();
        list.addAll(jsxms);
        list.addAll(dzxxms);

        return list;
    }

    @Override
    public List<Object> getJYlsForRoad(String lxbh, Double qdzh,Double zdzh) {
        List<ZhjsGcxmShape> jsxms = zhjsGcxmShapeMapper.getJYlsForRoad(lxbh,qdzh,zdzh);
        List<ZhyhDzxgcglGcxx> dzxxms = zhyhDzxgcglGcxxMapper.getJYlsForRoad(lxbh,qdzh,zdzh);
        List<Object> list = new ArrayList<>();
        list.addAll(jsxms);
        list.addAll(dzxxms);

        return list;
    }
}
