zoukankan      html  css  js  c++  java
  • mybatis+sql语句

    创建表

    //创建表createTable
    void createTable(String table);
      <update id="createTable" >
        CREATE TABLE `${table}` (
        id int(11) NOT NULL AUTO_INCREMENT COMMENT '车辆的id',
        time varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
        gps_wd varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
        gps_jd varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
        bd_wd varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
        bd_jd varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
        type varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'up down',
        line varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '线路名',
        PRIMARY KEY (id)
      )
      </update>

    插入表

    int insertTable(String table,RealTime record);
      <insert id="insertTable">
        insert into `${table}` (time, gps_wd,gps_jd, bd_wd, bd_jd,type,line)
        values(#{record.time,jdbcType=VARCHAR}, #{record.gpsWd,jdbcType=VARCHAR},
          #{record.gpsJd,jdbcType=VARCHAR}, #{record.bdWd,jdbcType=VARCHAR}, #{record.bdJd,jdbcType=VARCHAR},
          #{record.type,jdbcType=VARCHAR}, #{record.line,jdbcType=VARCHAR})
      </insert>
  • 相关阅读:
    HDU
    01字典树模板
    扩展欧几里得和乘法逆元
    HDOJ-1156 Brownie Points II 线段树/树状数组(模板)
    CF-825E Minimal Labels 反向拓扑排序
    CF-831D Office Keys 思维题
    RMQ 解决区间查询问题
    hdu 5073 有坑+方差贪心
    hdu 5074 相邻数和最大dp
    hdu 5078 水题
  • 原文地址:https://www.cnblogs.com/watm/p/13958552.html
Copyright © 2011-2022 走看看