Example usage for org.apache.ibatis.jdbc SQL SQL

List of usage examples for org.apache.ibatis.jdbc SQL SQL

Introduction

In this page you can find the example usage for org.apache.ibatis.jdbc SQL SQL.

Prototype

SQL

Source Link

Usage

From source file:com.mycompany.geocoordinate.mappers.MySqlProvider.java

public String selectCoordinateForLineorCircle() {

    return new SQL() {

        {/*www  . j a v a  2s.c  o m*/
            SELECT("*");
            FROM("GeoObject");
            WHERE("Coordinate=#{coordinate}");
        }

    }.toString();

}

From source file:com.mycompany.geocoordinate.mappers.MySqlProvider.java

public String insertCoordinateForLineorCircle() {

    return new SQL() {

        {/*  w  w w  .  ja v  a  2s  .com*/
            INSERT_INTO("GeoObject");
            VALUES("IdType,Coordinate", "#{typeCircle},#{coordinate}");

        }

    }.toString();
}

From source file:com.mycompany.geocoordinate.mappers.MySqlProvider.java

public String insertCoordinateForLine() {

    return new SQL() {

        {//from w w w  . j  a va 2s .  c om
            INSERT_INTO("GeoObject");
            VALUES("IdType,coordinate", "#{typeLine},#{coordinate}");

        }

    }.toString();
}

From source file:com.mycompany.geocoordinate.mappers.MySqlProvider.java

public String insertCoordinateForPolygon() {

    return new SQL() {
        {/*from  w w  w  .j a  v  a2  s . c  o  m*/
            INSERT_INTO("GeoObject");
            VALUES("IdType,Coordiante", "#{typePolygon},#{coordinate}");

        }

    }.toString();
}

From source file:com.mycompany.geocoordinate.mappers.MySqlProvider.java

public String loadCoorindateAndType() {

    return new SQL() {
        {/*from w  w  w  . ja  v  a  2s  .c  om*/
            SELECT("coordinate,IdType,ID");
            FROM("GeoObject");
            WHERE("IdType=#{ID}");

        }

    }.toString();
}

From source file:com.sc.mapper.generator.SellersSqlProvider.java

public String countByExample(SellersExample example) {
    SQL sql = new SQL();
    sql.SELECT("count(*)").FROM("TB_SELLERS");
    applyWhere(sql, example, false);//from   w w w  . j  a v  a  2s .co m
    return sql.toString();
}

From source file:com.sc.mapper.generator.SellersSqlProvider.java

public String deleteByExample(SellersExample example) {
    SQL sql = new SQL();
    sql.DELETE_FROM("TB_SELLERS");
    applyWhere(sql, example, false);// w w w.jav  a  2  s  . co  m
    return sql.toString();
}

From source file:com.sc.mapper.generator.SellersSqlProvider.java

public String insertSelective(Sellers record) {
    SQL sql = new SQL();
    sql.INSERT_INTO("TB_SELLERS");

    if (record.getCM_SELLERID() != null) {
        sql.VALUES("CM_SELLERID", "#{CM_SELLERID,jdbcType=VARCHAR}");
    }/*from www  .j av  a 2s  .c om*/

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

    if (record.getCM_PHONE() != null) {
        sql.VALUES("CM_PHONE", "#{CM_PHONE,jdbcType=BIGINT}");
    }

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

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

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

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

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

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

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

    if (record.getCM_LON() != null) {
        sql.VALUES("CM_LON", "#{CM_LON,jdbcType=DOUBLE}");
    }

    if (record.getCM_LAT() != null) {
        sql.VALUES("CM_LAT", "#{CM_LAT,jdbcType=DOUBLE}");
    }

    if (record.getCM_CREATETIME() != null) {
        sql.VALUES("CM_CREATETIME", "#{CM_CREATETIME,jdbcType=TIMESTAMP}");
    }

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

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

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

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

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

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

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

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

    return sql.toString();
}

From source file:com.sc.mapper.generator.SellersSqlProvider.java

public String selectByExample(SellersExample example) {
    SQL sql = new SQL();
    if (example != null && example.isDistinct()) {
        sql.SELECT_DISTINCT("CM_SELLERID");
    } else {//  w w  w  .j  ava 2 s  . c  om
        sql.SELECT("CM_SELLERID");
    }
    sql.SELECT("CM_SELLERNAME");
    sql.SELECT("CM_PHONE");
    sql.SELECT("CM_ACCOUNT");
    sql.SELECT("CM_PASSWORD");
    sql.SELECT("CM_BRANDID");
    sql.SELECT("CM_CARDPATH");
    sql.SELECT("CM_STOREPATH");
    sql.SELECT("CM_LICENSEPATH");
    sql.SELECT("CM_ADDRESS");
    sql.SELECT("CM_LON");
    sql.SELECT("CM_LAT");
    sql.SELECT("CM_CREATETIME");
    sql.SELECT("CM_ISEXAMINE");
    sql.SELECT("CM_REASON");
    sql.SELECT("CM_CARDNO");
    sql.SELECT("CM_NAME");
    sql.SELECT("CM_CONTACTNAME");
    sql.SELECT("CM_CONTACTPHONE");
    sql.SELECT("CM_TELEPHONE");
    sql.SELECT("CM_PAX");
    sql.FROM("TB_SELLERS");
    applyWhere(sql, example, false);

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

    return sql.toString();
}

From source file:com.sc.mapper.generator.SellersSqlProvider.java

public String updateByExampleSelective(Map<String, Object> parameter) {
    Sellers record = (Sellers) parameter.get("record");
    SellersExample example = (SellersExample) parameter.get("example");

    SQL sql = new SQL();
    sql.UPDATE("TB_SELLERS");

    if (record.getCM_SELLERID() != null) {
        sql.SET("CM_SELLERID = #{record.CM_SELLERID,jdbcType=VARCHAR}");
    }/*w ww  .  j  a  v a 2 s. c  o m*/

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

    if (record.getCM_PHONE() != null) {
        sql.SET("CM_PHONE = #{record.CM_PHONE,jdbcType=BIGINT}");
    }

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

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

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

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

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

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

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

    if (record.getCM_LON() != null) {
        sql.SET("CM_LON = #{record.CM_LON,jdbcType=DOUBLE}");
    }

    if (record.getCM_LAT() != null) {
        sql.SET("CM_LAT = #{record.CM_LAT,jdbcType=DOUBLE}");
    }

    if (record.getCM_CREATETIME() != null) {
        sql.SET("CM_CREATETIME = #{record.CM_CREATETIME,jdbcType=TIMESTAMP}");
    }

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

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

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

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

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

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

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

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

    applyWhere(sql, example, true);
    return sql.toString();
}