Commit 8fb30fca authored by tianbo's avatar tianbo

fix(amos-boot): 修复气瓶查询 SQL 问题

-修复了气瓶查询中 chargingMedium 字段的获取方式 -优化了气瓶查询的 SQL语句,使用 ALL 关键字替代 IN 关键字 -调整了查询参数类型,从 Set<String> 改为 String[]
parent 84476248
......@@ -113,7 +113,6 @@ public class BaseEnterpriseVideoServiceImpl extends BaseService<BaseEnterpriseVi
if (result.get("data") instanceof JSONObject) {
JSONObject dataObj = (JSONObject) result.get("data");
String cameraUrl = dataObj.getString("url");
video.setType(param.getString("protocol"));
video.setUrl(cameraUrl);
video.setType(param.getString("protocol"));
}
......
......@@ -64,7 +64,7 @@ public interface JgUseRegistrationMapper extends BaseMapper<JgUseRegistration> {
Map<String, Object> getUseRegistrationDetail(@Param("id") String id);
Page<JSONObject> queryForUnitVesselEquipmentPage(@Param("page") Page<JSONObject> page, @Param("jsonObject") JSONObject jsonObject, @Param("records") Set<String> records);
Page<JSONObject> queryForUnitVesselEquipmentPage(@Param("page") Page<JSONObject> page, @Param("jsonObject") JSONObject jsonObject, @Param("records") String[] records);
Page<JSONObject> queryForEquipUsedByVehiclePage(@Param("page") Page<JSONObject> page, @Param("jsonObject") JSONObject jsonObject);
......
......@@ -926,7 +926,6 @@
ri."EQU_CODE_TYPE" equCodeType,
ri."WHETHER_VEHICLE_CYLINDER" whetherVehicleCylinder,
pv."CHARGING_MEDIUM" chargingMedium,
(select name from cb_data_dictionary where code = pv."CHARGING_MEDIUM" and type = 'FILLING_MEDIUM') chargingMedium,
pv."NOMINAL_WORKING_PRESSURE" nominalWorkingPressure,
pv."SINGLE_BOTTLE_VOLUME" singleBottleVolume,
pv."VIN" vin,
......@@ -992,11 +991,12 @@
and ui."RECORD" = #{jsonObject.record}
</when>
<otherwise>
<if test="records != null and records.size() > 0">
and ui."RECORD" not in
<foreach collection="records" item="record" separator="," open="(" close=")">
#{record}
</foreach>
<if test="records != null and records.length > 0">
<!-- and ui."RECORD" not in-->
<!-- <foreach collection="records" item="record" separator="," open="(" close=")">-->
<!-- #{record}-->
<!-- </foreach>-->
and ui."RECORD" <![CDATA[<>]]> ALL(#{records})
</if>
</otherwise>
</choose>
......
......@@ -3617,10 +3617,11 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
jsonObject.put("useUnitCreditCode", useUnitCreditCode);
Page<JSONObject> page = new Page<>(jsonObject.getLong("number"), jsonObject.getLong("size"));
Set<String> records = EquipUsedCheckStrategyContext.getUsedStrategy("useRegistration").getEquipInFlow(useUnitCreditCode);
String[] recordList = ValidationUtil.isEmpty(records) ? null : records.toArray(new String[records.size()]);
if ("2300".equals(jsonObject.get(EQU_CATEGORY_CODE))) {// 气瓶
List<DictionarieValueModel> fillingMedium = Systemctl.dictionarieClient.dictValues("FILLING_MEDIUM").getResult();
Map<String, Object> fillingMediumMap = fillingMedium.stream().collect(Collectors.toMap(DictionarieValueModel::getDictDataKey, DictionarieValueModel::getDictDataValue));
Page<JSONObject> result = jgUseRegistrationMapper.queryForUnitVesselEquipmentPage(page, jsonObject, records);
Page<JSONObject> result = jgUseRegistrationMapper.queryForUnitVesselEquipmentPage(page, jsonObject, recordList);
result.getRecords().forEach(i -> {
i.put("chargingMedium", fillingMediumMap.get(i.get("chargingMedium")));
i.put("productPhoto", JSONArray.parseArray(i.getString("productPhoto")));
......
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