From 16e4354e393799963ec49630d814292bbfeae110 Mon Sep 17 00:00:00 2001 From: wumu <mayi@mayi.com> Date: 星期三, 15 五月 2024 23:45:15 +0800 Subject: [PATCH] 0515 --- internal_system_v1/threemergeproblemlist.cpp | 85 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 85 insertions(+), 0 deletions(-) diff --git a/internal_system_v1/threemergeproblemlist.cpp b/internal_system_v1/threemergeproblemlist.cpp index 2b00b35..e3ecf7f 100644 --- a/internal_system_v1/threemergeproblemlist.cpp +++ b/internal_system_v1/threemergeproblemlist.cpp @@ -830,3 +830,88 @@ QMessageBox::information(this,"淇濆瓨鎻愮ず",QString("鎬昏鏁颁负%1,鎴愬姛%2琛岋紝澶辫触%3琛屻��").arg(ui->tableWidget->rowCount()) .arg(hasContentRow).arg(ui->tableWidget->rowCount()-hasContentRow)); } + +void ThreeMergeProblemList::on_pushButton_moreSearch_clicked() +{ + QString sql = "select * from standing_book_info "; + + QVector<QString> vecCon; // 淇濆瓨鎵�鏈夋潯浠� + + if(ui->checkBox_type->isChecked()){ + QString condition= QString(" 瀹¤绫诲埆='%1' ").arg(ui->comboBox_type->currentText()); + vecCon.append(condition); + } + if(ui->checkBox_year->isChecked()){ + QString condition= QString(" 瀹¤骞村害='%1' ").arg(ui->dateEdit_year->text()); + vecCon.append(condition); + } + if(ui->checkBox_com->isChecked()){ + QString condition= QString(" 瀹¤鍗曚綅='%1' ").arg(ui->comboBox_com->currentText()); + vecCon.append(condition); + } + if(ui->checkBox_way->isChecked()){ + QString condition= QString(" 瀹¤鏂瑰紡='%1' ").arg(ui->comboBox_way->currentText()); + vecCon.append(condition); + } + if(ui->checkBox_mainCom->isChecked()){ + QString condition= QString(" 璐d换涓讳綋鍚嶇О='%1' ").arg(ui->comboBox_mainCom->currentText()); + vecCon.append(condition); + } + if(ui->checkBox_pro->isChecked()){ + QString condition= QString(" 瀹¤椤圭洰='%1' ").arg(ui->comboBox_pro->currentText()); + vecCon.append(condition); + } + if(ui->checkBox_proName->isChecked()){ + QString condition= QString(" 瀹¤椤圭洰鍚嶇О='%1' ").arg(ui->comboBox_proName->currentText()); + vecCon.append(condition); + } + if(ui->checkBox_qtype->isChecked()){ + QString condition= QString(" 闂绫诲埆='%1' ").arg(ui->comboBox_qtype->currentText()); + vecCon.append(condition); + } + if(ui->checkBox_qdx->isChecked()){ + QString condition= QString(" 闂瀹氭��='%1' ").arg(ui->comboBox_qdx->currentText()); + vecCon.append(condition); + } + if(ui->checkBox_about_money->isChecked()){ + QString condition= QString(" 娑夊強閲戦>='%1' and 娑夊強閲戦<='%2' ").arg(ui->comboBox_about_bgMonney->currentText()).arg(ui->comboBox_about_edMoney->currentText()); + vecCon.append(condition); + } + if(ui->checkBox_changeMoney->isChecked()){ + QString condition= QString(" 鏁存敼閲戦>='%1' and 鏁存敼閲戦<='%2' ").arg(ui->comboBox_change_bgMoney->currentText()).arg(ui->comboBox_change_edMoney->currentText()); + vecCon.append(condition); + } + if(ui->checkBox_change_over_time->isChecked()){ + QString condition= QString(" 鏁存敼瀹屾垚鏃堕棿='%1' ").arg(ui->dateEdit_change_over_time->text()); + vecCon.append(condition); + } + if(ui->checkBox_change_expected_time->isChecked()){ + QString condition= QString(" 鏁存敼棰勮瀹屾垚鏃堕棿='%1' ").arg(ui->dateEdit_change_expected_time->text()); + vecCon.append(condition); + } + QString condition; + if(vecCon.size() == 1){ + condition += QString(" where %1").arg(vecCon.at(0)); + }else if(vecCon.size() > 1){ + condition += QString(" where %1").arg(vecCon.at(0)); + for(int i=1;i<vecCon.size();++i){ + condition += QString(" and %1 ").arg(vecCon.at(i)); + } + } + sql += condition; + qDebug()<<sql; + + QVector<QVector<QString>> res; + int rows = selectSQL(sql,res); + if(rows > 0){ + ui->tableWidget->setRowCount(rows); + for(int i=0;i<res.size();++i){ + for(int j=0;j<res.at(0).size()-1;++j){ // 鍘绘帀璁板綍鏃堕棿 + ui->tableWidget->setItem(i,j,new QTableWidgetItem(res[i][j])); + } + } + }else{ + QMessageBox::information(this,"鏌ヨ澶辫触","鍙兘鏌ヨ鐨勫唴瀹逛笉姝g‘鎴栬�呮病鏈夎褰曠浉搴旂殑鏁版嵁"); + } + +} -- Gitblit v1.8.0