示例#1
0
  public String update(Map<String, Object> params) {
    final BaseDomain bd = (BaseDomain) params.get("o");
    final SQL sql = new SQL().UPDATE(getTable(bd.getClass()));
    String sqlString;

    ReflectionUtils.doWithFields(
        bd.getClass(),
        new FieldCallback() {
          @Override
          public void doWith(Field field) throws IllegalArgumentException, IllegalAccessException {
            field.setAccessible(true);
            if (field.getName().equals("id")) {
              sql.WHERE(equal(getColumn(field), wrapColumnValue(field.get(bd))));
            }
            sql.SET(equal(getColumn(field), wrapColumnValue(field.get(bd))));
          }
        },
        new FieldFilter() { // 只提取没有对应注解的非静态字段
          @Override
          public boolean matches(Field field) {
            return !(field.isAnnotationPresent(Resource.class)
                || field.isAnnotationPresent(Autowired.class)
                || field.isAnnotationPresent(Transient.class)
                || Modifier.isStatic(field.getModifiers())
                || Modifier.isFinal(field.getModifiers())
                || field.isAnnotationPresent(Transient.class)
                || (!bd.supportLogicDelete() && "deleteFlag".equals(field.getName())));
          }
        });

    sqlString = sql.toString();
    logger.debug("{} : {}", logger.getName(), sqlString);
    return sqlString;
  }
示例#2
0
  /**
   * @param params
   * @return
   */
  public String get(Map<String, Object> params) {
    Long id = (Long) params.get("id");
    Class domainClass = (Class<? extends BaseDomain>) params.get("domain");
    String tableName = getTable(domainClass);
    String sqlString;
    SQL sql = new SQL().SELECT("*").FROM(tableName).WHERE("id=" + id);

    sqlString = sql.toString();
    logger.debug("{} : {}", logger.getName(), sqlString);
    return sqlString;
  }
示例#3
0
  /**
   * 计数
   *
   * @param params
   * @return
   */
  public String count(Map<String, Object> params) {
    Class domainClass = (Class<? extends BaseDomain>) params.get("domain");
    Criteria criteria = (Criteria) params.get("criteria");
    String tableName = getTable(domainClass);
    String sqlString;
    SQL sql = new SQL().SELECT("count(*)").FROM(tableName);

    if (Objects.nonNull(criteria) && criteria.nonEmpty()) {
      sql.WHERE(criteria.toSqlString());
    }

    sqlString = sql.toString();
    logger.debug("{} : {}", logger.getName(), sqlString);
    return sqlString;
  }
示例#4
0
  /**
   * Generates SQL query in which individual Capability filters are joined using AND
   *
   * @param filters list of capability constraints
   * @return SQL query
   */
  private String generateAndSQL(List<CapabilityFilter> filters) {
    SQL sql = startQuery();

    for (int i = 0; i < filters.size(); i++) {
      processRootCapabilityJoin(sql, filters.get(i), i);
    }

    sql.WHERE("r.repository_id = #{repositoryId}");

    for (int i = 0; i < filters.size(); i++) {
      processRootCapabilityWhere(sql, filters.get(i), i);
    }

    return sql.toString();
  }
示例#5
0
 /**
  * Generate WHERE clause related to a root capability filter
  *
  * @param sql existing sql
  * @param filter root capability filter
  * @param index index of the filter in the filters list
  */
 private void processRootCapabilityWhere(SQL sql, CapabilityFilter filter, int index) {
   SimpleStringBuilder builder = new SimpleStringBuilder();
   List<Integer> filterPath = new LinkedList<>();
   filterPath.add(index);
   processCapabilityWhere(builder, createRootCapabilityAlias(index), filter, filterPath);
   sql.WHERE(builder.toString());
 }
