<?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="org.jeecg.modules.mdc.mapper.EquipmentStatisticalInfoMapper">
|
<select id="findDataRankingForBigScreen" resultType="org.jeecg.modules.mdc.subcontrol.vo.LastWeekDataVo">
|
SELECT
|
equipment_id equipment,
|
SUM( open_long ) openingLong,
|
SUM( close_long ) closelong,
|
SUM( wait_long ) waitlong,
|
SUM( process_long ) processingLong,
|
SUM( error_long ) errorlong
|
FROM
|
mdc_equipment_statistical_info
|
<where>
|
<if test="equipmentIdList != null and equipmentIdList.size() > 0">
|
AND equipment_id IN
|
<foreach collection="equipmentIdList" item="id" index="index" open="(" close=")" separator=",">
|
#{ id }
|
</foreach>
|
</if>
|
AND the_date >= #{ monday }
|
AND the_date <= #{ saturday }
|
</where>
|
GROUP BY
|
equipment_id;
|
</select>
|
|
<select id="findDataForBigScreen" resultType="org.jeecg.modules.mdc.subcontrol.vo.LastWeekDataVo">
|
SELECT
|
the_date thedate,
|
SUM( open_long ) openingLong,
|
SUM( close_long ) closelong,
|
SUM( wait_long ) waitlong,
|
SUM( process_long ) processingLong,
|
SUM( error_long ) errorlong
|
FROM
|
mdc_equipment_statistical_info
|
<where>
|
<if test="equipmentIdList != null and equipmentIdList.size() > 0">
|
AND equipment_id IN
|
<foreach collection="equipmentIdList" item="id" index="index" open="(" close=")" separator=",">
|
#{ id }
|
</foreach>
|
</if>
|
AND the_date >= #{ monday }
|
AND the_date <= #{ saturday }
|
</where>
|
GROUP BY
|
the_date
|
ORDER BY
|
the_date ASC;
|
</select>
|
|
<select id="findEquipmentId" resultType="java.lang.String">
|
SELECT DISTINCT
|
equipment_id equipment
|
FROM
|
|
mdc_equipment_statistical_info
|
<where>
|
<if test="equipmentIdList != null and equipmentIdList.size() > 0">
|
AND equipment_id IN
|
<foreach collection="equipmentIdList" item="id" index="index" open="(" close=")" separator=",">
|
#{ id }
|
</foreach>
|
</if>
|
<if test="date != null and date != ''">
|
AND the_date = #{ date }
|
</if>
|
</where>
|
</select>
|
|
</mapper>
|