DesignDao.dql 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. -- [selectDesignFonts]
  2. select * from $table$;
  3. -- [addDesignFont]
  4. insert into $table$ (id, fontName, fontThumbUrl, voidFlag,
  5. fontFilePath, createBy, createTime,
  6. createTimeLong, updateBy, updateTime,
  7. updateTimeLong ) values ( #{id}, #{fontname}, #{fontthumburl}, #{voidflag},
  8. #{fontfilepath}, #{createby}, #{createtime},
  9. #{createtimelong}, #{updateby}, #{updatetime},
  10. #{updatetimelong} );
  11. -- [voidDesignFont]
  12. update $table$ set
  13. voidFlag = #{voidflag},
  14. updateBy = #{updateby},
  15. updateTime = #{updatetime}
  16. where id = #{id};
  17. -- [selectDesignTemplates]
  18. select *
  19. from $table$
  20. -- trim prefix=WHERE prefixOverrides=AND|OR
  21. -- isNotEmpty voidFlag
  22. -- if voidFlag >= 0
  23. voidFlag = #{voidFlag}
  24. -- end
  25. -- end
  26. -- isNotEmpty keyWord
  27. and (templateName LIKE #{Like:keyWord})
  28. -- end
  29. -- isNotEmpty templateName
  30. and templateName LIKE #{Like:templateName}
  31. -- end
  32. -- end
  33. -- isEmpty orderBy
  34. order by createTime desc
  35. -- else
  36. order by #{orderBy}
  37. -- end
  38. ;
  39. -- [selectDesignTemplateItems]
  40. select * from $table$ where idTemplate = #{idTemplate};
  41. -- [addDesignTemplate]
  42. insert into $table$ (id, templateName, backgroundPath, viewThumbPath,
  43. canvasHeight, canvasWidth, breedHeight,
  44. breedWidth, idProduct, voidFlag,
  45. jsonContent, createBy, createTime,
  46. createTimeLong, updateBy, updateTime,
  47. updateTimeLong ) values ( #{id}, #{templatename}, #{backgroundpath}, #{viewthumbpath},
  48. #{canvasheight}, #{canvaswidth}, #{breedheight},
  49. #{breedwidth}, #{idproduct}, #{voidflag},
  50. #{jsoncontent}, #{createby}, #{createtime},
  51. #{createtimelong}, #{updateby}, #{updatetime},
  52. #{updatetimelong} );
  53. -- [updateDesignTemplate]
  54. update $table$ set templateName = #{templatename}, jsonContent = #{jsoncontent},
  55. updateBy = #{updateby},
  56. updateTime = #{updatetime}
  57. where id = #{id};
  58. -- [updateDesignTemplateThumb]
  59. update $table$ set templateName = #{templatename}, viewThumbPath = #{viewthumbpath},
  60. updateBy = #{updateby},
  61. updateTime = #{updatetime}
  62. where id = #{id};
  63. -- [addDesignTemplateItem]
  64. insert into $table$ (id, idTemplate, itemType, locationX,
  65. locationY, sizeWidth, sizeHeight,
  66. rotation, zIndex, jsonContent,
  67. createBy, createTime, createTimeLong,
  68. updateBy, updateTime, updateTimeLong ) values ( #{id}, #{idtemplate}, #{itemtype}, #{locationx},
  69. #{locationy}, #{sizewidth}, #{sizeheight},
  70. #{rotation}, #{zindex}, #{jsoncontent},
  71. #{createby}, #{createtime}, #{createtimelong},
  72. #{updateby}, #{updatetime}, #{updatetimelong} );
  73. -- [deleteDesignTemplateItem]
  74. delete from $table$ where idTemplate = #{id};
  75. -- [voidDesignTemplate]
  76. update $table$ set
  77. voidFlag = #{voidflag},
  78. updateBy = #{updateby},
  79. updateTime = #{updatetime}
  80. where id = #{id};