| | |
| | | <resultMap id="BaseResultMap" type="com.qianwen.mdc.collect.entity.iotdb.DeviceState"> |
| | | <result column="workstation_id" jdbcType="BIGINT" property="workstationId"/> |
| | | <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="shift_index" jdbcType="INTEGER" property="shiftIndex"/> |
| | | <result column="shift_time_type" jdbcType="INTEGER" property="shiftTimeType"/> |
| | | <result column="wcs" jdbcType="INTEGER" property="wcs"/> |
| | | <result column="rps" jdbcType="INTEGER" property="wcs"/> |
| | | <result column="rps" jdbcType="INTEGER" property="rps"/> |
| | | <result column="is_sync" jdbcType="BOOLEAN" property="isSync"/> |
| | | <result column="feedback_id" jdbcType="BIGINT" property="feedbackId"/> |
| | | <result column="is_deleted" jdbcType="BOOLEAN" property="isDeleted"/> |
| | | <result column="is_plan" jdbcType="BIGINT" property="isPlan"/> |
| | | <result column="employee_id" jdbcType="BIGINT" property="employeeId"/> |
| | | </resultMap> |
| | | <!-- |
| | |
| | | where is_sync=false and is_fix_point=false and feedback_point_type=0 and is_deleted=false |
| | | order by time asc limit 1 |
| | | </select> |
| | | |
| | | <!-- --> |
| | | <select id="statesInTimeRange" resultMap="BaseResultMap"> |
| | | select <include refid="all_columns" /> FROM root.f2.aggregate_state_${workstationId} |
| | | select <include refid="all_columns" /> FROM root.f2.state_${workstationId} |
| | | <where> |
| | | is_deleted=false |
| | | <if test="timeRange.startTime != null"> |
| | |
| | | </where> |
| | | |
| | | order by time asc |
| | | align by device |
| | | </select> |
| | | |
| | | <!-- 只能用as 和resultType的形式??? resultType="com.qianwen.mdc.collect.entity.iotdb.DeviceState" |
| | | <select id="statesInTimeRange" resultMap="BaseResultMap"> |
| | | select <include refid="all_columns" /> FROM root.f2.state_${workstationId} |
| | | <where> |
| | | is_deleted=false |
| | | <if test="timeRange.startTime != null"> |
| | | AND time >= #{timeRange.startTime} |
| | | </if> |
| | | AND time <= #{timeRange.endTime} |
| | | </where> |
| | | |
| | | order by time asc |
| | | align by device |
| | | </select>--> |
| | | <select id="fixPointCountByDate" resultType="Long"> |
| | | select count(factory_date) FROM root.f2.state_* where factory_date=#{factoryDate} and is_fix_point=true |
| | | </select> |