1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.mapper.TestUseCaseMapper">
<resultMap id="BaseResultMap" type="com.ruoyi.domain.TestUseCase">
<id property="id" column="id" jdbcType="BIGINT"/>
<result property="testScenarioId" column="test_scenario_id" jdbcType="BIGINT"/>
<result property="testTypeId" column="test_type_id" jdbcType="BIGINT"/>
<result property="usecaseNo" column="usecase_no" jdbcType="VARCHAR"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
<result property="tools" column="tools" jdbcType="VARCHAR"/>
<result property="input" column="input" jdbcType="VARCHAR"/>
<result property="description" column="description" jdbcType="VARCHAR"/>
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="testType" column="test_type" />
<result property="testScenario" column="test_scenario" />
</resultMap>
<sql id="Base_Column_List">
id,test_scenario_id,test_type_id,
usecase_no,`name`,tools,
input,description
</sql>
<select id="selectseCaseList" parameterType="com.ruoyi.web.request.TestUserCaseRequest" resultMap="BaseResultMap">
select tu.id,
tu.test_scenario_id,
tu.test_type_id,
tu.usecase_no,
tu.name,
tu.tools,
tu.input,
tu.description,
tu.update_by,
tu.update_time,
ty.test_type,
ts.test_scenario
from t_test_usecase tu
left join t_test_type ty on ty.id = tu.test_type_id
left join t_test_scenario ts on ts.id = tu.test_scenario_id
<where>
<if test="testScenarioId != null and testScenarioId != ''"> and tu.test_scenario_id = #{testScenarioId}</if>
<if test="testTypeId != null and testTypeId != ''"> and tu.test_type_id = #{testTypeId}</if>
<if test="searchKeywords != null and searchKeywords != ''"> and tu.usecase_no like concat('%', #{searchKeywords}, '%') or tu.name like concat('%', #{searchKeywords}, '%')</if>
</where>
</select>
<select id="selectListByTaskId" resultType="com.ruoyi.domain.vo.TestUsecaseVO">
select tu.id,
tu.case_id caseId,
ts.test_scenario testScenario,
tt.test_type testType,
tu.usecase_no usecaseNo,
tu.name,
tu.tools,
tu.input,
tu.description,
tu.review_standard_id,
rs.chapter,
rs.text,
rs.test_method testMethod,
tr.test_result testResult
from t_test_usecase tu
left join t_test_scenario ts on tu.test_scenario_id = ts.id
left join t_test_type tt on tu.test_type_id = tt.id
left join t_review_standard rs on tu.review_standard_id = rs.id
left join t_task_scenario_relation tsr on tsr.test_scenario_id = ts.id
left join t_task t on tsr.task_id = t.id
left join t_model_test_task mtt on mtt.id = t.model_test_task_id
left join t_test_records tr on tu.case_id = tr.usecase_id
where mtt.id = #{id}
group by tu.id, tu.case_id, ts.test_scenario, tt.test_type, tu.usecase_no, tu.name, tu.tools, tu.input,
tu.description, tu.review_standard_id, rs.chapter, rs.text, rs.test_method, tr.test_result
</select>
<select id="selectOptionalUsecase" resultType="com.ruoyi.domain.vo.OptionalUseCasesVO">
select
id AS `key`,
CONCAT('(', usecase_no, ')', name) AS label,
review_standard_id AS standardId
from
t_test_usecase
</select>
</mapper>