yangys
2024-04-04 2cf2921440e7473ae50796c2cb688f609b3a7995
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.qianwen.smartman.modules.dmpLog.mapper.DmpLogSignalFlowMapper">
 
    <insert id="save" parameterType="com.qianwen.smartman.modules.dmpLog.entity.SignalFlowLog">
        insert into iot_data.dmp_log_signal_flow_${MachineCode}_${collectMonth} USING iot_data.super_dmp_log_signal_flow
        TAGS (${MachineCode},${collectMonth}) (ts,trace_id,type, message)
        values (#{TimeStamp} ,#{TraceId}, #{type}, #{message})
    </insert>
    <!--创建子表-->
    <update id="createTable">
        create table if not exists iot_data.dmp_log_signal_flow_${machineCode}_${collectMonth} using iot_data.super_dmp_log_signal_flow tags
        (
            ${machineCode},${collectMonth}
        )
 
    </update>
 
 
    <select id="getByTraceId" resultType="com.qianwen.smartman.modules.dmpLog.vo.DmpLogDetailVO">
        select *
        from super_dmp_log_signal_flow
        where trace_id = #{traceId}
        order by ts desc
    </select>
</mapper>