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

索引实体

上级 42a1775f
......@@ -14,17 +14,21 @@ TARGET=PSDATAENTITY
<#if isIndexSubDE=true && indexPSDER??>
<#comment>索引主实体</#comment>
<#assign indexMajorDE=indexPSDER.getMajorPSDataEntity()>
<#assign indexMajorDECodeName=indexPSDER.getMajorPSDataEntity().codeName>
<#assign indexMajorDECodeNameCamel = srfcaseformat(indexMajorDECodeName,'l_u2lC')?cap_first>
<#assign deCodeName=de.codeName>
<#assign deCodeNameCamel = srfcaseformat(deCodeName,'l_u2lC')?cap_first>
<#assign majorIndexDE=indexPSDER.getMajorPSDataEntity()>
<#assign majorIndexDECodeName=indexPSDER.getMajorPSDataEntity().codeName>
<#assign majorIndexDECodeNameCamel = srfcaseformat(majorIndexDECodeName,'l_u2lC')?cap_first>
<#assign majorIndexDEKeyFieldCodeName=majorIndexDE.getKeyPSDEField().codeName>
<#assign majorIndexDEMajorTextFieldCodeName=majorIndexDE.getMajorPSDEField().codeName>
<#assign MinorIndexDECodeName=de.codeName>
<#assign MinorIndexDECodeNameCamel = srfcaseformat(MinorIndexDECodeName,'l_u2lC')?cap_first>
<#assign MinorIndexDEKeyFieldCodeName=de.getKeyPSDEField().codeName>
<#assign MinorIndexDEMajorTextFieldCodeName=de.getMajorPSDEField().codeName>
package ${pub.getPKGCodeName()}.core.${de.getPSSystemModule().codeName?lower_case}.mapping.${de.codeName}InheritMapping;
import org.mapstruct.*;
import ${pub.getPKGCodeName()}.core.${de.getPSSystemModule().getCodeName()?lower_case}.domain.${de.codeName};
import ${pub.getPKGCodeName()}.core.${indexMajorDE.getPSSystemModule().getCodeName()?lower_case}.domain.${indexMajorDE.codeName};
import ${pub.getPKGCodeName()}.core.${majorIndexDE.getPSSystemModule().getCodeName()?lower_case}.domain.${majorIndexDE.codeName};
import ${pub.getPKGCodeName()}.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
import java.util.List;
......@@ -35,25 +39,24 @@ import java.util.List;
public interface ${item.getCodeName()}Mapping extends MappingBase<${item.codeName}, ${indexPSDER.codeName}> {
@Mappings({
<#if indexPSDER.getPropertyMapNames?? && indexPSDER.getPropertyMapNames()??>
<#list indexPSDER.getPropertyMapNames() as indexFieldMapping>
<#if indexPSDER.containsUserParam(indexFieldMapping)>
//${indexPSDER.getUserParam(indexFieldMapping)}
<#else>
//false
</#if>
<#--@Mapping(source ="humanname" ,target = "cityname"), //平台配置参数映射-->
<#--@Mapping(source ="humanname" ,target = "cityname") //主键-->
</#list>
</#if>
<#if indexPSDER.getPropertyMapNames?? && indexPSDER.getPropertyMapNames()??>
@Mapping(source ="${MinorIndexDEKeyFieldCodeName}",target = "${majorIndexDEKeyFieldCodeName}"), //平台配置参数映射
@Mapping(source ="${MinorIndexDEMajorTextFieldCodeName}",target = "${majorIndexDEMajorTextFieldCodeName}"), //平台配置参数映射
</#if>
})
${indexMajorDECodeName} to${indexMajorDECodeNameCamel}(${deCodeName} ${deCodeName?lower_case});
${majorIndexDECodeName} to${majorIndexDECodeNameCamel}(${MinorIndexDECodeName} ${MinorIndexDECodeName?lower_case});
${deCodeName} to${deCodeNameCamel}(${indexMajorDECodeName} ${indexMajorDECodeName?lower_case});
@Mappings({
<#if indexPSDER.getPropertyMapNames?? && indexPSDER.getPropertyMapNames()??>
@Mapping(source ="${majorIndexDEKeyFieldCodeName}" ,target = "${MinorIndexDEKeyFieldCodeName}"), //平台配置参数映射
@Mapping(source ="${majorIndexDEMajorTextFieldCodeName}" ,target = "${MinorIndexDEMajorTextFieldCodeName}"), //平台配置参数映射
</#if>
})
${MinorIndexDECodeName} to${MinorIndexDECodeNameCamel}(${majorIndexDECodeName} ${majorIndexDECodeName?lower_case});
List<${indexMajorDECodeName}> to${indexMajorDECodeNameCamel}(List<${deCodeName}> ${deCodeName?lower_case});
List<${majorIndexDECodeName}> to${majorIndexDECodeNameCamel}(List<${MinorIndexDECodeName}> ${MinorIndexDECodeName?lower_case});
List<${deCodeName}> to${deCodeNameCamel}(List<${indexMajorDECodeName}> ${indexMajorDECodeName?lower_case});
List<${MinorIndexDECodeName}> to${MinorIndexDECodeNameCamel}(List<${majorIndexDECodeName}> ${majorIndexDECodeName?lower_case});
}
</#if>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册