四零语境后端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
2.3 KiB

1 month ago
  1. <#if po.fieldDbType=='Blob'>
  2. private transient java.lang.String ${po.fieldName}String;
  3. private byte[] ${po.fieldName};
  4. public byte[] get${po.fieldName?cap_first}(){
  5. if(${po.fieldName}String==null){
  6. return null;
  7. }
  8. try {
  9. return ${po.fieldName}String.getBytes("UTF-8");
  10. } catch (UnsupportedEncodingException e) {
  11. e.printStackTrace();
  12. }
  13. return null;
  14. }
  15. public String get${po.fieldName?cap_first}String(){
  16. if(${po.fieldName}==null || ${po.fieldName}.length==0){
  17. return "";
  18. }
  19. try {
  20. return new String(${po.fieldName},"UTF-8");
  21. } catch (UnsupportedEncodingException e) {
  22. e.printStackTrace();
  23. }
  24. return "";
  25. }
  26. <#elseif po.classType=='switch'>
  27. <#assign switch_extend_arr=['Y','N']>
  28. <#if po.dictField?default("")?contains("[")>
  29. <#assign switch_extend_arr=po.dictField?eval>
  30. </#if>
  31. <#list switch_extend_arr as a>
  32. <#if a_index == 0>
  33. <#assign switch_extend_arr1=a>
  34. <#else>
  35. <#assign switch_extend_arr2=a>
  36. </#if>
  37. </#list>
  38. @Excel(name = "${po.filedComment}", width = 15,replace = {"是_${switch_extend_arr1}","否_${switch_extend_arr2}"} )
  39. @Schema(description = "${po.filedComment}")
  40. private ${po.fieldType} ${po.fieldName};
  41. <#elseif po.classType=='pca'>
  42. @Excel(name = "${po.filedComment}", width = 15,exportConvert=true,importConvert = true )
  43. @Schema(description = "${po.filedComment}")
  44. private ${po.fieldType} ${po.fieldName};
  45. public String convertis${po.fieldName?cap_first}() {
  46. return SpringContextUtils.getBean(ProvinceCityArea.class).getText(${po.fieldName});
  47. }
  48. public void convertset${po.fieldName?cap_first}(String text) {
  49. this.${po.fieldName} = SpringContextUtils.getBean(ProvinceCityArea.class).getCode(text);
  50. }
  51. <#elseif po.classType=='cat_tree'>
  52. <#assign list_field_dictCode=', dictTable = "sys_category", dicText = "name", dicCode = "id"'>
  53. @Excel(name = "${po.filedComment}", width = 15${list_field_dictCode})
  54. @Schema(description = "${po.filedComment}")
  55. private ${po.fieldType} ${po.fieldName};
  56. <#else>
  57. @Schema(description = "${po.filedComment}")
  58. <#if po.fieldDbName == 'del_flag'>
  59. @TableLogic
  60. </#if>
  61. private ${po.fieldType} ${po.fieldName};
  62. </#if>