ShutdowneventMapper.xml 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555
  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.frame.mapper.auto.ShutdowneventMapper">
  4. <!-- <cache type="org.mybatis.caches.ehcache.EhcacheCache">-->
  5. <!-- <property name="timeToIdleSeconds" value="60"></property>&lt;!&ndash;&lt;!&ndash;当缓存闲置60秒后销毁&ndash;&gt;&ndash;&gt;-->
  6. <!-- <property name="timeToLiveSeconds" value="160"></property>&lt;!&ndash;&lt;!&ndash;缓存存在160秒后销毁&ndash;&gt;&ndash;&gt;-->
  7. <!-- <property name="maxEntriesLocalHeap" value="1000"></property>-->
  8. <!-- <property name="maxEntriesLocalDisk" value="10000000"></property>-->
  9. <!-- <property name="memoryStoreEvictionPolicy" value="LRU"></property>-->
  10. <!-- </cache>-->
  11. <resultMap id="BaseResultMap" type="com.gyee.frame.model.auto.Shutdownevent">
  12. <!--
  13. WARNING - @mbg.generated
  14. This element is automatically generated by MyBatis Generator, do not modify.
  15. -->
  16. <id column="id" jdbcType="VARCHAR" property="id" />
  17. <result column="windPowerStationId" jdbcType="VARCHAR" property="windpowerstationid" />
  18. <result column="windTurbineId" jdbcType="VARCHAR" property="windturbineid" />
  19. <result column="stopTime" jdbcType="TIMESTAMP" property="stoptime" />
  20. <result column="startTime" jdbcType="TIMESTAMP" property="starttime" />
  21. <result column="stopHours" jdbcType="DECIMAL" property="stophours" />
  22. <result column="lossPower" jdbcType="DECIMAL" property="losspower" />
  23. <result column="stopTypeId" jdbcType="VARCHAR" property="stoptypeid" />
  24. <result column="isHandle" jdbcType="SMALLINT" property="ishandle" />
  25. <result column="warningId" jdbcType="VARCHAR" property="warningid" />
  26. <result column="projectId" jdbcType="VARCHAR" property="projectid" />
  27. <result column="handleWay" jdbcType="VARCHAR" property="handleway" />
  28. <result column="faultView" jdbcType="VARCHAR" property="faultview" />
  29. <result column="statusCode" jdbcType="INTEGER" property="statuscode" />
  30. <result column="mainId" jdbcType="VARCHAR" property="mainid" />
  31. <result column="resetRate" jdbcType="VARCHAR" property="resetrate" />
  32. <result column="stateRate" jdbcType="VARCHAR" property="staterate" />
  33. <result column="failRate" jdbcType="VARCHAR" property="failrate" />
  34. <result column="warningRecordsId" jdbcType="INTEGER" property="warningrecordsid" />
  35. </resultMap>
  36. <sql id="Example_Where_Clause">
  37. <!--
  38. WARNING - @mbg.generated
  39. This element is automatically generated by MyBatis Generator, do not modify.
  40. -->
  41. <where>
  42. <foreach collection="oredCriteria" item="criteria" separator="or">
  43. <if test="criteria.valid">
  44. <trim prefix="(" prefixOverrides="and" suffix=")">
  45. <foreach collection="criteria.criteria" item="criterion">
  46. <choose>
  47. <when test="criterion.noValue">
  48. and ${criterion.condition}
  49. </when>
  50. <when test="criterion.singleValue">
  51. and ${criterion.condition} #{criterion.value}
  52. </when>
  53. <when test="criterion.dateValue">
  54. and ${criterion.condition} to_date(#{criterion.value},'yyyy-MM-dd')
  55. </when>
  56. <when test="criterion.betweenValue">
  57. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  58. </when>
  59. <when test="criterion.listValue">
  60. and ${criterion.condition}
  61. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  62. #{listItem}
  63. </foreach>
  64. </when>
  65. </choose>
  66. </foreach>
  67. </trim>
  68. </if>
  69. </foreach>
  70. </where>
  71. </sql>
  72. <sql id="Update_By_Example_Where_Clause">
  73. <!--
  74. WARNING - @mbg.generated
  75. This element is automatically generated by MyBatis Generator, do not modify.
  76. -->
  77. <where>
  78. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  79. <if test="criteria.valid">
  80. <trim prefix="(" prefixOverrides="and" suffix=")">
  81. <foreach collection="criteria.criteria" item="criterion">
  82. <choose>
  83. <when test="criterion.noValue">
  84. and ${criterion.condition}
  85. </when>
  86. <when test="criterion.singleValue">
  87. and ${criterion.condition} #{criterion.value}
  88. </when>
  89. <when test="criterion.betweenValue">
  90. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  91. </when>
  92. <when test="criterion.listValue">
  93. and ${criterion.condition}
  94. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  95. #{listItem}
  96. </foreach>
  97. </when>
  98. </choose>
  99. </foreach>
  100. </trim>
  101. </if>
  102. </foreach>
  103. </where>
  104. </sql>
  105. <sql id="Base_Column_List">
  106. <!--
  107. WARNING - @mbg.generated
  108. This element is automatically generated by MyBatis Generator, do not modify.
  109. -->
  110. id, windPowerStationId, windTurbineId, stopTime, startTime, stopHours, lossPower,
  111. stopTypeId, isHandle, warningId, projectId, handleWay, faultView, statusCode, mainId,
  112. resetRate, stateRate, failRate, warningRecordsId
  113. </sql>
  114. <select id="selectByExample" parameterType="com.gyee.frame.model.auto.ShutdowneventExample" resultMap="BaseResultMap">
  115. <!--
  116. WARNING - @mbg.generated
  117. This element is automatically generated by MyBatis Generator, do not modify.
  118. -->
  119. select
  120. <if test="distinct">
  121. distinct
  122. </if>
  123. <include refid="Base_Column_List" />
  124. from shutdownevent
  125. <if test="_parameter != null">
  126. <include refid="Example_Where_Clause" />
  127. </if>
  128. <if test="orderByClause != null">
  129. order by ${orderByClause}
  130. </if>
  131. </select>
  132. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  133. <!--
  134. WARNING - @mbg.generated
  135. This element is automatically generated by MyBatis Generator, do not modify.
  136. -->
  137. select
  138. <include refid="Base_Column_List" />
  139. from shutdownevent
  140. where id = #{id,jdbcType=VARCHAR}
  141. </select>
  142. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  143. <!--
  144. WARNING - @mbg.generated
  145. This element is automatically generated by MyBatis Generator, do not modify.
  146. -->
  147. delete from shutdownevent
  148. where id = #{id,jdbcType=VARCHAR}
  149. </delete>
  150. <delete id="deleteByExample" parameterType="com.gyee.frame.model.auto.ShutdowneventExample">
  151. <!--
  152. WARNING - @mbg.generated
  153. This element is automatically generated by MyBatis Generator, do not modify.
  154. -->
  155. delete from shutdownevent
  156. <if test="_parameter != null">
  157. <include refid="Example_Where_Clause" />
  158. </if>
  159. </delete>
  160. <insert id="insert" parameterType="com.gyee.frame.model.auto.Shutdownevent">
  161. <!--
  162. WARNING - @mbg.generated
  163. This element is automatically generated by MyBatis Generator, do not modify.
  164. -->
  165. insert into shutdownevent (id, windPowerStationId, windTurbineId,
  166. stopTime, startTime, stopHours,
  167. lossPower, stopTypeId, isHandle,
  168. warningId, projectId, handleWay,
  169. faultView, statusCode, mainId,
  170. resetRate, stateRate, failRate,
  171. warningRecordsId)
  172. values (#{id,jdbcType=VARCHAR}, #{windpowerstationid,jdbcType=VARCHAR}, #{windturbineid,jdbcType=VARCHAR},
  173. #{stoptime,jdbcType=TIMESTAMP}, #{starttime,jdbcType=TIMESTAMP}, #{stophours,jdbcType=DECIMAL},
  174. #{losspower,jdbcType=DECIMAL}, #{stoptypeid,jdbcType=VARCHAR}, #{ishandle,jdbcType=SMALLINT},
  175. #{warningid,jdbcType=VARCHAR}, #{projectid,jdbcType=VARCHAR}, #{handleway,jdbcType=VARCHAR},
  176. #{faultview,jdbcType=VARCHAR}, #{statuscode,jdbcType=INTEGER}, #{mainid,jdbcType=VARCHAR},
  177. #{resetrate,jdbcType=VARCHAR}, #{staterate,jdbcType=VARCHAR}, #{failrate,jdbcType=VARCHAR},
  178. #{warningrecordsid,jdbcType=INTEGER})
  179. </insert>
  180. <insert id="insertSelective" parameterType="com.gyee.frame.model.auto.Shutdownevent">
  181. <!--
  182. WARNING - @mbg.generated
  183. This element is automatically generated by MyBatis Generator, do not modify.
  184. -->
  185. insert into shutdownevent
  186. <trim prefix="(" suffix=")" suffixOverrides=",">
  187. <if test="id != null">
  188. id,
  189. </if>
  190. <if test="windpowerstationid != null">
  191. windPowerStationId,
  192. </if>
  193. <if test="windturbineid != null">
  194. windTurbineId,
  195. </if>
  196. <if test="stoptime != null">
  197. stopTime,
  198. </if>
  199. <if test="starttime != null">
  200. startTime,
  201. </if>
  202. <if test="stophours != null">
  203. stopHours,
  204. </if>
  205. <if test="losspower != null">
  206. lossPower,
  207. </if>
  208. <if test="stoptypeid != null">
  209. stopTypeId,
  210. </if>
  211. <if test="ishandle != null">
  212. isHandle,
  213. </if>
  214. <if test="warningid != null">
  215. warningId,
  216. </if>
  217. <if test="projectid != null">
  218. projectId,
  219. </if>
  220. <if test="handleway != null">
  221. handleWay,
  222. </if>
  223. <if test="faultview != null">
  224. faultView,
  225. </if>
  226. <if test="statuscode != null">
  227. statusCode,
  228. </if>
  229. <if test="mainid != null">
  230. mainId,
  231. </if>
  232. <if test="resetrate != null">
  233. resetRate,
  234. </if>
  235. <if test="staterate != null">
  236. stateRate,
  237. </if>
  238. <if test="failrate != null">
  239. failRate,
  240. </if>
  241. <if test="warningrecordsid != null">
  242. warningRecordsId,
  243. </if>
  244. </trim>
  245. <trim prefix="values (" suffix=")" suffixOverrides=",">
  246. <if test="id != null">
  247. #{id,jdbcType=VARCHAR},
  248. </if>
  249. <if test="windpowerstationid != null">
  250. #{windpowerstationid,jdbcType=VARCHAR},
  251. </if>
  252. <if test="windturbineid != null">
  253. #{windturbineid,jdbcType=VARCHAR},
  254. </if>
  255. <if test="stoptime != null">
  256. #{stoptime,jdbcType=TIMESTAMP},
  257. </if>
  258. <if test="starttime != null">
  259. #{starttime,jdbcType=TIMESTAMP},
  260. </if>
  261. <if test="stophours != null">
  262. #{stophours,jdbcType=DECIMAL},
  263. </if>
  264. <if test="losspower != null">
  265. #{losspower,jdbcType=DECIMAL},
  266. </if>
  267. <if test="stoptypeid != null">
  268. #{stoptypeid,jdbcType=VARCHAR},
  269. </if>
  270. <if test="ishandle != null">
  271. #{ishandle,jdbcType=SMALLINT},
  272. </if>
  273. <if test="warningid != null">
  274. #{warningid,jdbcType=VARCHAR},
  275. </if>
  276. <if test="projectid != null">
  277. #{projectid,jdbcType=VARCHAR},
  278. </if>
  279. <if test="handleway != null">
  280. #{handleway,jdbcType=VARCHAR},
  281. </if>
  282. <if test="faultview != null">
  283. #{faultview,jdbcType=VARCHAR},
  284. </if>
  285. <if test="statuscode != null">
  286. #{statuscode,jdbcType=INTEGER},
  287. </if>
  288. <if test="mainid != null">
  289. #{mainid,jdbcType=VARCHAR},
  290. </if>
  291. <if test="resetrate != null">
  292. #{resetrate,jdbcType=VARCHAR},
  293. </if>
  294. <if test="staterate != null">
  295. #{staterate,jdbcType=VARCHAR},
  296. </if>
  297. <if test="failrate != null">
  298. #{failrate,jdbcType=VARCHAR},
  299. </if>
  300. <if test="warningrecordsid != null">
  301. #{warningrecordsid,jdbcType=INTEGER},
  302. </if>
  303. </trim>
  304. </insert>
  305. <select id="countByExample" parameterType="com.gyee.frame.model.auto.ShutdowneventExample" resultType="java.lang.Long">
  306. <!--
  307. WARNING - @mbg.generated
  308. This element is automatically generated by MyBatis Generator, do not modify.
  309. -->
  310. select count(*) from shutdownevent
  311. <if test="_parameter != null">
  312. <include refid="Example_Where_Clause" />
  313. </if>
  314. </select>
  315. <update id="updateByExampleSelective" parameterType="map">
  316. <!--
  317. WARNING - @mbg.generated
  318. This element is automatically generated by MyBatis Generator, do not modify.
  319. -->
  320. update shutdownevent
  321. <set>
  322. <if test="record.id != null">
  323. id = #{record.id,jdbcType=VARCHAR},
  324. </if>
  325. <if test="record.windpowerstationid != null">
  326. windPowerStationId = #{record.windpowerstationid,jdbcType=VARCHAR},
  327. </if>
  328. <if test="record.windturbineid != null">
  329. windTurbineId = #{record.windturbineid,jdbcType=VARCHAR},
  330. </if>
  331. <if test="record.stoptime != null">
  332. stopTime = #{record.stoptime,jdbcType=TIMESTAMP},
  333. </if>
  334. <if test="record.starttime != null">
  335. startTime = #{record.starttime,jdbcType=TIMESTAMP},
  336. </if>
  337. <if test="record.stophours != null">
  338. stopHours = #{record.stophours,jdbcType=DECIMAL},
  339. </if>
  340. <if test="record.losspower != null">
  341. lossPower = #{record.losspower,jdbcType=DECIMAL},
  342. </if>
  343. <if test="record.stoptypeid != null">
  344. stopTypeId = #{record.stoptypeid,jdbcType=VARCHAR},
  345. </if>
  346. <if test="record.ishandle != null">
  347. isHandle = #{record.ishandle,jdbcType=SMALLINT},
  348. </if>
  349. <if test="record.warningid != null">
  350. warningId = #{record.warningid,jdbcType=VARCHAR},
  351. </if>
  352. <if test="record.projectid != null">
  353. projectId = #{record.projectid,jdbcType=VARCHAR},
  354. </if>
  355. <if test="record.handleway != null">
  356. handleWay = #{record.handleway,jdbcType=VARCHAR},
  357. </if>
  358. <if test="record.faultview != null">
  359. faultView = #{record.faultview,jdbcType=VARCHAR},
  360. </if>
  361. <if test="record.statuscode != null">
  362. statusCode = #{record.statuscode,jdbcType=INTEGER},
  363. </if>
  364. <if test="record.mainid != null">
  365. mainId = #{record.mainid,jdbcType=VARCHAR},
  366. </if>
  367. <if test="record.resetrate != null">
  368. resetRate = #{record.resetrate,jdbcType=VARCHAR},
  369. </if>
  370. <if test="record.staterate != null">
  371. stateRate = #{record.staterate,jdbcType=VARCHAR},
  372. </if>
  373. <if test="record.failrate != null">
  374. failRate = #{record.failrate,jdbcType=VARCHAR},
  375. </if>
  376. <if test="record.warningrecordsid != null">
  377. warningRecordsId = #{record.warningrecordsid,jdbcType=INTEGER},
  378. </if>
  379. </set>
  380. <if test="_parameter != null">
  381. <include refid="Update_By_Example_Where_Clause" />
  382. </if>
  383. </update>
  384. <update id="updateByExample" parameterType="map">
  385. <!--
  386. WARNING - @mbg.generated
  387. This element is automatically generated by MyBatis Generator, do not modify.
  388. -->
  389. update shutdownevent
  390. set id = #{record.id,jdbcType=VARCHAR},
  391. windPowerStationId = #{record.windpowerstationid,jdbcType=VARCHAR},
  392. windTurbineId = #{record.windturbineid,jdbcType=VARCHAR},
  393. stopTime = #{record.stoptime,jdbcType=TIMESTAMP},
  394. startTime = #{record.starttime,jdbcType=TIMESTAMP},
  395. stopHours = #{record.stophours,jdbcType=DECIMAL},
  396. lossPower = #{record.losspower,jdbcType=DECIMAL},
  397. stopTypeId = #{record.stoptypeid,jdbcType=VARCHAR},
  398. isHandle = #{record.ishandle,jdbcType=SMALLINT},
  399. warningId = #{record.warningid,jdbcType=VARCHAR},
  400. projectId = #{record.projectid,jdbcType=VARCHAR},
  401. handleWay = #{record.handleway,jdbcType=VARCHAR},
  402. faultView = #{record.faultview,jdbcType=VARCHAR},
  403. statusCode = #{record.statuscode,jdbcType=INTEGER},
  404. mainId = #{record.mainid,jdbcType=VARCHAR},
  405. resetRate = #{record.resetrate,jdbcType=VARCHAR},
  406. stateRate = #{record.staterate,jdbcType=VARCHAR},
  407. failRate = #{record.failrate,jdbcType=VARCHAR},
  408. warningRecordsId = #{record.warningrecordsid,jdbcType=INTEGER}
  409. <if test="_parameter != null">
  410. <include refid="Update_By_Example_Where_Clause" />
  411. </if>
  412. </update>
  413. <update id="updateByPrimaryKeySelective" parameterType="com.gyee.frame.model.auto.Shutdownevent">
  414. <!--
  415. WARNING - @mbg.generated
  416. This element is automatically generated by MyBatis Generator, do not modify.
  417. -->
  418. update shutdownevent
  419. <set>
  420. <if test="windpowerstationid != null">
  421. windPowerStationId = #{windpowerstationid,jdbcType=VARCHAR},
  422. </if>
  423. <if test="windturbineid != null">
  424. windTurbineId = #{windturbineid,jdbcType=VARCHAR},
  425. </if>
  426. <if test="stoptime != null">
  427. stopTime = #{stoptime,jdbcType=TIMESTAMP},
  428. </if>
  429. <if test="starttime != null">
  430. startTime = #{starttime,jdbcType=TIMESTAMP},
  431. </if>
  432. <if test="stophours != null">
  433. stopHours = #{stophours,jdbcType=DECIMAL},
  434. </if>
  435. <if test="losspower != null">
  436. lossPower = #{losspower,jdbcType=DECIMAL},
  437. </if>
  438. <if test="stoptypeid != null">
  439. stopTypeId = #{stoptypeid,jdbcType=VARCHAR},
  440. </if>
  441. <if test="ishandle != null">
  442. isHandle = #{ishandle,jdbcType=SMALLINT},
  443. </if>
  444. <if test="warningid != null">
  445. warningId = #{warningid,jdbcType=VARCHAR},
  446. </if>
  447. <if test="projectid != null">
  448. projectId = #{projectid,jdbcType=VARCHAR},
  449. </if>
  450. <if test="handleway != null">
  451. handleWay = #{handleway,jdbcType=VARCHAR},
  452. </if>
  453. <if test="faultview != null">
  454. faultView = #{faultview,jdbcType=VARCHAR},
  455. </if>
  456. <if test="statuscode != null">
  457. statusCode = #{statuscode,jdbcType=INTEGER},
  458. </if>
  459. <if test="mainid != null">
  460. mainId = #{mainid,jdbcType=VARCHAR},
  461. </if>
  462. <if test="resetrate != null">
  463. resetRate = #{resetrate,jdbcType=VARCHAR},
  464. </if>
  465. <if test="staterate != null">
  466. stateRate = #{staterate,jdbcType=VARCHAR},
  467. </if>
  468. <if test="failrate != null">
  469. failRate = #{failrate,jdbcType=VARCHAR},
  470. </if>
  471. <if test="warningrecordsid != null">
  472. warningRecordsId = #{warningrecordsid,jdbcType=INTEGER},
  473. </if>
  474. </set>
  475. where id = #{id,jdbcType=VARCHAR}
  476. </update>
  477. <update id="updateByPrimaryKey" parameterType="com.gyee.frame.model.auto.Shutdownevent">
  478. <!--
  479. WARNING - @mbg.generated
  480. This element is automatically generated by MyBatis Generator, do not modify.
  481. -->
  482. update shutdownevent
  483. set windPowerStationId = #{windpowerstationid,jdbcType=VARCHAR},
  484. windTurbineId = #{windturbineid,jdbcType=VARCHAR},
  485. stopTime = #{stoptime,jdbcType=TIMESTAMP},
  486. startTime = #{starttime,jdbcType=TIMESTAMP},
  487. stopHours = #{stophours,jdbcType=DECIMAL},
  488. lossPower = #{losspower,jdbcType=DECIMAL},
  489. stopTypeId = #{stoptypeid,jdbcType=VARCHAR},
  490. isHandle = #{ishandle,jdbcType=SMALLINT},
  491. warningId = #{warningid,jdbcType=VARCHAR},
  492. projectId = #{projectid,jdbcType=VARCHAR},
  493. handleWay = #{handleway,jdbcType=VARCHAR},
  494. faultView = #{faultview,jdbcType=VARCHAR},
  495. statusCode = #{statuscode,jdbcType=INTEGER},
  496. mainId = #{mainid,jdbcType=VARCHAR},
  497. resetRate = #{resetrate,jdbcType=VARCHAR},
  498. stateRate = #{staterate,jdbcType=VARCHAR},
  499. failRate = #{failrate,jdbcType=VARCHAR},
  500. warningRecordsId = #{warningrecordsid,jdbcType=INTEGER}
  501. where id = #{id,jdbcType=VARCHAR}
  502. </update>
  503. <!--
  504. <select id="countStopByWp" resultType="com.gyee.frame.model.custom.SimpleVo">
  505. select t.windpowerstationid id,count(*) value from shutdownevent t
  506. where instr(t.windpowerstationid,'_FDC')>0 and t.statuscode=2
  507. and t.stoptime >= (select max(stoptime)-7 from shutdownevent)
  508. and t.stoptime &lt;= (select max(stoptime) from shutdownevent) group by t.windpowerstationid
  509. </select>
  510. <select id="countStopByPj" resultType="com.gyee.frame.model.custom.SimpleVo">
  511. select t1.projectid id,count(*) value from shutdownevent t,windturbine t1 where instr(t.windpowerstationid,'_FDC')>0 and t.statuscode=2
  512. and t.stoptime >= (select max(stoptime)-7 from shutdownevent)
  513. and t.stoptime &lt;= (select max(stoptime) from shutdownevent) and t.windturbineid = t1.id group by t1.projectid order by t1.projectid
  514. </select>
  515. -->
  516. <select id="countStopByWp" resultType="com.gyee.frame.model.custom.SimpleVo">
  517. select b.windpowerstationid id, count(*) filter(where a.stoptime between (SELECT current_date - interval '7 day') and current_date) as
  518. value from shutdownevent a,windturbine b
  519. where a.windturbineid = b.id and a.statuscode=2 group by b.windpowerstationid
  520. </select>
  521. <select id="countStopByPj" resultType="com.gyee.frame.model.custom.SimpleVo">
  522. select b.projectid id, count(*) filter(where a.stoptime between (SELECT current_date - interval '7 day') and current_date) as
  523. value from shutdownevent a,windturbine b
  524. where a.windturbineid = b.id and a.statuscode=2 group by b.projectid
  525. </select>
  526. <select id="queryEvents" resultType="com.gyee.frame.model.custom.ShutdowneventVo">
  527. select t.id,t.windPowerStationId,t.windTurbineId,t.warningId,w.chinesetext warnDesc,t.stopTime,t.startTime,t.stopHours,t.lossPower,t.statusCode,t.stopTypeId
  528. from shutdownevent t ,warning2 w,windturbine b WHERE
  529. cast(t.warningid as integer ) =w.ednavalue and t.windturbineid=b.id and b.modelid=w.modelid
  530. and t.stopTime>=#{beginDate}
  531. and t.stopTime&lt;=#{endDate}
  532. and t.statusCode=2
  533. <if test="type != null">
  534. and t.statusCode = #{type,jdbcType=VARCHAR}
  535. </if>
  536. <if test="wtId != null">
  537. and t.windTurbineId = #{wtId,jdbcType=VARCHAR}
  538. </if>
  539. <if test="wpId != null">
  540. and t.windPowerStationId = #{wpId,jdbcType=VARCHAR}
  541. </if>
  542. order by t.windturbineid,t.starttime desc
  543. </select>
  544. </mapper>