Пример #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 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();
  }