package com.yunzhupaas.onlinedev.util.onlineDevUtil;

import com.yunzhupaas.onlinedev.model.OnlineDevListModel.VisualColumnSearchVO;

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

/**
 *
 * 关联表单工具类
 * @author 云筑产品开发平台组
 * @version V3.2.0
 * @copyright 深圳市乐程软件有限公司（http://www.szlecheng.cn）
 * @date  2022/1/7
 */
public class RelationFormUtils {

	/**
	 * 转后后查询
	 * @param dataVOList
	 * @param searchVOList
	 * @return
	 */
	public static List<Map<String, Object>> getRelationListByKeyword(List<Map<String, Object>> dataVOList, List<VisualColumnSearchVO> searchVOList){
		List<Map<String, Object>> passDataList = new ArrayList<>();
		for (Map<String, Object> dataMap : dataVOList){
			int i =0;
			for (VisualColumnSearchVO searchVO : searchVOList){
				String s = String.valueOf(dataMap.get(searchVO.getVModel()));
				if (s.contains(String.valueOf(searchVO.getValue()))){
					i++;
				}
			}
			if (i>0){
				passDataList.add(dataMap);
			}
		}
		return passDataList;
	}
}

