DesignDao.dql 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. -- [selectDesignFonts]
  2. select * from $table$;
  3. -- [addDesignFont]
  4. insert into $table$ (id, fontName, fontFamily, fontThumbUrl,
  5. voidFlag, fontFilePath, createBy,
  6. createTime, createTimeLong, updateBy,
  7. updateTime, updateTimeLong ) values ( #{id}, #{fontname}, #{fontfamily}, #{fontthumburl},
  8. #{voidflag}, #{fontfilepath}, #{createby},
  9. #{createtime}, #{createtimelong}, #{updateby},
  10. #{updatetime}, #{updatetimelong} );
  11. -- [voidDesignFont]
  12. update $table$ set
  13. voidFlag = #{voidflag},
  14. updateBy = #{updateby},
  15. updateTime = #{updatetime}
  16. where id = #{id};
  17. -- [selectDesignTemplates]
  18. select a.*
  19. from $table1$ a left join $table2$ b on a.id = b.idTemplate
  20. -- trim prefix=WHERE prefixOverrides=AND|OR
  21. -- isNotEmpty voidFlag
  22. -- if voidFlag >= 0
  23. a.voidFlag = #{voidFlag}
  24. -- end
  25. -- end
  26. -- isNotEmpty keyWord
  27. and (a.templateName LIKE #{Like:keyWord})
  28. -- end
  29. -- isNotEmpty templateName
  30. and a.templateName LIKE #{Like:templateName}
  31. -- end
  32. -- isNotEmpty productIdentity
  33. and FIND_IN_SET(#{productIdentity},a.productIdentity)
  34. -- end
  35. -- isNotEmpty tags
  36. and b.tagName in (/* in tags */)
  37. -- end
  38. -- end
  39. GROUP BY a.id
  40. -- isNotEmpty tags
  41. HAVING COUNT(DISTINCT b.tagName) = #{tagCount}
  42. -- end
  43. -- isEmpty orderBy
  44. order by a.createTime desc
  45. -- else
  46. order by #{orderBy}
  47. -- end
  48. ;
  49. -- [selectDesignTemplateItems]
  50. select * from $table$ where idTemplate = #{idTemplate};
  51. -- [selectDesignOrders]
  52. select *
  53. from $table$
  54. -- trim prefix=WHERE prefixOverrides=AND|OR
  55. -- isNotEmpty voidFlag
  56. -- if voidFlag >= 0
  57. voidFlag = #{voidFlag}
  58. -- end
  59. -- end
  60. -- isNotEmpty userIdentity
  61. and userIdentity = #{userIdentity}
  62. -- end
  63. -- isNotEmpty keyWord
  64. and (orderName LIKE #{Like:keyWord})
  65. -- end
  66. -- isNotEmpty orderName
  67. and templateName LIKE #{Like:orderName}
  68. -- end
  69. -- end
  70. -- isEmpty orderBy
  71. order by createTime desc
  72. -- else
  73. order by #{orderBy}
  74. -- end
  75. ;
  76. -- [selectDesignOrderItems]
  77. select * from $table$ where idOrder = #{idOrder};
  78. -- [addDesignTemplate]
  79. insert into $table$ (id, templateName, backgroundPath, viewThumbPath,
  80. canvasHeight, canvasWidth, breedHeight,
  81. breedWidth, productIdentity, voidFlag,
  82. jsonContent, createBy, createTime,
  83. createTimeLong, updateBy, updateTime,
  84. updateTimeLong ) values ( #{id}, #{templatename}, #{backgroundpath}, #{viewthumbpath},
  85. #{canvasheight}, #{canvaswidth}, #{breedheight},
  86. #{breedwidth}, #{productidentity}, #{voidflag},
  87. #{jsoncontent}, #{createby}, #{createtime},
  88. #{createtimelong}, #{updateby}, #{updatetime},
  89. #{updatetimelong} );
  90. -- [updateDesignTemplate]
  91. update $table$ set templateName = #{templatename},
  92. productIdentity = #{productidentity},
  93. jsonContent = #{jsoncontent},
  94. backgroundPath = #{backgroundpath},
  95. canvasHeight = #{canvasheight},
  96. canvasWidth = #{canvaswidth},
  97. breedHeight = #{breedheight},
  98. breedWidth = #{breedwidth},
  99. updateBy = #{updateby},
  100. updateTime = #{updatetime}
  101. where id = #{id};
  102. -- [updateDesignTemplateThumb]
  103. update $table$ set templateName = #{templatename}, viewThumbPath = #{viewthumbpath},
  104. updateBy = #{updateby},
  105. updateTime = #{updatetime}
  106. where id = #{id};
  107. -- [addDesignTemplateItem]
  108. insert into $table$ (id, idTemplate, itemType, locationX,
  109. locationY, sizeWidth, sizeHeight,
  110. rotation, zIndex, jsonContent,
  111. createBy, createTime, createTimeLong,
  112. updateBy, updateTime, updateTimeLong ) values ( #{id}, #{idtemplate}, #{itemtype}, #{locationx},
  113. #{locationy}, #{sizewidth}, #{sizeheight},
  114. #{rotation}, #{zindex}, #{jsoncontent},
  115. #{createby}, #{createtime}, #{createtimelong},
  116. #{updateby}, #{updatetime}, #{updatetimelong} );
  117. -- [deleteDesignTemplateItem]
  118. delete from $table$ where idTemplate = #{id};
  119. -- [voidDesignTemplate]
  120. update $table$ set
  121. voidFlag = #{voidflag},
  122. updateBy = #{updateby},
  123. updateTime = #{updatetime}
  124. where id = #{id};
  125. -- [addDesignOrder]
  126. insert into $table$ (id, idTemplate, userIdentity, orderName,
  127. backgroundPath, viewThumbPath, canvasHeight,
  128. canvasWidth, breedHeight, breedWidth,
  129. productIdentity, pdfDownloadUrl, voidFlag,
  130. jsonContent, createBy, createTime,
  131. createTimeLong, updateBy, updateTime,
  132. updateTimeLong ) values ( #{id}, #{idtemplate}, #{useridentity}, #{ordername},
  133. #{backgroundpath}, #{viewthumbpath}, #{canvasheight},
  134. #{canvaswidth}, #{breedheight}, #{breedwidth},
  135. #{productidentity}, #{pdfdownloadurl}, #{voidflag},
  136. #{jsoncontent}, #{createby}, #{createtime},
  137. #{createtimelong}, #{updateby}, #{updatetime},
  138. #{updatetimelong} );
  139. -- [addDesignOrderItem]
  140. insert into $table$ (id, idOrder, itemType, locationX,
  141. locationY, sizeWidth, sizeHeight,
  142. rotation, zIndex, jsonContent,
  143. createBy, createTime, createTimeLong,
  144. updateBy, updateTime, updateTimeLong ) values ( #{id}, #{idorder}, #{itemtype}, #{locationx},
  145. #{locationy}, #{sizewidth}, #{sizeheight},
  146. #{rotation}, #{zindex}, #{jsoncontent},
  147. #{createby}, #{createtime}, #{createtimelong},
  148. #{updateby}, #{updatetime}, #{updatetimelong} );
  149. -- [updateDesignOrder]
  150. update $table$ set backgroundPath = #{backgroundpath},
  151. canvasHeight = #{canvasheight},
  152. canvasWidth = #{canvaswidth},
  153. breedHeight = #{breedheight},
  154. breedWidth = #{breedwidth},
  155. jsonContent = #{jsoncontent},
  156. updateBy = #{updateby},
  157. updateTime = #{updatetime}
  158. where id = #{id};
  159. -- [pdfCallbackDesignOrder]
  160. update $table$ set pdfDownloadUrl = #{pdfdownloadurl}
  161. where id = #{id};
  162. -- [deleteDesignOrderItem]
  163. delete from $table$ where idOrder = #{id};
  164. -- [queryDesignTagType]
  165. select *
  166. from $table$
  167. -- trim prefix=WHERE prefixOverrides=AND|OR
  168. -- isNotEmpty keyWord
  169. (name LIKE #{Like:keyWord})
  170. -- end
  171. -- isNotEmpty ids
  172. and id in (/* in ids */)
  173. -- end
  174. -- end
  175. -- isEmpty orderBy
  176. order by createTime desc
  177. -- else
  178. order by #{orderBy}
  179. -- end
  180. ;
  181. -- [getDesignTagType]
  182. select * from $table$ where id = #{id};
  183. -- [newDesignTagType]
  184. insert into $table$ (id, idParentType, name, createBy,
  185. createTime, createTimeLong, updateBy,
  186. updateTime, updateTimeLong ) values ( #{id}, #{idparenttype}, #{name}, #{createby},
  187. #{createtime}, #{createtimelong}, #{updateby},
  188. #{updatetime}, #{updatetimelong} );
  189. -- [deleteDesignTagType]
  190. delete from $table$ where id = #{id};
  191. -- [updateDesignTagType]
  192. update $table$ set idParentType = #{idparenttype},name = #{name},createBy = #{createby},createTime = #{createtime},
  193. createTimeLong = #{createtimelong},updateBy = #{updateby},updateTime = #{updatetime},updateTimeLong = #{updatetimelong}
  194. where id = #{id};
  195. -- [queryDesignTags]
  196. select *
  197. from $table$
  198. -- trim prefix=WHERE prefixOverrides=AND|OR
  199. -- isNotEmpty keyWord
  200. (tagName LIKE #{Like:keyWord})
  201. -- end
  202. -- isNotEmpty idType
  203. -- if idType >= 0
  204. and idType = #{idType}
  205. -- end
  206. -- end
  207. -- end
  208. -- isEmpty orderBy
  209. order by createTime desc
  210. -- else
  211. order by #{orderBy}
  212. -- end
  213. ;
  214. -- [newDesignTag]
  215. insert into $table$ (id, idType, tagName, createBy,
  216. createTime, createTimeLong, updateBy,
  217. updateTime, updateTimeLong ) values ( #{id}, #{idtype}, #{tagname}, #{createby},
  218. #{createtime}, #{createtimelong}, #{updateby},
  219. #{updatetime}, #{updatetimelong} );
  220. -- [changeTagType]
  221. update $table$ set idType = #{idtype} where id = #{id};
  222. -- [deleteDesignTag]
  223. delete from $table$ where id = #{id};
  224. -- [getTemplateTags]
  225. select * from $table$ where idTemplate in (/* in ids */);
  226. -- [deleteTemplateTag]
  227. delete from $table$ where idTemplate = #{idTemplate};
  228. -- [addTemplateTag]
  229. insert into $table$ (id, idTemplate, tagName, tagTypeName,
  230. createBy, createTime, createTimeLong,
  231. updateBy, updateTime, updateTimeLong ) values ( #{id}, #{idtemplate}, #{tagname}, #{tagtypename},
  232. #{createby}, #{createtime}, #{createtimelong},
  233. #{updateby}, #{updatetime}, #{updatetimelong} );