public String countByExample(StudentLogAssignExample example) {
   BEGIN();
   SELECT("count(*)");
   FROM("student_log_assign");
   applyWhere(example, false);
   return SQL();
 }
  public String selectByExample(StudentLogAssignExample example) {
    BEGIN();
    if (example != null && example.isDistinct()) {
      SELECT_DISTINCT("assign_id");
    } else {
      SELECT("assign_id");
    }
    SELECT("student_id");
    SELECT("depart_code");
    SELECT("depart_name");
    SELECT("job_code");
    SELECT("job_name");
    SELECT("job_days");
    SELECT("job_deadline");
    SELECT("assigned_to");
    SELECT("create_time");
    SELECT("create_user");
    FROM("student_log_assign");
    applyWhere(example, false);

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

    return SQL();
  }
 /**
  * This method was generated by MyBatis Generator. This method corresponds to the database table
  * voltage_rank_classify
  *
  * @mbggenerated Wed Jan 13 12:15:38 CST 2016
  */
 public String countByExample(VoltageRankClassifyExample example) {
   BEGIN();
   SELECT("count(*)");
   FROM("voltage_rank_classify");
   applyWhere(example, false);
   return SQL();
 }
Exemple #4
0
  /**
   * 获取查询sql <功能详细描述>
   *
   * @return [参数说明]
   * @return String [返回类型说明]
   * @exception throws [异常类型] [异常说明]
   * @see [类、类#方法、类#成员]
   */
  public String countSql(Object obj) {
    // 构建query语句
    SqlBuilder.BEGIN();
    SqlBuilder.SELECT("COUNT(1)");
    SqlBuilder.FROM(this.tableName);

    if (!ObjectUtils.isEmpty(obj)) {
      MetaObject metaObject = MetaObjectUtils.forObject(obj);
      for (Entry<String, String> entryTemp : queryConditionKey2SqlMapping.entrySet()) {
        String queryKeyName = entryTemp.getKey();
        Object valueObj = metaObject.getValue(queryKeyName);
        if (ObjectUtils.isEmpty(valueObj)) {
          continue;
        }
        SqlBuilder.WHERE(entryTemp.getValue());
      }
    }
    for (String conditionExpressionTemp : otherCondition) {
      SqlBuilder.WHERE(conditionExpressionTemp);
    }
    String querySql = SqlBuilder.SQL();
    SqlBuilder.RESET();

    return querySql;
  }
 public String countByExample(NewsExample example) {
   BEGIN();
   SELECT("count (*)");
   FROM("news");
   applyWhere(example, false);
   return SQL();
 }
Exemple #6
0
  /**
   * 获取查询单条数据的sql <功能详细描述>
   *
   * @return [参数说明]
   * @return String [返回类型说明]
   * @exception throws [异常类型] [异常说明]
   * @see [类、类#方法、类#成员]
   */
  public String findSql() {
    AssertUtils.notEmpty(this.pkName, "pkName is empty.");
    AssertUtils.isTrue(
        this.getter2columnNameMapping.containsKey(this.pkName),
        "property2columnNameMapping not contains pkName:{}.",
        this.pkName);

    SqlBuilder.BEGIN();
    for (Entry<String, String> entryTemp : getter2columnNameMapping.entrySet()) {
      SqlBuilder.SELECT(entryTemp.getValue());
    }
    SqlBuilder.FROM(this.tableName);
    SqlBuilder.WHERE(this.getter2columnNameMapping.get(this.pkName) + " = ? ");
    String findSql = SqlBuilder.SQL();
    SqlBuilder.RESET();
    return findSql;
  }
 /**
  * This method was generated by MyBatis Generator. This method corresponds to the database table
  * voltage_rank_classify
  *
  * @mbggenerated Wed Jan 13 12:15:38 CST 2016
  */
 public String selectByExample(VoltageRankClassifyExample example) {
   BEGIN();
   if (example != null && example.isDistinct()) {
     SELECT_DISTINCT("id");
   } else {
     SELECT("id");
   }
   SELECT("name");
   SELECT("value");
   SELECT("bigEquipment");
   FROM("voltage_rank_classify");
   applyWhere(example, false);
   if (example != null && example.getOrderByClause() != null) {
     ORDER_BY(example.getOrderByClause());
   }
   return SQL();
 }
Exemple #8
0
  /**
   * 获取查询sql <功能详细描述>
   *
   * @return [参数说明]
   * @return String [返回类型说明]
   * @exception throws [异常类型] [异常说明]
   * @see [类、类#方法、类#成员]
   */
  public String querySql(Object obj) {
    AssertUtils.notEmpty(this.pkName, "pkName is empty.");
    AssertUtils.isTrue(
        this.getter2columnNameMapping.containsKey(this.pkName),
        "property2columnNameMapping not contains pkName:{}.",
        this.pkName);

    // 构建query语句
    SqlBuilder.BEGIN();
    for (Entry<String, String> entryTemp : getter2columnNameMapping.entrySet()) {
      SqlBuilder.SELECT(entryTemp.getValue());
    }
    SqlBuilder.FROM(this.tableName);

    if (!ObjectUtils.isEmpty(obj)) {
      MetaObject metaObject = MetaObjectUtils.forObject(obj);
      for (Entry<String, String> entryTemp : queryConditionKey2SqlMapping.entrySet()) {
        String queryKeyName = entryTemp.getKey();
        Object valueObj = metaObject.getValue(queryKeyName);
        if (ObjectUtils.isEmpty(valueObj)) {
          continue;
        }
        SqlBuilder.WHERE(entryTemp.getValue());
      }
    }
    for (String conditionExpressionTemp : otherCondition) {
      SqlBuilder.WHERE(conditionExpressionTemp);
    }

    // 在不存在排序字段时默认使用主键对应字段作为排序字段<br/>
    if (CollectionUtils.isEmpty(orderList)) {
      SqlBuilder.ORDER_BY(this.getter2columnNameMapping.get(this.pkName));
    } else {
      for (String order : orderList) {
        SqlBuilder.ORDER_BY(order);
      }
    }

    String querySql = SqlBuilder.SQL();
    SqlBuilder.RESET();

    return querySql;
  }
  public String selectByExample(NewsExample example) {
    BEGIN();
    if (example != null && example.isDistinct()) {
      SELECT_DISTINCT("id");
    } else {
      SELECT("id");
    }
    SELECT("host");
    SELECT("title");
    SELECT("url");
    FROM("news");
    applyWhere(example, false);

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

    return SQL();
  }