#include "stockbasissqlmanager.h"

StockBasisSqlManager::StockBasisSqlManager()
{

}


StockBasisSqlManager::~StockBasisSqlManager()
{

}

QString StockBasisSqlManager::toInsertSql(_stocksInfo stock)
{
//    insert into stock_basis (code,name,blemind2,blemind3,listdate) value ('301099.SZ','C雅创','电子元件','电子元件','2021-11-22')
//            on DUPLICATE key update name = 'Ccv雅创',blemind2='电子元件'
    QString sql = QString("insert into stock_basis (code, name, blemind2,blemind3,listdate) "
                          "value(':code', ':name', ':blemind2',':blemind3',':listdate') on DUPLICATE key "
                          "update name = ':name',blemind2=':blemind2',blemind3=':blemind3',listdate=':listdate';");
    sql.replace(":code",stock.code);
    sql.replace(":name",stock.name);
    sql.replace(":blemind2",stock.blemind2);
    sql.replace(":blemind3",stock.blemind3);
    sql.replace(":listdate",stock.listDate);
    return sql;
}

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

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