<?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>
|