提交 8e4c7ff2 编写于 作者: zhouweidong's avatar zhouweidong

实体关系属性映射(batch)

上级 66249be1
...@@ -725,24 +725,24 @@ ${deaction.getRender().code} ...@@ -725,24 +725,24 @@ ${deaction.getRender().code}
*/ */
private void updateParentDataBatch(List <${item.getCodeName()}> entities){ private void updateParentDataBatch(List <${item.getCodeName()}> entities){
Map <Object,${item.getCodeName()}> map =new HashMap<>(); Map <Object,${item.getCodeName()}> map =new HashMap<>();
if(entities.size()>0){
for(${item.getCodeName()} entity: entities){
<#list item.getMinorPSDERs() as MinorPSDER> <#list item.getMinorPSDERs() as MinorPSDER>
<#if MinorPSDER?? && MinorPSDER.getDERType()=='DER1N' && (MinorPSDER.getMajorPSDataEntity().getStorageMode()==1||MinorPSDER.getMajorPSDataEntity().getStorageMode()==2||MinorPSDER.getMajorPSDataEntity().getStorageMode()==4)> <#if MinorPSDER?? && MinorPSDER.getDERType()=='DER1N' && (MinorPSDER.getMajorPSDataEntity().getStorageMode()==1||MinorPSDER.getMajorPSDataEntity().getStorageMode()==2||MinorPSDER.getMajorPSDataEntity().getStorageMode()==4)>
<#if MinorPSDER.getMajorPSDataEntity?? && MinorPSDER.getMajorPSDataEntity()?? && MinorPSDER.getCodeName?? && MinorPSDER.getCodeName()??> <#if MinorPSDER.getMajorPSDataEntity?? && MinorPSDER.getMajorPSDataEntity()?? && MinorPSDER.getCodeName?? && MinorPSDER.getCodeName()??>
<#assign MajorKeyFieldCodeName =srfcaseformat(MinorPSDER.getPSPickupDEField().codeName,'l_u2lC')?cap_first> <#assign MajorKeyFieldCodeName =srfcaseformat(MinorPSDER.getPSPickupDEField().codeName,'l_u2lC')?cap_first>
if(entities.size()>0){
for(${item.getCodeName()} entity: entities){
//实体关系[${MinorPSDER.name}] //实体关系[${MinorPSDER.name}]
if(!ObjectUtils.isEmpty(entity.get${MajorKeyFieldCodeName}()) && !map.containsKey(entity.get${MajorKeyFieldCodeName}())){ if(!ObjectUtils.isEmpty(entity.get${MajorKeyFieldCodeName}()) && !map.containsKey(entity.get${MajorKeyFieldCodeName}())){
map.put(entity.get${MajorKeyFieldCodeName}(),entity); map.put(entity.get${MajorKeyFieldCodeName}(),entity);
} }
</#if>
</#if>
</#list>
} }
if(map.size()>0){ if(map.size()>0){
map.values().forEach(entity -> updateParentData(entity)); map.values().forEach(entity -> updateParentData(entity));
} }
} }
</#if>
</#if>
</#list>
} }
</#if> </#if>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册