|
@@ -0,0 +1,59 @@
|
|
|
+<?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.bizmatics.mhfire.persistence.mapper.AlertMapper">
|
|
|
+
|
|
|
+ <!-- 通用查询映射结果 -->
|
|
|
+ <resultMap id="BaseResultMap" type="com.bizmatics.mhfire.model.Alert">
|
|
|
+ <id column="id" property="id" />
|
|
|
+ <result column="afdz" property="afdz" />
|
|
|
+ <result column="ajbh" property="ajbh" />
|
|
|
+ <result column="ajdj" property="ajdj" />
|
|
|
+ <result column="ajlx" property="ajlx" />
|
|
|
+ <result column="ajlxdm" property="ajlxdm" />
|
|
|
+ <result column="ajqy" property="ajqy" />
|
|
|
+ <result column="ajsjd" property="ajsjd" />
|
|
|
+ <result column="ajxz" property="ajxz" />
|
|
|
+ <result column="ajzt" property="ajzt" />
|
|
|
+ <result column="bcxx" property="bcxx" />
|
|
|
+ <result column="cdcl" property="cdcl" />
|
|
|
+ <result column="czdx" property="czdx" />
|
|
|
+ <result column="dcsj" property="dcsj" />
|
|
|
+ <result column="fdsj" property="fdsj" />
|
|
|
+ <result column="gIS_X" property="gisX" />
|
|
|
+ <result column="gIS_Y" property="gisY" />
|
|
|
+ <result column="larq" property="larq" />
|
|
|
+ <result column="lasj" property="lasj" />
|
|
|
+ <result column="qrqk" property="qrqk" />
|
|
|
+ <result column="qx" property="qx" />
|
|
|
+ <result column="qy" property="qy" />
|
|
|
+ <result column="sJC" property="sJC" />
|
|
|
+ <result column="tzdcsj" property="tzdcsj" />
|
|
|
+ <result column="tzfdsj" property="tzfdsj" />
|
|
|
+ <result column="tzsj" property="tzsj" />
|
|
|
+ <result column="zgzd" property="zgzd" />
|
|
|
+ <result column="zhongdui" property="zhongdui" />
|
|
|
+ </resultMap>
|
|
|
+ <select id="getCountByHorse" resultType="java.util.Map">
|
|
|
+ SELECT
|
|
|
+ HOUR(dcsj) monthTime,
|
|
|
+ COUNT(id) as aCount,
|
|
|
+ ajlx as aType
|
|
|
+ FROM
|
|
|
+ `alert`
|
|
|
+ WHERE
|
|
|
+ dcsj BETWEEN #{startTime} AND #{endTime}
|
|
|
+ GROUP BY monthTime,ajlx
|
|
|
+ </select>
|
|
|
+ <select id="getCountByMonth" resultType="java.util.Map">
|
|
|
+ SELECT
|
|
|
+ DATE_FORMAT(dcsj, '%Y-%m-%d') monthTime,
|
|
|
+ COUNT(id) as aCount,
|
|
|
+ ajlx as aType
|
|
|
+ FROM
|
|
|
+ `alert`
|
|
|
+ WHERE
|
|
|
+ dcsj BETWEEN #{startTime} AND #{endTime}
|
|
|
+ GROUP BY monthTime,ajlx
|
|
|
+ </select>
|
|
|
+
|
|
|
+</mapper>
|