• 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>
  • 相关阅读:
    TIDB的体系结构学习
    TIDB操作相关命令
    TIDB的分布式事物
    FeignClient支持application/xwwwformurlencoded请求
    sublime json格式化
    VC++60MFC学习右键菜单RMenu
    VC++60新建MFC框架程序 对话框程序
    MAC 前端准备环境
    二叉树的基本知识
    电脑广告来源记录
  • 原文地址:https://www.cnblogs.com/watm/p/13958552.html
Copyright © 2020-2023  润新知