|
@@ -52,23 +52,27 @@ public class QCTestController {
|
|
|
List<Map<String, Object>> updates = new ArrayList<>();
|
|
|
List<Map<String, Object>> wheres = new ArrayList<>();
|
|
|
try {
|
|
|
+ String textSql = "select id, text from qc_inputcases ";
|
|
|
if (StringUtils.isNotEmpty(txtId)) {
|
|
|
- mysqlJdbc.update("update qc_inputcases_mapping set pass = 0 where text_id = " + txtId);
|
|
|
+ textSql = textSql + " where qi.id >= " + txtId;
|
|
|
}
|
|
|
+ textSql = textSql + " order by id limit 0, " + length;
|
|
|
+ //更新pass状态
|
|
|
+ mysqlJdbc.update("update qc_inputcases_mapping qim, " +
|
|
|
+ "(" + textSql + ") qi\n" +
|
|
|
+ "set qim.pass = 0 where qim.text_id = qi.id");
|
|
|
|
|
|
st = conn.createStatement();
|
|
|
//测试数据查询
|
|
|
- String sql = "SELECT qmap.id, qi.id text_id, qi.text, ca.name, entry.code FROM \n" +
|
|
|
- "qc_inputcases_mapping qmap, qc_inputcases qi, qc_cases_entry entry, qc_cases ca\n" +
|
|
|
- "where qmap.text_id = qi.id and qmap.cases_entry_id = entry.id and entry.cases_id = ca.id and qi.id != 37";
|
|
|
+ String sql = "SELECT qmap.id, qi.id text_id, qi.text, ca.name, entry.code FROM " +
|
|
|
+ "qc_inputcases_mapping qmap, (" + textSql + ") qi, qc_cases_entry entry, qc_cases ca " +
|
|
|
+ "where qmap.text_id = qi.id and qmap.cases_entry_id = entry.id and entry.cases_id = ca.id";
|
|
|
|
|
|
if (StringUtils.isNotEmpty(caseIds)) {
|
|
|
sql = sql + " and entry.cases_id in (" + caseIds + ")";
|
|
|
}
|
|
|
- if (StringUtils.isNotEmpty(txtId)) {
|
|
|
- sql = sql + " and qi.id = " + txtId;
|
|
|
- }
|
|
|
- sql = sql + " order by qi.id";
|
|
|
+
|
|
|
+ sql = sql + " order by qi.id, entry.code";
|
|
|
|
|
|
Map<String, String> map = new HashMap<>();
|
|
|
rs = st.executeQuery(sql);
|
|
@@ -92,15 +96,14 @@ public class QCTestController {
|
|
|
r5 = rs.getString(5);
|
|
|
if (!textId.equals(String.valueOf(r2))) {
|
|
|
if (StringUtils.isNotEmpty(textId)) {
|
|
|
- index++;
|
|
|
- if (index > length) {
|
|
|
- break;
|
|
|
- }
|
|
|
catalogueList.add(catalogueMap);
|
|
|
updateList.add(updateMap);
|
|
|
- textList.add(r3);
|
|
|
- caseList.add(r4);
|
|
|
- textIdList.add(r2);
|
|
|
+ textList.add(text);
|
|
|
+ caseList.add(caseName);
|
|
|
+ textIdList.add(textId);
|
|
|
+
|
|
|
+ catalogueMap = new HashMap<>();
|
|
|
+ updateMap = new HashMap<>();
|
|
|
}
|
|
|
catalogueMap = new HashMap<>();
|
|
|
}
|