提交 | 用户 | 时间
|
532d0b
|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
D |
2 |
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|
3 |
|
|
4 |
<mapper namespace="com.iailab.module.pms.production.wash.dao.HourVolumeDao"> |
|
5 |
|
|
6 |
<select id="selectListByName" resultType="java.lang.String"> |
|
7 |
|
|
8 |
SELECT |
|
9 |
b.${name} |
|
10 |
FROM |
|
11 |
( |
|
12 |
SELECT '08' AS time, 1 AS sort_order UNION ALL |
|
13 |
SELECT '09' AS time, 2 AS sort_order UNION ALL |
|
14 |
SELECT '10' AS time, 3 AS sort_order UNION ALL |
|
15 |
SELECT '11' AS time, 4 AS sort_order UNION ALL |
|
16 |
SELECT '12' AS time, 5 AS sort_order UNION ALL |
|
17 |
SELECT '13' AS time, 6 AS sort_order UNION ALL |
|
18 |
SELECT '14' AS time, 7 AS sort_order UNION ALL |
|
19 |
SELECT '15' AS time, 8 AS sort_order UNION ALL |
|
20 |
SELECT '16' AS time, 9 AS sort_order UNION ALL |
|
21 |
SELECT '17' AS time, 10 AS sort_order UNION ALL |
|
22 |
SELECT '18' AS time, 11 AS sort_order UNION ALL |
|
23 |
SELECT '19' AS time, 12 AS sort_order UNION ALL |
|
24 |
SELECT '20' AS time, 13 AS sort_order UNION ALL |
|
25 |
SELECT '21' AS time, 14 AS sort_order UNION ALL |
|
26 |
SELECT '22' AS time, 15 AS sort_order UNION ALL |
|
27 |
SELECT '23' AS time, 16 AS sort_order UNION ALL |
|
28 |
SELECT '00' AS time, 17 AS sort_order UNION ALL |
|
29 |
SELECT '01' AS time, 18 AS sort_order UNION ALL |
|
30 |
SELECT '02' AS time, 19 AS sort_order UNION ALL |
|
31 |
SELECT '03' AS time, 20 AS sort_order UNION ALL |
|
32 |
SELECT '04' AS time, 21 AS sort_order UNION ALL |
|
33 |
SELECT '05' AS time, 22 AS sort_order UNION ALL |
|
34 |
SELECT '06' AS time, 23 AS sort_order UNION ALL |
|
35 |
SELECT '07' AS time, 24 AS sort_order |
|
36 |
) a left join ( |
|
37 |
SELECT |
|
38 |
${name} |
|
39 |
,sj |
|
40 |
FROM t_wash_hour_volume |
|
41 |
WHERE |
|
42 |
sj >= #{startTime} |
|
43 |
AND |
|
44 |
sj <= #{endTime} |
|
45 |
) b |
|
46 |
ON |
|
47 |
a.time = DATE_FORMAT(b.sj,'%H') |
|
48 |
ORDER BY |
|
49 |
a.sort_order |
|
50 |
</select> |
|
51 |
</mapper> |