缺陷查询增加部件id
This commit is contained in:
parent
1143ea4c18
commit
817791b6e1
|
@ -1,12 +1,11 @@
|
||||||
package com.dite.znpt.domain.vo;
|
package com.dite.znpt.domain.vo;
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author huise23
|
* @author huise23
|
||||||
* @date 2025/04/11 23:17
|
* @date 2025/04/11 23:17
|
||||||
|
@ -27,6 +26,9 @@ public class DefectListReq implements Serializable {
|
||||||
@ApiModelProperty("机组id")
|
@ApiModelProperty("机组id")
|
||||||
private String turbineId;
|
private String turbineId;
|
||||||
|
|
||||||
|
@ApiModelProperty("部件id")
|
||||||
|
private String partId;
|
||||||
|
|
||||||
@ApiModelProperty("缺陷类型,枚举:DefectTypeEnum")
|
@ApiModelProperty("缺陷类型,枚举:DefectTypeEnum")
|
||||||
private String defectType;
|
private String defectType;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.dite.znpt.domain.vo;
|
package com.dite.znpt.domain.vo;
|
||||||
|
|
||||||
|
import com.dite.znpt.domain.bo.Detection;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -32,4 +33,10 @@ public class DefectListResp implements Serializable {
|
||||||
|
|
||||||
@ApiModelProperty("说明")
|
@ApiModelProperty("说明")
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
|
@ApiModelProperty("标注信息")
|
||||||
|
private String labelInfo;
|
||||||
|
|
||||||
|
@ApiModelProperty("标注信息")
|
||||||
|
private Detection markInfo;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,8 +3,8 @@ package com.dite.znpt.mapper;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.dite.znpt.domain.entity.DefectEntity;
|
import com.dite.znpt.domain.entity.DefectEntity;
|
||||||
import com.dite.znpt.domain.vo.DefectListReq;
|
import com.dite.znpt.domain.vo.DefectListReq;
|
||||||
|
import com.dite.znpt.domain.vo.DefectListResp;
|
||||||
import com.dite.znpt.domain.vo.DefectResp;
|
import com.dite.znpt.domain.vo.DefectResp;
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ import java.util.List;
|
||||||
* @Description: 缺陷记录表数据库访问层
|
* @Description: 缺陷记录表数据库访问层
|
||||||
*/
|
*/
|
||||||
public interface DefectMapper extends BaseMapper<DefectEntity> {
|
public interface DefectMapper extends BaseMapper<DefectEntity> {
|
||||||
List<DefectResp> queryBySelective(DefectListReq defectReq);
|
List<DefectListResp> queryBySelective(DefectListReq defectReq);
|
||||||
DefectResp detail(String defectId);
|
DefectResp detail(String defectId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,9 +21,9 @@ public interface DefectService extends IService<DefectEntity> {
|
||||||
* @author huise23
|
* @author huise23
|
||||||
* @date 2025/04/11 23:17
|
* @date 2025/04/11 23:17
|
||||||
**/
|
**/
|
||||||
List<DefectResp> page(DefectListReq req);
|
List<DefectListResp> page(DefectListReq req);
|
||||||
|
|
||||||
List<DefectResp> list(DefectListReq req);
|
List<DefectListResp> list(DefectListReq req);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 功能描述:查询单条缺陷记录
|
* 功能描述:查询单条缺陷记录
|
||||||
|
|
|
@ -58,9 +58,9 @@ public class DefectServiceImpl extends ServiceImpl<DefectMapper, DefectEntity> i
|
||||||
* @date 2025/04/11 23:17
|
* @date 2025/04/11 23:17
|
||||||
**/
|
**/
|
||||||
@Override
|
@Override
|
||||||
public List<DefectResp> page(DefectListReq req) {
|
public List<DefectListResp> page(DefectListReq req) {
|
||||||
PageUtil.startPage();
|
PageUtil.startPage();
|
||||||
List<DefectResp> list = this.list(req);
|
List<DefectListResp> list = this.list(req);
|
||||||
list.forEach(defect -> {
|
list.forEach(defect -> {
|
||||||
defect.setMarkInfo(JSONUtil.toBean(defect.getLabelInfo(), Detection.class));
|
defect.setMarkInfo(JSONUtil.toBean(defect.getLabelInfo(), Detection.class));
|
||||||
});
|
});
|
||||||
|
@ -68,8 +68,8 @@ public class DefectServiceImpl extends ServiceImpl<DefectMapper, DefectEntity> i
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DefectResp> list(DefectListReq req) {
|
public List<DefectListResp> list(DefectListReq req) {
|
||||||
List<DefectResp> defectList= this.baseMapper.queryBySelective(req);
|
List<DefectListResp> defectList= this.baseMapper.queryBySelective(req);
|
||||||
defectList.forEach(defect -> {
|
defectList.forEach(defect -> {
|
||||||
defect.setMarkInfo(JSONUtil.toBean(defect.getLabelInfo(), Detection.class));
|
defect.setMarkInfo(JSONUtil.toBean(defect.getLabelInfo(), Detection.class));
|
||||||
});
|
});
|
||||||
|
|
|
@ -11,12 +11,12 @@
|
||||||
LEFT JOIN image_collect ic ON ic.collect_id = i.collect_id
|
LEFT JOIN image_collect ic ON ic.collect_id = i.collect_id
|
||||||
LEFT JOIN part p ON i.part_id = p.part_id
|
LEFT JOIN part p ON i.part_id = p.part_id
|
||||||
<where>
|
<where>
|
||||||
<if test="keyword != null and keyword != ''">
|
|
||||||
# AND (d.defect_name LIKE concat('%', #{keyword,jdbcType=VARCHAR}, '%') OR d.defect_code LIKE concat('%', #{keyword,jdbcType=VARCHAR}, '%'))
|
|
||||||
</if>
|
|
||||||
<if test="turbineId != null and turbineId != ''">
|
<if test="turbineId != null and turbineId != ''">
|
||||||
AND p.turbine_id = #{turbineId}
|
AND p.turbine_id = #{turbineId}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="partId != null and partId != ''">
|
||||||
|
AND i.part_id = #{partId}
|
||||||
|
</if>
|
||||||
<if test="defectType != null and defectType != ''">
|
<if test="defectType != null and defectType != ''">
|
||||||
AND d.defect_type = #{defectType}
|
AND d.defect_type = #{defectType}
|
||||||
</if>
|
</if>
|
||||||
|
|
|
@ -3,10 +3,7 @@ package com.dite.znpt.web.controller;
|
||||||
|
|
||||||
import com.dite.znpt.domain.PageResult;
|
import com.dite.znpt.domain.PageResult;
|
||||||
import com.dite.znpt.domain.Result;
|
import com.dite.znpt.domain.Result;
|
||||||
import com.dite.znpt.domain.vo.DefectListReq;
|
import com.dite.znpt.domain.vo.*;
|
||||||
import com.dite.znpt.domain.vo.DefectMarkReq;
|
|
||||||
import com.dite.znpt.domain.vo.DefectReq;
|
|
||||||
import com.dite.znpt.domain.vo.DefectResp;
|
|
||||||
import com.dite.znpt.service.DefectService;
|
import com.dite.znpt.service.DefectService;
|
||||||
import com.dite.znpt.util.ValidationGroup;
|
import com.dite.znpt.util.ValidationGroup;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
|
@ -30,13 +27,13 @@ public class DefectController {
|
||||||
|
|
||||||
@ApiOperation(value = "分页查询缺陷记录列表", httpMethod = "GET")
|
@ApiOperation(value = "分页查询缺陷记录列表", httpMethod = "GET")
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
public PageResult<DefectResp> page(DefectListReq req) {
|
public PageResult<DefectListResp> page(DefectListReq req) {
|
||||||
return PageResult.ok(defectService.page(req));
|
return PageResult.ok(defectService.page(req));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "查询缺陷记录列表", httpMethod = "GET")
|
@ApiOperation(value = "查询缺陷记录列表", httpMethod = "GET")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public Result<List<DefectResp>> list(DefectListReq req) {
|
public Result<List<DefectListResp>> list(DefectListReq req) {
|
||||||
return Result.ok(defectService.list(req));
|
return Result.ok(defectService.list(req));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue