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
88
89
90
91
92
93
94
<?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.ReviewStandardMapper">
<resultMap id="StandardTreeResultMap" type="com.ruoyi.domain.ReviewStandard">
<id property="id" column="id" jdbcType="BIGINT"/>
<result property="type" column="type" jdbcType="VARBINARY"/>
<result property="chapter" column="chapter" jdbcType="VARCHAR"/>
<result property="text" column="text" jdbcType="VARCHAR"/>
<result property="standardId" column="standard_id" jdbcType="BIGINT"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
<result property="standardNo" column="standard_no" jdbcType="VARCHAR"/>
<result property="file" column="file" jdbcType="VARCHAR"/>
<result property="conformity" column="conformity" jdbcType="VARCHAR"/>
<result property="inconformity" column="inconformity" jdbcType="VARCHAR"/>
<result property="testMethod" column="test_method" jdbcType="VARCHAR"/>
<collection property="keyPointList" ofType="com.ruoyi.domain.ReviewKeyPoint" select="com.ruoyi.mapper.ReviewKeyPointMapper.findAllByReviewStandardId" column="id">
<result property="id" column="u_id" jdbcType="BIGINT"/>
<result property="text" column="text" jdbcType="VARCHAR"/>
</collection>
</resultMap>
<resultMap id="StandardListResultMap" type="com.ruoyi.web.response.ReviewStandardListResponse">
<id property="id" column="id" jdbcType="BIGINT"/>
<result property="chapter" column="chapter" jdbcType="VARCHAR"/>
<result property="text" column="text" jdbcType="VARCHAR"/>
</resultMap>
<select id="findTree" resultMap="StandardTreeResultMap">
SELECT id, chapter, text, standard_id, name, standard_no, file, conformity, inconformity FROM t_review_standard;
</select>
<select id="findListByStandardIdAndType" resultType="com.ruoyi.domain.ReviewStandard">
SELECT id, type, chapter, text, standard_id, name, standard_no, file, conformity, inconformity FROM t_review_standard WHERE standard_id = #{standardId} AND type = #{type};
</select>
<select id="selectReviewStandardList" parameterType="com.ruoyi.web.request.ReviewStandardListByPageRequest" resultType="com.ruoyi.web.response.ReviewStandardResponse">
select
id, chapter, text
from
t_review_standard
<where>
<if test="standardId != null"> and standard_id = #{standardId} </if>
<if test="type != null and type != ''"> and `type` = #{type} </if>
<if test="chapter != null and chapter != ''"> and chapter like concat('%', #{chapter}, '%') </if>
<if test="text != null and text != ''"> and text like concat('%', #{text}, '%') </if>
</where>
ORDER BY
chapter
</select>
<select id="selectTestInspectionContent"
resultType="com.ruoyi.web.response.ReviewStandardTestInspectionContentResponse">
SELECT
usecase.NAME useCaseName,
usecase.usecase_no useCaseNumber,
scenario.test_scenario,
type.test_type
FROM
t_test_usecase usecase
LEFT JOIN t_test_scenario scenario ON scenario.id = usecase.test_scenario_id
LEFT JOIN t_test_type type ON type.id = usecase.test_type_id
WHERE
usecase.review_standard_id = #{id}
</select>
<select id="findReviewStandardList" resultType="com.ruoyi.web.response.ReviewStandardListResponse">
SELECT id,chapter,text FROM t_review_standard
<where>
type = #{type}
<if test="chapter != null and chapter != ''">
and chapter like concat('%', #{chapter}, '%')
</if>
<if test="text != null and text != ''">
and text like concat('%', #{text}, '%')
</if>
</where>
</select>
<select id="findByKeyPointList" resultType="com.ruoyi.domain.ReviewStandard">
SELECT id, chapter, text FROM t_review_standard
WHERE id IN
<foreach collection="keyPointList" item="keyPoint" open="(" separator="," close=")">
#{keyPoint.reviewStandardId}
</foreach>
and standard_id = #{request.standardId}
and type = #{request.type}
</select>
</mapper>