示例#6
0
  /**
   * Generates SQL query in which individual Capability filters are joined using OR
   *
   * @param filters list of capability constraints
   * @return SQL query
   */
  private String generateOrSQL(List<CapabilityFilter> filters) {
    StringBuilder output = new StringBuilder();
    SQL sql;

    for (int i = 0; i < filters.size(); i++) {
      sql = startQuery();
      processRootCapabilityJoin(sql, filters.get(i), i);
      sql.WHERE("r.repository_id = #{repositoryId}");
      processRootCapabilityWhere(sql, filters.get(i), i);

      if (output.length() > 0) {
        output.append(" UNION ");
      }
      output.append(sql);
    }

    return output.toString();
  }
  /**
   * This method was generated by MyBatis Generator. This method corresponds to the database table
   * `trade_move_check`
   *
   * @mbggenerated
   */
  public String updateByExample(Map<String, Object> parameter) {
    SQL sql = new SQL();
    sql.UPDATE("`trade_move_check`");

    sql.SET("id = #{record.id,jdbcType=INTEGER}");
    sql.SET("order_id = #{record.orderId,jdbcType=VARCHAR}");
    sql.SET("order_sn = #{record.orderSn,jdbcType=VARCHAR}");
    sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}");
    sql.SET("is_move_success = #{record.isMoveSuccess,jdbcType=INTEGER}");
    sql.SET("is_in_info = #{record.isInInfo,jdbcType=INTEGER}");
    sql.SET("info_flag = #{record.infoFlag,jdbcType=INTEGER}");
    sql.SET("info_desc = #{record.infoDesc,jdbcType=VARCHAR}");
    sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
    sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");

    TradeMoveCheckExample example = (TradeMoveCheckExample) parameter.get("example");
    applyWhere(sql, example, true);
    return sql.toString();
  }
示例#8
0
  /**
   * Generate JOIN clause related to a root capability filter
   *
   * @param sql existing sql
   * @param filter root capability filter
   * @param index index of the filter in the filters list
   */
  private void processRootCapabilityJoin(SQL sql, CapabilityFilter filter, int index) {
    String capabilityAlias = createRootCapabilityAlias(index);
    sql.JOIN(
        "capability "
            + capabilityAlias
            + " ON "
            + capabilityAlias
            + ".resource_id = r.resource_id");
    processAttributesJoin(sql, filter.getAttributes(), capabilityAlias);

    processSubCapabilitiesJoin(sql, filter, capabilityAlias);
  }
  /**
   * This method was generated by MyBatis Generator. This method corresponds to the database table
   * `orderguidereward`
   *
   * @mbggenerated
   */
  public String updateByExample(Map<String, Object> parameter) {
    SQL sql = new SQL();
    sql.UPDATE("`orderguidereward`");

    sql.SET("orderGuideRewardId = #{record.orderguiderewardid,jdbcType=VARCHAR}");
    sql.SET("orderId = #{record.orderid,jdbcType=VARCHAR}");
    sql.SET("guideId = #{record.guideid,jdbcType=INTEGER}");
    sql.SET("orderRewardType = #{record.orderrewardtype,jdbcType=INTEGER}");
    sql.SET("comment = #{record.comment,jdbcType=VARCHAR}");
    sql.SET("reward = #{record.reward,jdbcType=DECIMAL}");
    sql.SET("status = #{record.status,jdbcType=INTEGER}");
    sql.SET("updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}");
    sql.SET("created_at = #{record.createdAt,jdbcType=TIMESTAMP}");

    FinalOrderGuideRewardCriteria example =
        (FinalOrderGuideRewardCriteria) parameter.get("example");
    applyWhere(sql, example, true);
    return sql.toString();
  }
示例#10
0
  public String delete(Map<String, Object> params) {
    String sqlString;
    SQL sql = new SQL();
    String tableName = getTable((Class<? extends BaseDomain>) params.get("domain"));
    Long[] ids = (Long[]) Objects.getDefault(params.get("ids"), new Long[] {});
    final StringBuilder idsCondition = new StringBuilder("(-1");

    Iterators.forEach(
        Arrays.asList(ids).iterator(),
        new Iterators.CustomerHandler<Long>() {
          @Override
          public void handle(Long id) {
            idsCondition.append(",").append(id);
          }
        });
    idsCondition.append(")");

    sql.DELETE_FROM(tableName).WHERE("id in " + idsCondition.toString());

    sqlString = sql.toString();
    logger.debug("{} : {}", logger.getName(), sqlString);
    return sqlString;
  }
