DSourceSQLBuilder.java 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520
  1. package com.miniframe.model.system;
  2. import java.util.ArrayList;
  3. import java.util.List;
  4. public class DSourceSQLBuilder {
  5. protected String orderByClause;
  6. protected boolean distinct;
  7. protected List<Criteria> oredCriteria;
  8. public DSourceSQLBuilder() {
  9. oredCriteria = new ArrayList<Criteria>();
  10. }
  11. public void setOrderByClause(String orderByClause) {
  12. this.orderByClause = orderByClause;
  13. }
  14. public String getOrderByClause() {
  15. return orderByClause;
  16. }
  17. public void setDistinct(boolean distinct) {
  18. this.distinct = distinct;
  19. }
  20. public boolean isDistinct() {
  21. return distinct;
  22. }
  23. public List<Criteria> getOredCriteria() {
  24. return oredCriteria;
  25. }
  26. public void or(Criteria criteria) {
  27. oredCriteria.add(criteria);
  28. }
  29. public Criteria or() {
  30. Criteria criteria = createCriteriaInternal();
  31. oredCriteria.add(criteria);
  32. return criteria;
  33. }
  34. public Criteria createCriteria() {
  35. Criteria criteria = createCriteriaInternal();
  36. if (oredCriteria.size() == 0) {
  37. oredCriteria.add(criteria);
  38. }
  39. return criteria;
  40. }
  41. protected Criteria createCriteriaInternal() {
  42. Criteria criteria = new Criteria();
  43. return criteria;
  44. }
  45. public void clear() {
  46. oredCriteria.clear();
  47. orderByClause = null;
  48. distinct = false;
  49. }
  50. protected abstract static class GeneratedCriteria {
  51. protected List<Criterion> criteria;
  52. protected GeneratedCriteria() {
  53. super();
  54. criteria = new ArrayList<Criterion>();
  55. }
  56. public boolean isValid() {
  57. return criteria.size() > 0;
  58. }
  59. public List<Criterion> getAllCriteria() {
  60. return criteria;
  61. }
  62. public List<Criterion> getCriteria() {
  63. return criteria;
  64. }
  65. protected void addCriterion(String condition) {
  66. if (condition == null) {
  67. throw new RuntimeException("Value for condition cannot be null");
  68. }
  69. criteria.add(new Criterion(condition));
  70. }
  71. protected void addCriterion(String condition, Object value, String property) {
  72. if (value == null) {
  73. throw new RuntimeException("Value for " + property + " cannot be null");
  74. }
  75. criteria.add(new Criterion(condition, value));
  76. }
  77. protected void addCriterion(String condition, Object value1, Object value2, String property) {
  78. if (value1 == null || value2 == null) {
  79. throw new RuntimeException("Between values for " + property + " cannot be null");
  80. }
  81. criteria.add(new Criterion(condition, value1, value2));
  82. }
  83. public Criteria andIdIsNull() {
  84. addCriterion("id is null");
  85. return (Criteria) this;
  86. }
  87. public Criteria andIdIsNotNull() {
  88. addCriterion("id is not null");
  89. return (Criteria) this;
  90. }
  91. public Criteria andIdEqualTo(Integer value) {
  92. addCriterion("id =", value, "id");
  93. return (Criteria) this;
  94. }
  95. public Criteria andIdNotEqualTo(Integer value) {
  96. addCriterion("id <>", value, "id");
  97. return (Criteria) this;
  98. }
  99. public Criteria andIdGreaterThan(Integer value) {
  100. addCriterion("id >", value, "id");
  101. return (Criteria) this;
  102. }
  103. public Criteria andIdGreaterThanOrEqualTo(Integer value) {
  104. addCriterion("id >=", value, "id");
  105. return (Criteria) this;
  106. }
  107. public Criteria andIdLessThan(Integer value) {
  108. addCriterion("id <", value, "id");
  109. return (Criteria) this;
  110. }
  111. public Criteria andIdLessThanOrEqualTo(Integer value) {
  112. addCriterion("id <=", value, "id");
  113. return (Criteria) this;
  114. }
  115. public Criteria andIdIn(List<Integer> values) {
  116. addCriterion("id in", values, "id");
  117. return (Criteria) this;
  118. }
  119. public Criteria andIdNotIn(List<Integer> values) {
  120. addCriterion("id not in", values, "id");
  121. return (Criteria) this;
  122. }
  123. public Criteria andIdBetween(Integer value1, Integer value2) {
  124. addCriterion("id between", value1, value2, "id");
  125. return (Criteria) this;
  126. }
  127. public Criteria andIdNotBetween(Integer value1, Integer value2) {
  128. addCriterion("id not between", value1, value2, "id");
  129. return (Criteria) this;
  130. }
  131. public Criteria andNidIsNull() {
  132. addCriterion("nid is null");
  133. return (Criteria) this;
  134. }
  135. public Criteria andNidIsNotNull() {
  136. addCriterion("nid is not null");
  137. return (Criteria) this;
  138. }
  139. public Criteria andNidEqualTo(Integer value) {
  140. addCriterion("nid =", value, "nid");
  141. return (Criteria) this;
  142. }
  143. public Criteria andNidNotEqualTo(Integer value) {
  144. addCriterion("nid <>", value, "nid");
  145. return (Criteria) this;
  146. }
  147. public Criteria andNidGreaterThan(Integer value) {
  148. addCriterion("nid >", value, "nid");
  149. return (Criteria) this;
  150. }
  151. public Criteria andNidGreaterThanOrEqualTo(Integer value) {
  152. addCriterion("nid >=", value, "nid");
  153. return (Criteria) this;
  154. }
  155. public Criteria andNidLessThan(Integer value) {
  156. addCriterion("nid <", value, "nid");
  157. return (Criteria) this;
  158. }
  159. public Criteria andNidLessThanOrEqualTo(Integer value) {
  160. addCriterion("nid <=", value, "nid");
  161. return (Criteria) this;
  162. }
  163. public Criteria andNidIn(List<Integer> values) {
  164. addCriterion("nid in", values, "nid");
  165. return (Criteria) this;
  166. }
  167. public Criteria andNidNotIn(List<Integer> values) {
  168. addCriterion("nid not in", values, "nid");
  169. return (Criteria) this;
  170. }
  171. public Criteria andNidBetween(Integer value1, Integer value2) {
  172. addCriterion("nid between", value1, value2, "nid");
  173. return (Criteria) this;
  174. }
  175. public Criteria andNidNotBetween(Integer value1, Integer value2) {
  176. addCriterion("nid not between", value1, value2, "nid");
  177. return (Criteria) this;
  178. }
  179. public Criteria andNnameIsNull() {
  180. addCriterion("nname is null");
  181. return (Criteria) this;
  182. }
  183. public Criteria andNnameIsNotNull() {
  184. addCriterion("nname is not null");
  185. return (Criteria) this;
  186. }
  187. public Criteria andNnameEqualTo(String value) {
  188. addCriterion("nname =", value, "nname");
  189. return (Criteria) this;
  190. }
  191. public Criteria andNnameNotEqualTo(String value) {
  192. addCriterion("nname <>", value, "nname");
  193. return (Criteria) this;
  194. }
  195. public Criteria andNnameGreaterThan(String value) {
  196. addCriterion("nname >", value, "nname");
  197. return (Criteria) this;
  198. }
  199. public Criteria andNnameGreaterThanOrEqualTo(String value) {
  200. addCriterion("nname >=", value, "nname");
  201. return (Criteria) this;
  202. }
  203. public Criteria andNnameLessThan(String value) {
  204. addCriterion("nname <", value, "nname");
  205. return (Criteria) this;
  206. }
  207. public Criteria andNnameLessThanOrEqualTo(String value) {
  208. addCriterion("nname <=", value, "nname");
  209. return (Criteria) this;
  210. }
  211. public Criteria andNnameLike(String value) {
  212. addCriterion("nname like", value, "nname");
  213. return (Criteria) this;
  214. }
  215. public Criteria andNnameNotLike(String value) {
  216. addCriterion("nname not like", value, "nname");
  217. return (Criteria) this;
  218. }
  219. public Criteria andNnameIn(List<String> values) {
  220. addCriterion("nname in", values, "nname");
  221. return (Criteria) this;
  222. }
  223. public Criteria andNnameNotIn(List<String> values) {
  224. addCriterion("nname not in", values, "nname");
  225. return (Criteria) this;
  226. }
  227. public Criteria andNnameBetween(String value1, String value2) {
  228. addCriterion("nname between", value1, value2, "nname");
  229. return (Criteria) this;
  230. }
  231. public Criteria andNnameNotBetween(String value1, String value2) {
  232. addCriterion("nname not between", value1, value2, "nname");
  233. return (Criteria) this;
  234. }
  235. public Criteria andSTypeIsNull() {
  236. addCriterion("s_type is null");
  237. return (Criteria) this;
  238. }
  239. public Criteria andSTypeIsNotNull() {
  240. addCriterion("s_type is not null");
  241. return (Criteria) this;
  242. }
  243. public Criteria andSTypeEqualTo(String value) {
  244. addCriterion("s_type =", value, "sType");
  245. return (Criteria) this;
  246. }
  247. public Criteria andSTypeNotEqualTo(String value) {
  248. addCriterion("s_type <>", value, "sType");
  249. return (Criteria) this;
  250. }
  251. public Criteria andSTypeGreaterThan(String value) {
  252. addCriterion("s_type >", value, "sType");
  253. return (Criteria) this;
  254. }
  255. public Criteria andSTypeGreaterThanOrEqualTo(String value) {
  256. addCriterion("s_type >=", value, "sType");
  257. return (Criteria) this;
  258. }
  259. public Criteria andSTypeLessThan(String value) {
  260. addCriterion("s_type <", value, "sType");
  261. return (Criteria) this;
  262. }
  263. public Criteria andSTypeLessThanOrEqualTo(String value) {
  264. addCriterion("s_type <=", value, "sType");
  265. return (Criteria) this;
  266. }
  267. public Criteria andSTypeLike(String value) {
  268. addCriterion("s_type like", value, "sType");
  269. return (Criteria) this;
  270. }
  271. public Criteria andSTypeNotLike(String value) {
  272. addCriterion("s_type not like", value, "sType");
  273. return (Criteria) this;
  274. }
  275. public Criteria andSTypeIn(List<String> values) {
  276. addCriterion("s_type in", values, "sType");
  277. return (Criteria) this;
  278. }
  279. public Criteria andSTypeNotIn(List<String> values) {
  280. addCriterion("s_type not in", values, "sType");
  281. return (Criteria) this;
  282. }
  283. public Criteria andSTypeBetween(String value1, String value2) {
  284. addCriterion("s_type between", value1, value2, "sType");
  285. return (Criteria) this;
  286. }
  287. public Criteria andSTypeNotBetween(String value1, String value2) {
  288. addCriterion("s_type not between", value1, value2, "sType");
  289. return (Criteria) this;
  290. }
  291. public Criteria andAidIsNull() {
  292. addCriterion("aid is null");
  293. return (Criteria) this;
  294. }
  295. public Criteria andAidIsNotNull() {
  296. addCriterion("aid is not null");
  297. return (Criteria) this;
  298. }
  299. public Criteria andAidEqualTo(Integer value) {
  300. addCriterion("aid =", value, "aid");
  301. return (Criteria) this;
  302. }
  303. public Criteria andAidNotEqualTo(Integer value) {
  304. addCriterion("aid <>", value, "aid");
  305. return (Criteria) this;
  306. }
  307. public Criteria andAidGreaterThan(Integer value) {
  308. addCriterion("aid >", value, "aid");
  309. return (Criteria) this;
  310. }
  311. public Criteria andAidGreaterThanOrEqualTo(Integer value) {
  312. addCriterion("aid >=", value, "aid");
  313. return (Criteria) this;
  314. }
  315. public Criteria andAidLessThan(Integer value) {
  316. addCriterion("aid <", value, "aid");
  317. return (Criteria) this;
  318. }
  319. public Criteria andAidLessThanOrEqualTo(Integer value) {
  320. addCriterion("aid <=", value, "aid");
  321. return (Criteria) this;
  322. }
  323. public Criteria andAidIn(List<Integer> values) {
  324. addCriterion("aid in", values, "aid");
  325. return (Criteria) this;
  326. }
  327. public Criteria andAidNotIn(List<Integer> values) {
  328. addCriterion("aid not in", values, "aid");
  329. return (Criteria) this;
  330. }
  331. public Criteria andAidBetween(Integer value1, Integer value2) {
  332. addCriterion("aid between", value1, value2, "aid");
  333. return (Criteria) this;
  334. }
  335. public Criteria andAidNotBetween(Integer value1, Integer value2) {
  336. addCriterion("aid not between", value1, value2, "aid");
  337. return (Criteria) this;
  338. }
  339. }
  340. public static class Criteria extends GeneratedCriteria {
  341. protected Criteria() {
  342. super();
  343. }
  344. }
  345. public static class Criterion {
  346. private String condition;
  347. private Object value;
  348. private Object secondValue;
  349. private boolean noValue;
  350. private boolean singleValue;
  351. private boolean betweenValue;
  352. private boolean listValue;
  353. private String typeHandler;
  354. public String getCondition() {
  355. return condition;
  356. }
  357. public Object getValue() {
  358. return value;
  359. }
  360. public Object getSecondValue() {
  361. return secondValue;
  362. }
  363. public boolean isNoValue() {
  364. return noValue;
  365. }
  366. public boolean isSingleValue() {
  367. return singleValue;
  368. }
  369. public boolean isBetweenValue() {
  370. return betweenValue;
  371. }
  372. public boolean isListValue() {
  373. return listValue;
  374. }
  375. public String getTypeHandler() {
  376. return typeHandler;
  377. }
  378. protected Criterion(String condition) {
  379. super();
  380. this.condition = condition;
  381. this.typeHandler = null;
  382. this.noValue = true;
  383. }
  384. protected Criterion(String condition, Object value, String typeHandler) {
  385. super();
  386. this.condition = condition;
  387. this.value = value;
  388. this.typeHandler = typeHandler;
  389. if (value instanceof List<?>) {
  390. this.listValue = true;
  391. } else {
  392. this.singleValue = true;
  393. }
  394. }
  395. protected Criterion(String condition, Object value) {
  396. this(condition, value, null);
  397. }
  398. protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
  399. super();
  400. this.condition = condition;
  401. this.value = value;
  402. this.secondValue = secondValue;
  403. this.typeHandler = typeHandler;
  404. this.betweenValue = true;
  405. }
  406. protected Criterion(String condition, Object value, Object secondValue) {
  407. this(condition, value, secondValue, null);
  408. }
  409. }
  410. }