DocDao.dql 5.6 KB

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