示例#11
0
 /**
  * Generates portion of the query for attribute JOIN
  *
  * @param sql already existing portion of the SQL, presumed to have at least SELECT and FROM
  *     clauses.
  * @param attributes list of attribute constraints for the capability with #capabilityAlias
  * @param capabilityAlias alias of the capability to which these attribute constraints belong
  */
 private void processAttributesJoin(
     SQL sql, List<Attribute<?>> attributes, String capabilityAlias) {
   String attributeAlias;
   for (int j = 0; j < attributes.size(); j++) {
     attributeAlias = createAttributeAlias(capabilityAlias, j);
     sql.INNER_JOIN(
         "capability_attribute "
             + attributeAlias
             + " ON "
             + attributeAlias
             + ".capability_id = "
             + capabilityAlias
             + ".capability_id");
   }
 }
示例#12
0
  /**
   * Generates portion of the query for subcapability JOIN
   *
   * @param sql already existing portion of the SQL, presumed to have at least SELECT and FROM
   *     clauses.
   * @param filter filter for the particular subcapability
   * @param parentCapabilityAlias alias of the subcapability's parent in the #sql query
   */
  private void processSubCapabilitiesJoin(
      SQL sql, CapabilityFilter filter, String parentCapabilityAlias) {
    String subAlias;
    CapabilityFilter subFilter;
    for (int k = 0; k < filter.getSubFilters().size(); k++) {
      subFilter = filter.getSubFilters().get(k);

      subAlias = parentCapabilityAlias + k;
      sql.INNER_JOIN(
          "capability "
              + subAlias
              + " ON "
              + parentCapabilityAlias
              + ".capability_id = "
              + subAlias
              + ".parent_capability_id");

      processAttributesJoin(sql, subFilter.getAttributes(), subAlias);

      processSubCapabilitiesJoin(sql, subFilter, subAlias);
    }
  }
  /**
   * This method was generated by MyBatis Generator. This method corresponds to the database table
   * `agentaccountlog`
   *
   * @mbggenerated
   */
  public String selectByExample(FinalAgentaccountLogCriteria example) {
    SQL sql = new SQL();
    if (example != null && example.isDistinct()) {
      sql.SELECT_DISTINCT("agentAccountLogId");
    } else {
      sql.SELECT("agentAccountLogId");
    }
    sql.SELECT("agentId");
    sql.SELECT("agentUserId");
    sql.SELECT("agentUserName");
    sql.SELECT("orderId");
    sql.SELECT("type");
    sql.SELECT("bizType");
    sql.SELECT("price");
    sql.SELECT("content");
    sql.SELECT("comment");
    sql.SELECT("tips");
    sql.SELECT("bizStatus");
    sql.SELECT("payType");
    sql.SELECT("bizComment");
    sql.SELECT("updated_at");
    sql.SELECT("created_at");
    sql.FROM("`agentaccountlog`");
    applyWhere(sql, example, false);

    if (example != null && example.getOrderByClause() != null) {
      sql.ORDER_BY(example.getOrderByClause());
    }

    String sqlStr = sql.toString();
    if (example.getPage() != null) {
      sqlStr =
          sqlStr
              + " limit "
              + example.getPage().getOffset()
              + ","
              + example.getPage().getLimit()
              + "";
    }
    return sqlStr;
  }
 /**
  * This method was generated by MyBatis Generator. This method corresponds to the database table
  * `orderguidereward`
  *
  * @mbggenerated
  */
 public String countByExample(FinalOrderGuideRewardCriteria example) {
   SQL sql = new SQL();
   sql.SELECT("count(*)").FROM("`orderguidereward`");
   applyWhere(sql, example, false);
   return sql.toString();
 }
