FireStatisticsMapper.xml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.bizmatics.mhfire.persistence.mapper.FireStatisticsMapper">
  4. <select id="selectCount" resultType="java.lang.Integer">
  5. select count(1)
  6. from `hzdc-hztjb`
  7. <where>
  8. <if test="startTime != null">
  9. and `起火时间_日期型` >= #{startTime}
  10. </if>
  11. <if test="endTime != null">
  12. and `起火时间_日期型` &lt;= #{endTime}
  13. </if>
  14. <if test="fireAddress != null and fireAddress != ''">
  15. and `起火地点` LIKE CONCAT(CONCAT('%', #{fireAddress}), '%')
  16. </if>
  17. <if test="level != null and level != ''">
  18. and `火灾原因分类(一级)` = #{level}
  19. </if>
  20. <if test="unitId != null and unitId != ''">
  21. and `单位代码` = #{unitId}
  22. </if>
  23. </where>
  24. </select>
  25. <select id="page" resultType="java.util.Map">
  26. select *
  27. from `hzdc-hztjb`
  28. <where>
  29. <if test="startTime != null">
  30. and `起火时间_日期型` >= #{startTime}
  31. </if>
  32. <if test="endTime !=null">
  33. and `起火时间_日期型` &lt;= #{endTime}
  34. </if>
  35. <if test="address !=null and address !=''">
  36. and `起火地点` LIKE CONCAT(CONCAT('%', #{address}), '%')
  37. </if>
  38. </where>
  39. </select>
  40. <select id="getOne" resultType="java.util.Map">
  41. select * from `hzdc-hztjb` where `火灾序号` = #{id};
  42. </select>
  43. <select id="groupByCause" resultType="java.lang.String">
  44. select `火灾原因分类(一级)` from `hzdc-hztjb` group by `火灾原因分类(一级)`
  45. </select>
  46. <select id="getAddress" resultType="java.lang.String">
  47. select `行政区域` from `hzdc-hztjb` group by `行政区域`
  48. </select>
  49. </mapper>