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

修复searchContext in查询

上级 fe654fd6
...@@ -78,26 +78,13 @@ public class ${item.codeName}SearchContext extends QueryWrapperContext<${item.co ...@@ -78,26 +78,13 @@ public class ${item.codeName}SearchContext extends QueryWrapperContext<${item.co
this.getSearchCond().isNull("${formitem.getPSDEField().getName()?lower_case}"); this.getSearchCond().isNull("${formitem.getPSDEField().getName()?lower_case}");
} }
<#elseif formitem.getValueOp() == "IN"> <#elseif formitem.getValueOp() == "IN">
<#assign valueSeparator=";"> <#comment>获取分隔符</#comment>
<#if formitem.getPSCodeListId()??> <#assign valueSeparator=getInCondSeparator(formitem)>
<#assign codelistId=formitem.getPSCodeListId()>
<#if sys.getPSCodeList(codelistId,true)??>
<#assign codelist=sys.getPSCodeList(codelistId)>
<#if codelist.getValueSeparator?? && codelist.getValueSeparator()?? && codelist.getValueSeparator()!=''>
<#assign valueSeparator=codelist.getValueSeparator()>
</#if>
</#if>
</#if>
this.getSearchCond().in("${formitem.getPSDEField().getName()?lower_case}",this.${formitem.getName()?lower_case}.split("${valueSeparator}")); this.getSearchCond().in("${formitem.getPSDEField().getName()?lower_case}",this.${formitem.getName()?lower_case}.split("${valueSeparator}"));
<#elseif formitem.getValueOp() == "NOTIN"> <#elseif formitem.getValueOp() == "NOTIN">
<#if formitem.getPSCodeListId()??> <#comment>获取分隔符</#comment>
<#assign codeListName=getCodeListName(formitem.getPSCodeListId())> <#assign valueSeparator=getInCondSeparator(formitem)>
String defaultSeparator=(CodeListBase.getCodeList("${codeListName}")==null)?";":CodeListBase.getCodeList("${codeListName}").getCodeList().getValueseparator(); this.getSearchCond().notIn("${formitem.getPSDEField().getName()?lower_case}",this.${formitem.getName()?lower_case}.split("${valueSeparator}"));
<#else >
String defaultSeparator=";";
</#if>
String defaultSeparator=";";
this.getSearchCond().notIn("${formitem.getPSDEField().getName()?lower_case}",this.${formitem.getName()?lower_case}.split(defaultSeparator));
</#if> </#if>
} }
} }
...@@ -198,22 +185,13 @@ public class ${item.codeName}SearchContext extends QueryBuildContext { ...@@ -198,22 +185,13 @@ public class ${item.codeName}SearchContext extends QueryBuildContext {
this.getSearchCond().and("${formitem.getPSDEField().getName()?lower_case}").exists(null); this.getSearchCond().and("${formitem.getPSDEField().getName()?lower_case}").exists(null);
} }
<#elseif formitem.getValueOp() == "IN"> <#elseif formitem.getValueOp() == "IN">
<#if formitem.getPSCodeListId()??> <#comment>获取分隔符</#comment>
<#assign codeListName=getCodeListName(formitem.getPSCodeListId())> <#assign valueSeparator=getInCondSeparator(formitem)>
String defaultSeparator=(CodeListBase.getCodeList("${codeListName}")==null)?";":CodeListBase.getCodeList("${codeListName}").getCodeList().getValueseparator(); this.getSearchCond().and("${formitem.getPSDEField().getName()?lower_case}").in(this.${formitem.getName()?lower_case}.split("${valueSeparator}")));
<#else >
String defaultSeparator=";";
</#if>
this.getSearchCond().and("${formitem.getPSDEField().getName()?lower_case}").in(this.${formitem.getName()?lower_case}.split(defaultSeparator)));
<#elseif formitem.getValueOp() == "NOTIN"> <#elseif formitem.getValueOp() == "NOTIN">
<#if formitem.getPSCodeListId()??> <#comment>获取分隔符</#comment>
<#assign codeListName=getCodeListName(formitem.getPSCodeListId())> <#assign valueSeparator=getInCondSeparator(formitem)>
String defaultSeparator=(CodeListBase.getCodeList("${codeListName}")==null)?";":CodeListBase.getCodeList("${codeListName}").getCodeList().getValueseparator(); this.getSearchCond().and("${formitem.getPSDEField().getName()?lower_case}").notIn(this.${formitem.getName()?lower_case}.split("${valueSeparator}")));
<#else >
String defaultSeparator=";";
</#if>
String defaultSeparator=";";
this.getSearchCond().and("${formitem.getPSDEField().getName()?lower_case}").notIn(this.${formitem.getName()?lower_case}.split(defaultSeparator)));
</#if> </#if>
} }
} }
...@@ -306,4 +284,19 @@ public class ${item.codeName}SearchContext extends SearchContextBase { ...@@ -306,4 +284,19 @@ public class ${item.codeName}SearchContext extends SearchContextBase {
</#if> </#if>
<#comment>获取in查询的分隔符</#comment>
<#function getInCondSeparator formitem>
<#assign valueSeparator=";">
<#if formitem.getPSCodeListId()??>
<#assign codelistId=formitem.getPSCodeListId()>
<#if sys.getPSCodeList(codelistId,true)??>
<#assign codelist=sys.getPSCodeList(codelistId)>
<#if codelist.getValueSeparator?? && codelist.getValueSeparator()?? && codelist.getValueSeparator()!=''>
<#assign valueSeparator=codelist.getValueSeparator()>
</#if>
</#if>
</#if>
<#return valueSeparator/>
</#function>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册