Commit 07cae430 authored by wdy's avatar wdy

查询标准要求

parent 3ba8ba44
...@@ -3,6 +3,8 @@ package com.ruoyi.mapper; ...@@ -3,6 +3,8 @@ package com.ruoyi.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.domain.ReviewStandard; import com.ruoyi.domain.ReviewStandard;
import com.ruoyi.web.request.ReviewStandardListByPageRequest; import com.ruoyi.web.request.ReviewStandardListByPageRequest;
import com.ruoyi.web.request.ReviewStandardListRequest;
import com.ruoyi.web.response.ReviewStandardListResponse;
import com.ruoyi.web.response.ReviewStandardResponse; import com.ruoyi.web.response.ReviewStandardResponse;
import com.ruoyi.web.response.ReviewStandardTestInspectionContentResponse; import com.ruoyi.web.response.ReviewStandardTestInspectionContentResponse;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -30,4 +32,6 @@ public interface ReviewStandardMapper extends BaseMapper<ReviewStandard> { ...@@ -30,4 +32,6 @@ public interface ReviewStandardMapper extends BaseMapper<ReviewStandard> {
* @return * @return
*/ */
List<ReviewStandardTestInspectionContentResponse> selectTestInspectionContent(Long id); List<ReviewStandardTestInspectionContentResponse> selectTestInspectionContent(Long id);
List<ReviewStandardListResponse> findReviewStandardList(ReviewStandardListRequest request);
} }
...@@ -3,7 +3,9 @@ package com.ruoyi.service; ...@@ -3,7 +3,9 @@ package com.ruoyi.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.domain.ReviewStandard; import com.ruoyi.domain.ReviewStandard;
import com.ruoyi.web.request.ReviewStandardListByPageRequest; import com.ruoyi.web.request.ReviewStandardListByPageRequest;
import com.ruoyi.web.request.ReviewStandardListRequest;
import com.ruoyi.web.response.ReviewStandardInspectionContentResponse; import com.ruoyi.web.response.ReviewStandardInspectionContentResponse;
import com.ruoyi.web.response.ReviewStandardListResponse;
import com.ruoyi.web.response.ReviewStandardResponse; import com.ruoyi.web.response.ReviewStandardResponse;
import com.ruoyi.web.response.ReviewStandardTestInspectionContentResponse; import com.ruoyi.web.response.ReviewStandardTestInspectionContentResponse;
...@@ -43,4 +45,11 @@ public interface ReviewStandardService extends IService<ReviewStandard> { ...@@ -43,4 +45,11 @@ public interface ReviewStandardService extends IService<ReviewStandard> {
* @return * @return
*/ */
List<ReviewStandardTestInspectionContentResponse> selectTestInspectionContent(Long id); List<ReviewStandardTestInspectionContentResponse> selectTestInspectionContent(Long id);
/**
* 查询标准要求
* @param request
* @return
*/
List<ReviewStandardListResponse> findReviewStandardList(ReviewStandardListRequest request);
} }
...@@ -6,7 +6,9 @@ import com.ruoyi.domain.*; ...@@ -6,7 +6,9 @@ import com.ruoyi.domain.*;
import com.ruoyi.mapper.ReviewStandardMapper; import com.ruoyi.mapper.ReviewStandardMapper;
import com.ruoyi.service.*; import com.ruoyi.service.*;
import com.ruoyi.web.request.ReviewStandardListByPageRequest; import com.ruoyi.web.request.ReviewStandardListByPageRequest;
import com.ruoyi.web.request.ReviewStandardListRequest;
import com.ruoyi.web.response.ReviewStandardInspectionContentResponse; import com.ruoyi.web.response.ReviewStandardInspectionContentResponse;
import com.ruoyi.web.response.ReviewStandardListResponse;
import com.ruoyi.web.response.ReviewStandardResponse; import com.ruoyi.web.response.ReviewStandardResponse;
import com.ruoyi.web.response.ReviewStandardTestInspectionContentResponse; import com.ruoyi.web.response.ReviewStandardTestInspectionContentResponse;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -98,6 +100,11 @@ public class ReviewStandardServiceImpl extends ServiceImpl<ReviewStandardMapper, ...@@ -98,6 +100,11 @@ public class ReviewStandardServiceImpl extends ServiceImpl<ReviewStandardMapper,
return list; return list;
} }
@Override
public List<ReviewStandardListResponse> findReviewStandardList(ReviewStandardListRequest request) {
return reviewStandardMapper.findReviewStandardList(request);
}
/** /**
* 将审查 标准、要点、细则、场景 按照父子关系拆分写入到各自的表中 * 将审查 标准、要点、细则、场景 按照父子关系拆分写入到各自的表中
* @param reviewStandardList * @param reviewStandardList
......
...@@ -7,20 +7,19 @@ import com.ruoyi.common.core.domain.R; ...@@ -7,20 +7,19 @@ import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.domain.ReviewStandard; import com.ruoyi.domain.ReviewStandard;
import com.ruoyi.service.ReviewStandardService; import com.ruoyi.service.ReviewStandardService;
import com.ruoyi.web.request.ReviewStandardInspectionContentRequest; import com.ruoyi.web.request.*;
import com.ruoyi.web.request.ReviewStandardListByPageRequest;
import com.ruoyi.web.request.ReviewStandardTestInspectionContentRequest;
import com.ruoyi.web.response.ReviewStandardInspectionContentResponse; import com.ruoyi.web.response.ReviewStandardInspectionContentResponse;
import com.ruoyi.web.response.ReviewStandardListResponse;
import com.ruoyi.web.response.ReviewStandardResponse; import com.ruoyi.web.response.ReviewStandardResponse;
import com.ruoyi.web.response.ReviewStandardTestInspectionContentResponse; import com.ruoyi.web.response.ReviewStandardTestInspectionContentResponse;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Tags;
import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List; import java.util.List;
...@@ -72,4 +71,12 @@ public class ReviewStandardController extends BaseController { ...@@ -72,4 +71,12 @@ public class ReviewStandardController extends BaseController {
List<ReviewStandardTestInspectionContentResponse> response = reviewStandardService.selectTestInspectionContent(request.getId()); List<ReviewStandardTestInspectionContentResponse> response = reviewStandardService.selectTestInspectionContent(request.getId());
return R.ok(response); return R.ok(response);
} }
@ApiOperation("查询标注要求列表")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/findReviewStandardList")
public TableDataInfo<ReviewStandardListResponse> findReviewStandardList(@Validated @RequestBody ReviewStandardListRequest request) {
return getDataTable(reviewStandardService.findReviewStandardList(request));
}
} }
package com.ruoyi.web.request;
import com.ruoyi.common.core.page.PageDomain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@ApiModel(value = "ReviewStandardListRequest", description = "查询标准要求")
@Data
public class ReviewStandardListRequest {
@ApiModelProperty("章节")
private String chapter;
@ApiModelProperty("要求")
private String text;
@ApiModelProperty("分类要求[system、car、test]")
private String type;
}
package com.ruoyi.web.response;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "ReviewStandardListResponse", description = "查询标准要求")
public class ReviewStandardListResponse {
@ApiModelProperty("ID")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long id;
@ApiModelProperty("章节")
private String chapter;
@ApiModelProperty("文本内容")
private String text;
}
...@@ -25,6 +25,12 @@ ...@@ -25,6 +25,12 @@
</resultMap> </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="findTree" resultMap="StandardTreeResultMap">
SELECT id, chapter, text, standard_id, name, standard_no, file, conformity, inconformity FROM t_review_standard; SELECT id, chapter, text, standard_id, name, standard_no, file, conformity, inconformity FROM t_review_standard;
</select> </select>
...@@ -62,6 +68,18 @@ ...@@ -62,6 +68,18 @@
WHERE WHERE
usecase.review_standard_id = #{id} usecase.review_standard_id = #{id}
</select> </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>
</mapper> </mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment