| | |
| | | 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(" 责任主体名称='%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,"查询失败","可能查询的内容不正确或者没有记录相应的数据"); |
| | | } |
| | | |
| | | } |