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

主实体批量删除

上级 c1d81a9c
......@@ -510,6 +510,8 @@ public class ${item.getCodeName()}ServiceImpl extends ServiceImpl<${de.getCodeNa
<#if hasPSDERsMapping>
List<${item.getCodeName()}> entities= baseMapper.selectBatchIds(idList);
</#if>
<#comment>主实体删除操作(同时删除、置空、限制删除)</#comment>
<@majorEntityRemoveBatch/>
removeByIds(idList);
<#comment>批量更新父数据(实体关系属性映射)</#comment>
<#if hasPSDERsMapping>
......@@ -2887,4 +2889,22 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser
</#if>
</#macro>
<#comment>主实体批量删除操作</#comment>
<#macro majorEntityRemoveBatch>
<#if de.getMajorPSDERs()??>
<#list de.getMajorPSDERs() as der>
<#if der.getDERType() =='DER1N' && der.getRemoveActionType()?? && der.getMinorPSDataEntity()?? && (der.getMinorPSDataEntity().getStorageMode()==1||der.getMinorPSDataEntity().getStorageMode()==2||der.getMinorPSDataEntity().getStorageMode()==4) >
<#assign MajorDerField = der.getPSPickupDEField()>
<#assign minorKeyField = der.getMinorPSDataEntity().getKeyPSDEField()>
<#assign minorEntityCodeName=der.getMinorPSDataEntity().getCodeName()>
<#if der.getRemoveActionType()?c=='1'><#comment>同时删除</#comment>
${srfcaseformat(minorEntityCodeName,'l_u2lC')}Service.removeBy${srfcaseformat(MajorDerField.codeName,'l_u2lC')?cap_first}(ids) ;
<#elseif der.getRemoveActionType()?c=='2'><#comment>置空</#comment>
<#elseif der.getRemoveActionType()?c=='3'><#comment>限制删除</#comment>
</#if>
</#if>
</#list>
</#if>
</#macro>
</#if>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册