| | |
| | | <select id="countByTimes" resultType="java.util.Map">
|
| | | select
|
| | | <if test="format !=null">
|
| | | DATE_FORMAT(a.time,#{format}) as time,
|
| | | </if>
|
| | | count(*) as count
|
| | | from
|
| | | (<foreach collection="list" item="item" separator="union">
|
| | | select
|
| | | * from
|
| | | alarm_${item}
|
| | | </foreach>) as a
|
| | | where
|
| | | a.time >= #{start}
|
| | | and a.time
|
| | | <![CDATA[<=]]> #{end}
|
| | | <if test="format !=null">
|
| | | GROUP BY DATE_FORMAT(a.time,#{format}) ;
|
| | | </if>
|
| | | </select>
|
| | |
|
| | | <!-- <select id="countByTimes" resultType="java.util.Map">
|
| | | select
|
| | | <if test="format !=null">
|
| | | DATE_FORMAT(time,#{format}) as time,
|
| | | </if>
|
| | | COUNT(*) as count from alarm
|
| | |
| | | <if test="format !=null">
|
| | | GROUP BY DATE_FORMAT(time,#{format}) ;
|
| | | </if>
|
| | | </select>
|
| | | </select>-->
|
| | | </mapper> |