燕山石化溯源三维电子沙盘-【后端】-服务
13693261870
2024-03-13 f6e0b62b719eeb948125c98cf6ceb249f70645f6
src/main/resources/mapper/SuYuanMapper.xml
@@ -113,6 +113,14 @@
      limit 1;
   </select>
   <select id="getSuYuan500MaxByFilter" resultMap="DistanceSuYuanResult">
      select id, x, y, format(c, 2) "c", u, v
      from ${tableName}
      where ${filter}
      order by c desc
      limit 1;
   </select>
   <select id="getSuYuanById" resultMap="DistanceSuYuanResult">
      select id, x, y, format(c, 2) "c", u, v
      from ${tableName}
@@ -146,13 +154,6 @@
          WHERE id = #{id}
       </foreach>
    </select>
   <select id="getNewMonitorData" resultType="com.yssh.entity.SuYuanMonitorData">
      select id, format(value, 2) "value", time
      from yssh_qxsh
      where name = #{name} and Cast(time as signed) between ${start} and ${end}
      order by time desc;
   </select>
    
    <select id="getMonthValueDataMax" resultType="java.util.Map">
       <foreach collection="tableNames" item="tableName" separator=" UNION ">
@@ -165,7 +166,7 @@
    </select>
   <select id="selectSuYuan700ById" resultType="com.yssh.entity.SuYuan700">
      select * from suyuan_700
      select * from suyuan_70_70
      where su_yuan_id = #{id} and create_time = #{time}
      limit 1;
   </select>
@@ -207,19 +208,25 @@
   <select id="isTableExists" resultType="java.lang.Integer">
      select count(*) from information_schema.tables where table_name = #{tableName};
   </select>
   <select id="selectFastById" resultType="com.yssh.entity.SuYuanFast">
      select * from yssh.suyuan_fast
      where su_yuan_id = #{id} and create_time = #{time}
      order by id;
   </select>
   <update id="createTable" parameterType="java.lang.String">
       CREATE TABLE ${tableName}  (
            `id` varchar(255) NOT NULL COMMENT '主键',
        `x` int(7) NULL DEFAULT NULL,
        `y` int(7) NULL DEFAULT NULL,
        `z` int(7) NULL DEFAULT NULL,
        `u` double NULL DEFAULT NULL,
        `v` double NULL DEFAULT NULL,
        `w` double NULL DEFAULT NULL,
        `c` double NULL DEFAULT NULL,
        PRIMARY KEY (`id`) USING BTREE
      ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
      create table ${tableName}  (
               `id` varchar(10) not null comment '主键',
           `x` int(3) null default null,
           `y` int(3) null default null,
           `z` int(2) null default null,
           `u` double null default null,
           `v` double null default null,
           `w` double null default null,
           `c` double null default null,
           primary key (`id`) using btree
      ) engine = innodb character set = utf8 collate = utf8_general_ci row_format = dynamic;
    </update>
    
    <update id="update" >