yangys
2025-11-24 11d4be720620abf502d35000e2ed40d30c4023bf
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
27
28
29
30
31
32
<?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.mdc.collect.mapper.iotdb.OutputMapper">
 
    <resultMap id="BaseResultMap" type="com.qianwen.mdc.collect.entity.iotdb.Output">
        <result column="value_collect" jdbcType="BIGINT" property="valueCollect"/>
        <result column="param_type" jdbcType="INTEGER" property="paramType"/>
        <result column="calendar_code" jdbcType="VARCHAR" property="calendarCode"/>
        <result column="factory_year" jdbcType="INTEGER" property="factoryYear"/>
        <result column="factory_month" jdbcType="INTEGER" property="factoryMonth"/>
        <result column="factory_week" jdbcType="INTEGER" property="factoryWeek"/>
        <result column="factory_date" jdbcType="INTEGER" property="factoryDate"/>
        <result column="shift_index" jdbcType="INTEGER" property="shiftIndex"/>
        <result column="shift_time_type" jdbcType="INTEGER" property="shiftTimeType"/>
        <result column="is_sync" jdbcType="BOOLEAN" property="isSync"/>
        <result column="employee_id" jdbcType="BIGINT" property="employeeId"/>
    </resultMap>
 
    <select id="getLastIsSyncOutput" resultMap="BaseResultMap"
            parameterType="java.lang.Long">
            select workstation_id,value_collect,calendar_code,factory_year,factory_month,factory_date,factory_week,shift_index,shift_time_type,is_sync,employee_id from root.f2.output_*
             where is_sync=true and workstation_id=#{workstationId} order by time desc limit 1 align by device
    </select>
 
    <select id="notSyncWorkstationOutputs" resultMap="BaseResultMap"
            parameterType="java.lang.Long">
            select workstation_id,output,calendar_code,factory_year,factory_month,factory_date,factory_week,shift_index,shift_time_type,is_sync,employee_id from root.f2.output*
             where is_sync=false and workstation_id=#{workstationId} order by time asc  align by device
    </select>
 
</mapper>