PaperDao.dql 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. -- [selectPaperBrand]
  2. select * from $table$
  3. -- trim prefix=WHERE prefixOverrides=AND|OR
  4. -- isNotBlank keyWord
  5. brandName LIKE #{Like:keyWord}
  6. -- end
  7. -- isNotBlank voidFlag
  8. and voidFlag = #{voidFlag}
  9. -- end
  10. -- end
  11. ;
  12. -- [existPaperBrand]
  13. select count(id) from $table$ where brandName = #{brandname} and voidFlag = 0;
  14. -- [addPaperBrand]
  15. insert into $table$ (id, brandName, companyName, voidFlag,
  16. createBy, createTime, createTimeLong,
  17. updateBy, updateTime, updateTimeLong ) values ( #{id}, #{brandname}, #{companyname}, #{voidflag},
  18. #{createby}, #{createtime}, #{createtimelong},
  19. #{updateby}, #{updatetime}, #{updatetimelong} );
  20. -- [updatePaperBrand]
  21. update $table$ set brandName = #{brandname},companyName = #{companyname},updateBy = #{updateby},updateTime = #{updatetime},
  22. updateTimeLong = #{updatetimelong} where id = #{id};
  23. -- [voidPaperBrand]
  24. update $table$ set voidFlag = #{voidflag},updateBy = #{updateby},updateTime = #{updatetime},
  25. updateTimeLong = #{updatetimelong} where id = #{id};
  26. -- [selectPaperInfoType]
  27. select id, paperTypeName, voidFlag, paperCount,
  28. paperTypeCode, createBy, createTime,
  29. createTimeLong, updateBy, updateTime,
  30. updateTimeLong from $table$;
  31. -- [addPaperInfoType]
  32. insert into $table$ (id, paperTypeName, voidFlag, paperCount,
  33. paperTypeCode, createBy, createTime,
  34. createTimeLong, updateBy, updateTime,
  35. updateTimeLong ) values ( #{id}, #{papertypename}, #{voidflag}, #{papercount},
  36. #{papertypecode}, #{createby}, #{createtime},
  37. #{createtimelong}, #{updateby}, #{updatetime},
  38. #{updatetimelong} );
  39. -- [updatePaperInfoType]
  40. update $table$ set
  41. paperTypeName = #{papertypename},
  42. updateBy = #{updateby},
  43. updateTime = #{updatetime},
  44. updateTimeLong = #{updatetimelong} where id = #{id};
  45. -- [voidPaperInfoType]
  46. update $table$ set voidFlag = #{voidflag},
  47. updateBy = #{updateby},updateTime = #{updatetime}
  48. where id = #{id};
  49. -- [selectPaperBaseInfo]
  50. select id, mtSuttle, idPaperType, paperTypeName,
  51. paperInfoCode, paperName, priceType,sortNum,
  52. paperPrice, createBy, createTime,
  53. createTimeLong, updateBy, updateTime,
  54. updateTimeLong from $table$;
  55. -- [addPaperBaseInfo]
  56. insert into $table$ (id, mtSuttle, idPaperType, paperTypeName,
  57. paperInfoCode, paperName, priceType,
  58. paperPrice, voidFlag, createBy,code,sortNum,
  59. createTime, createTimeLong, updateBy,
  60. updateTime, updateTimeLong ) values ( #{id}, #{mtsuttle}, #{idpapertype}, #{papertypename},
  61. #{paperinfocode}, #{papername}, #{pricetype},
  62. #{paperprice}, #{voidflag}, #{createby},#{code},#{sortnum},
  63. #{createtime}, #{createtimelong}, #{updateby},
  64. #{updatetime}, #{updatetimelong} );
  65. -- [updatePaperBaseInfo]
  66. update $table$ set mtSuttle = #{mtsuttle},idPaperType = #{idpapertype},paperTypeName = #{papertypename},paperInfoCode = #{paperinfocode},
  67. paperName = #{papername},priceType = #{pricetype},paperPrice = #{paperprice},voidFlag = #{voidflag},sortNum = #{sortnum},
  68. updateBy = #{updateby},
  69. updateTime = #{updatetime},updateTimeLong = #{updatetimelong} where id = #{id};
  70. -- [voidPaperBaseInfo]
  71. update $table$ set voidFlag = #{voidflag},
  72. updateBy = #{updateby},updateTime = #{updatetime}
  73. where id = #{id};
  74. -- [savePaperBaseInfoPrice]
  75. update $table$ set paperPrice = #{paperprice},
  76. updateBy = #{updateby},updateTime = #{updatetime}
  77. where id = #{id};
  78. -- [selectPaperInfo]
  79. select id, idPaperBaseInfo, mtRule, mtSuttle,
  80. idPaperType, paperTypeName, mtModel,
  81. paperName, byUnit, mtUnit,
  82. seUnit, newestPrice, paperCode,
  83. convertUnitByToMt, convertUnitMtToSe, voidFlag,
  84. remark, barCode, paperPrice,
  85. stockPrecision, priceType, createBy, updateBy from $table$;
  86. -- [addPaperInfo]
  87. insert into $table$ (id, mtRule, mtSuttle, idPaperType,idPaperBaseInfo,
  88. paperTypeName, mtModel, paperName,
  89. byUnit, mtUnit, seUnit,
  90. newestPrice, paperCode, convertUnitByToMt,
  91. convertUnitMtToSe, voidFlag, remark,stockPrecision,code,
  92. barCode, createBy, createTime,
  93. createTimeLong, updateBy, updateTime,
  94. updateTimeLong,
  95. priceType)
  96. values (
  97. #{id}, #{mtrule}, #{mtsuttle}, #{idpapertype},#{idpaperbaseinfo},
  98. #{papertypename}, #{mtmodel}, #{papername},
  99. #{byunit}, #{mtunit}, #{seunit},
  100. #{newestprice}, #{papercode}, #{convertunitbytomt},
  101. #{convertunitmttose}, #{voidflag}, #{remark},#{stockprecision},#{code},
  102. #{barcode}, #{createby}, #{createtime},
  103. #{createtimelong}, #{updateby}, #{updatetime},
  104. #{updatetimelong},
  105. #{pricetype});
  106. -- [updatePaperInfo]
  107. update $table$ set
  108. --mtRule = #{mtrule},
  109. --mtSuttle = #{mtsuttle},
  110. --idPaperType = #{idpapertype},
  111. --paperTypeName = #{papertypename},
  112. --idPaperBaseInfo=#{idpaperbaseinfo},
  113. --mtModel = #{mtmodel},
  114. --paperName = #{papername},
  115. --byUnit = #{byunit},
  116. --mtUnit = #{mtunit},
  117. --seUnit = #{seunit},
  118. --newestPrice = #{newestprice},
  119. --convertUnitByToMt = #{convertunitbytomt},
  120. --convertUnitMtToSe = #{convertunitmttose},
  121. remark = #{remark},
  122. --barCode = #{barcode},
  123. --stockPrecision = #{stockprecision},
  124. --updateBy = #{updateby},
  125. --updateTime = #{updatetime},
  126. --updateTimeLong = #{updatetimelong},
  127. priceType = #{pricetype}
  128. where id = #{id};
  129. -- [voidPaperInfo]
  130. update $table$ set voidFlag = #{voidflag},
  131. updateBy = #{updateby},updateTime = #{updatetime}
  132. where id = #{id};
  133. -- [savePaperInfoPrice]
  134. update $table$ set paperPrice = #{paperprice},
  135. updateBy = #{updateby},updateTime = #{updatetime}
  136. where id = #{id};
  137. -- [queryPaperCutInfo]
  138. select * from $table$
  139. order by cutCount;
  140. -- [addPaperCutInfo]
  141. insert into $table$ (id, cutName, cutCount,
  142. createBy, createTime,
  143. updateBy, updateTime ) values ( #{id}, #{cutname}, #{cutcount},
  144. #{createby}, #{createtime},
  145. #{updateby}, #{updatetime} );
  146. -- [updatePaperCutInfo]
  147. update $table$ set cutName = #{cutname},cutCount = #{cutcount},
  148. updateBy = #{updateby},updateTime = #{updatetime}
  149. where id = #{id};
  150. -- [deletePaperCutInfo]
  151. delete from $table$
  152. where id = #{idCutInfo};
  153. -- [queryPaperCutSizeInfo]
  154. select * from $table$
  155. -- trim prefix=WHERE prefixOverrides=AND|OR
  156. -- isNotEmpty idCutInfo
  157. idCutInfo = #{idCutInfo}
  158. -- end
  159. -- end
  160. ;
  161. -- [addPaperCutSizeInfo]
  162. insert into $table$ (id, idCutInfo, wholePaperSize, cutPaperSize,
  163. createBy, createTime,
  164. updateBy, updateTime ) values ( #{id}, #{idcutinfo}, #{wholepapersize}, #{cutpapersize},
  165. #{createby}, #{createtime},
  166. #{updateby}, #{updatetime});
  167. -- [deletePaperCutSizeInfo]
  168. delete from $table$
  169. where id = #{id};
  170. -- [deletePaperCutSizeInfoList]
  171. delete from $table$
  172. where idCutInfo = #{id};
  173. -- [selectPaperQuoteInfo]
  174. select * from $table$;
  175. -- [addPaperQuoteInfo]
  176. insert into $table$ (id, idPaperBaseInfo, paperBaseName, idPaperBrand,
  177. paperBrandName, paperQuoteName, priceType,
  178. paperPrice, voidFlag, createBy,
  179. createTime, createTimeLong, updateBy,
  180. updateTime, updateTimeLong ) values ( #{id}, #{idpaperbaseinfo}, #{paperbasename}, #{idpaperbrand},
  181. #{paperbrandname}, #{paperquotename}, #{pricetype},
  182. #{paperprice}, #{voidflag}, #{createby},
  183. #{createtime}, #{createtimelong}, #{updateby},
  184. #{updatetime}, #{updatetimelong} );
  185. -- [updatePaperQuoteInfo]
  186. update $table$ set paperQuoteName = #{paperquotename}, priceType = #{pricetype},paperPrice = #{paperprice},updateBy = #{updateby},
  187. updateTime = #{updatetime},updateTimeLong = #{updatetimelong} where id = #{id};
  188. -- [voidPaperQuoteInfo]
  189. update $table$ set voidFlag = #{voidflag},updateBy = #{updateby},updateTime = #{updatetime},
  190. updateTimeLong = #{updatetimelong} where id = #{id};