DocDao.dql 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. -- [selectBusinessScript]
  2. select *
  3. from $table$
  4. -- trim prefix=WHERE prefixOverrides=AND|OR
  5. -- isNotEmpty voidFlag
  6. -- if voidFlag >= 0
  7. voidFlag = #{voidFlag}
  8. -- end
  9. -- end
  10. -- isNotEmpty keyWord
  11. and (businessName LIKE #{Like:keyWord} or businessCode LIKE #{Like:keyWord})
  12. -- end
  13. -- isNotEmpty businessName
  14. and businessName LIKE #{Like:businessName}
  15. -- end
  16. -- isNotEmpty businessCode
  17. and businessCode LIKE #{Like:businessCode}
  18. -- end
  19. -- isNotEmpty businessModule
  20. -- if businessModule >= 0
  21. and businessModule = #{businessModule}
  22. -- end
  23. -- end
  24. -- end
  25. -- isEmpty orderBy
  26. order by businessModule asc, createTime desc
  27. -- else
  28. order by #{orderBy}
  29. -- end
  30. ;
  31. -- [addBusinessScript]
  32. insert into $table$
  33. (id, businessName, businessCode,
  34. voidFlag, businessModule, systemFlag, commonFlag,
  35. createBy, createTime,
  36. updateBy, updateTime)
  37. values (
  38. #{id}, #{businessname}, #{businesscode},
  39. #{voidflag}, #{businessmodule}, #{systemflag}, #{commonflag},
  40. #{createby}, #{createtime}, #{updateby},
  41. #{updatetime}
  42. );
  43. -- [updateBusinessScript]
  44. update $table$ set
  45. businessName = #{businessname},
  46. commonFlag = #{commonflag},
  47. updateBy = #{updateby},
  48. updateTime = #{updatetime}
  49. where id = #{id};
  50. -- [voidBusinessScript]
  51. update $table$ set
  52. voidFlag = #{voidflag},
  53. updateBy = #{updateby},
  54. updateTime = #{updatetime}
  55. where id = #{id};
  56. -- [selectInquireMainInfo]
  57. select * from $table$;
  58. -- [addInquireMainInfo]
  59. insert into $table$ (id, inquireName, inquireFuncName, inquireType, canExport, queryInPage,
  60. voidFlag, createBy, createTime,
  61. updateBy, updateTime ) values ( #{id}, #{inquirename}, #{inquirefuncname}, #{inquiretype}, #{canexport}, #{queryinpage},
  62. #{voidflag}, #{createby}, #{createtime},
  63. #{updateby}, #{updatetime} );
  64. -- [updateInquireMainInfo]
  65. update $table$ set inquireName = #{inquirename},inquireType = #{inquiretype}, canExport = #{canexport}, queryInPage = #{queryinpage},
  66. updateBy = #{updateby},
  67. updateTime = #{updatetime} where id = #{id};
  68. -- [voidInquireMainInfo]
  69. update $table$ set voidFlag = #{voidflag},
  70. updateBy = #{updateby},
  71. updateTime = #{updatetime} where id = #{id};
  72. -- [selectInquireResultColumn]
  73. select * from $table$
  74. -- trim prefix=WHERE prefixOverrides=AND|OR
  75. -- if idInquire > 0
  76. idInquire = #{idInquire}
  77. -- end
  78. -- end
  79. ;
  80. -- [addInquireResultColumn]
  81. insert into $table$ (id, idInquire, idParentColumn, columnName,
  82. columnField, columnWidth, visible,
  83. hasStatistics, statisticsFormat, linkUrl,
  84. sortAsc, createBy, createTime,
  85. updateBy, updateTime ) values ( #{id}, #{idinquire}, #{idparentcolumn}, #{columnname},
  86. #{columnfield}, #{columnwidth}, #{visible},
  87. #{hasstatistics}, #{statisticsformat}, #{linkurl},
  88. #{sortasc}, #{createby}, #{createtime},
  89. #{updateby}, #{updatetime} );
  90. -- [updateInquireResultColumn]
  91. update $table$ set columnName = #{columnname},columnField = #{columnfield},columnWidth = #{columnwidth},
  92. visible = #{visible},hasStatistics = #{hasstatistics},statisticsFormat = #{statisticsformat}, linkUrl = #{linkurl}, sortAsc = #{sortasc},
  93. updateBy = #{updateby},
  94. updateTime = #{updatetime} where id = #{id};
  95. -- [deleteInquireResultColumn]
  96. delete from $table$ where id = #{id};
  97. -- [selectInquireCondition]
  98. select * from $table$
  99. -- trim prefix=WHERE prefixOverrides=AND|OR
  100. -- if idInquire > 0
  101. idInquire = #{idInquire}
  102. -- end
  103. -- end
  104. ;
  105. -- [addInquireCondition]
  106. insert into $table$ (id, idInquire, conditionName, conditionField,
  107. dataType, defaultValue, visible,
  108. selectDicType, sortAsc, createBy,
  109. createTime, updateBy,
  110. updateTime ) values ( #{id}, #{idinquire}, #{conditionname}, #{conditionfield},
  111. #{datatype}, #{defaultvalue}, #{visible},
  112. #{selectdictype}, #{sortasc}, #{createby},
  113. #{createtime}, #{updateby},
  114. #{updatetime} );
  115. -- [updateInquireCondition]
  116. update $table$ set conditionName = #{conditionname},conditionField = #{conditionfield},dataType = #{datatype},
  117. defaultValue = #{defaultvalue},visible = #{visible},selectDicType = #{selectdictype},sortAsc = #{sortasc},
  118. updateBy = #{updateby},
  119. updateTime = #{updatetime} where id = #{id};
  120. -- [deleteInquireCondition]
  121. delete from $table$ where id = #{id};
  122. -- [deleteInquireResultColumnByMain]
  123. delete from $table$ where idInquire = #{id};
  124. -- [deleteInquireConditionByMain]
  125. delete from $table$ where idInquire = #{id};
  126. -- [selectCompanyInfo]
  127. select *
  128. from $table$
  129. -- trim prefix=WHERE prefixOverrides=AND|OR
  130. -- if voidFlag >= 0
  131. voidFlag = #{voidFlag}
  132. -- end
  133. -- isNotEmpty keyWord
  134. and (companyName LIKE #{Like:keyWord} or linkMan LIKE #{Like:keyWord})
  135. -- end
  136. -- end
  137. -- isEmpty orderBy
  138. order by createTime desc
  139. -- else
  140. order by #{orderBy}
  141. -- end;
  142. -- [addCompanyInfo]
  143. insert into $table$ (
  144. id, companyName, address, linkMan,
  145. linkPhone, voidFlag, createBy,
  146. createTime, createTimeLong, updateBy,
  147. updateTime, updateTimeLong )
  148. values (
  149. #{id}, #{companyname}, #{address}, #{linkman},
  150. #{linkphone}, #{voidflag}, #{createby},
  151. #{createtime}, #{createtimelong}, #{updateby},
  152. #{updatetime}, #{updatetimelong}
  153. );
  154. -- [updateCompanyInfo]
  155. update $table$ set
  156. companyName = #{companyname},
  157. address = #{address},
  158. linkMan = #{linkman},
  159. linkPhone = #{linkphone},
  160. updateBy = #{updateby},
  161. updateTime = #{updatetime},
  162. updateTimeLong = #{updatetimelong}
  163. where id = #{id};
  164. -- [voidCompanyInfo]
  165. update $table$ set
  166. voidFlag = #{voidflag},
  167. updateBy = #{updateby},
  168. updateTime = #{updatetime},
  169. updateTimeLong = #{updatetimelong}
  170. where id = #{id};