<?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.mes.opctask.mapper.EdgStorageDeviceTaskHistoryMapper">
|
|
<resultMap id="baseMap" type="com.mes.largenscreen.entity.DailyProductionVO">
|
<result column="date" property="date"/>
|
<result column="count_out_one" property="countOutOne"/>
|
<result column="total_area_out_one" property="totalAreaOutOne"/>
|
<result column="count_out_two" property="countOutTwo"/>
|
<result column="total_area_out_two" property="totalAreaOutTwo"/>
|
<result column="count_in" property="countIn"/>
|
<result column="total_area_in" property="totalAreaIn"/>
|
<result column="count_out" property="countOut"/>
|
<result column="total_area_out" property="totalAreaOut"/>
|
<result column="hollow_count_out_one" property="hollowCountOutOne"/>
|
<result column="hollow_total_area_out_one" property="hollowTotalAreaOutOne"/>
|
<result column="hollow_count_out_two" property="hollowCountOutTwo"/>
|
<result column="hollow_total_area_out_two" property="hollowTotalAreaOutTwo"/>
|
</resultMap>
|
|
|
<select id="queryEdgDailyProduction" resultMap="baseMap">
|
SELECT
|
count( t.glass_id_out ) AS count_out_one,
|
round( sum( t1.width * t1.height )/ 1000000, 2 ) AS total_area_out_one
|
FROM
|
edg_storage_device_task_history t
|
INNER JOIN glass_info t1 ON t.glass_id_out = t1.glass_id
|
WHERE
|
t.task_type IN ( 2, 3 )
|
<if test="beginDate != null and beginDate != ''">
|
AND STR_TO_DATE( t.create_time, '%Y-%m-%d' ) BETWEEN #{beginDate}
|
AND #{endDate}
|
</if>
|
<if test="deviceId != null and deviceId != 0">
|
AND device_id = #{deviceId}
|
</if>
|
</select>
|
|
|
</mapper>
|