fix: 图表修改

This commit is contained in:
guoyuqi 2021-10-29 18:52:50 +08:00 committed by 刘瑞斌
parent a8f2e17476
commit 4cfb2e38ad
7 changed files with 27 additions and 7 deletions

View File

@ -141,7 +141,8 @@
</sql> </sql>
<select id="listModule" resultType="java.lang.Integer"> <select id="listModule" resultType="java.lang.Integer">
select count(id) from api_scenario select count(api_scenario.id) from api_scenario
left join project on api_scenario.project_id = project.id
<include refid="queryWhereCondition"/> <include refid="queryWhereCondition"/>
</select> </select>

View File

@ -540,7 +540,8 @@
</select> </select>
<select id="moduleCount" resultType="java.lang.Integer"> <select id="moduleCount" resultType="java.lang.Integer">
SELECT count(id) FROM api_test_case SELECT count(api_test_case.id) FROM api_test_case
left join project on api_test_case.project_id = project.id
<include refid="criCondition"/> <include refid="criCondition"/>
</select> </select>
@ -687,6 +688,9 @@
<property name="objectKey" value="request.combine.tags"/> <property name="objectKey" value="request.combine.tags"/>
</include> </include>
</if> </if>
<if test="request.workspaceId != null">
AND project.workspace_id = #{request.workspaceId}
</if>
</where> </where>
</sql> </sql>

View File

@ -30,7 +30,8 @@
SELECT * FROM issues WHERE issues.project_id = #{projectId} ORDER BY num DESC LIMIT 1; SELECT * FROM issues WHERE issues.project_id = #{projectId} ORDER BY num DESC LIMIT 1;
</select> </select>
<select id="getCountByStatus" resultType="io.metersphere.base.domain.IssuesDao"> <select id="getCountByStatus" resultType="io.metersphere.base.domain.IssuesDao">
select count(id) as totalIssueCount, ifnull(issues.status,issues.platform_status) as status from issues select count(issues.id) as totalIssueCount, ifnull(issues.status,issues.platform_status) as status from issues
left join project on issues.project_id = project.id
<include refid="queryWhereCondition"/> <include refid="queryWhereCondition"/>
group by status; group by status;
</select> </select>

View File

@ -193,7 +193,8 @@
</select> </select>
<select id="moduleCount" resultType="java.lang.Integer"> <select id="moduleCount" resultType="java.lang.Integer">
select count(id) from load_test select count(load_test.id) from load_test
left join project on load_test.project_id = project.id
<where> <where>
<if test="request.combine != null"> <if test="request.combine != null">
<include refid="countCombine"> <include refid="countCombine">
@ -202,6 +203,9 @@
<property name="objectKey" value="request.combine.tags"/> <property name="objectKey" value="request.combine.tags"/>
</include> </include>
</if> </if>
<if test="request.workspaceId != null">
AND project.workspace_id = #{request.workspaceId}
</if>
</where> </where>
</select> </select>

View File

@ -185,7 +185,8 @@
<include refid="io.metersphere.base.mapper.ext.ExtBaseMapper.orders"/> <include refid="io.metersphere.base.mapper.ext.ExtBaseMapper.orders"/>
</select> </select>
<select id="moduleCount" resultType="java.lang.Integer"> <select id="moduleCount" resultType="java.lang.Integer">
select count(id) from test_case select count(test_case.id) from test_case
left join project on test_case.project_id = project.id
<include refid="queryWhereCondition"/> <include refid="queryWhereCondition"/>
</select> </select>
@ -289,7 +290,7 @@
<select id="selectIds" resultType="java.lang.String"> <select id="selectIds" resultType="java.lang.String">
select select
id test_case.id
from test_case from test_case
<include refid="queryWhereCondition"/> <include refid="queryWhereCondition"/>
<include refid="io.metersphere.base.mapper.ext.ExtBaseMapper.orders"/> <include refid="io.metersphere.base.mapper.ext.ExtBaseMapper.orders"/>

View File

@ -35,7 +35,9 @@ public class WorkstationService {
//build query condition object //build query condition object
QueryTestPlanRequest testPlanRequest = new QueryTestPlanRequest(); QueryTestPlanRequest testPlanRequest = new QueryTestPlanRequest();
testPlanRequest.setUserId(userId); testPlanRequest.setUserId(userId);
testPlanRequest.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
ApiTestCaseRequest apiTestCaseRequest = new ApiTestCaseRequest(); ApiTestCaseRequest apiTestCaseRequest = new ApiTestCaseRequest();
apiTestCaseRequest.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
//@see io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml:103 //@see io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml:103
Map<String, Object> combine = new HashMap<>(2); Map<String, Object> combine = new HashMap<>(2);
Map<String,String>operatorValue = new HashMap<>(2); Map<String,String>operatorValue = new HashMap<>(2);
@ -45,8 +47,10 @@ public class WorkstationService {
testPlanRequest.setCombine(combine); testPlanRequest.setCombine(combine);
apiTestCaseRequest.setCombine(combine); apiTestCaseRequest.setCombine(combine);
ApiScenarioRequest apiScenarioRequest = new ApiScenarioRequest(); ApiScenarioRequest apiScenarioRequest = new ApiScenarioRequest();
apiScenarioRequest.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
apiScenarioRequest.setCombine(combine); apiScenarioRequest.setCombine(combine);
QueryTestCaseRequest testCaseRequest = new QueryTestCaseRequest(); QueryTestCaseRequest testCaseRequest = new QueryTestCaseRequest();
testCaseRequest.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
testCaseRequest.setCombine(combine); testCaseRequest.setCombine(combine);
//query db //query db
int apiScenarioCaseCount = extApiScenarioMapper.listModule(apiScenarioRequest); int apiScenarioCaseCount = extApiScenarioMapper.listModule(apiScenarioRequest);

View File

@ -171,7 +171,12 @@ export default {
}, },
mounted() { mounted() {
this.getProject(); this.getProject();
let routeTestCase = this.$route.params.testCase;
if(routeTestCase && routeTestCase.add===true){
this.addTab({name: 'add'});
}else {
this.init(this.$route); this.init(this.$route);
}
}, },
watch: { watch: {
redirectID() { redirectID() {