Ejemplo n.º 1
0
  public String updateByExampleSelective(Map<String, Object> parameter) {
    News record = (News) parameter.get("record");
    NewsExample example = (NewsExample) parameter.get("example");

    BEGIN();
    UPDATE("news");

    if (record.getId() != null) {
      SET("id = #{record.id,jdbcType=BIGINT}");
    }

    if (record.getHost() != null) {
      SET("host = #{record.host,jdbcType=VARCHAR}");
    }

    if (record.getTitle() != null) {
      SET("title = #{record.title,jdbcType=VARCHAR}");
    }

    if (record.getUrl() != null) {
      SET("url = #{record.url,jdbcType=VARCHAR}");
    }

    applyWhere(example, true);
    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 updateByExample(Map<String, Object> parameter) {
   BEGIN();
   UPDATE("voltage_rank_classify");
   SET("id = #{record.id,jdbcType=INTEGER}");
   SET("name = #{record.name,jdbcType=VARCHAR}");
   SET("value = #{record.value,jdbcType=INTEGER}");
   SET("bigEquipment = #{record.bigequipment,jdbcType=INTEGER}");
   VoltageRankClassifyExample example = (VoltageRankClassifyExample) parameter.get("example");
   applyWhere(example, true);
   return SQL();
 }
Ejemplo n.º 3
0
  public String updateByExample(Map<String, Object> parameter) {
    BEGIN();
    UPDATE("news");

    SET("id = #{record.id,jdbcType=BIGINT}");
    SET("host = #{record.host,jdbcType=VARCHAR}");
    SET("title = #{record.title,jdbcType=VARCHAR}");
    SET("url = #{record.url,jdbcType=VARCHAR}");

    NewsExample example = (NewsExample) parameter.get("example");
    applyWhere(example, true);
    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 updateByPrimaryKeySelective(VoltageRankClassify record) {
   BEGIN();
   UPDATE("voltage_rank_classify");
   if (record.getName() != null) {
     SET("name = #{name,jdbcType=VARCHAR}");
   }
   if (record.getValue() != null) {
     SET("value = #{value,jdbcType=INTEGER}");
   }
   if (record.getBigequipment() != null) {
     SET("bigEquipment = #{bigequipment,jdbcType=INTEGER}");
   }
   WHERE("id = #{id,jdbcType=INTEGER}");
   return SQL();
 }
Ejemplo n.º 5
0
  /**
   * This method was generated by MyBatis Generator. This method corresponds to the database table
   * STAR
   *
   * @mbggenerated
   */
  public String updateByPrimaryKeySelective(Star record) {
    BEGIN();
    UPDATE("STAR");

    if (record.getFirstname() != null) {
      SET("FIRSTNAME = #{firstname,jdbcType=VARCHAR}");
    }

    if (record.getLastname() != null) {
      SET("LASTNAME = #{lastname,jdbcType=VARCHAR}");
    }

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

    return SQL();
  }
Ejemplo n.º 6
0
  /**
   * 获取查询sql <功能详细描述>
   *
   * @return [参数说明]
   * @return String [返回类型说明]
   * @exception throws [异常类型] [异常说明]
   * @see [类、类#方法、类#成员]
   */
  public String updateSql(Object obj) {
    AssertUtils.notEmpty(obj, "update obj must not empty.");

    // 获取当前对象中有哪些属性
    MetaObject metaObject = MetaObjectUtils.forObject(obj);
    Set<String> keySet = new HashSet<String>();
    for (String getterName : metaObject.getGetterNames()) {
      keySet.add(getterName);
    }
    AssertUtils.isTrue(
        keySet.contains(this.pkName),
        "obj:{} must contains pk{}.",
        new Object[] {obj, this.pkName});

    // 构建query语句
    SqlBuilder.BEGIN();
    SqlBuilder.UPDATE(this.tableName);

    for (String propertyName : updateAblePropertyNames) {
      if (!keySet.contains(propertyName)) {
        continue;
      }
      // Object value = metaObject.getValue(propertyName);
      String columnName = getter2columnNameMapping.get(propertyName);
      SqlBuilder.SET(columnName + " = ?");
    }
    SqlBuilder.WHERE(this.getter2columnNameMapping.get(this.pkName) + " = ? ");
    String updateSql = SqlBuilder.SQL();
    SqlBuilder.RESET();
    return updateSql;
  }
 /**
  * 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 updateByExampleSelective(Map<String, Object> parameter) {
   VoltageRankClassify record = (VoltageRankClassify) parameter.get("record");
   VoltageRankClassifyExample example = (VoltageRankClassifyExample) parameter.get("example");
   BEGIN();
   UPDATE("voltage_rank_classify");
   if (record.getId() != null) {
     SET("id = #{record.id,jdbcType=INTEGER}");
   }
   if (record.getName() != null) {
     SET("name = #{record.name,jdbcType=VARCHAR}");
   }
   if (record.getValue() != null) {
     SET("value = #{record.value,jdbcType=INTEGER}");
   }
   if (record.getBigequipment() != null) {
     SET("bigEquipment = #{record.bigequipment,jdbcType=INTEGER}");
   }
   applyWhere(example, true);
   return SQL();
 }
Ejemplo n.º 8
0
  public String updateByPrimaryKeySelective(News record) {
    BEGIN();
    UPDATE("news");

    if (record.getHost() != null) {
      SET("host = #{host,jdbcType=VARCHAR}");
    }

    if (record.getTitle() != null) {
      SET("title = #{title,jdbcType=VARCHAR}");
    }

    if (record.getUrl() != null) {
      SET("url = #{url,jdbcType=VARCHAR}");
    }

    WHERE("id = #{id,jdbcType=BIGINT}");

    return SQL();
  }
  public String updateByExample(Map<String, Object> parameter) {
    BEGIN();
    UPDATE("student_log_assign");

    SET("assign_id = #{record.assignId,jdbcType=BIGINT}");
    SET("student_id = #{record.studentId,jdbcType=BIGINT}");
    SET("depart_code = #{record.departCode,jdbcType=CHAR}");
    SET("depart_name = #{record.departName,jdbcType=VARCHAR}");
    SET("job_code = #{record.jobCode,jdbcType=CHAR}");
    SET("job_name = #{record.jobName,jdbcType=VARCHAR}");
    SET("job_days = #{record.jobDays,jdbcType=INTEGER}");
    SET("job_deadline = #{record.jobDeadline,jdbcType=DATE}");
    SET("assigned_to = #{record.assignedTo,jdbcType=VARCHAR}");
    SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
    SET("create_user = #{record.createUser,jdbcType=VARCHAR}");

    StudentLogAssignExample example = (StudentLogAssignExample) parameter.get("example");
    applyWhere(example, true);
    return SQL();
  }