refactor: 修改查询方法
This commit is contained in:
parent
2105d16cba
commit
4118ad2bfb
|
@ -490,10 +490,14 @@
|
|||
WHERE ref_id = api_definition.ref_id
|
||||
LIMIT 1)
|
||||
OR
|
||||
version_id = (SELECT tmp.version_id
|
||||
version_id = (SELECT project_version.id
|
||||
FROM api_definition tmp
|
||||
JOIN project_version ON tmp.project_id = project_version.project_id AND
|
||||
tmp.version_id = project_version.id
|
||||
WHERE ref_id = api_definition.ref_id
|
||||
ORDER BY tmp.update_time DESC
|
||||
GROUP BY ref_id
|
||||
HAVING MAX(latest) = 0
|
||||
ORDER BY MAX(tmp.update_time) DESC
|
||||
LIMIT 1)
|
||||
)
|
||||
</if>
|
||||
|
@ -750,10 +754,14 @@
|
|||
WHERE ref_id = api_definition.ref_id
|
||||
LIMIT 1)
|
||||
OR
|
||||
version_id = (SELECT tmp.version_id
|
||||
version_id = (SELECT project_version.id
|
||||
FROM api_definition tmp
|
||||
JOIN project_version ON tmp.project_id = project_version.project_id AND
|
||||
tmp.version_id = project_version.id
|
||||
WHERE ref_id = api_definition.ref_id
|
||||
ORDER BY tmp.update_time DESC
|
||||
GROUP BY ref_id
|
||||
HAVING MAX(latest) = 0
|
||||
ORDER BY MAX(tmp.update_time) DESC
|
||||
LIMIT 1)
|
||||
)
|
||||
</if>
|
||||
|
|
|
@ -333,10 +333,14 @@
|
|||
WHERE ref_id = api_scenario.ref_id
|
||||
LIMIT 1)
|
||||
OR
|
||||
version_id = (SELECT tmp.version_id
|
||||
version_id = (SELECT project_version.id
|
||||
FROM api_scenario tmp
|
||||
JOIN project_version ON tmp.project_id = project_version.project_id AND
|
||||
tmp.version_id = project_version.id
|
||||
WHERE ref_id = api_scenario.ref_id
|
||||
ORDER BY tmp.update_time DESC
|
||||
GROUP BY ref_id
|
||||
HAVING MAX(latest) = 0
|
||||
ORDER BY MAX(tmp.update_time) DESC
|
||||
LIMIT 1)
|
||||
)
|
||||
</if>
|
||||
|
|
|
@ -181,10 +181,14 @@
|
|||
WHERE ref_id = load_test.ref_id
|
||||
LIMIT 1)
|
||||
OR
|
||||
version_id = (SELECT tmp.version_id
|
||||
version_id = (SELECT project_version.id
|
||||
FROM load_test tmp
|
||||
JOIN project_version ON tmp.project_id = project_version.project_id AND
|
||||
tmp.version_id = project_version.id
|
||||
WHERE ref_id = load_test.ref_id
|
||||
ORDER BY tmp.update_time DESC
|
||||
GROUP BY ref_id
|
||||
HAVING MAX(latest) = 0
|
||||
ORDER BY MAX(tmp.update_time) DESC
|
||||
LIMIT 1)
|
||||
)
|
||||
</if>
|
||||
|
|
|
@ -142,10 +142,14 @@
|
|||
WHERE ref_id = test_case.ref_id
|
||||
LIMIT 1)
|
||||
OR
|
||||
version_id = (SELECT tmp.version_id
|
||||
version_id = (SELECT project_version.id
|
||||
FROM test_case tmp
|
||||
JOIN project_version ON tmp.project_id = project_version.project_id AND
|
||||
tmp.version_id = project_version.id
|
||||
WHERE ref_id = test_case.ref_id
|
||||
ORDER BY tmp.update_time DESC
|
||||
GROUP BY ref_id
|
||||
HAVING MAX(latest) = 0
|
||||
ORDER BY MAX(tmp.update_time) DESC
|
||||
LIMIT 1)
|
||||
)
|
||||
</if>
|
||||
|
@ -631,10 +635,14 @@
|
|||
WHERE ref_id = test_case.ref_id
|
||||
LIMIT 1)
|
||||
OR
|
||||
version_id = (SELECT tmp.version_id
|
||||
version_id = (SELECT project_version.id
|
||||
FROM test_case tmp
|
||||
JOIN project_version ON tmp.project_id = project_version.project_id AND
|
||||
tmp.version_id = project_version.id
|
||||
WHERE ref_id = test_case.ref_id
|
||||
ORDER BY tmp.update_time DESC
|
||||
GROUP BY ref_id
|
||||
HAVING MAX(latest) = 0
|
||||
ORDER BY MAX(tmp.update_time) DESC
|
||||
LIMIT 1)
|
||||
)
|
||||
</if>
|
||||
|
|
|
@ -186,10 +186,14 @@
|
|||
WHERE ref_id = test_case.ref_id
|
||||
LIMIT 1)
|
||||
OR
|
||||
version_id = (SELECT tmp.version_id
|
||||
version_id = (SELECT project_version.id
|
||||
FROM test_case tmp
|
||||
JOIN project_version ON tmp.project_id = project_version.project_id AND
|
||||
tmp.version_id = project_version.id
|
||||
WHERE ref_id = test_case.ref_id
|
||||
ORDER BY tmp.update_time DESC
|
||||
GROUP BY ref_id
|
||||
HAVING MAX(latest) = 0
|
||||
ORDER BY MAX(tmp.update_time) DESC
|
||||
LIMIT 1)
|
||||
)
|
||||
</if>
|
||||
|
|
|
@ -182,10 +182,14 @@
|
|||
WHERE ref_id = test_case.ref_id
|
||||
LIMIT 1)
|
||||
OR
|
||||
version_id = (SELECT tmp.version_id
|
||||
version_id = (SELECT project_version.id
|
||||
FROM test_case tmp
|
||||
JOIN project_version ON tmp.project_id = project_version.project_id AND
|
||||
tmp.version_id = project_version.id
|
||||
WHERE ref_id = test_case.ref_id
|
||||
ORDER BY tmp.update_time DESC
|
||||
GROUP BY ref_id
|
||||
HAVING MAX(latest) = 0
|
||||
ORDER BY MAX(tmp.update_time) DESC
|
||||
LIMIT 1)
|
||||
)
|
||||
</if>
|
||||
|
|
Loading…
Reference in New Issue