#pragma once
#include <string>
#include <map>
#include <vector>
#include "CivSimuResStruct.h"
#include "pandaDbManager.h"

class CivConnection;

/**
 模拟结果集操作类
*/
class PANDADBMANAGER_API CivSimulResHelperAbs
{
public:
	explicit CivSimulResHelperAbs();
	virtual ~CivSimulResHelperAbs();

	virtual bool insertNodes(const NodeResultItems& nodeitems);
	virtual bool insertLinks(const LinkResultItems& linkMap);
	virtual bool insertTanks(const TankResultItems& tankMap);

	virtual bool insertLinksBulk(const std::map<int, LinkResultItems>& linksMap);
	virtual bool insertNodeBulk(const std::map<int, TankResultItems>& nodesMap);
	virtual void saveNodeToDb(const std::vector<ProjNodeResultItem>& nodeItems);
	virtual void savePipeToDb(const std::vector<PorjPipeResultItem>& pipeItems);

	void getLinCodeSnMap(std::map<std::string, std::string>& map);
	void getNodeCodeSnMap(std::map<std::string, std::string>& map);

	void getAllNodeCoords(NodeCoords& nodeCoords);
	void getAllPipeCoords(PipeCoords& pipeCoords);

protected:
	CivConnection* mConn = nullptr;
};