#pragma once
#include "CivAssembly.h"
#include "CivInpHelperAbs.h"
#include <memory>
#include "pandaDbManager.h"

/**
 从数据库获取inp文件相关的类
*/
class PANDADBMANAGER_API CivInpDbHelper:public CivInpHelperAbs
{
public:
	explicit CivInpDbHelper(const std::string& uri);
	~CivInpDbHelper();

	void handlePump() override;
	void handleValve() override;
	bool getNode(CivNode& node)override;
	bool getPipe(CivPipe& pipe) override;
	bool getTank(CivTank& tank) override;
	bool getValve(CivValve& valve) override;
	bool getPumps(CivPumps& pump) override;
	bool getReservoirs(CivReservoirs& reservoirs) override;
	bool getCoordinates(CivCoordinates& coord) override;
	bool getQuality(CivQuality& quality) override;	
	bool getStatus(CivStatus& status) override;

private:
	bool handleValves2();
	
	std::string splicingSql(const std::string& rightTable,const std::string& demandName="需水量模式",const std::string& demandPattern = "基本需水量");

};
