|
@@ -13,9 +13,9 @@ bool SchemeInfoService::AddSchemeInfoList(const QList<SchemaEval *> &schemeList)
|
|
Transaction t(SqlDBHelper::getDatabase());
|
|
Transaction t(SqlDBHelper::getDatabase());
|
|
for (int i = 0; i < schemeList.length(); i++) {
|
|
for (int i = 0; i < schemeList.length(); i++) {
|
|
SchemaEval *scheme = schemeList.at(i);
|
|
SchemaEval *scheme = schemeList.at(i);
|
|
- InsertQuery q = t.insertInto("t_scheme_info (project_id,name,remark,value_str,score,file_path)");
|
|
|
|
|
|
+ InsertQuery q = t.insertInto("t_scheme_info (project_id,name,remark,value_str,score,file_path,type)");
|
|
q.values(scheme->engineerId, scheme->name, scheme->remark, scheme->valueStr, scheme->score,
|
|
q.values(scheme->engineerId, scheme->name, scheme->remark, scheme->valueStr, scheme->score,
|
|
- scheme->filePath)
|
|
|
|
|
|
+ scheme->filePath, scheme->type)
|
|
.exec();
|
|
.exec();
|
|
t.commit();
|
|
t.commit();
|
|
}
|
|
}
|
|
@@ -40,15 +40,16 @@ bool SchemeInfoService::DeleteSchemeByEngineerId(int engineerId)
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
-bool SchemeInfoService::QuerySchemeInfoByEngineerId(QList<SchemaEval *> *schemeList, int engineerId)
|
|
|
|
|
|
+bool SchemeInfoService::QuerySchemeInfoByEngineerId(QList<SchemaEval *> *schemeList, int engineerId, int type)
|
|
{
|
|
{
|
|
QSqlDatabase db = SqlDBHelper::getDatabase();
|
|
QSqlDatabase db = SqlDBHelper::getDatabase();
|
|
QSqlQuery query(db);
|
|
QSqlQuery query(db);
|
|
bool ret = false;
|
|
bool ret = false;
|
|
QString selectSql = QString("select id,project_id,name,remark,value_str "
|
|
QString selectSql = QString("select id,project_id,name,remark,value_str "
|
|
- ",score from t_scheme_info where "
|
|
|
|
- " engineer_id =%1 ")
|
|
|
|
- .arg(QString::number(engineerId));
|
|
|
|
|
|
+ ",score,file_path,type from t_scheme_info where "
|
|
|
|
+ " project_id =%1 and type = %2 ")
|
|
|
|
+ .arg(QString::number(engineerId))
|
|
|
|
+ .arg(type);
|
|
// qDebug() << "sql=" << selectSql;
|
|
// qDebug() << "sql=" << selectSql;
|
|
if (query.exec(selectSql)) {
|
|
if (query.exec(selectSql)) {
|
|
while (query.next()) {
|
|
while (query.next()) {
|
|
@@ -60,6 +61,8 @@ bool SchemeInfoService::QuerySchemeInfoByEngineerId(QList<SchemaEval *> *schemeL
|
|
scheme->remark = query.value(3).toString();
|
|
scheme->remark = query.value(3).toString();
|
|
scheme->valueStr = query.value(4).toString();
|
|
scheme->valueStr = query.value(4).toString();
|
|
scheme->score = query.value(5).toDouble();
|
|
scheme->score = query.value(5).toDouble();
|
|
|
|
+ scheme->filePath = query.value(6).toString();
|
|
|
|
+ scheme->type = query.value(7).toInt();
|
|
schemeList->append(scheme);
|
|
schemeList->append(scheme);
|
|
}
|
|
}
|
|
ret = true;
|
|
ret = true;
|