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

继承实体

上级 0afc8ce3
...@@ -233,6 +233,10 @@ ${deaction.getRender().code} ...@@ -233,6 +233,10 @@ ${deaction.getRender().code}
<@addBoforeLogic deaction/> <@addBoforeLogic deaction/>
if(!this.retBool(this.baseMapper.insert(et))) if(!this.retBool(this.baseMapper.insert(et)))
return false; return false;
<#comment>同步创建继承主实体数据</#comment>
<#if isIndexSubDE && indexPSDER.getDERType()=="DERINHERIT">
createIndexMajorEntityData(et);
</#if>
<#comment>1N关系中,在父实体中创建子实体的List集合</#comment> <#comment>1N关系中,在父实体中创建子实体的List集合</#comment>
<#if de.getMajorPSDERs?? && de.getMajorPSDERs()??> <#if de.getMajorPSDERs?? && de.getMajorPSDERs()??>
<#list de.getMajorPSDERs() as MajorPSDER> <#list de.getMajorPSDERs() as MajorPSDER>
...@@ -259,12 +263,12 @@ ${deaction.getRender().code} ...@@ -259,12 +263,12 @@ ${deaction.getRender().code}
</#if> </#if>
<#comment>成功后get填充一次完整信息</#comment> <#comment>成功后get填充一次完整信息</#comment>
CachedBeanCopier.copy(get(et.get${srfcaseformat(keyfield.codeName,'l_u2lC')?cap_first}()),et); CachedBeanCopier.copy(get(et.get${srfcaseformat(keyfield.codeName,'l_u2lC')?cap_first}()),et);
<#comment>附加数据逻辑-操作后</#comment> <#comment>同步创建索引主实体数据</#comment>
<@addAfterLogic deaction/> <#if isIndexSubDE && indexPSDER.getDERType()=="DERINDEX">
<#comment>同步创建索引主实体</#comment>
<#if isIndexSubDE>
createIndexMajorEntityData(et); createIndexMajorEntityData(et);
</#if> </#if>
<#comment>附加数据逻辑-操作后</#comment>
<@addAfterLogic deaction/>
return true; return true;
} }
...@@ -293,6 +297,10 @@ ${deaction.getRender().code} ...@@ -293,6 +297,10 @@ ${deaction.getRender().code}
<#if de.getKeyPSDEField()??> <#if de.getKeyPSDEField()??>
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("${keyfield.name?lower_case}",et.get${srfcaseformat(keyfield.codeName,'l_u2lC')?cap_first}()))) if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("${keyfield.name?lower_case}",et.get${srfcaseformat(keyfield.codeName,'l_u2lC')?cap_first}())))
return false; return false;
<#comment>同步更新继承主实体数据</#comment>
<#if isIndexSubDE && indexPSDER.getDERType()=="DERINHERIT">
${srfcaseformat(majorIndexDECodeName,'l_u2lC')}Service.update(${de.codeName?lower_case}InheritMapping.to${majorIndexDECodeNameCamel}(et));
</#if>
<#comment>1N关系中,在父实体中创建子实体的List集合</#comment> <#comment>1N关系中,在父实体中创建子实体的List集合</#comment>
<#if de.getMajorPSDERs?? && de.getMajorPSDERs()??> <#if de.getMajorPSDERs?? && de.getMajorPSDERs()??>
<#list de.getMajorPSDERs() as MajorPSDER> <#list de.getMajorPSDERs() as MajorPSDER>
...@@ -319,8 +327,8 @@ ${deaction.getRender().code} ...@@ -319,8 +327,8 @@ ${deaction.getRender().code}
</#if> </#if>
<#comment>成功后get填充一次完整信息</#comment> <#comment>成功后get填充一次完整信息</#comment>
CachedBeanCopier.copy(get(et.get${srfcaseformat(keyfield.codeName,'l_u2lC')?cap_first}()),et); CachedBeanCopier.copy(get(et.get${srfcaseformat(keyfield.codeName,'l_u2lC')?cap_first}()),et);
<#comment>同步更新索引主实体</#comment> <#comment>同步更新索引主实体数据</#comment>
<#if isIndexSubDE> <#if isIndexSubDE && indexPSDER.getDERType()=="DERINDEX">
${srfcaseformat(majorIndexDECodeName,'l_u2lC')}Service.update(${de.codeName?lower_case}InheritMapping.to${majorIndexDECodeNameCamel}(et)); ${srfcaseformat(majorIndexDECodeName,'l_u2lC')}Service.update(${de.codeName?lower_case}InheritMapping.to${majorIndexDECodeNameCamel}(et));
</#if> </#if>
<#comment>附加数据逻辑-操作后</#comment> <#comment>附加数据逻辑-操作后</#comment>
...@@ -398,7 +406,7 @@ ${deaction.getRender().code} ...@@ -398,7 +406,7 @@ ${deaction.getRender().code}
</#list> </#list>
</#if> </#if>
boolean result=removeById(key); boolean result=removeById(key);
<#comment>同步清除索引主实体</#comment> <#comment>同步清除索引主实体数据</#comment>
<#if isIndexSubDE> <#if isIndexSubDE>
${srfcaseformat(majorIndexDECodeName,'l_u2lC')}Service.remove(key); ${srfcaseformat(majorIndexDECodeName,'l_u2lC')}Service.remove(key);
</#if> </#if>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册