<?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.smartman.modules.andon.mapper.AndonRecordMapper">
|
|
|
<select id="queryCard" resultType="com.qianwen.smartman.modules.andon.vo.AndonStatisticalCardVO">
|
select SUM(IF(cur_status = 3, unix_timestamp(end_time), unix_timestamp(NOW())) -
|
unix_timestamp(call_time)) as callTimeTotal,
|
count(*) as callCountTotal,
|
SUM(IF(response_time is not null, unix_timestamp(response_time) - unix_timestamp(call_time),
|
0)) as avgResponseTimeTotal
|
from blade_andon_record
|
where is_deleted = 0 and call_time between #{startTime} and #{endTime}
|
and workstation_id in
|
<foreach collection="workstations" item="workstationId" open="(" separator="," close=")">
|
#{workstationId}
|
</foreach>
|
</select>
|
|
<select id="getTableAndon" resultType="com.qianwen.smartman.modules.andon.vo.AndonTableStatisticalVO">
|
select type_code as typeCode,
|
type_name as typeName,
|
SUM(IF(cur_status = 3, unix_timestamp(end_time), unix_timestamp(NOW())) -
|
unix_timestamp(call_time)) as callTimeTotal,
|
count(*) as callTimeCount,
|
SUM(IF(response_time is not null, unix_timestamp(response_time) - unix_timestamp(call_time),
|
0)) as responseTimeTotal
|
from blade_andon_record
|
where is_deleted = 0
|
and call_time between #{startTime} and #{endTime}
|
and workstation_id in
|
<foreach collection="workstationIds" item="workstationId" open="(" separator="," close=")">
|
#{workstationId}
|
</foreach>
|
group by type_code, type_name
|
order by type_code;
|
</select>
|
</mapper>
|