Commit 694d8a5b authored by tianbo's avatar tianbo

单位办理设备列表

parent 000aa5cb
package com.yeejoin.amos.boot.module.jg.api.mapper;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistration;
......@@ -40,4 +41,9 @@ public interface JgUseRegistrationMapper extends BaseMapper<JgUseRegistration> {
Map<String, Object> getiInstallDetail(@Param("id")String id);
Map<String, Object> getUseRegistrationDetail(@Param("id")String id);
Page<JSONObject> queryForUnitVesselEquipmentPage(@Param("page") Page<JSONObject> page, @Param("jsonObject")JSONObject jsonObject);
Page<JSONObject> queryForUnitPipelineEquipmentPage(@Param("page") Page<JSONObject> page, @Param("jsonObject")JSONObject jsonObject);
}
......@@ -315,4 +315,82 @@
LIMIT 1
</select>
<select id="queryForUnitPipelineEquipmentPage" resultType="com.alibaba.fastjson.JSONObject">
SELECT
ui."USE_UNIT_NAME" useUnitName,
ui."USE_UNIT_CREDIT_CODE" useUnitCreditCode,
to_char(ui."USE_DATE", 'YYYY-MM') useDate,
(SELECT DESIGN_UNIT_NAME from idx_biz_jg_design_info where "RECORD" = ui."RECORD") designUnitName,
(SELECT USC_UNIT_NAME from idx_biz_jg_construction_info where "RECORD" = ui."RECORD" ORDER BY USC_DATE limit 1) uscUnitName,
to_char((SELECT USC_DATE from idx_biz_jg_construction_info where "RECORD" = ui."RECORD" ORDER BY USC_DATE limit 1), 'YYYY-MM') uscDate,
ui."RECORD" record,
ri."EQU_CODE" equCode,
ri."EQU_LIST" equList,
(select name from tz_equipment_category where code = ri."EQU_LIST") equListName,
ri."EQU_CATEGORY" equCategory,
(select name from tz_equipment_category where code = ri."EQU_CATEGORY") equCategoryName,
ri."EQU_DEFINE" equDefine,
(select name from tz_equipment_category where code = ri."EQU_DEFINE") equDefineName,
ri."PRODUCT_NAME" productName,
ri."BRAND_NAME" brandName,
ri."EQU_TYPE" equType,
ri."EQU_CODE_TYPE" equCodeType,
ri."WHETHER_VEHICLE_CYLINDER" whetherVehicleCylinder,
pp."DEVICE_NAME" deviceName,
pp."DEVICE_LEVEL" deviceLevel,
pp."PIPE_NAME" pipeName,
pp."PIPELINE_NUMBER" pipelineNumber,
pp."NOMINAL_DIAMETER" nominalDiameter,
pp."WALL_THICKNESS" wallThickness,
pp."PIPE_LENGTH" pipeLength,
pp."PRESSURE" pressure,
pp."TEMPERATURE" temperature,
pp."MEDIUM" medium,
(select INSPECT_ORG_NAME from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY INSPECT_DATE limit 1) inspectOrgName,
(select INSPECT_CONCLUSION from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY INSPECT_DATE limit 1) inspectConclusion,
to_char((select NEXT_INSPECT_DATE from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY INSPECT_DATE limit 1), 'YYYY-MM-DD') nextInspectDate
FROM
idx_biz_jg_use_info ui
LEFT JOIN idx_biz_jg_register_info ri on ri."RECORD" = ui."RECORD"
LEFT JOIN idx_biz_jg_tech_params_pipeline pp ON pp."RECORD" = ui."RECORD"
WHERE ri."EQU_CATEGORY" = '8300'
<if test="jsonObject.useUnitCreditCode != null and jsonObject.useUnitCreditCode != ''" >
and ui."USE_UNIT_CREDIT_CODE" = #{jsonObject.useUnitCreditCode}
</if>
</select>
<select id="queryForUnitVesselEquipmentPage" resultType="com.alibaba.fastjson.JSONObject">
SELECT
ui."USE_UNIT_NAME" useUnitName,
ui."USE_UNIT_CREDIT_CODE" useUnitCreditCode,
to_char(ui."USE_DATE", 'YYYY-MM') useDate,
(SELECT "PRODUCE_UNIT_NAME" from idx_biz_jg_factory_info where "RECORD" = ui."RECORD") produceUnitName,
to_char((SELECT "PRODUCE_DATE" from idx_biz_jg_factory_info where "RECORD" = ui."RECORD"), 'YYYY-MM') produceDate,
ui."RECORD" record,
ui."USE_INNER_CODE" useInnerCode,
ri."EQU_CODE" equCode,
ri."EQU_LIST" equList,
(select name from tz_equipment_category where code = ri."EQU_LIST") equListName,
ri."EQU_CATEGORY" equCategory,
(select name from tz_equipment_category where code = ri."EQU_CATEGORY") equCategoryName,
ri."EQU_DEFINE" equDefine,
(select name from tz_equipment_category where code = ri."EQU_DEFINE") equDefineName,
ri."PRODUCT_NAME" productName,
ri."BRAND_NAME" brandName,
ri."EQU_TYPE" equType,
ri."EQU_CODE_TYPE" equCodeType,
ri."WHETHER_VEHICLE_CYLINDER" whetherVehicleCylinder,
pv."CHARGING_MEDIUM" chargingMedium,
pv."NOMINAL_WORKING_PRESSURE" nominalWorkingPressure,
pv."SINGLE_BOTTLE_VOLUME" singleBottleVolume,
to_char((select INSPECT_DATE from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY INSPECT_DATE limit 1), 'YYYY-MM-DD') inspectDate,
to_char((select NEXT_INSPECT_DATE from idx_biz_jg_inspection_detection_info where "RECORD" = ui."RECORD" ORDER BY INSPECT_DATE limit 1), 'YYYY-MM-DD') nextInspectDate
FROM
idx_biz_jg_use_info ui
LEFT JOIN idx_biz_jg_register_info ri on ri."RECORD" = ui."RECORD"
LEFT JOIN idx_biz_jg_tech_params_vessel pv ON pv."RECORD" = ui."RECORD"
WHERE ri."EQU_CATEGORY" = '2300' and (ri.whether_vehicle_cylinder is null or ri.whether_vehicle_cylinder != 1)
<if test="jsonObject.useUnitCreditCode != null and jsonObject.useUnitCreditCode != ''" >
and ui."USE_UNIT_CREDIT_CODE" = #{jsonObject.useUnitCreditCode}
</if>
</select>
</mapper>
......@@ -105,7 +105,6 @@ public class IdxBizJqEquipmentRegisterController extends BaseController {
return ResponseHelper.buildResponse(idxBizJgRegisterInfoService.queryForEquipmentRegisterPage(jsonObject));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/category/list")
@ApiOperation(httpMethod = "GET", value = "查询不同单位类型可新增的设备种类列表", notes = "查询不同单位类型可新增的设备种类列表")
......@@ -121,5 +120,11 @@ public class IdxBizJqEquipmentRegisterController extends BaseController {
return ResponseHelper.buildResponse(idxBizJgRegisterInfoService.equCategoryListByCompanyType(getSelectedOrgInfo(), equList));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/equip/page")
@ApiOperation(httpMethod = "GET", value = "单位办理设备列表查询", notes = "单位办理设备列表查询")
public ResponseModel<Page<JSONObject>> queryEquipPage(@RequestParam Map<String, Object> queryMap) {
JSONObject jsonObject = new JSONObject(queryMap);
return ResponseHelper.buildResponse(idxBizJgRegisterInfoService.queryForUnitEquipmentPage(jsonObject));
}
}
......@@ -31,4 +31,6 @@ public interface IIdxBizJgRegisterInfoService {
Map<String, Object> getDetailFieldCamelCaseByRecord(String record);
List<DictionarieValueModel> equCategoryListByCompanyType(ReginParams selectedOrgInfo, String equList);
Page<JSONObject> queryForUnitEquipmentPage(JSONObject jsonObject);
}
......@@ -49,7 +49,6 @@ import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.StringUtil;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
......@@ -1697,4 +1696,18 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
return result;
}
@Override
public Page<JSONObject> queryForUnitEquipmentPage(JSONObject jsonObject) {
ReginParams reginParams = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
String useUnitCreditCode = reginParams.getCompany().getCompanyCode();
jsonObject.put("useUnitCreditCode", useUnitCreditCode);
Page<JSONObject> page = new Page<>();
if ("8300".equals(jsonObject.get("EQU_CATEGORY_CODE"))) {
return jgUseRegistrationMapper.queryForUnitPipelineEquipmentPage(page, jsonObject);
} else if ("2300".equals(jsonObject.get("EQU_CATEGORY_CODE"))) {
return jgUseRegistrationMapper.queryForUnitVesselEquipmentPage(page, jsonObject);
}
return page;
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.ymt.api.mapper;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgRegisterInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgRegisterInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.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