1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <?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.FireStatisticsMapper">
- <select id="selectCount" resultType="java.lang.Integer">
- select count(1)
- from `hzdc-hztjb`
- <where>
- <if test="startTime != null">
- and `起火时间_日期型` >= #{startTime}
- </if>
- <if test="endTime != null">
- and `起火时间_日期型` <= #{endTime}
- </if>
- <if test="fireAddress != null and fireAddress != ''">
- and `起火地点` LIKE CONCAT(CONCAT('%', #{fireAddress}), '%')
- </if>
- <if test="level != null and level != ''">
- and `火灾原因分类(一级)` = #{level}
- </if>
- <if test="unitId != null and unitId != ''">
- and `单位代码` = #{unitId}
- </if>
- </where>
- </select>
- <select id="page" resultType="java.util.Map">
- select *
- from `hzdc-hztjb`
- <where>
- <if test="startTime != null">
- and `起火时间_日期型` >= #{startTime}
- </if>
- <if test="endTime !=null">
- and `起火时间_日期型` <= #{endTime}
- </if>
- <if test="address !=null and address !=''">
- and `起火地点` LIKE CONCAT(CONCAT('%', #{address}), '%')
- </if>
- </where>
- order by isnull(`死亡人数`) || `死亡人数`='null' || `死亡人数`='' asc,`死亡人数` desc
- </select>
- <select id="getOne" resultType="java.util.Map">
- select * from `hzdc-hztjb` where `火灾序号` = #{id};
- </select>
- <select id="groupByCause" resultType="java.lang.String">
- select `火灾原因分类(一级)` from `hzdc-hztjb` group by `火灾原因分类(一级)`
- </select>
- <select id="getAddress" resultType="java.lang.String">
- select `行政区域` from `hzdc-hztjb` group by `行政区域`
- </select>
- <select id="selectMaxDate" resultType="java.util.Date">
- select max(`起火时间_日期型`) from `hzdc-hztjb`
- </select>
- <select id="selectMinDate" resultType="java.util.Date">
- select min(`起火时间_日期型`) from `hzdc-hztjb`
- </select>
- <select id="selectCountByRangeDate" resultType="java.lang.Integer">
- select count(1)
- from `hzdc-hztjb`
- <where>
- <if test="address != null and address != ''">
- and `起火地点` LIKE CONCAT(CONCAT('%', #{address}), '%')
- </if>
- <if test="fireType != null and fireType != ''">
- and `火灾原因分类(一级)` = #{fireType}
- </if>
- <if test="startTime != null and endTime != null">
- and `起火时间_日期型` between STR_TO_DATE(#{startTime},'%Y-%m-%d %H:%i:%s')
- and STR_TO_DATE(#{endTime},'%Y-%m-%d %H:%i:%s')
- </if>
- and Month(`起火时间_日期型`) = #{month}
- </where>
- </select>
- </mapper>
|