|
@@ -164,8 +164,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
FROM t_xlht_add_record
|
|
|
<where>
|
|
|
1 = 1
|
|
|
- <if test="timeBegin != null and timeBegin != ''"> and create_time >= #{timeBegin}</if>
|
|
|
- <if test="timeEnd != null and timeEnd != ''"> and create_time <= #{timeEnd}</if>
|
|
|
+ <if test="timeBegin != null and timeBegin != ''"> and DATEADD(HOUR, DATEDIFF(HOUR, 0, create_time), 0) >= #{timeBegin}</if>
|
|
|
+ <if test="timeEnd != null and timeEnd != ''"> and DATEADD(HOUR, DATEDIFF(HOUR, 0, create_time), 0) <= #{timeEnd}</if>
|
|
|
</where>
|
|
|
GROUP BY DATEADD(HOUR, DATEDIFF(HOUR, 0, create_time), 0)
|
|
|
) AS rec_hour
|
|
@@ -177,8 +177,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
FROM t_xlht_add_record_sec
|
|
|
<where>
|
|
|
1 = 1
|
|
|
- <if test="timeBegin != null and timeBegin != ''"> and create_time >= #{timeBegin}</if>
|
|
|
- <if test="timeEnd != null and timeEnd != ''"> and create_time <= #{timeEnd}</if>
|
|
|
+ <if test="timeBegin != null and timeBegin != ''"> and DATEADD(HOUR, DATEDIFF(HOUR, 0, create_time), 0) >= #{timeBegin}</if>
|
|
|
+ <if test="timeEnd != null and timeEnd != ''"> and DATEADD(HOUR, DATEDIFF(HOUR, 0, create_time), 0) <= #{timeEnd}</if>
|
|
|
</where>
|
|
|
GROUP BY DATEADD(HOUR, DATEDIFF(HOUR, 0, create_time), 0)
|
|
|
) AS sec_hour
|
|
@@ -208,8 +208,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
FROM t_xlht_add_record
|
|
|
<where>
|
|
|
1 = 1
|
|
|
- <if test="timeBegin != null and timeBegin != ''"> and create_time >= #{timeBegin}</if>
|
|
|
- <if test="timeEnd != null and timeEnd != ''"> and create_time <= #{timeEnd}</if>
|
|
|
+ <if test="timeBegin != null and timeBegin != ''"> and CAST(create_time AS DATE) >= #{timeBegin}</if>
|
|
|
+ <if test="timeEnd != null and timeEnd != ''"> and CAST(create_time AS DATE) <= #{timeEnd}</if>
|
|
|
</where>
|
|
|
GROUP BY CAST(create_time AS DATE)
|
|
|
) AS rec_day
|
|
@@ -221,8 +221,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
FROM t_xlht_add_record_sec
|
|
|
<where>
|
|
|
1 = 1
|
|
|
- <if test="timeBegin != null and timeBegin != ''"> and create_time >= #{timeBegin}</if>
|
|
|
- <if test="timeEnd != null and timeEnd != ''"> and create_time <= #{timeEnd}</if>
|
|
|
+ <if test="timeBegin != null and timeBegin != ''"> and CAST(create_time AS DATE) >= #{timeBegin}</if>
|
|
|
+ <if test="timeEnd != null and timeEnd != ''"> and CAST(create_time AS DATE) <= #{timeEnd}</if>
|
|
|
</where>
|
|
|
GROUP BY CAST(create_time AS DATE)
|
|
|
) AS sec_day
|