DesignDao.dql 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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. -- [selectDesignOrders]
  42. select *
  43. from $table$
  44. -- trim prefix=WHERE prefixOverrides=AND|OR
  45. -- isNotEmpty voidFlag
  46. -- if voidFlag >= 0
  47. voidFlag = #{voidFlag}
  48. -- end
  49. -- end
  50. -- isNotEmpty userIdentity
  51. userIdentity = #{userIdentity}
  52. -- end
  53. -- isNotEmpty keyWord
  54. and (orderName LIKE #{Like:keyWord})
  55. -- end
  56. -- isNotEmpty orderName
  57. and templateName LIKE #{Like:orderName}
  58. -- end
  59. -- end
  60. -- isEmpty orderBy
  61. order by createTime desc
  62. -- else
  63. order by #{orderBy}
  64. -- end
  65. ;
  66. -- [selectDesignOrderItems]
  67. select * from $table$ where idOrder = #{idOrder};
  68. -- [addDesignTemplate]
  69. insert into $table$ (id, templateName, backgroundPath, viewThumbPath,
  70. canvasHeight, canvasWidth, breedHeight,
  71. breedWidth, productIdentity, voidFlag,
  72. jsonContent, createBy, createTime,
  73. createTimeLong, updateBy, updateTime,
  74. updateTimeLong ) values ( #{id}, #{templatename}, #{backgroundpath}, #{viewthumbpath},
  75. #{canvasheight}, #{canvaswidth}, #{breedheight},
  76. #{breedwidth}, #{productidentity}, #{voidflag},
  77. #{jsoncontent}, #{createby}, #{createtime},
  78. #{createtimelong}, #{updateby}, #{updatetime},
  79. #{updatetimelong} );
  80. -- [updateDesignTemplate]
  81. update $table$ set templateName = #{templatename},
  82. jsonContent = #{jsoncontent},
  83. backgroundPath = #{backgroundpath},
  84. canvasHeight = #{canvasheight},
  85. canvasWidth = #{canvaswidth},
  86. breedHeight = #{breedheight},
  87. breedWidth = #{breedwidth},
  88. updateBy = #{updateby},
  89. updateTime = #{updatetime}
  90. where id = #{id};
  91. -- [updateDesignTemplateThumb]
  92. update $table$ set templateName = #{templatename}, viewThumbPath = #{viewthumbpath},
  93. updateBy = #{updateby},
  94. updateTime = #{updatetime}
  95. where id = #{id};
  96. -- [addDesignTemplateItem]
  97. insert into $table$ (id, idTemplate, itemType, locationX,
  98. locationY, sizeWidth, sizeHeight,
  99. rotation, zIndex, jsonContent,
  100. createBy, createTime, createTimeLong,
  101. updateBy, updateTime, updateTimeLong ) values ( #{id}, #{idtemplate}, #{itemtype}, #{locationx},
  102. #{locationy}, #{sizewidth}, #{sizeheight},
  103. #{rotation}, #{zindex}, #{jsoncontent},
  104. #{createby}, #{createtime}, #{createtimelong},
  105. #{updateby}, #{updatetime}, #{updatetimelong} );
  106. -- [deleteDesignTemplateItem]
  107. delete from $table$ where idTemplate = #{id};
  108. -- [voidDesignTemplate]
  109. update $table$ set
  110. voidFlag = #{voidflag},
  111. updateBy = #{updateby},
  112. updateTime = #{updatetime}
  113. where id = #{id};
  114. -- [addDesignOrder]
  115. insert into $table$ (id, idTemplate, userIdentity, orderMame,
  116. backgroundPath, viewThumbPath, canvasHeight,
  117. canvasWidth, breedHeight, breedWidth,
  118. productIdentity, voidFlag, jsonContent,
  119. createBy, createTime, createTimeLong,
  120. updateBy, updateTime, updateTimeLong ) values ( #{id}, #{idtemplate}, #{useridentity}, #{ordermame},
  121. #{backgroundpath}, #{viewthumbpath}, #{canvasheight},
  122. #{canvaswidth}, #{breedheight}, #{breedwidth},
  123. #{productidentity}, #{voidflag}, #{jsoncontent},
  124. #{createby}, #{createtime}, #{createtimelong},
  125. #{updateby}, #{updatetime}, #{updatetimelong} );
  126. -- [addDesignOrderItem]
  127. insert into $table$ (id, idOrder, itemType, locationX,
  128. locationY, sizeWidth, sizeHeight,
  129. rotation, zIndex, jsonContent,
  130. createBy, createTime, createTimeLong,
  131. updateBy, updateTime, updateTimeLong ) values ( #{id}, #{idorder}, #{itemtype}, #{locationx},
  132. #{locationy}, #{sizewidth}, #{sizeheight},
  133. #{rotation}, #{zindex}, #{jsoncontent},
  134. #{createby}, #{createtime}, #{createtimelong},
  135. #{updateby}, #{updatetime}, #{updatetimelong} );
  136. -- [updateDesignOrder]
  137. update $table$ set backgroundPath = #{backgroundpath},
  138. canvasHeight = #{canvasheight},
  139. canvasWidth = #{canvaswidth},
  140. breedHeight = #{breedheight},
  141. breedWidth = #{breedwidth},
  142. jsonContent = #{jsoncontent},
  143. updateBy = #{updateby},
  144. updateTime = #{updatetime}
  145. where id = #{id};
  146. -- [deleteDesignOrderItem]
  147. delete from $table$ where idOrder = #{id};