<?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.iailab.module.pms.production.wash.dao.HourVolumeDao">
|
|
<select id="selectListByName" resultType="java.lang.String">
|
|
SELECT
|
b.${name}
|
FROM
|
(
|
SELECT '08' AS time, 1 AS sort_order UNION ALL
|
SELECT '09' AS time, 2 AS sort_order UNION ALL
|
SELECT '10' AS time, 3 AS sort_order UNION ALL
|
SELECT '11' AS time, 4 AS sort_order UNION ALL
|
SELECT '12' AS time, 5 AS sort_order UNION ALL
|
SELECT '13' AS time, 6 AS sort_order UNION ALL
|
SELECT '14' AS time, 7 AS sort_order UNION ALL
|
SELECT '15' AS time, 8 AS sort_order UNION ALL
|
SELECT '16' AS time, 9 AS sort_order UNION ALL
|
SELECT '17' AS time, 10 AS sort_order UNION ALL
|
SELECT '18' AS time, 11 AS sort_order UNION ALL
|
SELECT '19' AS time, 12 AS sort_order UNION ALL
|
SELECT '20' AS time, 13 AS sort_order UNION ALL
|
SELECT '21' AS time, 14 AS sort_order UNION ALL
|
SELECT '22' AS time, 15 AS sort_order UNION ALL
|
SELECT '23' AS time, 16 AS sort_order UNION ALL
|
SELECT '00' AS time, 17 AS sort_order UNION ALL
|
SELECT '01' AS time, 18 AS sort_order UNION ALL
|
SELECT '02' AS time, 19 AS sort_order UNION ALL
|
SELECT '03' AS time, 20 AS sort_order UNION ALL
|
SELECT '04' AS time, 21 AS sort_order UNION ALL
|
SELECT '05' AS time, 22 AS sort_order UNION ALL
|
SELECT '06' AS time, 23 AS sort_order UNION ALL
|
SELECT '07' AS time, 24 AS sort_order
|
) a left join (
|
SELECT
|
${name}
|
,sj
|
FROM t_wash_hour_volume
|
WHERE
|
sj >= #{startTime}
|
AND
|
sj <= #{endTime}
|
) b
|
ON
|
a.time = DATE_FORMAT(b.sj,'%H')
|
ORDER BY
|
a.sort_order
|
</select>
|
</mapper>
|