Commit efbd8421 authored by 刘林's avatar 刘林

fix(jg):列表去掉压力管道查询,工程装置详情优化

parent e34f0033
...@@ -23,10 +23,9 @@ import java.util.Map; ...@@ -23,10 +23,9 @@ import java.util.Map;
@Mapper @Mapper
public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> { public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> {
@Select("SELECT * FROM tz_equipment_category WHERE code NOT LIKE '7%' ORDER BY parent_id") @Select("SELECT * FROM tz_equipment_category WHERE code NOT LIKE '7%' AND code NOT LIKE '8%' ORDER BY parent_id")
List<EquipmentCategoryDto> selectClassifyNoStart7(); List<EquipmentCategoryDto> selectClassifyNoStart7();
@Select("select * from tz_equipment_category where code in('1000','2000','3000','4000','5000','6000','8000','9000')") @Select("select * from tz_equipment_category where code in('1000','2000','3000','4000','5000','6000','8000','9000')")
List<EquipmentCategoryDto> selectClassify(); List<EquipmentCategoryDto> selectClassify();
......
...@@ -52,53 +52,30 @@ ...@@ -52,53 +52,30 @@
</select> </select>
<select id="selectEquipList" resultType="java.util.Map"> <select id="selectEquipList" resultType="java.util.Map">
WITH LatestInspection AS ( SELECT ibjtpp."PIPE_NAME" AS pipeName,
SELECT ibjtpp."PIPELINE_NUMBER" AS pipelineNumber,
RECORD, ibjtpp."DEVICE_LEVEL" AS deviceLevel,
"INSPECT_ORG_NAME", ibjtpp."NOMINAL_DIAMETER" AS nominalDiameter,
"INSPECT_CONCLUSION", ibjtpp."WALL_THICKNESS" AS wallThickness,
"NEXT_INSPECT_DATE", ibjtpp."PIPE_LENGTH" AS pipeLength,
ROW_NUMBER() OVER (PARTITION BY RECORD ORDER BY "INSPECT_DATE" DESC) AS rn ibjtpp."PRESSURE" AS pressure,
FROM idx_biz_jg_inspection_detection_info ibjtpp."TEMPERATURE" AS temperature,
), ibjtpp."MEDIUM" AS medium,
LatestConstruction AS ( ibjtpp."WORK_PRESSURE" AS workPressure,
SELECT ibjtpp."WORK_TEMPERATURE" AS workTemperature,
RECORD, ibjtpp."WORK_MEDIUM" AS workMedium,
"USC_UNIT_NAME", ibjtpp."REMARKS" AS remarks,
"USC_DATE", (select INSPECT_ORG_NAME from idx_biz_jg_inspection_detection_info where "RECORD" = ibjui."RECORD" ORDER BY INSPECT_DATE DESC limit 1) inspectOrgName,
ROW_NUMBER() OVER (PARTITION BY RECORD ORDER BY "USC_DATE" DESC) AS rn (select INSPECT_CONCLUSION from idx_biz_jg_inspection_detection_info where "RECORD" = ibjui."RECORD" ORDER BY INSPECT_DATE DESC limit 1) inspectConclusion,
FROM idx_biz_jg_construction_info (select NEXT_INSPECT_DATE from idx_biz_jg_inspection_detection_info where "RECORD" = ibjui."RECORD" ORDER BY INSPECT_DATE DESC limit 1) nextInspectDate,
) (select USC_UNIT_NAME from idx_biz_jg_construction_info jci where ibjui.RECORD = jci.RECORD ORDER BY jci."REC_DATE" DESC limit 1) as uscUnitName,
SELECT (select USC_DATE from idx_biz_jg_construction_info jci where ibjui.RECORD = jci.RECORD ORDER BY jci."REC_DATE" DESC limit 1) as uscDate,
ibjtpp."PIPE_NAME" AS pipeName, ibjdi."DESIGN_UNIT_NAME" AS designUnitName,
ibjtpp."PIPELINE_NUMBER" AS pipelineNumber, ibjui."USE_DATE" AS useDate,
ibjtpp."DEVICE_LEVEL" AS deviceLevel, ibjui."RECORD" AS record
ibjtpp."NOMINAL_DIAMETER" AS nominalDiameter, FROM idx_biz_jg_use_info ibjui
ibjtpp."WALL_THICKNESS" AS wallThickness, LEFT JOIN idx_biz_jg_tech_params_pipeline ibjtpp ON ibjui.RECORD = ibjtpp.RECORD
ibjtpp."PIPE_LENGTH" AS pipeLength, LEFT JOIN idx_biz_jg_design_info ibjdi ON ibjui.RECORD = ibjdi.RECORD
ibjtpp."PRESSURE" AS pressure,
ibjtpp."TEMPERATURE" AS temperature,
ibjtpp."MEDIUM" AS medium,
ibjtpp."WORK_PRESSURE" AS workPressure,
ibjtpp."WORK_TEMPERATURE" AS workTemperature,
ibjtpp."WORK_MEDIUM" AS workMedium,
ibjtpp."REMARKS" AS remarks,
latestInspection."INSPECT_ORG_NAME" AS inspectOrgName,
latestInspection."INSPECT_CONCLUSION" AS inspectConclusion,
latestInspection."NEXT_INSPECT_DATE" AS nextInspectDate,
ibjdi."DESIGN_UNIT_NAME" AS designUnitName,
latestConstruction."USC_UNIT_NAME" AS uscUnitName,
latestConstruction."USC_DATE" AS uscDate,
ibjui."USE_DATE" AS useDate,
ibjui."RECORD" AS record
FROM
idx_biz_jg_use_info ibjui
LEFT JOIN idx_biz_jg_tech_params_pipeline ibjtpp ON ibjui.RECORD = ibjtpp.RECORD
LEFT JOIN idx_biz_jg_design_info ibjdi ON ibjui.RECORD = ibjdi.RECORD
LEFT JOIN LatestInspection latestInspection
ON ibjui.RECORD = latestInspection.RECORD AND latestInspection.rn = 1
LEFT JOIN LatestConstruction latestConstruction
ON ibjui.RECORD = latestConstruction.RECORD AND latestConstruction.rn = 1
WHERE ibjui.project_contraption_id = #{sequenceNbr} WHERE ibjui.project_contraption_id = #{sequenceNbr}
</select> </select>
......
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