예제 #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();
  }
예제 #2
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();
  }
예제 #3
0
  public String insertSelective(News record) {
    BEGIN();
    INSERT_INTO("news");

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

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

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

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

    return SQL();
  }