ShutdownEventMapper.xml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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.gyee.wisdom.alarm.sharding.mapper.ShutdownEventMapper">
  4. <select id="queryShutdownEventList" resultType="com.gyee.wisdom.alarm.sharding.entity.ShutdownEvent">
  5. SELECT
  6. *
  7. FROM
  8. Shutdownevent s
  9. LEFT JOIN Warning2 w ON s.warningid = w.id
  10. <where>
  11. s.windpowerstationid = #{stId}
  12. and s.statuscode = '2'
  13. and s.stoptypeid in (select id from stoptype where parentid= 'gz' and id != 'gzbmq')
  14. and s.windpowerstationid is not null
  15. and s.stoptime &lt;= #{startdate,jdbcType=DATE}
  16. and s.stoptime &gt; #{edtend,jdbcType=DATE}
  17. </where>
  18. </select>
  19. <select id="queryShutdownEventCurrentDate"
  20. resultType="com.gyee.wisdom.alarm.sharding.entity.ShutdownEvent">
  21. SELECT
  22. *
  23. FROM
  24. Shutdownevent s
  25. <where>
  26. and s.stoptime &gt;= #{currentDate,jdbcType=DATE}
  27. and s.statuscode = '2'
  28. and s.stoptypeid in (select id from stoptype where parentid= 'gz' and id != 'gzbmq')
  29. and s.windpowerstationid is not null
  30. <if test="stId !=null and stId !=''">
  31. and s.windpowerstationid = #{stId}
  32. </if>
  33. </where>
  34. </select>
  35. <select id="queryTodayCount" resultType="java.util.Map">
  36. SELECT count(s.id) as count
  37. FROM Shutdownevent s
  38. where s.stoptime >= #{currentDate,jdbcType=DATE}
  39. and s.statuscode = '2'
  40. and s.stoptypeid in (select id from stoptype where parentid = 'gz')
  41. and s.windpowerstationid is not null
  42. </select>
  43. </mapper>