Skip to content

5.6.37 提供针对同一个字段进行多次翻译或根据具体逻辑条件进行翻译的功能

Latest
Compare
Choose a tag to compare
@chenrenfei chenrenfei released this 29 Dec 08:57
· 4 commits to 5.6 since this release
2b8b624

1、提供针对同一个字段进行多次翻译或根据具体逻辑条件进行翻译的功能

<sql id="sqltoy_complax_trans">
      <!-- where like colName==xxx | colName!=xxx | colName in (a,b) |colName out (a,b) -->
      <translate cache="dictCache" cache-type="purchase_deliver_type" columns="deliver_type" where="order_type==purchase"/>
      <translate cache="dictCache" cache-type="sales_deliver_type" columns="deliver_type" where="order_type==sales"/>
      <value><!CDATA[[
       select order_id,order_type,deliver_type
       from order_info
         ]]>
      </value>
  </sql>

输入图片说明

// 演示基于代码模式的缓存翻译、电话号码脱敏、自定义filter等
Page<StaffInfoVO> result = lightDao.findPageEntity(new Page(), StaffInfoVO.class,
	EntityQuery.create().where("STATUS=1 #[and STAFF_NAME like :staffName]").orderByDesc("ENTRY_DATE")
		.values(new StaffInfoVO().setStaffName("张")).filters(new ParamsFilter("staffName").rlike())
		.translates(new Translate("organIdName").setKeyColumn("organId").setColumn("organName")
		.setCompareColumn("orderType").setCompareType("eq").setCompareValues("PO"))
		.secureMask(MaskType.TEL, "telNo"));
<!-- 其他非spring框架可以基于sagacity-sqltoy 进行扩展 -->
<dependency>
	<groupId>com.sagframe</groupId>
	<artifactId>sagacity-sqltoy</artifactId>
         <!-- jdk8 对应的版本号为:5.6.37.jre8 -->
	<version>5.6.37</version>
</dependency>

<!-- springboot  -->
<dependency>
	<groupId>com.sagframe</groupId>
	<artifactId>sagacity-sqltoy-spring-starter</artifactId>
         <!-- jdk8 对应的版本号为:5.6.37.jre8 -->
	<version>5.6.37</version>
</dependency>

<!-- solon 插件  -->
<dependency>
	<groupId>com.sagframe</groupId>
	<artifactId>sagacity-sqltoy-solon-plugin</artifactId>
        <!-- jdk8 对应的版本号为:5.6.37.jre8 -->
	<version>5.6.37</version>
</dependency>