SqlCondition.java 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /**
  2. * Copyright (c) 2011-2014, hubin (jobob@qq.com).
  3. * <p>
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. * <p>
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. * <p>
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package com.baomidou.mybatisplus.annotations;
  17. /**
  18. * <p>
  19. * SQL 比较条件枚举类
  20. * </p>
  21. *
  22. * @author hubin
  23. * @Date 2018-01-05
  24. */
  25. public class SqlCondition {
  26. /**
  27. * 等于
  28. */
  29. public static final String EQUAL = "%s=#{%s}";
  30. /**
  31. * 不等于
  32. */
  33. public static final String NOT_EQUAL = "%s&lt;&gt;#{%s}";
  34. /**
  35. * % 两边 %
  36. */
  37. public static final String LIKE = "%s LIKE CONCAT('%%',#{%s},'%%')";
  38. /**
  39. * % 左
  40. */
  41. public static final String LIKE_LEFT = "%s LIKE CONCAT('%%',#{%s})";
  42. /**
  43. * 右 %
  44. */
  45. public static final String LIKE_RIGHT = "%s LIKE CONCAT(#{%s},'%%')";
  46. }