#include "xhighstocks.h"

XHighStocks::XHighStocks(QObject *parent) : QObject(parent)
{

}

XHighStocks::~XHighStocks()
{

}

QString XHighStocks::toInsertSql(_HighStocksParam stock)
{
    QString sql = QString("insert into highstocks (code, name, tradeDay,open,close,high,differRange,volumn,BLEMIND2,hpDateP,isHighRangeP) "
                                           "SELECT  '%1', '%2', '%3',%4,%5,%6,%7,%8,'%9','%10',%11 from DUAL where not exists(select code from highstocks where code = '%1' and tradeDay = '%3' and open = %4);")
            .arg(stock.code)
            .arg(stock.name)
            .arg(stock.tradeDay)
            .arg(stock.open)
            .arg(stock.close)
            .arg(stock.high)
            .arg(stock.differRange)
            .arg(stock.volumn)
            .arg(stock.BLEMIND2)
            .arg(stock.HpDateP)
            .arg(stock.isHighRangeP);
    return sql;
}

QString XHighStocks::toDeleteSql()
{
    return "";
}

QString XHighStocks::toQuerySql()
{
    return "";
}
