🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
可以使用注解 @StaticTranslate直接从td_s_static 表翻译 @TableTranslate指定表进行翻译,如需依次从多个表查找,可用分号间隔。 注意:类要用@TranslateEnable 进行标注 ``` /** * 实体类的编码翻译示例 * StaticTranslate:翻译静态表td_s_static。 * TableTranslate:翻译普通表,根据某字段翻译某字段。 * Translate:可自定义翻译器。translator可指定为翻译器service名,或类名xx.class.getName(); * * @author shf675 * */ @TranslateEnable public class TfNListExt extends TfNList { private static final long serialVersionUID = 1L; @StaticTranslate(by = "custType", typeId = "LIST_CUST_TYPE") private String custTypeName; @TableTranslate(by = "custManagerId", path = "TD_M_STAFF.STAFF_ID.STAFF_NAME;") private String custManagerName; @TableTranslate(by = "custManagerId", path = "TD_M_STAFF.STAFF_ID.DEPART_ID;TD_M_DEPART.DEPART_ID.DEPART_NAME") private String custManagerDepartName; public String getCustManagerDepartName() { return custManagerDepartName; } public void setCustManagerDepartName(String custManagerDepartName) { this.custManagerDepartName = custManagerDepartName; } public String getCustTypeName() { return custTypeName; } public void setCustTypeName(String custTypeName) { this.custTypeName = custTypeName; } public String getCustManagerName() { return custManagerName; } public void setCustManagerName(String custManagerName) { this.custManagerName = custManagerName; } } ```