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

update 、batch缓存清除

上级 40615c70
...@@ -44,6 +44,10 @@ public interface ${item.getCodeName()}Mapper extends BaseMapper<${item.getCodeNa ...@@ -44,6 +44,10 @@ public interface ${item.getCodeName()}Mapper extends BaseMapper<${item.getCodeNa
@CacheEvict( value="${item.codeName?lower_case}",key = "'row:'+#p0.${keyfieldCodeName}") @CacheEvict( value="${item.codeName?lower_case}",key = "'row:'+#p0.${keyfieldCodeName}")
</#if> </#if>
int updateById(@Param(Constants.ENTITY) ${item.getCodeName()} entity); int updateById(@Param(Constants.ENTITY) ${item.getCodeName()} entity);
<#if item.isEnableEntityCache()==true>
@CacheEvict(value="${item.codeName?lower_case}",key = "'row:'+#p0.${keyfieldCodeName}")
</#if>
int update(@Param(Constants.ENTITY) ${item.getCodeName()} entity, @Param("ew") Wrapper<${item.codeName?lower_case}> updateWrapper);
@Override @Override
<#if item.isEnableEntityCache()==true> <#if item.isEnableEntityCache()==true>
@CacheEvict( value="${item.codeName?lower_case}",key = "'row:'+#p0") @CacheEvict( value="${item.codeName?lower_case}",key = "'row:'+#p0")
......
...@@ -97,15 +97,27 @@ public interface I${item.codeName}Service{ ...@@ -97,15 +97,27 @@ public interface I${item.codeName}Service{
${item.codeName} get(${srfjavatype(keyfield.stdDataType)} key) ; ${item.codeName} get(${srfjavatype(keyfield.stdDataType)} key) ;
<#elseif deaction.codeName?lower_case == "create"> <#elseif deaction.codeName?lower_case == "create">
boolean create(${item.codeName} et) ; boolean create(${item.codeName} et) ;
<#if item.isEnableEntityCache()==true>
@CacheEvict(value="${item.codeName?lower_case}",allEntries=true)
</#if>
void createBatch(List<${item.codeName}> list) ; void createBatch(List<${item.codeName}> list) ;
<#elseif deaction.codeName?lower_case == "update"> <#elseif deaction.codeName?lower_case == "update">
boolean update(${item.codeName} et) ; boolean update(${item.codeName} et) ;
<#if item.isEnableEntityCache()==true>
@CacheEvict(value="${item.codeName?lower_case}",allEntries=true)
</#if>
void updateBatch(List<${item.codeName}> list) ; void updateBatch(List<${item.codeName}> list) ;
<#elseif deaction.codeName?lower_case == "remove"> <#elseif deaction.codeName?lower_case == "remove">
boolean remove(${srfjavatype(keyfield.stdDataType)} key) ; boolean remove(${srfjavatype(keyfield.stdDataType)} key) ;
<#if item.isEnableEntityCache()==true>
@CacheEvict(value="${item.codeName?lower_case}",allEntries=true)
</#if>
void removeBatch(Collection<${srfjavatype(keyfield.stdDataType)}> idList) ; void removeBatch(Collection<${srfjavatype(keyfield.stdDataType)}> idList) ;
<#elseif deaction.codeName?lower_case == "save"> <#elseif deaction.codeName?lower_case == "save">
boolean save(${item.codeName} et) ; boolean save(${item.codeName} et) ;
<#if item.isEnableEntityCache()==true>
@CacheEvict(value="${item.codeName?lower_case}",allEntries=true)
</#if>
void saveBatch(List<${item.codeName}> list) ; void saveBatch(List<${item.codeName}> list) ;
<#elseif deaction.codeName?lower_case == "getdraft"> <#elseif deaction.codeName?lower_case == "getdraft">
${item.codeName} getDraft(${item.codeName} et) ; ${item.codeName} getDraft(${item.codeName} et) ;
...@@ -140,6 +152,9 @@ public interface I${item.codeName}Service{ ...@@ -140,6 +152,9 @@ public interface I${item.codeName}Service{
<#assign deDefaultDataSet=de.getDefaultPSDEDataSet()> <#assign deDefaultDataSet=de.getDefaultPSDEDataSet()>
<#if deDefaultDataSet.getPSDEDataQueries()??> <#if deDefaultDataSet.getPSDEDataQueries()??>
List<${item.getCodeName()}> selectBy${srfcaseformat(MajorField.codeName,'l_u2lC')?cap_first}(${srfjavatype(MajorField.stdDataType)} ${MajorkeyField.codeName?lower_case}) ; List<${item.getCodeName()}> selectBy${srfcaseformat(MajorField.codeName,'l_u2lC')?cap_first}(${srfjavatype(MajorField.stdDataType)} ${MajorkeyField.codeName?lower_case}) ;
<#if item.isEnableEntityCache()==true>
@CacheEvict(value="${item.codeName?lower_case}",allEntries=true)
</#if>
void removeBy${srfcaseformat(MajorField.codeName,'l_u2lC')?cap_first}(${srfjavatype(MajorField.stdDataType)} ${MajorkeyField.codeName?lower_case}) ; void removeBy${srfcaseformat(MajorField.codeName,'l_u2lC')?cap_first}(${srfjavatype(MajorField.stdDataType)} ${MajorkeyField.codeName?lower_case}) ;
<#assign nested=MinorPSDER.isNestedRS()> <#assign nested=MinorPSDER.isNestedRS()>
<#if nested == false && MinorPSDER.getMinorPSDataEntity().getAllPSDEServiceAPIs()??> <#if nested == false && MinorPSDER.getMinorPSDataEntity().getAllPSDEServiceAPIs()??>
...@@ -150,6 +165,9 @@ public interface I${item.codeName}Service{ ...@@ -150,6 +165,9 @@ public interface I${item.codeName}Service{
</#list> </#list>
</#if> </#if>
<#if nested> <#if nested>
<#if item.isEnableEntityCache()==true>
@CacheEvict(value="${item.codeName?lower_case}",allEntries=true)
</#if>
void saveBy${srfcaseformat(MajorField.codeName,'l_u2lC')?cap_first}(${srfjavatype(MajorField.stdDataType)} ${MajorkeyField.codeName?lower_case},List<${item.getCodeName()}> list) ; void saveBy${srfcaseformat(MajorField.codeName,'l_u2lC')?cap_first}(${srfjavatype(MajorField.stdDataType)} ${MajorkeyField.codeName?lower_case},List<${item.getCodeName()}> list) ;
</#if> </#if>
</#if> </#if>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册