java.lang.Object
org.ssssssss.magicapi.modules.db.table.Where

public class Where extends Object
单表API的Where
作者:
mxd
  • 字段详细资料

    • tokens

      private final List<String> tokens
    • params

      private final List<Object> params
    • namedTable

      private final NamedTable namedTable
    • needWhere

      private final boolean needWhere
    • notNull

      private boolean notNull
    • notBlank

      private boolean notBlank
  • 构造器详细资料

    • Where

      public Where(NamedTable namedTable)
    • Where

      public Where(NamedTable namedTable, boolean needWhere)
  • 方法详细资料

    • clone

      @Comment("\u514b\u9686") public Where clone()
      覆盖:
      clone 在类中 Object
    • notNull

      @Comment("\u8fc7\u6ee4`null`\u7684\u53c2\u6570") public Where notNull()
    • notBlank

      @Comment("\u8fc7\u6ee4`blank`\u7684\u53c2\u6570") public Where notBlank()
    • notNull

      @Comment("\u662f\u5426\u8fc7\u6ee4`null`\u7684\u53c2\u6570") public Where notNull(boolean flag)
    • notBlank

      @Comment("\u662f\u5426\u8fc7\u6ee4`blank`\u7684\u53c2\u6570") public Where notBlank(boolean flag)
    • eq

      @Comment("\u7b49\u4e8e`=`,\u5982\uff1a`eq(\'name\', \'\u8001\u738b\') ---> name = \'\u8001\u738b\'`") public Where eq(@Comment(name="column",value="\u6570\u636e\u5e93\u4e2d\u7684\u5217\u540d") String column, @Comment(name="value",value="\u503c") Object value)
    • eq

      @Comment("\u7b49\u4e8e`=`,\u5982\uff1a`eq(\'name\', \'\u8001\u738b\') ---> name = \'\u8001\u738b\'`") public Where eq(@Comment(name="condition",value="\u5224\u65ad\u8868\u8fbe\u5f0f\uff0c\u5f53\u4e3atrue\u65f6\u62fc\u63a5\u6761\u4ef6") boolean condition, @Comment(name="column",value="\u6570\u636e\u5e93\u4e2d\u7684\u5217\u540d") String column, @Comment(name="value",value="\u503c") Object value)
    • ne

      @Comment("\u4e0d\u7b49\u4e8e`<>`,\u5982\uff1a`ne(\'name\', \'\u8001\u738b\') ---> name <> \'\u8001\u738b\'`") public Where ne(@Comment(name="column",value="\u6570\u636e\u5e93\u4e2d\u7684\u5217\u540d") String column, @Comment(name="value",value="\u503c") Object value)
    • ne

      @Comment("\u4e0d\u7b49\u4e8e`<>`,\u5982\uff1a`ne(\'name\', \'\u8001\u738b\') ---> name <> \'\u8001\u738b\'`") public Where ne(@Comment(name="condition",value="\u5224\u65ad\u8868\u8fbe\u5f0f\uff0c\u5f53\u4e3atrue\u65f6\u62fc\u63a5\u6761\u4ef6") boolean condition, @Comment(name="column",value="\u6570\u636e\u5e93\u4e2d\u7684\u5217\u540d") String column, @Comment(name="value",value="\u503c") Object value)
    • lt

      @Comment("\u5c0f\u4e8e`<`,\u5982\uff1a`lt(\'age\', 18) ---> age < 18") public Where lt(@Comment(name="column",value="\u6570\u636e\u5e93\u4e2d\u7684\u5217\u540d") String column, @Comment(name="value",value="\u503c") Object value)
    • lt

      @Comment("\u5c0f\u4e8e`<`,\u5982\uff1a`lt(\'age\', 18) ---> age < 18") public Where lt(@Comment(name="condition",value="\u5224\u65ad\u8868\u8fbe\u5f0f\uff0c\u5f53\u4e3atrue\u65f6\u62fc\u63a5\u6761\u4ef6") boolean condition, @Comment(name="column",value="\u6570\u636e\u5e93\u4e2d\u7684\u5217\u540d") String column, @Comment(name="value",value="\u503c") Object value)
    • lte

      @Comment("\u5c0f\u4e8e\u7b49\u4e8e`<=`,\u5982\uff1a`lte(\'age\', 18) ---> age <= 18") public Where lte(@Comment(name="column",value="\u6570\u636e\u5e93\u4e2d\u7684\u5217\u540d") String column, @Comment(name="value",value="\u503c") Object value)
    • lte

      @Comment("\u5c0f\u4e8e\u7b49\u4e8e`<=`,\u5982\uff1a`lte(\'age\', 18) ---> age <= 18") public Where lte(@Comment(name="condition",value="\u5224\u65ad\u8868\u8fbe\u5f0f\uff0c\u5f53\u4e3atrue\u65f6\u62fc\u63a5\u6761\u4ef6") boolean condition, @Comment(name="column",value="\u6570\u636e\u5e93\u4e2d\u7684\u5217\u540d") String column, @Comment(name="value",value="\u503c") Object value)
    • gt

      @Comment("\u5927\u4e8e`>`,\u5982\uff1a`get(\'age\', 18) ---> age > 18") public Where gt(@Comment(name="column",value="\u6570\u636e\u5e93\u4e2d\u7684\u5217\u540d") String column, @Comment(name="value",value="\u503c") Object value)
    • gt

      @Comment("\u5927\u4e8e`>`,\u5982\uff1a`get(\'age\', 18) ---> age > 18") public Where gt(@Comment(name="condition",value="\u5224\u65ad\u8868\u8fbe\u5f0f\uff0c\u5f53\u4e3atrue\u65f6\u62fc\u63a5\u6761\u4ef6") boolean condition, @Comment(name="column",value="\u6570\u636e\u5e93\u4e2d\u7684\u5217\u540d") String column, @Comment(name="value",value="\u503c") Object value)
    • gte

      @Comment("\u5927\u4e8e\u7b49\u4e8e`>=`,\u5982\uff1a`get(\'age\', 18) ---> age >= 18") public Where gte(@Comment(name="column",value="\u6570\u636e\u5e93\u4e2d\u7684\u5217\u540d") String column, @Comment(name="value",value="\u503c") Object value)
    • gte

      @Comment("\u5927\u4e8e\u7b49\u4e8e`>=`,\u5982\uff1a`get(\'age\', 18) ---> age >= 18") public Where gte(@Comment(name="condition",value="\u5224\u65ad\u8868\u8fbe\u5f0f\uff0c\u5f53\u4e3atrue\u65f6\u62fc\u63a5\u6761\u4ef6") boolean condition, @Comment(name="column",value="\u6570\u636e\u5e93\u4e2d\u7684\u5217\u540d") String column, @Comment(name="value",value="\u503c") Object value)
    • in

      @Comment("`in`,\u5982\uff1a`in(\'age\', [1,2,3]) ---> age in (1,2,3)") public Where in(@Comment(name="column",value="\u6570\u636e\u5e93\u4e2d\u7684\u5217\u540d") String column, @Comment(name="value",value="\u503c") Object value)
    • in

      @Comment("`in`,\u5982\uff1a`in(\'age\', [1,2,3]) ---> age in (1,2,3)") public Where in(@Comment(name="condition",value="\u5224\u65ad\u8868\u8fbe\u5f0f\uff0c\u5f53\u4e3atrue\u65f6\u62fc\u63a5\u6761\u4ef6") boolean condition, @Comment(name="column",value="\u6570\u636e\u5e93\u4e2d\u7684\u5217\u540d") String column, @Comment(name="value",value="\u503c") Object value)
    • notIn

      @Comment("`not in`,\u5982\uff1a`notIn(\'age\', [1,2,3]) ---> age not in (1,2,3)") public Where notIn(@Comment(name="column",value="\u6570\u636e\u5e93\u4e2d\u7684\u5217\u540d") String column, @Comment(name="value",value="\u503c") Object value)
    • notIn

      @Comment("`not in`,\u5982\uff1a`notIn(\'age\', [1,2,3]) ---> age not in (1,2,3)") public Where notIn(@Comment(name="condition",value="\u5224\u65ad\u8868\u8fbe\u5f0f\uff0c\u5f53\u4e3atrue\u65f6\u62fc\u63a5\u6761\u4ef6") boolean condition, @Comment(name="column",value="\u6570\u636e\u5e93\u4e2d\u7684\u5217\u540d") String column, @Comment(name="value",value="\u503c") Object value)
    • like

      @Comment("`like`,\u5982\uff1a`like(\'name\', \'%\u738b%\') ---> name like \'%\u738b%\'") public Where like(@Comment(name="column",value="\u6570\u636e\u5e93\u4e2d\u7684\u5217\u540d") String column, @Comment(name="value",value="\u503c") Object value)
    • like

      @Comment("`like`,\u5982\uff1a`like(\'name\', \'%\u738b%\') ---> name like \'%\u738b%\'") public Where like(@Comment(name="condition",value="\u5224\u65ad\u8868\u8fbe\u5f0f\uff0c\u5f53\u4e3atrue\u65f6\u62fc\u63a5\u6761\u4ef6") boolean condition, @Comment(name="column",value="\u6570\u636e\u5e93\u4e2d\u7684\u5217\u540d") String column, @Comment(name="value",value="\u503c") Object value)
    • notLike

      @Comment("`not like`,\u5982\uff1a`notLike(\'name\', \'%\u738b%\') ---> name not like \'%\u738b%\'") public Where notLike(@Comment(name="column",value="\u6570\u636e\u5e93\u4e2d\u7684\u5217\u540d") String column, @Comment(name="value",value="\u503c") Object value)
    • notLike

      @Comment("`not like` ,\u5982\uff1a`notLike(\'name\', \'%\u738b%\') ---> name not like \'%\u738b%\'") public Where notLike(@Comment(name="condition",value="\u5224\u65ad\u8868\u8fbe\u5f0f\uff0c\u5f53\u4e3atrue\u65f6\u62fc\u63a5\u6761\u4ef6") boolean condition, @Comment(name="column",value="\u6570\u636e\u5e93\u4e2d\u7684\u5217\u540d") String column, @Comment(name="value",value="\u503c") Object value)
    • isNull

      @Comment("`is null`,\u5982\uff1a`isNull(\'name\') ---> name is null") public Where isNull(@Comment(name="column",value="\u6570\u636e\u5e93\u4e2d\u7684\u5217\u540d") String column)
    • isNull

      @Comment("`is null`,\u5982\uff1a`isNull(\'name\') ---> name is null") public Where isNull(@Comment(name="condition",value="\u5224\u65ad\u8868\u8fbe\u5f0f\uff0c\u5f53\u4e3atrue\u65f6\u62fc\u63a5\u6761\u4ef6") boolean condition, @Comment(name="column",value="\u6570\u636e\u5e93\u4e2d\u7684\u5217\u540d") String column)
    • isNotNull

      @Comment("`is not null`,\u5982\uff1a`isNotNull(\'name\') ---> name is not null") public Where isNotNull(@Comment(name="column",value="\u6570\u636e\u5e93\u4e2d\u7684\u5217\u540d") String column)
    • isNotNull

      @Comment("`is not null`,\u5982\uff1a`isNotNull(\'name\') ---> name is not null") public Where isNotNull(@Comment(name="condition",value="\u5224\u65ad\u8868\u8fbe\u5f0f\uff0c\u5f53\u4e3atrue\u65f6\u62fc\u63a5\u6761\u4ef6") boolean condition, @Comment(name="column",value="\u6570\u636e\u5e93\u4e2d\u7684\u5217\u540d") String column)
    • or

      @Comment("\u62fc\u63a5`or`") public Where or()
    • and

      @Comment("\u62fc\u63a5`and`") public Where and()
    • and

      @Comment("`and`\u5d4c\u5957\uff0c\u5982and(it => it.eq(\'name\',\'\u674e\u767d\').ne(\'status\',\'\u6b63\u5e38\') --> and (name = \'\u674e\u767d\' and status <> \'\u6b63\u5e38\')") public Where and(@Comment(name="function",value="\u56de\u8c03\u51fd\u6570") Function<Object[],Where> function)
    • and

      @Comment("`and`\u5d4c\u5957\uff0c\u5982and(it => it.eq(\'name\',\'\u674e\u767d\').ne(\'status\',\'\u6b63\u5e38\') --> and (name = \'\u674e\u767d\' and status <> \'\u6b63\u5e38\')") public Where and(@Comment(name="condition",value="\u5224\u65ad\u8868\u8fbe\u5f0f\uff0c\u5f53\u4e3atrue\u65f6\u62fc\u63a5\u6761\u4ef6") boolean condition, @Comment(name="function",value="\u56de\u8c03\u51fd\u6570") Function<Object[],Where> function)
    • orderBy

      @Comment("\u62fc\u63a5`order by xxx asc/desc`") public Where orderBy(@Comment(name="column",value="\u8981\u6392\u5e8f\u7684\u5217") String column, @Comment(name="sort",value="`asc`\u6216`desc`") String sort)
    • orderBy

      @Comment("\u62fc\u63a5`order by xxx asc`") public Where orderBy(@Comment(name="column",value="\u8981\u6392\u5e8f\u7684\u5217") String column)
    • orderByDesc

      @Comment("\u62fc\u63a5`order by xxx desc`") public Where orderByDesc(@Comment(name="column",value="\u8981\u6392\u5e8f\u7684\u5217") String column)
    • groupBy

      @Comment("\u62fc\u63a5`group by`") public Where groupBy(@Comment("\u8981\u5206\u7ec4\u7684\u5217") String... columns)
    • save

      @Comment("\u4fdd\u5b58\u5230\u8868\u4e2d\uff0c\u5f53\u4e3b\u952e\u6709\u503c\u65f6\u5219\u4fee\u6539\uff0c\u5426\u5219\u63d2\u5165") public Object save(org.ssssssss.script.runtime.RuntimeContext runtimeContext)
    • save

      @Comment("\u4fdd\u5b58\u5230\u8868\u4e2d\uff0c\u5f53\u4e3b\u952e\u6709\u503c\u65f6\u5219\u4fee\u6539\uff0c\u5426\u5219\u63d2\u5165") public Object save(org.ssssssss.script.runtime.RuntimeContext runtimeContext, @Comment(name="beforeQuery",value="\u662f\u5426\u6839\u636eid\u67e5\u8be2\u6709\u6ca1\u6709\u6570\u636e") boolean beforeQuery)
    • save

      @Comment("\u4fdd\u5b58\u5230\u8868\u4e2d\uff0c\u5f53\u4e3b\u952e\u6709\u503c\u65f6\u5219\u4fee\u6539\uff0c\u5426\u5219\u63d2\u5165") public Object save(org.ssssssss.script.runtime.RuntimeContext runtimeContext, @Comment(name="data",value="\u5404\u9879\u5217\u548c\u503c") Map<String,Object> data)
    • save

      @Comment("\u4fdd\u5b58\u5230\u8868\u4e2d\uff0c\u5f53\u4e3b\u952e\u6709\u503c\u65f6\u5219\u4fee\u6539\uff0c\u5426\u5219\u63d2\u5165") public Object save(org.ssssssss.script.runtime.RuntimeContext runtimeContext, @Comment(name="data",value="\u5404\u9879\u5217\u548c\u503c") Map<String,Object> data, @Comment(name="beforeQuery",value="\u662f\u5426\u6839\u636eid\u67e5\u8be2\u6709\u6ca1\u6709\u6570\u636e") boolean beforeQuery)
    • insert

      @Comment("\u6267\u884c\u63d2\u5165\u8bed\u53e5\uff0c\u8fd4\u56de\u4e3b\u952e") public Object insert(org.ssssssss.script.runtime.RuntimeContext runtimeContext)
    • insert

      @Comment("\u6267\u884c\u63d2\u5165\u8bed\u53e5\uff0c\u8fd4\u56de\u4e3b\u952e") public Object insert(org.ssssssss.script.runtime.RuntimeContext runtimeContext, @Comment(name="data",value="\u5404\u9879\u5217\u548c\u503c") Map<String,Object> data)
    • update

      @Comment("\u6267\u884cupdate\u8bed\u53e5") public int update(org.ssssssss.script.runtime.RuntimeContext runtimeContext)
    • delete

      @Comment("\u6267\u884cdelete\u8bed\u53e5") public int delete(org.ssssssss.script.runtime.RuntimeContext runtimeContext)
    • update

      @Comment("\u6267\u884cupdate\u8bed\u53e5") public int update(org.ssssssss.script.runtime.RuntimeContext runtimeContext, @Comment(name="data",value="\u5404\u9879\u5217\u548c\u503c") Map<String,Object> data)
    • update

      @Comment("\u6267\u884cupdate\u8bed\u53e5") public int update(org.ssssssss.script.runtime.RuntimeContext runtimeContext, @Comment(name="data",value="\u5404\u9879\u5217\u548c\u503c") Map<String,Object> data, @Comment(name="isUpdateBlank",value="\u662f\u5426\u66f4\u65b0\u7a7a\u503c\u5b57\u6bb5") boolean isUpdateBlank)
    • page

      @Comment("\u6267\u884c\u5206\u9875\u67e5\u8be2") public Object page(org.ssssssss.script.runtime.RuntimeContext runtimeContext)
    • page

      @Comment("\u6267\u884c\u5206\u9875\u67e5\u8be2\uff0c\u5206\u9875\u6761\u4ef6\u624b\u52a8\u4f20\u5165") public Object page(org.ssssssss.script.runtime.RuntimeContext runtimeContext, @Comment(name="limit",value="\u9650\u5236\u6761\u6570") long limit, @Comment(name="offset",value="\u8df3\u8fc7\u6761\u6570") long offset)
    • select

      @Comment("\u6267\u884cselect\u67e5\u8be2") public List<Map<String,Object>> select(org.ssssssss.script.runtime.RuntimeContext runtimeContext)
    • selectOne

      @Comment("\u6267\u884cselectOne\u67e5\u8be2") public Map<String,Object> selectOne(org.ssssssss.script.runtime.RuntimeContext runtimeContext)
    • count

      @Comment("\u67e5\u8be2\u6761\u6570") public int count(org.ssssssss.script.runtime.RuntimeContext runtimeContext)
    • exists

      @Comment("\u67e5\u8be2\u662f\u5426\u5b58\u5728") public boolean exists(org.ssssssss.script.runtime.RuntimeContext runtimeContext)
    • appendAnd

      public void appendAnd()
    • appendOr

      public void appendOr()
    • getParams

      List<Object> getParams()
    • remove

      void remove()
    • isEmpty

      boolean isEmpty()
    • append

      public void append(String value)
    • append

      public void append(String sql, Object value)
    • getSql

      String getSql()
    • filterNullAndBlank

      boolean filterNullAndBlank(Object value)
    • append

      private Where append(boolean append, String column, String condition, Object value)