示例#15
0
 private SQL startQuery() {
   SQL sql = new SQL();
   return sql.SELECT("DISTINCT r.resource_id, r.repository_id, r.id, r.uri").FROM("resource r");
 }
  /**
   * This method was generated by MyBatis Generator. This method corresponds to the database table
   * `orderguidereward`
   *
   * @mbggenerated
   */
  public String updateByPrimaryKeySelective(FinalOrderGuideReward record) {
    SQL sql = new SQL();
    sql.UPDATE("`orderguidereward`");

    if (record.getOrderid() != null) {
      sql.SET("orderId = #{orderid,jdbcType=VARCHAR}");
    }

    if (record.getGuideid() != null) {
      sql.SET("guideId = #{guideid,jdbcType=INTEGER}");
    }

    if (record.getOrderrewardtype() != null) {
      sql.SET("orderRewardType = #{orderrewardtype,jdbcType=INTEGER}");
    }

    if (record.getComment() != null) {
      sql.SET("comment = #{comment,jdbcType=VARCHAR}");
    }

    if (record.getReward() != null) {
      sql.SET("reward = #{reward,jdbcType=DECIMAL}");
    }

    if (record.getStatus() != null) {
      sql.SET("status = #{status,jdbcType=INTEGER}");
    }

    if (record.getUpdatedAt() != null) {
      sql.SET("updated_at = #{updatedAt,jdbcType=TIMESTAMP}");
    }

    if (record.getCreatedAt() != null) {
      sql.SET("created_at = #{createdAt,jdbcType=TIMESTAMP}");
    }

    sql.WHERE("orderGuideRewardId = #{orderguiderewardid,jdbcType=VARCHAR}");

    return sql.toString();
  }
 /**
  * This method was generated by MyBatis Generator. This method corresponds to the database table
  * `orderguidereward`
  *
  * @mbggenerated
  */
 public String deleteByExample(FinalOrderGuideRewardCriteria example) {
   SQL sql = new SQL();
   sql.DELETE_FROM("`orderguidereward`");
   applyWhere(sql, example, false);
   return sql.toString();
 }
  /**
   * This method was generated by MyBatis Generator. This method corresponds to the database table
   * `orderguidereward`
   *
   * @mbggenerated
   */
  public String insertSelective(FinalOrderGuideReward record) {
    SQL sql = new SQL();
    sql.INSERT_INTO("`orderguidereward`");

    if (record.getOrderguiderewardid() != null) {
      sql.VALUES("orderGuideRewardId", "#{orderguiderewardid,jdbcType=VARCHAR}");
    }

    if (record.getOrderid() != null) {
      sql.VALUES("orderId", "#{orderid,jdbcType=VARCHAR}");
    }

    if (record.getGuideid() != null) {
      sql.VALUES("guideId", "#{guideid,jdbcType=INTEGER}");
    }

    if (record.getOrderrewardtype() != null) {
      sql.VALUES("orderRewardType", "#{orderrewardtype,jdbcType=INTEGER}");
    }

    if (record.getComment() != null) {
      sql.VALUES("comment", "#{comment,jdbcType=VARCHAR}");
    }

    if (record.getReward() != null) {
      sql.VALUES("reward", "#{reward,jdbcType=DECIMAL}");
    }

    if (record.getStatus() != null) {
      sql.VALUES("status", "#{status,jdbcType=INTEGER}");
    }

    if (record.getUpdatedAt() != null) {
      sql.VALUES("updated_at", "#{updatedAt,jdbcType=TIMESTAMP}");
    }

    if (record.getCreatedAt() != null) {
      sql.VALUES("created_at", "#{createdAt,jdbcType=TIMESTAMP}");
    }

    return sql.toString();
  }
  /**
   * This method was generated by MyBatis Generator. This method corresponds to the database table
   * `trade_move_check`
   *
   * @mbggenerated
   */
  public String insertSelective(TradeMoveCheck record) {
    SQL sql = new SQL();
    sql.INSERT_INTO("`trade_move_check`");

    if (record.getId() != null) {
      sql.VALUES("id", "#{id,jdbcType=INTEGER}");
    }

    if (record.getOrderId() != null) {
      sql.VALUES("order_id", "#{orderId,jdbcType=VARCHAR}");
    }

    if (record.getOrderSn() != null) {
      sql.VALUES("order_sn", "#{orderSn,jdbcType=VARCHAR}");
    }

    if (record.getOrderNo() != null) {
      sql.VALUES("order_no", "#{orderNo,jdbcType=VARCHAR}");
    }

    if (record.getIsMoveSuccess() != null) {
      sql.VALUES("is_move_success", "#{isMoveSuccess,jdbcType=INTEGER}");
    }

    if (record.getIsInInfo() != null) {
      sql.VALUES("is_in_info", "#{isInInfo,jdbcType=INTEGER}");
    }

    if (record.getInfoFlag() != null) {
      sql.VALUES("info_flag", "#{infoFlag,jdbcType=INTEGER}");
    }

    if (record.getInfoDesc() != null) {
      sql.VALUES("info_desc", "#{infoDesc,jdbcType=VARCHAR}");
    }

    if (record.getCreateTime() != null) {
      sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
    }

    if (record.getUpdateTime() != null) {
      sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}");
    }

    return sql.toString();
  }
  /**
   * This method was generated by MyBatis Generator. This method corresponds to the database table
   * `trade_move_check`
   *
   * @mbggenerated
   */
  protected void applyWhere(SQL sql, TradeMoveCheckExample example, boolean includeExamplePhrase) {
    if (example == null) {
      return;
    }

    String parmPhrase1;
    String parmPhrase1_th;
    String parmPhrase2;
    String parmPhrase2_th;
    String parmPhrase3;
    String parmPhrase3_th;
    if (includeExamplePhrase) {
      parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}";
      parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
      parmPhrase2 =
          "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}";
      parmPhrase2_th =
          "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
      parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}";
      parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
    } else {
      parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}";
      parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
      parmPhrase2 =
          "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}";
      parmPhrase2_th =
          "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
      parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}";
      parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
    }

    StringBuilder sb = new StringBuilder();
    List<Criteria> oredCriteria = example.getOredCriteria();
    boolean firstCriteria = true;
    for (int i = 0; i < oredCriteria.size(); i++) {
      Criteria criteria = oredCriteria.get(i);
      if (criteria.isValid()) {
        if (firstCriteria) {
          firstCriteria = false;
        } else {
          sb.append(" or ");
        }

        sb.append('(');
        List<Criterion> criterions = criteria.getAllCriteria();
        boolean firstCriterion = true;
        for (int j = 0; j < criterions.size(); j++) {
          Criterion criterion = criterions.get(j);
          if (firstCriterion) {
            firstCriterion = false;
          } else {
            sb.append(" and ");
          }

          if (criterion.isNoValue()) {
            sb.append(criterion.getCondition());
          } else if (criterion.isSingleValue()) {
            if (criterion.getTypeHandler() == null) {
              sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j));
            } else {
              sb.append(
                  String.format(
                      parmPhrase1_th, criterion.getCondition(), i, j, criterion.getTypeHandler()));
            }
          } else if (criterion.isBetweenValue()) {
            if (criterion.getTypeHandler() == null) {
              sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j));
            } else {
              sb.append(
                  String.format(
                      parmPhrase2_th,
                      criterion.getCondition(),
                      i,
                      j,
                      criterion.getTypeHandler(),
                      i,
                      j,
                      criterion.getTypeHandler()));
            }
          } else if (criterion.isListValue()) {
            sb.append(criterion.getCondition());
            sb.append(" (");
            List<?> listItems = (List<?>) criterion.getValue();
            boolean comma = false;
            for (int k = 0; k < listItems.size(); k++) {
              if (comma) {
                sb.append(", ");
              } else {
                comma = true;
              }
              if (criterion.getTypeHandler() == null) {
                sb.append(String.format(parmPhrase3, i, j, k));
              } else {
                sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler()));
              }
            }
            sb.append(')');
          }
        }
        sb.append(')');
      }
    }

    if (sb.length() > 0) {
      sql.WHERE(sb.toString());
    }
  }
  /**
   * This method was generated by MyBatis Generator. This method corresponds to the database table
   * `orderguidereward`
   *
   * @mbggenerated
   */
  public String selectByExample(FinalOrderGuideRewardCriteria example) {
    SQL sql = new SQL();
    if (example != null && example.isDistinct()) {
      sql.SELECT_DISTINCT("orderGuideRewardId");
    } else {
      sql.SELECT("orderGuideRewardId");
    }
    sql.SELECT("orderId");
    sql.SELECT("guideId");
    sql.SELECT("orderRewardType");
    sql.SELECT("comment");
    sql.SELECT("reward");
    sql.SELECT("status");
    sql.SELECT("updated_at");
    sql.SELECT("created_at");
    sql.FROM("`orderguidereward`");
    applyWhere(sql, example, false);

    if (example != null && example.getOrderByClause() != null) {
      sql.ORDER_BY(example.getOrderByClause());
    }

    String sqlStr = sql.toString();
    if (example.getPage() != null) {
      sqlStr =
          sqlStr
              + " limit "
              + example.getPage().getOffset()
              + ","
              + example.getPage().getLimit()
              + "";
    }
    return sqlStr;
  }
 /**
  * This method was generated by MyBatis Generator. This method corresponds to the database table
  * `trade_move_check`
  *
  * @mbggenerated
  */
 public String countByExample(TradeMoveCheckExample example) {
   SQL sql = new SQL();
   sql.SELECT("count(*)").FROM("`trade_move_check`");
   applyWhere(sql, example, false);
   return sql.toString();
 }
 /**
  * This method was generated by MyBatis Generator. This method corresponds to the database table
  * `agentaccountlog`
  *
  * @mbggenerated
  */
 public String countByExample(FinalAgentaccountLogCriteria example) {
   SQL sql = new SQL();
   sql.SELECT("count(*)").FROM("`agentaccountlog`");
   applyWhere(sql, example, false);
   return sql.toString();
 }
  /**
   * This method was generated by MyBatis Generator. This method corresponds to the database table
   * `trade_move_check`
   *
   * @mbggenerated
   */
  public String updateByPrimaryKeySelective(TradeMoveCheck record) {
    SQL sql = new SQL();
    sql.UPDATE("`trade_move_check`");

    if (record.getOrderId() != null) {
      sql.SET("order_id = #{orderId,jdbcType=VARCHAR}");
    }

    if (record.getOrderSn() != null) {
      sql.SET("order_sn = #{orderSn,jdbcType=VARCHAR}");
    }

    if (record.getOrderNo() != null) {
      sql.SET("order_no = #{orderNo,jdbcType=VARCHAR}");
    }

    if (record.getIsMoveSuccess() != null) {
      sql.SET("is_move_success = #{isMoveSuccess,jdbcType=INTEGER}");
    }

    if (record.getIsInInfo() != null) {
      sql.SET("is_in_info = #{isInInfo,jdbcType=INTEGER}");
    }

    if (record.getInfoFlag() != null) {
      sql.SET("info_flag = #{infoFlag,jdbcType=INTEGER}");
    }

    if (record.getInfoDesc() != null) {
      sql.SET("info_desc = #{infoDesc,jdbcType=VARCHAR}");
    }

    if (record.getCreateTime() != null) {
      sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
    }

    if (record.getUpdateTime() != null) {
      sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}");
    }

    sql.WHERE("id = #{id,jdbcType=INTEGER}");

    return sql.toString();
  }
  /**
   * This method was generated by MyBatis Generator. This method corresponds to the database table
   * `agentaccountlog`
   *
   * @mbggenerated
   */
  public String updateByExample(Map<String, Object> parameter) {
    SQL sql = new SQL();
    sql.UPDATE("`agentaccountlog`");

    sql.SET("agentAccountLogId = #{record.agentaccountlogid,jdbcType=VARCHAR}");
    sql.SET("agentId = #{record.agentid,jdbcType=INTEGER}");
    sql.SET("agentUserId = #{record.agentuserid,jdbcType=INTEGER}");
    sql.SET("agentUserName = #{record.agentusername,jdbcType=VARCHAR}");
    sql.SET("orderId = #{record.orderid,jdbcType=VARCHAR}");
    sql.SET("type = #{record.type,jdbcType=INTEGER}");
    sql.SET("bizType = #{record.biztype,jdbcType=INTEGER}");
    sql.SET("price = #{record.price,jdbcType=INTEGER}");
    sql.SET("content = #{record.content,jdbcType=VARCHAR}");
    sql.SET("comment = #{record.comment,jdbcType=VARCHAR}");
    sql.SET("tips = #{record.tips,jdbcType=VARCHAR}");
    sql.SET("bizStatus = #{record.bizstatus,jdbcType=INTEGER}");
    sql.SET("payType = #{record.paytype,jdbcType=INTEGER}");
    sql.SET("bizComment = #{record.bizcomment,jdbcType=VARCHAR}");
    sql.SET("updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}");
    sql.SET("created_at = #{record.createdAt,jdbcType=TIMESTAMP}");

    FinalAgentaccountLogCriteria example = (FinalAgentaccountLogCriteria) parameter.get("example");
    applyWhere(sql, example, true);
    return sql.toString();
  }
 /**
  * This method was generated by MyBatis Generator. This method corresponds to the database table
  * `trade_move_check`
  *
  * @mbggenerated
  */
 public String deleteByExample(TradeMoveCheckExample example) {
   SQL sql = new SQL();
   sql.DELETE_FROM("`trade_move_check`");
   applyWhere(sql, example, false);
   return sql.toString();
 }
 /**
  * This method was generated by MyBatis Generator. This method corresponds to the database table
  * `agentaccountlog`
  *
  * @mbggenerated
  */
 public String deleteByExample(FinalAgentaccountLogCriteria example) {
   SQL sql = new SQL();
   sql.DELETE_FROM("`agentaccountlog`");
   applyWhere(sql, example, false);
   return sql.toString();
 }
  /**
   * This method was generated by MyBatis Generator. This method corresponds to the database table
   * `trade_move_check`
   *
   * @mbggenerated
   */
  public String selectByExample(TradeMoveCheckExample example) {
    SQL sql = new SQL();
    if (example != null && example.isDistinct()) {
      sql.SELECT_DISTINCT("id");
    } else {
      sql.SELECT("id");
    }
    sql.SELECT("order_id");
    sql.SELECT("order_sn");
    sql.SELECT("order_no");
    sql.SELECT("is_move_success");
    sql.SELECT("is_in_info");
    sql.SELECT("info_flag");
    sql.SELECT("info_desc");
    sql.SELECT("create_time");
    sql.SELECT("update_time");
    sql.FROM("`trade_move_check`");
    applyWhere(sql, example, false);

    if (example != null && example.getOrderByClause() != null) {
      sql.ORDER_BY(example.getOrderByClause());
    }

    String sqlStr = sql.toString();
    if (example.getPage() != null) {
      sqlStr =
          sqlStr
              + " limit "
              + example.getPage().getOffset()
              + ","
              + example.getPage().getLimit()
              + "";
    }
    return sqlStr;
  }
  /**
   * This method was generated by MyBatis Generator. This method corresponds to the database table
   * `agentaccountlog`
   *
   * @mbggenerated
   */
  public String insertSelective(FinalAgentaccountLog record) {
    SQL sql = new SQL();
    sql.INSERT_INTO("`agentaccountlog`");

    if (record.getAgentaccountlogid() != null) {
      sql.VALUES("agentAccountLogId", "#{agentaccountlogid,jdbcType=VARCHAR}");
    }

    if (record.getAgentid() != null) {
      sql.VALUES("agentId", "#{agentid,jdbcType=INTEGER}");
    }

    if (record.getAgentuserid() != null) {
      sql.VALUES("agentUserId", "#{agentuserid,jdbcType=INTEGER}");
    }

    if (record.getAgentusername() != null) {
      sql.VALUES("agentUserName", "#{agentusername,jdbcType=VARCHAR}");
    }

    if (record.getOrderid() != null) {
      sql.VALUES("orderId", "#{orderid,jdbcType=VARCHAR}");
    }

    if (record.getType() != null) {
      sql.VALUES("type", "#{type,jdbcType=INTEGER}");
    }

    if (record.getBiztype() != null) {
      sql.VALUES("bizType", "#{biztype,jdbcType=INTEGER}");
    }

    if (record.getPrice() != null) {
      sql.VALUES("price", "#{price,jdbcType=INTEGER}");
    }

    if (record.getContent() != null) {
      sql.VALUES("content", "#{content,jdbcType=VARCHAR}");
    }

    if (record.getComment() != null) {
      sql.VALUES("comment", "#{comment,jdbcType=VARCHAR}");
    }

    if (record.getTips() != null) {
      sql.VALUES("tips", "#{tips,jdbcType=VARCHAR}");
    }

    if (record.getBizstatus() != null) {
      sql.VALUES("bizStatus", "#{bizstatus,jdbcType=INTEGER}");
    }

    if (record.getPaytype() != null) {
      sql.VALUES("payType", "#{paytype,jdbcType=INTEGER}");
    }

    if (record.getBizcomment() != null) {
      sql.VALUES("bizComment", "#{bizcomment,jdbcType=VARCHAR}");
    }

    if (record.getUpdatedAt() != null) {
      sql.VALUES("updated_at", "#{updatedAt,jdbcType=TIMESTAMP}");
    }

    if (record.getCreatedAt() != null) {
      sql.VALUES("created_at", "#{createdAt,jdbcType=TIMESTAMP}");
    }

    return sql.toString();
  }