GoafSensorDataMapper.xml 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  3. "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  4. <mapper namespace="com.zhyc.xps.goaf.mapper.GoafSensorDataMapper">
  5. <resultMap id="GoafSensorDataMapper" type="com.zhyc.xps.goaf.entity.GoafSensorData">
  6. <id column="goaf_data_id" property="goafDataId" jdbcType="BIGINT"/>
  7. <result column="oc_id" property="ocId" jdbcType="BIGINT"/>
  8. <result column="goaf_sensor_id" property="goafSensorId" jdbcType="BIGINT"/>
  9. <result column="goaf_sensor_name" property="goafSensorName" jdbcType="VARCHAR"/>
  10. <result column="goaf_dev_name" property="goafDevName" jdbcType="VARCHAR"/>
  11. <result column="goaf_dev_typename" property="goafDevTypename" jdbcType="VARCHAR"/>
  12. <result column="frequency_x" property="frequencyX" jdbcType="BIGINT"/>
  13. <result column="frequency_y" property="frequencyY" jdbcType="BIGINT"/>
  14. <result column="frequency_z" property="frequencyZ" jdbcType="BIGINT"/>
  15. <result column="acc_x" property="accX" jdbcType="BIGINT"/>
  16. <result column="acc_y" property="accY" jdbcType="BIGINT"/>
  17. <result column="acc_z" property="accZ" jdbcType="BIGINT"/>
  18. <result column="vel_x" property="velX" jdbcType="BIGINT"/>
  19. <result column="vel_y" property="velY" jdbcType="BIGINT"/>
  20. <result column="vel_z" property="velZ" jdbcType="BIGINT"/>
  21. <result column="dis_x" property="disX" jdbcType="BIGINT"/>
  22. <result column="dis_y" property="disY" jdbcType="BIGINT"/>
  23. <result column="dis_z" property="disZ" jdbcType="BIGINT"/>
  24. <result column="sensor_temperature" property="sensorTemperature" jdbcType="BIGINT"/>
  25. <result column="ang_x" property="angX" jdbcType="BIGINT"/>
  26. <result column="ang_y" property="angY" jdbcType="BIGINT"/>
  27. <result column="ang_z" property="angZ" jdbcType="BIGINT"/>
  28. <result column="f_alarm_acc_x" property="fAlarmAccX" jdbcType="BIGINT"/>
  29. <result column="f_alarm_acc_y" property="fAlarmAccY" jdbcType="BIGINT"/>
  30. <result column="f_alarm_acc_z" property="fAlarmAccZ" jdbcType="BIGINT"/>
  31. <result column="f_alarm_vel_x" property="fAlarmVelX" jdbcType="BIGINT"/>
  32. <result column="f_alarm_vel_y" property="fAlarmVelY" jdbcType="BIGINT"/>
  33. <result column="f_alarm_vel_z" property="fAlarmVelZ" jdbcType="BIGINT"/>
  34. <result column="f_alarm_dis_x" property="fAlarmDisX" jdbcType="BIGINT"/>
  35. <result column="f_alarm_dis_y" property="fAlarmDisY" jdbcType="BIGINT"/>
  36. <result column="f_alarm_dis_z" property="fAlarmDisZ" jdbcType="BIGINT"/>
  37. <result column="f_alarm_temperature" property="fAlarmTemperature" jdbcType="BIGINT"/>
  38. <result column="td_wave_value_x" property="tdWaveValueX" jdbcType="VARCHAR"/>
  39. <result column="td_wave_value_y" property="tdWaveValueY" jdbcType="VARCHAR"/>
  40. <result column="td_wave_value_z" property="tdWaveValueZ" jdbcType="VARCHAR"/>
  41. <result column="goaf_datareport_time" property="goafDatareportTime" jdbcType="TIMESTAMP"/>
  42. </resultMap>
  43. <resultMap id="GoafSensorDataDtoMapper" type="com.zhyc.xps.goaf.dto.GoafSensorDataDto">
  44. <id column="goaf_data_id" property="goafDataId" jdbcType="BIGINT"/>
  45. <result column="oc_id" property="ocId" jdbcType="BIGINT"/>
  46. <result column="goaf_sensor_id" property="goafSensorId" jdbcType="BIGINT"/>
  47. <result column="goaf_sensor_name" property="goafSensorName" jdbcType="VARCHAR"/>
  48. <result column="goaf_dev_name" property="goafDevName" jdbcType="VARCHAR"/>
  49. <result column="goaf_dev_typename" property="goafDevTypename" jdbcType="VARCHAR"/>
  50. <result column="frequency_x" property="frequencyX" jdbcType="BIGINT"/>
  51. <result column="frequency_y" property="frequencyY" jdbcType="BIGINT"/>
  52. <result column="frequency_z" property="frequencyZ" jdbcType="BIGINT"/>
  53. <result column="acc_x" property="accX" jdbcType="BIGINT"/>
  54. <result column="acc_y" property="accY" jdbcType="BIGINT"/>
  55. <result column="acc_z" property="accZ" jdbcType="BIGINT"/>
  56. <result column="vel_x" property="velX" jdbcType="BIGINT"/>
  57. <result column="vel_y" property="velY" jdbcType="BIGINT"/>
  58. <result column="vel_z" property="velZ" jdbcType="BIGINT"/>
  59. <result column="dis_x" property="disX" jdbcType="BIGINT"/>
  60. <result column="dis_y" property="disY" jdbcType="BIGINT"/>
  61. <result column="dis_z" property="disZ" jdbcType="BIGINT"/>
  62. <result column="sensor_temperature" property="sensorTemperature" jdbcType="BIGINT"/>
  63. <result column="ang_x" property="angX" jdbcType="BIGINT"/>
  64. <result column="ang_y" property="angY" jdbcType="BIGINT"/>
  65. <result column="ang_z" property="angZ" jdbcType="BIGINT"/>
  66. <result column="f_alarm_acc_x" property="fAlarmAccX" jdbcType="BIGINT"/>
  67. <result column="f_alarm_acc_y" property="fAlarmAccY" jdbcType="BIGINT"/>
  68. <result column="f_alarm_acc_z" property="fAlarmAccZ" jdbcType="BIGINT"/>
  69. <result column="f_alarm_vel_x" property="fAlarmVelX" jdbcType="BIGINT"/>
  70. <result column="f_alarm_vel_y" property="fAlarmVelY" jdbcType="BIGINT"/>
  71. <result column="f_alarm_vel_z" property="fAlarmVelZ" jdbcType="BIGINT"/>
  72. <result column="f_alarm_dis_x" property="fAlarmDisX" jdbcType="BIGINT"/>
  73. <result column="f_alarm_dis_y" property="fAlarmDisY" jdbcType="BIGINT"/>
  74. <result column="f_alarm_dis_z" property="fAlarmDisZ" jdbcType="BIGINT"/>
  75. <result column="f_alarm_temperature" property="fAlarmTemperature" jdbcType="BIGINT"/>
  76. <result column="td_wave_value_x" property="tdWaveValueX" jdbcType="VARCHAR"/>
  77. <result column="td_wave_value_y" property="tdWaveValueY" jdbcType="VARCHAR"/>
  78. <result column="td_wave_value_z" property="tdWaveValueZ" jdbcType="VARCHAR"/>
  79. <result column="goaf_datareport_time" property="goafDatareportTime" jdbcType="TIMESTAMP"/>
  80. <result column="goaf_sensor_alarm_level" property="goafSensorAlarmLevel" jdbcType="BIGINT"/>
  81. <result column="goaf_sensor_alarm_type" property="goafSensorAlarmType" jdbcType="VARCHAR"/>
  82. </resultMap>
  83. <select id="getByList" parameterType="java.util.Map" resultMap="GoafSensorDataMapper">
  84. SELECT *
  85. FROM goaf_sensordata
  86. WHERE oc_id = #{ocId ,jdbcType=BIGINT}
  87. <if test="goafSensorId !=null">
  88. AND goaf_sensor_id = #{goafSensorId ,jdbcType=BIGINT}
  89. </if>
  90. <if test="goafDevName !=null and goafDevName !=''">
  91. AND goaf_dev_name = #{goafDevName ,jdbcType=VARCHAR}
  92. </if>
  93. <if test="startDate != null and startDate !='' and endDate != null and endDate != ''">
  94. AND goaf_datareport_time BETWEEN #{startDate} AND #{endDate}
  95. </if>
  96. ORDER BY goaf_datareport_time DESC
  97. </select>
  98. <!-- <select id="getByNew" parameterType="java.util.Map" resultMap="GoafSensorDataMapper">-->
  99. <!-- SELECT *-->
  100. <!-- FROM goaf_sensordata-->
  101. <!-- WHERE oc_id = #{ocId ,jdbcType=BIGINT}-->
  102. <!-- <if test="goafSensorId !=null">-->
  103. <!-- AND goaf_sensor_id = #{goafSensorId ,jdbcType=BIGINT}-->
  104. <!-- </if>-->
  105. <!-- ORDER BY goaf_datareport_time DESC-->
  106. <!-- LIMIT 1-->
  107. <!-- </select>-->
  108. <select id="getByNew" parameterType="java.util.Map" resultMap="GoafSensorDataMapper">
  109. SELECT *
  110. FROM goaf_sensordata_new
  111. WHERE oc_id = #{ocId ,jdbcType=BIGINT}
  112. <if test="goafSensorId !=null">
  113. AND goaf_sensor_id = #{goafSensorId ,jdbcType=BIGINT}
  114. </if>
  115. </select>
  116. <!-- <select id="getByNewWihoutWave" parameterType="java.util.Map" resultMap="GoafSensorDataDtoMapper">-->
  117. <!-- SELECT A.goaf_data_id, A.oc_id, A.goaf_sensor_id, A.goaf_sensor_name, A.frequency_x, A.frequency_y, A.frequency_z,-->
  118. <!-- A.acc_x, A.acc_y, A.acc_z, A.vel_x, A.vel_y, A.vel_z, A.dis_x, A.dis_y, A.dis_z, A.sensor_temperature,-->
  119. <!-- A.ang_x, A.ang_y, A.ang_z, A.f_alarm_acc_x, A.f_alarm_acc_y, A.f_alarm_acc_z,-->
  120. <!-- A.f_alarm_vel_x, A.f_alarm_vel_y, A.f_alarm_vel_z, A.f_alarm_dis_x, A.f_alarm_dis_y, A.f_alarm_dis_z,-->
  121. <!-- A.f_alarm_temperature, A.goaf_datareport_time,B.goaf_sensor_alarm_level,B.goaf_sensor_alarm_type-->
  122. <!-- FROM goaf_sensordata AS A-->
  123. <!-- LEFT JOIN goaf_sensoralarm AS B ON A.goaf_data_id = B.goaf_data_id-->
  124. <!-- WHERE A.oc_id = #{ocId ,jdbcType=BIGINT}-->
  125. <!-- <if test="goafSensorId !=null">-->
  126. <!-- AND A.goaf_sensor_id = #{goafSensorId ,jdbcType=BIGINT}-->
  127. <!-- </if>-->
  128. <!-- ORDER BY A.goaf_datareport_time DESC-->
  129. <!-- LIMIT 1-->
  130. <!-- </select>-->
  131. <select id="getByNewWihoutWave" parameterType="java.util.Map" resultMap="GoafSensorDataDtoMapper">
  132. SELECT A.goaf_data_id, A.oc_id, A.goaf_sensor_id, A.goaf_sensor_name, A.frequency_x, A.frequency_y, A.frequency_z,
  133. A.acc_x, A.acc_y, A.acc_z, A.vel_x, A.vel_y, A.vel_z, A.dis_x, A.dis_y, A.dis_z, A.sensor_temperature,
  134. A.ang_x, A.ang_y, A.ang_z, A.f_alarm_acc_x, A.f_alarm_acc_y, A.f_alarm_acc_z,
  135. A.f_alarm_vel_x, A.f_alarm_vel_y, A.f_alarm_vel_z, A.f_alarm_dis_x, A.f_alarm_dis_y, A.f_alarm_dis_z,
  136. A.f_alarm_temperature, A.goaf_datareport_time,B.goaf_sensor_alarm_level,B.goaf_sensor_alarm_type
  137. FROM goaf_sensordata_new AS A
  138. LEFT JOIN goaf_sensoralarm AS B ON A.goaf_data_id = B.goaf_data_id
  139. WHERE A.oc_id = #{ocId ,jdbcType=BIGINT}
  140. <if test="goafSensorId !=null">
  141. AND A.goaf_sensor_id = #{goafSensorId ,jdbcType=BIGINT}
  142. </if>
  143. </select>
  144. <select id="getWavebyDataId" parameterType="java.util.Map" resultMap="GoafSensorDataMapper">
  145. SELECT td_wave_value_x, td_wave_value_y, td_wave_value_z
  146. FROM goaf_sensordata
  147. WHERE goaf_data_id = #{goafDataId ,jdbcType=BIGINT}
  148. </select>
  149. <!--分页查询-->
  150. <select id="getByPage" parameterType="java.util.Map" resultMap="GoafSensorDataMapper">
  151. SELECT *
  152. FROM goaf_sensordata
  153. WHERE oc_id = #{ocId ,jdbcType=BIGINT}
  154. <if test="goafSensorId !=null">
  155. AND goaf_sensor_id = #{goafSensorId ,jdbcType=BIGINT}
  156. </if>
  157. <if test="goafDevName !=null and goafDevName !=''">
  158. AND goaf_dev_name = #{goafDevName ,jdbcType=VARCHAR}
  159. </if>
  160. <if test="startDate != null and startDate !='' and endDate != null and endDate != ''">
  161. AND goaf_datareport_time BETWEEN #{startDate} AND #{endDate}
  162. </if>
  163. ORDER BY goaf_datareport_time DESC
  164. </select>
  165. <insert id="create" parameterType="com.zhyc.xps.goaf.entity.GoafSensorData">
  166. insert into goaf_sensordata
  167. <trim prefix="(" suffix=")" suffixOverrides=",">
  168. <if test="goafDataId != null">
  169. goaf_data_id,
  170. </if>
  171. <if test="ocId != null">
  172. oc_id,
  173. </if>
  174. <if test="goafSensorId != null">
  175. goaf_sensor_id,
  176. </if>
  177. <if test="goafSensorName != null and goafSensorName != ''">
  178. goaf_sensor_name,
  179. </if>
  180. <if test="goafDevName != null and goafDevName != ''">
  181. goaf_dev_name,
  182. </if>
  183. <if test="goafDevTypename != null and goafDevTypename != ''">
  184. goaf_dev_typename,
  185. </if>
  186. <if test="frequencyX != null">
  187. frequency_x,
  188. </if>
  189. <if test="frequencyY != null">
  190. frequency_y,
  191. </if>
  192. <if test="frequencyZ != null">
  193. frequency_z,
  194. </if>
  195. <if test="accX != null">
  196. acc_x,
  197. </if>
  198. <if test="accY != null">
  199. acc_y,
  200. </if>
  201. <if test="accZ != null">
  202. acc_z,
  203. </if>
  204. <if test="velX != null">
  205. vel_x,
  206. </if>
  207. <if test="velY != null">
  208. vel_y,
  209. </if>
  210. <if test="velZ != null">
  211. vel_z,
  212. </if>
  213. <if test="disX != null">
  214. dis_x,
  215. </if>
  216. <if test="disY != null">
  217. dis_y,
  218. </if>
  219. <if test="disZ != null">
  220. dis_z,
  221. </if>
  222. <if test="sensorTemperature != null">
  223. sensor_temperature,
  224. </if>
  225. <if test="angX != null">
  226. ang_x,
  227. </if>
  228. <if test="angY != null">
  229. ang_y,
  230. </if>
  231. <if test="angZ != null">
  232. ang_z,
  233. </if>
  234. <if test="fAlarmAccX != null">
  235. f_alarm_acc_x,
  236. </if>
  237. <if test="fAlarmAccY != null">
  238. f_alarm_acc_y,
  239. </if>
  240. <if test="fAlarmAccZ != null">
  241. f_alarm_acc_z,
  242. </if>
  243. <if test="fAlarmVelX != null">
  244. f_alarm_vel_x,
  245. </if>
  246. <if test="fAlarmVelY != null">
  247. f_alarm_vel_y,
  248. </if>
  249. <if test="fAlarmVelZ != null">
  250. f_alarm_vel_z,
  251. </if>
  252. <if test="fAlarmDisX != null">
  253. f_alarm_dis_x,
  254. </if>
  255. <if test="fAlarmDisY != null">
  256. f_alarm_dis_y,
  257. </if>
  258. <if test="fAlarmDisZ != null">
  259. f_alarm_dis_z,
  260. </if>
  261. <if test="fAlarmTemperature != null">
  262. f_alarm_temperature,
  263. </if>
  264. <if test="tdWaveValueX != null and tdWaveValueX != ''">
  265. td_wave_value_x,
  266. </if>
  267. <if test="tdWaveValueY != null and tdWaveValueY != ''">
  268. td_wave_value_y,
  269. </if>
  270. <if test="tdWaveValueZ != null and tdWaveValueZ != ''">
  271. td_wave_value_z,
  272. </if>
  273. <if test="goafDatareportTime != null">
  274. goaf_datareport_time,
  275. </if>
  276. </trim>
  277. <trim prefix="values (" suffix=")" suffixOverrides=",">
  278. <if test="goafDataId != null">
  279. #{goafDataId, jdbcType=BIGINT},
  280. </if>
  281. <if test="ocId != null">
  282. #{ocId, jdbcType=BIGINT},
  283. </if>
  284. <if test="goafSensorId != null">
  285. #{goafSensorId, jdbcType=BIGINT},
  286. </if>
  287. <if test="goafSensorName != null and goafSensorName != ''">
  288. #{goafSensorName, jdbcType=VARCHAR},
  289. </if>
  290. <if test="goafDevName != null and goafDevName != ''">
  291. #{goafDevName, jdbcType=VARCHAR},
  292. </if>
  293. <if test="goafDevTypename != null and goafDevTypename != ''">
  294. #{goafDevTypename},
  295. </if>
  296. <if test="frequencyX != null">
  297. #{frequencyX, jdbcType=BIGINT},
  298. </if>
  299. <if test="frequencyY != null">
  300. #{frequencyY, jdbcType=BIGINT},
  301. </if>
  302. <if test="frequencyZ != null">
  303. #{frequencyZ, jdbcType=BIGINT},
  304. </if>
  305. <if test="accX != null">
  306. #{accX, jdbcType=BIGINT},
  307. </if>
  308. <if test="accY != null">
  309. #{accY, jdbcType=BIGINT},
  310. </if>
  311. <if test="accZ != null">
  312. #{accZ, jdbcType=BIGINT},
  313. </if>
  314. <if test="velX != null">
  315. #{velX, jdbcType=BIGINT},
  316. </if>
  317. <if test="velY != null">
  318. #{velY, jdbcType=BIGINT},
  319. </if>
  320. <if test="velZ != null">
  321. #{velZ, jdbcType=BIGINT},
  322. </if>
  323. <if test="disX != null">
  324. #{disX, jdbcType=BIGINT},
  325. </if>
  326. <if test="disY != null">
  327. #{disY, jdbcType=BIGINT},
  328. </if>
  329. <if test="disZ != null">
  330. #{disZ, jdbcType=BIGINT},
  331. </if>
  332. <if test="sensorTemperature != null">
  333. #{sensorTemperature, jdbcType=BIGINT},
  334. </if>
  335. <if test="angX != null">
  336. #{angX, jdbcType=BIGINT},
  337. </if>
  338. <if test="angY != null">
  339. #{angY, jdbcType=BIGINT},
  340. </if>
  341. <if test="angZ != null">
  342. #{angZ, jdbcType=BIGINT},
  343. </if>
  344. <if test="fAlarmAccX != null">
  345. #{fAlarmAccX, jdbcType=BIGINT},
  346. </if>
  347. <if test="fAlarmAccY != null">
  348. #{fAlarmAccY, jdbcType=BIGINT},
  349. </if>
  350. <if test="fAlarmAccZ != null">
  351. #{fAlarmAccZ, jdbcType=BIGINT},
  352. </if>
  353. <if test="fAlarmVelX != null">
  354. #{fAlarmVelX, jdbcType=BIGINT},
  355. </if>
  356. <if test="fAlarmVelY != null">
  357. #{fAlarmVelY, jdbcType=BIGINT},
  358. </if>
  359. <if test="fAlarmVelZ != null">
  360. #{fAlarmVelZ, jdbcType=BIGINT},
  361. </if>
  362. <if test="fAlarmDisX != null">
  363. #{fAlarmDisX, jdbcType=BIGINT},
  364. </if>
  365. <if test="fAlarmDisY != null">
  366. #{fAlarmDisY, jdbcType=BIGINT},
  367. </if>
  368. <if test="fAlarmDisZ != null">
  369. #{fAlarmDisZ, jdbcType=BIGINT},
  370. </if>
  371. <if test="fAlarmTemperature != null">
  372. #{fAlarmTemperature, jdbcType=BIGINT},
  373. </if>
  374. <if test="tdWaveValueX != null and tdWaveValueX != ''">
  375. #{tdWaveValueX, jdbcType=VARCHAR},
  376. </if>
  377. <if test="tdWaveValueY != null and tdWaveValueY != ''">
  378. #{tdWaveValueY, jdbcType=VARCHAR},
  379. </if>
  380. <if test="tdWaveValueZ != null and tdWaveValueZ != ''">
  381. #{tdWaveValueZ, jdbcType=VARCHAR},
  382. </if>
  383. <if test="goafDatareportTime != null">
  384. #{goafDatareportTime, jdbcType=TIMESTAMP},
  385. </if>
  386. </trim>
  387. </insert>
  388. <insert id="createLatestData" parameterType="com.zhyc.xps.goaf.entity.GoafSensorData">
  389. insert into goaf_sensordata_new
  390. <trim prefix="(" suffix=")" suffixOverrides=",">
  391. <if test="goafDataId != null">
  392. goaf_data_id,
  393. </if>
  394. <if test="ocId != null">
  395. oc_id,
  396. </if>
  397. <if test="goafSensorId != null">
  398. goaf_sensor_id,
  399. </if>
  400. <if test="goafSensorName != null and goafSensorName != ''">
  401. goaf_sensor_name,
  402. </if>
  403. <if test="goafDevName != null and goafDevName != ''">
  404. goaf_dev_name,
  405. </if>
  406. <if test="goafDevTypename != null and goafDevTypename != ''">
  407. goaf_dev_typename,
  408. </if>
  409. <if test="frequencyX != null">
  410. frequency_x,
  411. </if>
  412. <if test="frequencyY != null">
  413. frequency_y,
  414. </if>
  415. <if test="frequencyZ != null">
  416. frequency_z,
  417. </if>
  418. <if test="accX != null">
  419. acc_x,
  420. </if>
  421. <if test="accY != null">
  422. acc_y,
  423. </if>
  424. <if test="accZ != null">
  425. acc_z,
  426. </if>
  427. <if test="velX != null">
  428. vel_x,
  429. </if>
  430. <if test="velY != null">
  431. vel_y,
  432. </if>
  433. <if test="velZ != null">
  434. vel_z,
  435. </if>
  436. <if test="disX != null">
  437. dis_x,
  438. </if>
  439. <if test="disY != null">
  440. dis_y,
  441. </if>
  442. <if test="disZ != null">
  443. dis_z,
  444. </if>
  445. <if test="sensorTemperature != null">
  446. sensor_temperature,
  447. </if>
  448. <if test="angX != null">
  449. ang_x,
  450. </if>
  451. <if test="angY != null">
  452. ang_y,
  453. </if>
  454. <if test="angZ != null">
  455. ang_z,
  456. </if>
  457. <if test="fAlarmAccX != null">
  458. f_alarm_acc_x,
  459. </if>
  460. <if test="fAlarmAccY != null">
  461. f_alarm_acc_y,
  462. </if>
  463. <if test="fAlarmAccZ != null">
  464. f_alarm_acc_z,
  465. </if>
  466. <if test="fAlarmVelX != null">
  467. f_alarm_vel_x,
  468. </if>
  469. <if test="fAlarmVelY != null">
  470. f_alarm_vel_y,
  471. </if>
  472. <if test="fAlarmVelZ != null">
  473. f_alarm_vel_z,
  474. </if>
  475. <if test="fAlarmDisX != null">
  476. f_alarm_dis_x,
  477. </if>
  478. <if test="fAlarmDisY != null">
  479. f_alarm_dis_y,
  480. </if>
  481. <if test="fAlarmDisZ != null">
  482. f_alarm_dis_z,
  483. </if>
  484. <if test="fAlarmTemperature != null">
  485. f_alarm_temperature,
  486. </if>
  487. <if test="tdWaveValueX != null and tdWaveValueX != ''">
  488. td_wave_value_x,
  489. </if>
  490. <if test="tdWaveValueY != null and tdWaveValueY != ''">
  491. td_wave_value_y,
  492. </if>
  493. <if test="tdWaveValueZ != null and tdWaveValueZ != ''">
  494. td_wave_value_z,
  495. </if>
  496. <if test="goafDatareportTime != null">
  497. goaf_datareport_time,
  498. </if>
  499. </trim>
  500. <trim prefix="values (" suffix=")" suffixOverrides=",">
  501. <if test="goafDataId != null">
  502. #{goafDataId, jdbcType=BIGINT},
  503. </if>
  504. <if test="ocId != null">
  505. #{ocId, jdbcType=BIGINT},
  506. </if>
  507. <if test="goafSensorId != null">
  508. #{goafSensorId, jdbcType=BIGINT},
  509. </if>
  510. <if test="goafSensorName != null and goafSensorName != ''">
  511. #{goafSensorName, jdbcType=VARCHAR},
  512. </if>
  513. <if test="goafDevName != null and goafDevName != ''">
  514. #{goafDevName, jdbcType=VARCHAR},
  515. </if>
  516. <if test="goafDevTypename != null and goafDevTypename != ''">
  517. #{goafDevTypename},
  518. </if>
  519. <if test="frequencyX != null">
  520. #{frequencyX, jdbcType=BIGINT},
  521. </if>
  522. <if test="frequencyY != null">
  523. #{frequencyY, jdbcType=BIGINT},
  524. </if>
  525. <if test="frequencyZ != null">
  526. #{frequencyZ, jdbcType=BIGINT},
  527. </if>
  528. <if test="accX != null">
  529. #{accX, jdbcType=BIGINT},
  530. </if>
  531. <if test="accY != null">
  532. #{accY, jdbcType=BIGINT},
  533. </if>
  534. <if test="accZ != null">
  535. #{accZ, jdbcType=BIGINT},
  536. </if>
  537. <if test="velX != null">
  538. #{velX, jdbcType=BIGINT},
  539. </if>
  540. <if test="velY != null">
  541. #{velY, jdbcType=BIGINT},
  542. </if>
  543. <if test="velZ != null">
  544. #{velZ, jdbcType=BIGINT},
  545. </if>
  546. <if test="disX != null">
  547. #{disX, jdbcType=BIGINT},
  548. </if>
  549. <if test="disY != null">
  550. #{disY, jdbcType=BIGINT},
  551. </if>
  552. <if test="disZ != null">
  553. #{disZ, jdbcType=BIGINT},
  554. </if>
  555. <if test="sensorTemperature != null">
  556. #{sensorTemperature, jdbcType=BIGINT},
  557. </if>
  558. <if test="angX != null">
  559. #{angX, jdbcType=BIGINT},
  560. </if>
  561. <if test="angY != null">
  562. #{angY, jdbcType=BIGINT},
  563. </if>
  564. <if test="angZ != null">
  565. #{angZ, jdbcType=BIGINT},
  566. </if>
  567. <if test="fAlarmAccX != null">
  568. #{fAlarmAccX, jdbcType=BIGINT},
  569. </if>
  570. <if test="fAlarmAccY != null">
  571. #{fAlarmAccY, jdbcType=BIGINT},
  572. </if>
  573. <if test="fAlarmAccZ != null">
  574. #{fAlarmAccZ, jdbcType=BIGINT},
  575. </if>
  576. <if test="fAlarmVelX != null">
  577. #{fAlarmVelX, jdbcType=BIGINT},
  578. </if>
  579. <if test="fAlarmVelY != null">
  580. #{fAlarmVelY, jdbcType=BIGINT},
  581. </if>
  582. <if test="fAlarmVelZ != null">
  583. #{fAlarmVelZ, jdbcType=BIGINT},
  584. </if>
  585. <if test="fAlarmDisX != null">
  586. #{fAlarmDisX, jdbcType=BIGINT},
  587. </if>
  588. <if test="fAlarmDisY != null">
  589. #{fAlarmDisY, jdbcType=BIGINT},
  590. </if>
  591. <if test="fAlarmDisZ != null">
  592. #{fAlarmDisZ, jdbcType=BIGINT},
  593. </if>
  594. <if test="fAlarmTemperature != null">
  595. #{fAlarmTemperature, jdbcType=BIGINT},
  596. </if>
  597. <if test="tdWaveValueX != null and tdWaveValueX != ''">
  598. #{tdWaveValueX, jdbcType=VARCHAR},
  599. </if>
  600. <if test="tdWaveValueY != null and tdWaveValueY != ''">
  601. #{tdWaveValueY, jdbcType=VARCHAR},
  602. </if>
  603. <if test="tdWaveValueZ != null and tdWaveValueZ != ''">
  604. #{tdWaveValueZ, jdbcType=VARCHAR},
  605. </if>
  606. <if test="goafDatareportTime != null">
  607. #{goafDatareportTime, jdbcType=TIMESTAMP},
  608. </if>
  609. </trim>
  610. </insert>
  611. <update id="updateLatestData" parameterType="com.zhyc.xps.goaf.entity.GoafSensorData">
  612. UPDATE goaf_sensordata_new
  613. <trim suffixOverrides=",">
  614. <set>
  615. <if test="goafDataId != null">
  616. goaf_data_id = #{goafDataId, jdbcType=BIGINT},
  617. </if>
  618. <if test="frequencyX != null">
  619. frequency_x = #{frequencyX, jdbcType=BIGINT},
  620. </if>
  621. <if test="frequencyY != null">
  622. frequency_y = #{frequencyY, jdbcType=BIGINT},
  623. </if>
  624. <if test="frequencyZ != null">
  625. frequency_z = #{frequencyZ, jdbcType=BIGINT},
  626. </if>
  627. <if test="accX != null">
  628. acc_x = #{accX, jdbcType=BIGINT},
  629. </if>
  630. <if test="accY != null">
  631. acc_y = #{accY, jdbcType=BIGINT},
  632. </if>
  633. <if test="accZ != null">
  634. acc_z = #{accZ, jdbcType=BIGINT},
  635. </if>
  636. <if test="velX != null">
  637. vel_x = #{velX, jdbcType=BIGINT},
  638. </if>
  639. <if test="velY != null">
  640. vel_y = #{velY, jdbcType=BIGINT},
  641. </if>
  642. <if test="velZ != null">
  643. vel_z = #{velZ, jdbcType=BIGINT},
  644. </if>
  645. <if test="disX != null">
  646. dis_x = #{disX, jdbcType=BIGINT},
  647. </if>
  648. <if test="disY != null">
  649. dis_y = #{disY, jdbcType=BIGINT},
  650. </if>
  651. <if test="disZ != null">
  652. dis_z = #{disZ, jdbcType=BIGINT},
  653. </if>
  654. <if test="sensorTemperature != null">
  655. sensor_temperature = #{sensorTemperature, jdbcType=BIGINT},
  656. </if>
  657. <if test="angX != null">
  658. ang_x = #{angX, jdbcType=BIGINT},
  659. </if>
  660. <if test="angY != null">
  661. ang_y = #{angY, jdbcType=BIGINT},
  662. </if>
  663. <if test="angZ != null">
  664. ang_z = #{angZ, jdbcType=BIGINT},
  665. </if>
  666. <if test="fAlarmAccX != null">
  667. f_alarm_acc_x = #{fAlarmAccX, jdbcType=BIGINT},
  668. </if>
  669. <if test="fAlarmAccY != null">
  670. f_alarm_acc_y = #{fAlarmAccY, jdbcType=BIGINT},
  671. </if>
  672. <if test="fAlarmAccZ != null">
  673. f_alarm_acc_z = #{fAlarmAccZ, jdbcType=BIGINT},
  674. </if>
  675. <if test="fAlarmVelX != null">
  676. f_alarm_vel_x = #{fAlarmVelX, jdbcType=BIGINT},
  677. </if>
  678. <if test="fAlarmVelY != null">
  679. f_alarm_vel_y = #{fAlarmVelY, jdbcType=BIGINT},
  680. </if>
  681. <if test="fAlarmVelZ != null">
  682. f_alarm_vel_z = #{fAlarmVelZ, jdbcType=BIGINT},
  683. </if>
  684. <if test="fAlarmDisX != null">
  685. f_alarm_dis_x = #{fAlarmDisX, jdbcType=BIGINT},
  686. </if>
  687. <if test="fAlarmDisY != null">
  688. f_alarm_dis_y = #{fAlarmDisY, jdbcType=BIGINT},
  689. </if>
  690. <if test="fAlarmDisZ != null">
  691. f_alarm_dis_z = #{fAlarmDisZ, jdbcType=BIGINT},
  692. </if>
  693. <if test="fAlarmTemperature != null">
  694. f_alarm_temperature = #{fAlarmTemperature, jdbcType=BIGINT},
  695. </if>
  696. <if test="tdWaveValueX != null and tdWaveValueX != ''">
  697. td_wave_value_x = #{tdWaveValueX, jdbcType=VARCHAR},
  698. </if>
  699. <if test="tdWaveValueY != null and tdWaveValueY != ''">
  700. td_wave_value_y = #{tdWaveValueY, jdbcType=VARCHAR},
  701. </if>
  702. <if test="tdWaveValueZ != null and tdWaveValueZ != ''">
  703. td_wave_value_z = #{tdWaveValueZ, jdbcType=VARCHAR},
  704. </if>
  705. <if test="goafDatareportTime != null">
  706. goaf_datareport_time = #{goafDatareportTime, jdbcType=TIMESTAMP},
  707. </if>
  708. </set>
  709. </trim>
  710. WHERE goaf_sensor_id = #{goafSensorId ,jdbcType=BIGINT}
  711. </update>
  712. <select id="getLatestDatabySensorId" parameterType="java.util.Map" resultMap="GoafSensorDataMapper">
  713. SELECT *
  714. FROM goaf_sensordata_new
  715. WHERE goaf_sensor_id = #{goafSensorId ,jdbcType=BIGINT}
  716. </select>
  717. <select id="getLatestDatabyList" resultMap="GoafSensorDataMapper">
  718. SELECT *
  719. FROM goaf_sensordata_new
  720. </select>
  721. </mapper>