123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162 |
- /**
- *
- */
- package com.primeton.dsp.datarelease.api.model;
- import org.apache.commons.lang.builder.ToStringBuilder;
- /**
- *
- * SQL 的 where 条件
- *
- * @author zhaopx
- *
- */
- public class WhereCause {
- /**
- * 表,where 条件的表
- */
- String tableName;
- /**
- * 该字段名称
- */
- String fieldName;
- /**
- * 左表某字段大于右表某字段的条件
- */
- String toTableName;
- /**
- * 左表某字段大于右表某字段的条件
- */
- String toFieldName;
- /**
- * 数据类型:string, numeric, datetime 三种类型
- */
- String type = "string";
- /**
- * 运算逻辑: =(等于),>(大于),<(小于),>=(大于或等于),<=(小于或等于),<> or !=(不等于)
- */
- String opera = "=";
- /**
- * 取值
- */
- String value;
- /**
- * 与上一个条件的连接条件,与或。默认为 and。 and/or
- */
- String cond = "and";
- /**
- * 构造方法
- */
- public WhereCause() {
-
- }
- public WhereCause(String tableName, String fieldName, String value) {
- this.tableName = tableName;
- this.fieldName = fieldName;
- this.value = value;
- }
- public WhereCause(String tableName, String fieldName, String opera, String value) {
- this(tableName, fieldName, value);
- this.opera = opera;
- }
- public WhereCause(String tableName, String fieldName, String type, String opera, String value) {
- this(tableName, fieldName, value);
- this.type = type;
- this.opera = opera;
- }
- public WhereCause(String tableName, String fieldName, String type, String opera, String value, String cond) {
- this(tableName, fieldName, value);
- this.type = type;
- this.opera = opera;
- this.cond = cond;
- }
-
-
- public String getTableName() {
- return tableName;
- }
- public String getFieldName() {
- return fieldName;
- }
- public String getToTableName() {
- return toTableName;
- }
- public String getToFieldName() {
- return toFieldName;
- }
- public String getType() {
- return type;
- }
- public String getOpera() {
- return opera;
- }
- public String getValue() {
- return value;
- }
- public String getCond() {
- return cond;
- }
- public void setTableName(String tableName) {
- this.tableName = tableName;
- }
- public void setFieldName(String fieldName) {
- this.fieldName = fieldName;
- }
- public void setToTableName(String toTableName) {
- this.toTableName = toTableName;
- }
- public void setToFieldName(String toFieldName) {
- this.toFieldName = toFieldName;
- }
- public void setType(String type) {
- this.type = type;
- }
- public void setOpera(String opera) {
- this.opera = opera;
- }
- public void setValue(String value) {
- this.value = value;
- }
- public void setCond(String cond) {
- this.cond = cond;
- }
- @Override
- public String toString() {
- return ToStringBuilder.reflectionToString(this);
- }
- }
|