TCm0348Mapper.xml 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977
  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.steerinfo.ems.tcm0348.mapper.TCm0348Mapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.ems.tcm0348.model.TCm0348">
  5. <id column="RECORDID" jdbcType="VARCHAR" property="recordid" />
  6. <result column="ANALYST" jdbcType="VARCHAR" property="analyst" />
  7. <result column="DATADATE" jdbcType="TIMESTAMP" property="datadate" />
  8. <result column="DATASTATE" jdbcType="VARCHAR" property="datastate" />
  9. <result column="MONITORDATE" jdbcType="VARCHAR" property="monitordate" />
  10. <result column="MONITORINGVALUE" jdbcType="DECIMAL" property="monitoringvalue" />
  11. <result column="NOTE" jdbcType="VARCHAR" property="note" />
  12. <result column="PLANID" jdbcType="VARCHAR" property="planid" />
  13. <result column="POWERDETECDEPARTMENT" jdbcType="VARCHAR" property="powerdetecdepartment" />
  14. <result column="POWERMONITORNAME" jdbcType="VARCHAR" property="powermonitorname" />
  15. <result column="POWERSYSTEMNAME" jdbcType="VARCHAR" property="powersystemname" />
  16. <result column="UNIT" jdbcType="VARCHAR" property="unit" />
  17. <result column="SITEM" jdbcType="VARCHAR" property="sitem" />
  18. <result column="BATCHNO" jdbcType="VARCHAR" property="batchno" />
  19. <result column="TIMEGRANID" jdbcType="VARCHAR" property="timegranid" />
  20. <result column="ITEMID" jdbcType="VARCHAR" property="itemid" />
  21. <result column="INSERT_TIME" jdbcType="VARCHAR" property="insertTime" />
  22. <result column="QTYPE" jdbcType="VARCHAR" property="qtype" />
  23. <result column="BANBIE" jdbcType="VARCHAR" property="banbie" />
  24. <result column="BANCI" jdbcType="VARCHAR" property="banci" />
  25. <result column="LSH" jdbcType="VARCHAR" property="lsh" />
  26. <result column="TOTALNUM" jdbcType="VARCHAR" property="totalnum" />
  27. <result column="PASSNUM" jdbcType="VARCHAR" property="passnum" />
  28. <result column="PASSRATE" jdbcType="VARCHAR" property="passrate" />
  29. </resultMap>
  30. <!-- 动力监测计划制定界面修改 -->
  31. <update id="updatefromother" parameterType="com.steerinfo.ems.tcm0348.model.TCm0348">
  32. update T_CM_0348
  33. <set>
  34. <if test="analyst != null">
  35. ANALYST = #{analyst,jdbcType=VARCHAR},
  36. </if>
  37. <if test="datadate != null">
  38. DATADATE = #{datadate,jdbcType=TIMESTAMP},
  39. </if>
  40. <if test="datastate != null">
  41. DATASTATE = #{datastate,jdbcType=VARCHAR},
  42. </if>
  43. <if test="monitordate != null">
  44. MONITORDATE = #{monitordate,jdbcType=VARCHAR},
  45. </if>
  46. <if test="monitoringvalue != null">
  47. MONITORINGVALUE = #{monitoringvalue,jdbcType=DECIMAL},
  48. </if>
  49. <if test="note != null">
  50. NOTE = #{note,jdbcType=VARCHAR},
  51. </if>
  52. </set>
  53. where RECORDID = #{recordid,jdbcType=VARCHAR}
  54. </update>
  55. <!-- 动力监测日月数据录入界面修改 -->
  56. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.ems.tcm0348.model.TCm0348">
  57. update T_CM_0348
  58. <set>
  59. <if test="analyst != null">
  60. ANALYST = #{analyst,jdbcType=VARCHAR},
  61. </if>
  62. <if test="datadate != null">
  63. DATADATE = #{datadate,jdbcType=TIMESTAMP},
  64. </if>
  65. <if test="datastate != null">
  66. DATASTATE = #{datastate,jdbcType=VARCHAR},
  67. </if>
  68. <if test="monitordate != null">
  69. MONITORDATE = #{monitordate,jdbcType=VARCHAR},
  70. </if>
  71. <if test="monitoringvalue != null">
  72. MONITORINGVALUE = #{monitoringvalue,jdbcType=DECIMAL},
  73. </if>
  74. <if test="note != null">
  75. NOTE = #{note,jdbcType=VARCHAR},
  76. </if>
  77. </set>
  78. where RECORDID = #{recordid,jdbcType=VARCHAR}
  79. </update>
  80. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  81. select RECORDID, ANALYST, DATADATE, DATASTATE, POWERDETECDEPARTMENT, MONITORDATE,
  82. MONITORINGVALUE, NOTE, PLANID, POWERMONITORNAME, SITEM, POWERSYSTEMNAME, UNIT, BATCHNO,
  83. TIMEGRANID, INSERT_TIME
  84. from T_CM_0348
  85. where RECORDID = #{recordid,jdbcType=VARCHAR}
  86. </select>
  87. <!-- 动力监测日月数据录入界面查询 -->
  88. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  89. select RECORDID, ANALYST, DATADATE, DATASTATE, POWERDETECDEPARTMENT, MONITORDATE,
  90. MONITORINGVALUE, NOTE, PLANID, POWERMONITORNAME, SITEM, POWERSYSTEMNAME, UNIT, BATCHNO,
  91. TIMEGRANID, INSERT_TIME
  92. from T_CM_0348
  93. <where>
  94. <if test="powerdetecdepartment != null and powerdetecdepartment != ''">
  95. and POWERDETECDEPARTMENT = #{powerdetecdepartment, jdbcType=VARCHAR}
  96. </if>
  97. <if test="planid != null and planid != ''">
  98. and PLANID = #{planid, jdbcType=VARCHAR}
  99. </if>
  100. <if test="powermonitorname != null and powermonitorname != ''">
  101. and POWERMONITORNAME in (${powermonitorname})
  102. </if>
  103. <if test="powersystemname != null and powersystemname != ''">
  104. and POWERSYSTEMNAME in (${powersystemname})
  105. </if>
  106. <if test="batchno != null and batchno != ''">
  107. and BATCHNO like '%${batchno}%'
  108. </if>
  109. <if test="timegranid != null and timegranid != ''">
  110. and TIMEGRANID = #{timegranid, jdbcType=VARCHAR}
  111. </if>
  112. <if test="sitem != null and sitem != ''">
  113. and SITEM in (${sitem})
  114. </if>
  115. <if test="startTime != null and startTime != '' and endTime != null and endTime !='' ">
  116. and
  117. to_date(MONITORDATE,'yyyy-mm-dd hh24:mi:ss')
  118. between to_date(#{startTime}, 'yyyy-mm-dd') and to_date(#{endTime}, 'yyyy-mm-dd')
  119. </if>
  120. </where>
  121. order by MONITORDATE desc
  122. </select>
  123. <insert id="batchInsert" parameterType="java.util.List">
  124. insert into T_CM_0348
  125. (RECORDID, PLANID, POWERDETECDEPARTMENT, POWERMONITORNAME, SITEM, POWERSYSTEMNAME, UNIT, BATCHNO, TIMEGRANID, INSERT_TIME, MONITORDATE,MONITORINGVALUE,ANALYST,DATADATE)
  126. ( <foreach collection="list" item="item" separator="union all">
  127. select
  128. #{item.recordid, jdbcType=DECIMAL}, #{item.planid, jdbcType=VARCHAR}, #{item.powerdetecdepartment, jdbcType=VARCHAR}, #{item.powermonitorname, jdbcType=VARCHAR},
  129. #{item.sitem, jdbcType=VARCHAR}, #{item.powersystemname, jdbcType=VARCHAR}, #{item.unit, jdbcType=VARCHAR}, #{item.batchno, jdbcType=VARCHAR},
  130. #{item.timegranid, jdbcType=VARCHAR}, #{item.insertTime, jdbcType=VARCHAR}, #{item.monitordate, jdbcType=VARCHAR},#{item.monitoringvalue, jdbcType=DECIMAL},
  131. #{item.analyst, jdbcType=VARCHAR}, #{item.datadate,jdbcType=TIMESTAMP}
  132. from dual
  133. </foreach> )
  134. </insert>
  135. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  136. delete from T_CM_0348
  137. where RECORDID = #{recordid,jdbcType=VARCHAR}
  138. </delete>
  139. <!-- 动力监测数据查询界面查询 -->
  140. <select id="dataQuery" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  141. select RECORDID, ANALYST, DATADATE, DATASTATE, POWERDETECDEPARTMENT, MONITORDATE,
  142. MONITORINGVALUE, NOTE, PLANID, POWERMONITORNAME, SITEM, POWERSYSTEMNAME, UNIT, BATCHNO,
  143. TIMEGRANID, INSERT_TIME
  144. from T_CM_0348
  145. <where>
  146. <if test="analyst != null and analyst != ''">
  147. and ANALYST like '%${analyst}%'
  148. </if>
  149. <if test="powerdetecdepartment != null and powerdetecdepartment != ''">
  150. and POWERDETECDEPARTMENT = #{powerdetecdepartment, jdbcType=VARCHAR}
  151. </if>
  152. <if test="powermonitorname != null and powermonitorname != ''">
  153. and POWERMONITORNAME = #{powermonitorname, jdbcType=VARCHAR}
  154. </if>
  155. <if test="powersystemname != null and powersystemname != ''">
  156. and POWERSYSTEMNAME = #{powersystemname, jdbcType=VARCHAR}
  157. </if>
  158. <if test="batchno != null and batchno != ''">
  159. and BATCHNO = #{batchno, jdbcType=VARCHAR}
  160. </if>
  161. <if test="timegranid != null and timegranid != ''">
  162. and TIMEGRANID = #{timegranid, jdbcType=VARCHAR}
  163. </if>
  164. <if test="monitordate != null and monitordate != ''">
  165. and MONITORDATE &gt;= #{monitordate, jdbcType=VARCHAR}
  166. </if>
  167. <if test="monitordatee != null and monitordatee != ''">
  168. and MONITORDATE &lt;= #{monitordatee, jdbcType=VARCHAR}
  169. </if>
  170. ORDER BY MONITORDATE, DATADATE
  171. </where>
  172. </select>
  173. <delete id="deleteprevious" parameterType="java.util.HashMap">
  174. delete from T_CM_0348
  175. where PLANID = #{planid, jdbcType=VARCHAR}
  176. and MONITORINGVALUE is null
  177. and DATADATE is null
  178. <if test="lowerpici != null and lowerpici !=''">
  179. and BATCHNO &gt; #{lowerpici, jdbcType=VARCHAR}
  180. </if>
  181. <if test="upperpici != null and upperpici !=''">
  182. and BATCHNO &lt;= #{upperpici, jdbcType=VARCHAR}
  183. </if>
  184. </delete>
  185. <select id="checkmaxdate" parameterType="java.lang.String" resultType="java.lang.String">
  186. select MAX(INSERT_TIME) as INSERT_TIME from T_CM_0348
  187. where PLANID = #{planid, jdbcType=VARCHAR}
  188. and MONITORDATE in (select MAX(MONITORDATE) from T_CM_0348)
  189. </select>
  190. <!-- 动力历史数据对比分析界面查询 -->
  191. <select id="datacomparison" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  192. select t.UNIT, t.POWERDETECDEPARTMENT, t.POWERMONITORNAME, t.POWERSYSTEMNAME,
  193. t.MONITORDATE, t.SITEM, t.DATADATE, t2.CLOCKMAXVALUE, t2.CLOCKMINVALUE
  194. from
  195. T_CM_0348 t,
  196. ( select SITEM, max(MONITORINGVALUE) as CLOCKMAXVALUE, min(MONITORINGVALUE) as CLOCKMINVALUE from T_CM_0348 group by SITEM ) t2
  197. where
  198. t.SITEM = t2.SITEM
  199. and MONITORDATE = #{monitordate, jdbcType = VARCHAR}
  200. and TIMEGRANID = #{timegran, jdbcType = VARCHAR}
  201. <if test="powerdetectiondepartment != null and powerdetectiondepartment != ''">
  202. and POWERDETECDEPARTMENT = #{powerdetectiondepartment, jdbcType=VARCHAR}
  203. </if>
  204. <if test="powermonitorname != null and powermonitorname != ''">
  205. and POWERMONITORNAME = #{powermonitorname, jdbcType=VARCHAR}
  206. </if>
  207. <if test="powersystemname != null and powersystemname != ''">
  208. and POWERSYSTEMNAME = #{powersystemname, jdbcType=VARCHAR}
  209. </if>
  210. <if test="sitem != null and sitem != ''">
  211. and SITEM = #{sitem, jdbcType=VARCHAR}
  212. </if>
  213. union select t.UNIT, t.POWERDETECDEPARTMENT, t.POWERMONITORNAME, t.POWERSYSTEMNAME,
  214. t.MONITORDATE, t.SITEM, t.DATADATE, t2.COMPARECLOCKMAXVALUE, t2.COMPARECLOCKMINVALUE
  215. from
  216. T_CM_0348 t,
  217. ( select SITEM, max(MONITORINGVALUE) as COMPARECLOCKMAXVALUE, min(MONITORINGVALUE) as COMPARECLOCKMINVALUE from T_CM_0348 group by SITEM ) t2
  218. where
  219. t.SITEM = t2.SITEM
  220. and MONITORDATE = #{monitordatee, jdbcType = VARCHAR}
  221. and TIMEGRANID = #{timegran, jdbcType = VARCHAR}
  222. <if test="powerdetectiondepartment != null and powerdetectiondepartment != ''">
  223. and POWERDETECDEPARTMENT = #{powerdetectiondepartment, jdbcType=VARCHAR}
  224. </if>
  225. <if test="powermonitorname != null and powermonitorname != ''">
  226. and POWERMONITORNAME = #{powermonitorname, jdbcType=VARCHAR}
  227. </if>
  228. <if test="powersystemname != null and powersystemname != ''">
  229. and POWERSYSTEMNAME = #{powersystemname, jdbcType=VARCHAR}
  230. </if>
  231. <if test="sitem != null and sitem != ''">
  232. and SITEM = #{sitem, jdbcType=VARCHAR}
  233. </if>
  234. ORDER BY MONITORDATE
  235. </select>
  236. <!-- 动力质量考核指标统计界面查询 -->
  237. <select id="qualityassessment" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  238. SELECT
  239. sum( CASE WHEN a.MONITORINGVALUE &lt;= c.UPPERLIMIT AND a.MONITORINGVALUE &gt;= c.LOWERLIMIT THEN 1 ELSE 0 END ) AS PASSNUM,
  240. count( a.SITEM ) AS TOTALNUM,
  241. round( 100 * sum( CASE WHEN a.MONITORINGVALUE &lt;= c.UPPERLIMIT AND a.MONITORINGVALUE &gt;= c.LOWERLIMIT THEN 1 ELSE 0 END ) / count( a.SITEM ), 2 ) AS PASSRATE,
  242. a.POWERDETECDEPARTMENT,
  243. a.POWERMONITORNAME,
  244. a.POWERSYSTEMNAME
  245. FROM T_CM_0348 a, T_CM_0323 b, T_CM_0324 c
  246. WHERE
  247. b.ITEMCODE = a.SITEM
  248. and b.CHECKSTATE = 'Check'
  249. and a.POWERDETECDEPARTMENT = c.POWERDETECDEPARTMENT
  250. and a.POWERSYSTEMNAME = c.POWERSYSTEMNAME
  251. and a.POWERMONITORNAME = c.POWERMONITORNAME
  252. and a.SITEM = c.ITEMNAME
  253. and instr( a.MONITORDATE, c.CREATYEAR ) &gt; 0
  254. <if test="monitordate != null and monitordate != ''">
  255. and instr( a.MONITORDATE, #{monitordate, jdbcType=VARCHAR}) &gt; 0
  256. </if>
  257. <if test="powerdetecdepartment != null and powerdetecdepartment != ''">
  258. and POWERDETECDEPARTMENT = #{powerdetecdepartment, jdbcType=VARCHAR}
  259. </if>
  260. <if test="powersystemname != null and powersystemname != ''">
  261. and POWERSYSTEMNAME = #{powersystemname, jdbcType=VARCHAR}
  262. </if>
  263. GROUP BY a.POWERDETECDEPARTMENT, a.POWERMONITORNAME, a.POWERSYSTEMNAME
  264. </select>
  265. <!--
  266. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  267. select RECORDID, ANALYST, DATADATE, DATASTATE, POWERDETECDEPARTMENT, MONITORDATE,
  268. MONITORINGVALUE, NOTE, PLANID, POWERMONITORNAME, SITEM, POWERSYSTEMNAME, UNIT, BATCHNO,
  269. TIMEGRANID, INSERT_TIME
  270. from T_CM_0348
  271. <where>
  272. <if test="recordid != null">
  273. and RECORDID = #{recordid}
  274. </if>
  275. <if test="analyst != null and analyst != ''">
  276. and ANALYST LIKE '%${analyst}%'
  277. </if>
  278. <if test="datadate != null and datadate != ''">
  279. and DATADATE LIKE '%${datadate}%'
  280. </if>
  281. <if test="datastate != null and datastate != ''">
  282. and DATASTATE LIKE '%${datastate}%'
  283. </if>
  284. <if test="powerdetecdepartment != null and powerdetecdepartment != ''">
  285. and POWERDETECDEPARTMENT LIKE '%${powerdetecdepartment}%'
  286. </if>
  287. <if test="monitordate != null and monitordate != ''">
  288. and MONITORDATE LIKE '%${monitordate}%'
  289. </if>
  290. <if test="monitoringvalue != null">
  291. and MONITORINGVALUE = #{monitoringvalue}
  292. </if>
  293. <if test="note != null and note != ''">
  294. and NOTE LIKE '%${note}%'
  295. </if>
  296. <if test="planid != null and planid != ''">
  297. and PLANID LIKE '%${planid}%'
  298. </if>
  299. <if test="powermonitorname != null and powermonitorname != ''">
  300. and POWERMONITORNAME LIKE '%${powermonitorname}%'
  301. </if>
  302. <if test="sitem != null and sitem != ''">
  303. and SITEM LIKE '%${sitem}%'
  304. </if>
  305. <if test="powersystemname != null and powersystemname != ''">
  306. and POWERSYSTEMNAME LIKE '%${powersystemname}%'
  307. </if>
  308. <if test="unit != null and unit != ''">
  309. and UNIT LIKE '%${unit}%'
  310. </if>
  311. <if test="batchno != null and batchno != ''">
  312. and BATCHNO LIKE '%${batchno}%'
  313. </if>
  314. <if test="timegranid != null and timegranid != ''">
  315. and TIMEGRANID LIKE '%${timegranid}%'
  316. </if>
  317. <if test="inserttime != null and inserttime != ''">
  318. and INSERT_TIME LIKE '%${inserttime}%'
  319. </if>
  320. </where>
  321. </select>
  322. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  323. delete from T_CM_0348
  324. where RECORDID = #{recordid,jdbcType=VARCHAR}
  325. </delete>
  326. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  327. delete from T_CM_0348
  328. where 1!=1
  329. <if test="analyst != null and analyst != ''">
  330. and ANALYST = #{analyst}
  331. </if>
  332. <if test="datadate != null and datadate != ''">
  333. and DATADATE = #{datadate}
  334. </if>
  335. <if test="datastate != null and datastate != ''">
  336. and DATASTATE = #{datastate}
  337. </if>
  338. <if test="monitordate != null and monitordate != ''">
  339. and MONITORDATE = #{monitordate}
  340. </if>
  341. <if test="monitoringvalue != null">
  342. and MONITORINGVALUE = #{monitoringvalue}
  343. </if>
  344. <if test="note != null and note != ''">
  345. and NOTE = #{note}
  346. </if>
  347. <if test="planid != null and planid != ''">
  348. and PLANID = #{planid}
  349. </if>
  350. <if test="powerdetecdepartment != null and powerdetecdepartment != ''">
  351. and POWERDETECDEPARTMENT = #{powerdetecdepartment}
  352. </if>
  353. <if test="powermonitorname != null and powermonitorname != ''">
  354. and POWERMONITORNAME = #{powermonitorname}
  355. </if>
  356. <if test="powersystemname != null and powersystemname != ''">
  357. and POWERSYSTEMNAME = #{powersystemname}
  358. </if>
  359. <if test="unit != null and unit != ''">
  360. and UNIT = #{unit}
  361. </if>
  362. <if test="sitem != null and sitem != ''">
  363. and SITEM = #{sitem}
  364. </if>
  365. <if test="batchno != null and batchno != ''">
  366. and BATCHNO = #{batchno}
  367. </if>
  368. <if test="timegranid != null and timegranid != ''">
  369. and TIMEGRANID = #{timegranid}
  370. </if>
  371. <if test="itemid != null and itemid != ''">
  372. and ITEMID = #{itemid}
  373. </if>
  374. <if test="insertTime != null and insertTime != ''">
  375. and INSERT_TIME = #{insertTime}
  376. </if>
  377. <if test="qtype != null and qtype != ''">
  378. and QTYPE = #{qtype}
  379. </if>
  380. <if test="banbie != null and banbie != ''">
  381. and BANBIE = #{banbie}
  382. </if>
  383. <if test="banci != null and banci != ''">
  384. and BANCI = #{banci}
  385. </if>
  386. <if test="lsh != null and lsh != ''">
  387. and LSH = #{lsh}
  388. </if>
  389. </delete>
  390. <insert id="insert" parameterType="com.steerinfo.ems.tcm0348.model.TCm0348">
  391. insert into T_CM_0348 (RECORDID, ANALYST, DATADATE,
  392. DATASTATE, MONITORDATE,
  393. MONITORINGVALUE, NOTE, PLANID,
  394. POWERDETECDEPARTMENT, POWERMONITORNAME,
  395. POWERSYSTEMNAME, UNIT, SITEM,
  396. BATCHNO, TIMEGRANID, ITEMID,
  397. INSERT_TIME, QTYPE, BANBIE,
  398. BANCI, LSH)
  399. values (#{recordid,jdbcType=DECIMAL}, #{analyst,jdbcType=VARCHAR}, #{datadate,jdbcType=VARCHAR},
  400. #{datastate,jdbcType=VARCHAR}, #{monitordate,jdbcType=VARCHAR},
  401. #{monitoringvalue,jdbcType=DECIMAL}, #{note,jdbcType=VARCHAR}, #{planid,jdbcType=VARCHAR},
  402. #{powerdetecdepartment,jdbcType=VARCHAR}, #{powermonitorname,jdbcType=VARCHAR},
  403. #{powersystemname,jdbcType=VARCHAR}, #{unit,jdbcType=VARCHAR}, #{sitem,jdbcType=VARCHAR},
  404. #{batchno,jdbcType=VARCHAR}, #{timegranid,jdbcType=VARCHAR}, #{itemid,jdbcType=VARCHAR},
  405. #{insertTime,jdbcType=VARCHAR}, #{qtype,jdbcType=VARCHAR}, #{banbie,jdbcType=VARCHAR},
  406. #{banci,jdbcType=VARCHAR}, #{lsh,jdbcType=VARCHAR})
  407. </insert>
  408. <insert id="insertSelective" parameterType="com.steerinfo.ems.tcm0348.model.TCm0348">
  409. insert into T_CM_0348
  410. <trim prefix="(" suffix=")" suffixOverrides=",">
  411. <if test="recordid != null">
  412. RECORDID,
  413. </if>
  414. <if test="analyst != null">
  415. ANALYST,
  416. </if>
  417. <if test="datadate != null">
  418. DATADATE,
  419. </if>
  420. <if test="datastate != null">
  421. DATASTATE,
  422. </if>
  423. <if test="monitordate != null">
  424. MONITORDATE,
  425. </if>
  426. <if test="monitoringvalue != null">
  427. MONITORINGVALUE,
  428. </if>
  429. <if test="note != null">
  430. NOTE,
  431. </if>
  432. <if test="planid != null">
  433. PLANID,
  434. </if>
  435. <if test="powerdetecdepartment != null">
  436. POWERDETECDEPARTMENT,
  437. </if>
  438. <if test="powermonitorname != null">
  439. POWERMONITORNAME,
  440. </if>
  441. <if test="powersystemname != null">
  442. POWERSYSTEMNAME,
  443. </if>
  444. <if test="unit != null">
  445. UNIT,
  446. </if>
  447. <if test="sitem != null">
  448. SITEM,
  449. </if>
  450. <if test="batchno != null">
  451. BATCHNO,
  452. </if>
  453. <if test="timegranid != null">
  454. TIMEGRANID,
  455. </if>
  456. <if test="itemid != null">
  457. ITEMID,
  458. </if>
  459. <if test="insertTime != null">
  460. INSERT_TIME,
  461. </if>
  462. <if test="qtype != null">
  463. QTYPE,
  464. </if>
  465. <if test="banbie != null">
  466. BANBIE,
  467. </if>
  468. <if test="banci != null">
  469. BANCI,
  470. </if>
  471. <if test="lsh != null">
  472. LSH,
  473. </if>
  474. </trim>
  475. <trim prefix="values (" suffix=")" suffixOverrides=",">
  476. <if test="recordid != null">
  477. #{recordid,jdbcType=DECIMAL},
  478. </if>
  479. <if test="analyst != null">
  480. #{analyst,jdbcType=VARCHAR},
  481. </if>
  482. <if test="datadate != null">
  483. #{datadate,jdbcType=VARCHAR},
  484. </if>
  485. <if test="datastate != null">
  486. #{datastate,jdbcType=VARCHAR},
  487. </if>
  488. <if test="monitordate != null">
  489. #{monitordate,jdbcType=VARCHAR},
  490. </if>
  491. <if test="monitoringvalue != null">
  492. #{monitoringvalue,jdbcType=DECIMAL},
  493. </if>
  494. <if test="note != null">
  495. #{note,jdbcType=VARCHAR},
  496. </if>
  497. <if test="planid != null">
  498. #{planid,jdbcType=VARCHAR},
  499. </if>
  500. <if test="powerdetecdepartment != null">
  501. #{powerdetecdepartment,jdbcType=VARCHAR},
  502. </if>
  503. <if test="powermonitorname != null">
  504. #{powermonitorname,jdbcType=VARCHAR},
  505. </if>
  506. <if test="powersystemname != null">
  507. #{powersystemname,jdbcType=VARCHAR},
  508. </if>
  509. <if test="unit != null">
  510. #{unit,jdbcType=VARCHAR},
  511. </if>
  512. <if test="sitem != null">
  513. #{sitem,jdbcType=VARCHAR},
  514. </if>
  515. <if test="batchno != null">
  516. #{batchno,jdbcType=VARCHAR},
  517. </if>
  518. <if test="timegranid != null">
  519. #{timegranid,jdbcType=VARCHAR},
  520. </if>
  521. <if test="itemid != null">
  522. #{itemid,jdbcType=VARCHAR},
  523. </if>
  524. <if test="insertTime != null">
  525. #{insertTime,jdbcType=VARCHAR},
  526. </if>
  527. <if test="qtype != null">
  528. #{qtype,jdbcType=VARCHAR},
  529. </if>
  530. <if test="banbie != null">
  531. #{banbie,jdbcType=VARCHAR},
  532. </if>
  533. <if test="banci != null">
  534. #{banci,jdbcType=VARCHAR},
  535. </if>
  536. <if test="lsh != null">
  537. #{lsh,jdbcType=VARCHAR},
  538. </if>
  539. </trim>
  540. </insert>
  541. <update id="updateByPrimaryKey" parameterType="com.steerinfo.ems.tcm0348.model.TCm0348">
  542. update T_CM_0348
  543. set ANALYST = #{analyst,jdbcType=VARCHAR},
  544. DATADATE = #{datadate,jdbcType=VARCHAR},
  545. DATASTATE = #{datastate,jdbcType=VARCHAR},
  546. MONITORDATE = #{monitordate,jdbcType=VARCHAR},
  547. MONITORINGVALUE = #{monitoringvalue,jdbcType=DECIMAL},
  548. NOTE = #{note,jdbcType=VARCHAR},
  549. PLANID = #{planid,jdbcType=VARCHAR},
  550. POWERDETECDEPARTMENT = #{powerdetecdepartment,jdbcType=VARCHAR},
  551. POWERMONITORNAME = #{powermonitorname,jdbcType=VARCHAR},
  552. POWERSYSTEMNAME = #{powersystemname,jdbcType=VARCHAR},
  553. UNIT = #{unit,jdbcType=VARCHAR},
  554. SITEM = #{sitem,jdbcType=VARCHAR},
  555. BATCHNO = #{batchno,jdbcType=VARCHAR},
  556. TIMEGRANID = #{timegranid,jdbcType=VARCHAR},
  557. ITEMID = #{itemid,jdbcType=VARCHAR},
  558. INSERT_TIME = #{insertTime,jdbcType=VARCHAR},
  559. QTYPE = #{qtype,jdbcType=VARCHAR},
  560. BANBIE = #{banbie,jdbcType=VARCHAR},
  561. BANCI = #{banci,jdbcType=VARCHAR},
  562. LSH = #{lsh,jdbcType=VARCHAR}
  563. where RECORDID = #{recordid,jdbcType=VARCHAR}
  564. </update>
  565. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.ems.tcm0348.model.TCm0348">
  566. update T_CM_0348
  567. <set>
  568. <if test="analyst != null">
  569. ANALYST = #{analyst,jdbcType=VARCHAR},
  570. </if>
  571. <if test="datadate != null">
  572. DATADATE = #{datadate,jdbcType=VARCHAR},
  573. </if>
  574. <if test="datastate != null">
  575. DATASTATE = #{datastate,jdbcType=VARCHAR},
  576. </if>
  577. <if test="monitordate != null">
  578. MONITORDATE = #{monitordate,jdbcType=VARCHAR},
  579. </if>
  580. <if test="monitoringvalue != null">
  581. MONITORINGVALUE = #{monitoringvalue,jdbcType=DECIMAL},
  582. </if>
  583. <if test="note != null">
  584. NOTE = #{note,jdbcType=VARCHAR},
  585. </if>
  586. <if test="planid != null">
  587. PLANID = #{planid,jdbcType=VARCHAR},
  588. </if>
  589. <if test="powerdetecdepartment != null">
  590. POWERDETECDEPARTMENT = #{powerdetecdepartment,jdbcType=VARCHAR},
  591. </if>
  592. <if test="powermonitorname != null">
  593. POWERMONITORNAME = #{powermonitorname,jdbcType=VARCHAR},
  594. </if>
  595. <if test="powersystemname != null">
  596. POWERSYSTEMNAME = #{powersystemname,jdbcType=VARCHAR},
  597. </if>
  598. <if test="unit != null">
  599. UNIT = #{unit,jdbcType=VARCHAR},
  600. </if>
  601. <if test="sitem != null">
  602. SITEM = #{sitem,jdbcType=VARCHAR},
  603. </if>
  604. <if test="batchno != null">
  605. BATCHNO = #{batchno,jdbcType=VARCHAR},
  606. </if>
  607. <if test="timegranid != null">
  608. TIMEGRANID = #{timegranid,jdbcType=VARCHAR},
  609. </if>
  610. <if test="itemid != null">
  611. ITEMID = #{itemid,jdbcType=VARCHAR},
  612. </if>
  613. <if test="insertTime != null">
  614. INSERT_TIME = #{insertTime,jdbcType=VARCHAR},
  615. </if>
  616. <if test="qtype != null">
  617. QTYPE = #{qtype,jdbcType=VARCHAR},
  618. </if>
  619. <if test="banbie != null">
  620. BANBIE = #{banbie,jdbcType=VARCHAR},
  621. </if>
  622. <if test="banci != null">
  623. BANCI = #{banci,jdbcType=VARCHAR},
  624. </if>
  625. <if test="lsh != null">
  626. LSH = #{lsh,jdbcType=VARCHAR},
  627. </if>
  628. </set>
  629. where RECORDID = #{recordid,jdbcType=VARCHAR}
  630. </update>
  631. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  632. select RECORDID, ANALYST, DATADATE, DATASTATE, MONITORDATE, MONITORINGVALUE,
  633. NOTE, PLANID, POWERDETECDEPARTMENT, POWERMONITORNAME, POWERSYSTEMNAME, UNIT, SITEM,
  634. BATCHNO, TIMEGRANID, ITEMID, INSERT_TIME, QTYPE, BANBIE, BANCI, LSH
  635. from T_CM_0348
  636. where RECORDID = #{recordid,jdbcType=VARCHAR}
  637. </select>
  638. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  639. select RECORDID, ANALYST, DATADATE, DATASTATE, MONITORDATE, MONITORINGVALUE,
  640. NOTE, PLANID, POWERDETECDEPARTMENT, POWERMONITORNAME, POWERSYSTEMNAME, UNIT, SITEM,
  641. BATCHNO, TIMEGRANID, ITEMID, INSERT_TIME, QTYPE, BANBIE, BANCI, LSH
  642. from T_CM_0348
  643. <where>
  644. <if test="analyst != null and analyst != ''">
  645. and ANALYST = #{analyst}
  646. </if>
  647. <if test="datadate != null and datadate != ''">
  648. and DATADATE = #{datadate}
  649. </if>
  650. <if test="datastate != null and datastate != ''">
  651. and DATASTATE = #{datastate}
  652. </if>
  653. <if test="monitordate != null and monitordate != ''">
  654. and MONITORDATE = #{monitordate}
  655. </if>
  656. <if test="monitoringvalue != null">
  657. and MONITORINGVALUE = #{monitoringvalue}
  658. </if>
  659. <if test="note != null and note != ''">
  660. and NOTE = #{note}
  661. </if>
  662. <if test="planid != null and planid != ''">
  663. and PLANID = #{planid}
  664. </if>
  665. <if test="powerdetecdepartment != null and powerdetecdepartment != ''">
  666. and POWERDETECDEPARTMENT = #{powerdetecdepartment}
  667. </if>
  668. <if test="powermonitorname != null and powermonitorname != ''">
  669. and POWERMONITORNAME = #{powermonitorname}
  670. </if>
  671. <if test="powersystemname != null and powersystemname != ''">
  672. and POWERSYSTEMNAME = #{powersystemname}
  673. </if>
  674. <if test="unit != null and unit != ''">
  675. and UNIT = #{unit}
  676. </if>
  677. <if test="sitem != null and sitem != ''">
  678. and SITEM = #{sitem}
  679. </if>
  680. <if test="batchno != null and batchno != ''">
  681. and BATCHNO = #{batchno}
  682. </if>
  683. <if test="timegranid != null and timegranid != ''">
  684. and TIMEGRANID = #{timegranid}
  685. </if>
  686. <if test="itemid != null and itemid != ''">
  687. and ITEMID = #{itemid}
  688. </if>
  689. <if test="insertTime != null and insertTime != ''">
  690. and INSERT_TIME = #{insertTime}
  691. </if>
  692. <if test="qtype != null and qtype != ''">
  693. and QTYPE = #{qtype}
  694. </if>
  695. <if test="banbie != null and banbie != ''">
  696. and BANBIE = #{banbie}
  697. </if>
  698. <if test="banci != null and banci != ''">
  699. and BANCI = #{banci}
  700. </if>
  701. <if test="lsh != null and lsh != ''">
  702. and LSH = #{lsh}
  703. </if>
  704. </where>
  705. </select>
  706. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  707. select RECORDID, ANALYST, DATADATE, DATASTATE, MONITORDATE, MONITORINGVALUE,
  708. NOTE, PLANID, POWERDETECDEPARTMENT, POWERMONITORNAME, POWERSYSTEMNAME, UNIT, SITEM,
  709. BATCHNO, TIMEGRANID, ITEMID, INSERT_TIME, QTYPE, BANBIE, BANCI, LSH
  710. from T_CM_0348
  711. <where>
  712. <if test="analyst != null and analyst != ''">
  713. and ANALYST LIKE '%${analyst}%'
  714. </if>
  715. <if test="datadate != null and datadate != ''">
  716. and DATADATE LIKE '%${datadate}%'
  717. </if>
  718. <if test="datastate != null and datastate != ''">
  719. and DATASTATE LIKE '%${datastate}%'
  720. </if>
  721. <if test="monitordate != null and monitordate != ''">
  722. and MONITORDATE LIKE '%${monitordate}%'
  723. </if>
  724. <if test="monitoringvalue != null">
  725. and MONITORINGVALUE = #{monitoringvalue}
  726. </if>
  727. <if test="note != null and note != ''">
  728. and NOTE LIKE '%${note}%'
  729. </if>
  730. <if test="planid != null and planid != ''">
  731. and PLANID LIKE '%${planid}%'
  732. </if>
  733. <if test="powerdetecdepartment != null and powerdetecdepartment != ''">
  734. and POWERDETECDEPARTMENT LIKE '%${powerdetecdepartment}%'
  735. </if>
  736. <if test="powermonitorname != null and powermonitorname != ''">
  737. and POWERMONITORNAME LIKE '%${powermonitorname}%'
  738. </if>
  739. <if test="powersystemname != null and powersystemname != ''">
  740. and POWERSYSTEMNAME LIKE '%${powersystemname}%'
  741. </if>
  742. <if test="unit != null and unit != ''">
  743. and UNIT LIKE '%${unit}%'
  744. </if>
  745. <if test="sitem != null and sitem != ''">
  746. and SITEM LIKE '%${sitem}%'
  747. </if>
  748. <if test="batchno != null and batchno != ''">
  749. and BATCHNO LIKE '%${batchno}%'
  750. </if>
  751. <if test="timegranid != null and timegranid != ''">
  752. and TIMEGRANID LIKE '%${timegranid}%'
  753. </if>
  754. <if test="itemid != null and itemid != ''">
  755. and ITEMID LIKE '%${itemid}%'
  756. </if>
  757. <if test="insertTime != null and insertTime != ''">
  758. and INSERT_TIME LIKE '%${insertTime}%'
  759. </if>
  760. <if test="qtype != null and qtype != ''">
  761. and QTYPE LIKE '%${qtype}%'
  762. </if>
  763. <if test="banbie != null and banbie != ''">
  764. and BANBIE LIKE '%${banbie}%'
  765. </if>
  766. <if test="banci != null and banci != ''">
  767. and BANCI LIKE '%${banci}%'
  768. </if>
  769. <if test="lsh != null and lsh != ''">
  770. and LSH LIKE '%${lsh}%'
  771. </if>
  772. </where>
  773. </select>
  774. <insert id="batchInsert" parameterType="java.util.List">
  775. insert into T_CM_0348
  776. (RECORDID,
  777. ANALYST, DATADATE, DATASTATE, MONITORDATE, MONITORINGVALUE,
  778. NOTE, PLANID, POWERDETECDEPARTMENT,
  779. POWERMONITORNAME, POWERSYSTEMNAME,
  780. UNIT, SITEM, BATCHNO,
  781. TIMEGRANID, ITEMID, INSERT_TIME,
  782. QTYPE, BANBIE, BANCI,
  783. LSH)
  784. ( <foreach collection="list" item="item" separator="union all">
  785. select
  786. #{item.recordid,jdbcType=DECIMAL},
  787. #{item.analyst,jdbcType=VARCHAR}, #{item.datadate,jdbcType=VARCHAR}, #{item.datastate,jdbcType=VARCHAR}, #{item.monitordate,jdbcType=VARCHAR}, #{item.monitoringvalue,jdbcType=DECIMAL},
  788. #{item.note,jdbcType=VARCHAR}, #{item.planid,jdbcType=VARCHAR}, #{item.powerdetecdepartment,jdbcType=VARCHAR},
  789. #{item.powermonitorname,jdbcType=VARCHAR}, #{item.powersystemname,jdbcType=VARCHAR},
  790. #{item.unit,jdbcType=VARCHAR}, #{item.sitem,jdbcType=VARCHAR}, #{item.batchno,jdbcType=VARCHAR},
  791. #{item.timegranid,jdbcType=VARCHAR}, #{item.itemid,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=VARCHAR},
  792. #{item.qtype,jdbcType=VARCHAR}, #{item.banbie,jdbcType=VARCHAR}, #{item.banci,jdbcType=VARCHAR},
  793. #{item.lsh,jdbcType=VARCHAR} from dual
  794. </foreach> )
  795. </insert>
  796. <update id="batchUpdate" parameterType="java.util.List">
  797. update T_CM_0348
  798. set
  799. RECORDID=
  800. <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
  801. when #{item.recordid,jdbcType=DECIMAL} then #{item.recordid,jdbcType=DECIMAL}
  802. </foreach>
  803. ,ANALYST=
  804. <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
  805. when #{item.recordid,jdbcType=DECIMAL} then #{item.analyst,jdbcType=VARCHAR}
  806. </foreach>
  807. ,DATADATE=
  808. <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
  809. when #{item.recordid,jdbcType=DECIMAL} then #{item.datadate,jdbcType=VARCHAR}
  810. </foreach>
  811. ,DATASTATE=
  812. <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
  813. when #{item.recordid,jdbcType=DECIMAL} then #{item.datastate,jdbcType=VARCHAR}
  814. </foreach>
  815. ,MONITORDATE=
  816. <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
  817. when #{item.recordid,jdbcType=DECIMAL} then #{item.monitordate,jdbcType=VARCHAR}
  818. </foreach>
  819. ,MONITORINGVALUE=
  820. <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
  821. when #{item.recordid,jdbcType=DECIMAL} then #{item.monitoringvalue,jdbcType=DECIMAL}
  822. </foreach>
  823. ,NOTE=
  824. <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
  825. when #{item.recordid,jdbcType=DECIMAL} then #{item.note,jdbcType=VARCHAR}
  826. </foreach>
  827. ,PLANID=
  828. <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
  829. when #{item.recordid,jdbcType=DECIMAL} then #{item.planid,jdbcType=VARCHAR}
  830. </foreach>
  831. ,POWERDETECDEPARTMENT=
  832. <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
  833. when #{item.recordid,jdbcType=DECIMAL} then #{item.powerdetecdepartment,jdbcType=VARCHAR}
  834. </foreach>
  835. ,POWERMONITORNAME=
  836. <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
  837. when #{item.recordid,jdbcType=DECIMAL} then #{item.powermonitorname,jdbcType=VARCHAR}
  838. </foreach>
  839. ,POWERSYSTEMNAME=
  840. <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
  841. when #{item.recordid,jdbcType=DECIMAL} then #{item.powersystemname,jdbcType=VARCHAR}
  842. </foreach>
  843. ,UNIT=
  844. <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
  845. when #{item.recordid,jdbcType=DECIMAL} then #{item.unit,jdbcType=VARCHAR}
  846. </foreach>
  847. ,SITEM=
  848. <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
  849. when #{item.recordid,jdbcType=DECIMAL} then #{item.sitem,jdbcType=VARCHAR}
  850. </foreach>
  851. ,BATCHNO=
  852. <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
  853. when #{item.recordid,jdbcType=DECIMAL} then #{item.batchno,jdbcType=VARCHAR}
  854. </foreach>
  855. ,TIMEGRANID=
  856. <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
  857. when #{item.recordid,jdbcType=DECIMAL} then #{item.timegranid,jdbcType=VARCHAR}
  858. </foreach>
  859. ,ITEMID=
  860. <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
  861. when #{item.recordid,jdbcType=DECIMAL} then #{item.itemid,jdbcType=VARCHAR}
  862. </foreach>
  863. ,INSERT_TIME=
  864. <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
  865. when #{item.recordid,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=VARCHAR}
  866. </foreach>
  867. ,QTYPE=
  868. <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
  869. when #{item.recordid,jdbcType=DECIMAL} then #{item.qtype,jdbcType=VARCHAR}
  870. </foreach>
  871. ,BANBIE=
  872. <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
  873. when #{item.recordid,jdbcType=DECIMAL} then #{item.banbie,jdbcType=VARCHAR}
  874. </foreach>
  875. ,BANCI=
  876. <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
  877. when #{item.recordid,jdbcType=DECIMAL} then #{item.banci,jdbcType=VARCHAR}
  878. </foreach>
  879. ,LSH=
  880. <foreach collection="list" item="item" index="index" separator=" " open="case RECORDID" close="end">
  881. when #{item.recordid,jdbcType=DECIMAL} then #{item.lsh,jdbcType=VARCHAR}
  882. </foreach>
  883. where RECORDID in
  884. <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
  885. #{item.recordid,jdbcType=DECIMAL}
  886. </foreach>
  887. </update>
  888. <delete id="batchDelete" parameterType="java.util.List">
  889. delete from T_CM_0348
  890. where RECORDID in
  891. <foreach collection="list" item="id" open="(" close=")" separator=",">
  892. #{id}
  893. </foreach>
  894. </delete>
  895. -->
  896. <select id="getDateforbfhyd" parameterType="java.lang.String" resultMap="BaseResultMap">
  897. select 'QualityInspectionCenter' as POWERDETECDEPARTMENT,
  898. t2.powercode as POWERSYSTEMNAME,
  899. t1.POWERMONITORCODE as POWERMONITORNAME ,
  900. t.ITEMNAME as SITEM,
  901. to_char(to_date(BFHYD_HYRQ, 'yyyymmdd hh24miss'),
  902. 'yyyy-mm-dd hh24:mi:ss') as MONITORDATE,
  903. t.BFHYD_ZJDH as BATCHNO,
  904. t.MONITORINGVALUE,
  905. t3.unit as UNIT,
  906. t.TS as DATADATE,
  907. t.BFHYD_ZJR as ANALYST
  908. from BFHYD unpivot(MONITORINGVALUE for ITEMNAME
  909. in(BFHYD_01,
  910. BFHYD_02,
  911. BFHYD_03,
  912. BFHYD_04,
  913. BFHYD_05,
  914. BFHYD_06,
  915. BFHYD_07,
  916. BFHYD_08,
  917. BFHYD_09,
  918. BFHYD_10,
  919. BFHYD_11,
  920. BFHYD_12)) t
  921. left join t_cm_0325 t2
  922. on t.BFHYD_27 = t2.powername
  923. left join t_cm_0323 t3
  924. on t.ITEMNAME = t3.itemcode
  925. left join t_cm_0316 t1
  926. on t.BFHYD_26 = t1.powermonitorname and t2.powercode = t1.powersystemname
  927. where t.BFHYD_ZJDH = #{bfhydzjdh}
  928. </select>
  929. <update id="updates" parameterType="com.steerinfo.ems.tcm0348.model.TCm0348">
  930. update t_cm_0348
  931. <set>
  932. <if test="monitoringvalue != null ">
  933. MONITORINGVALUE = #{monitoringvalue},
  934. </if>
  935. <if test="note != null and note != ''">
  936. NOTE = #{note}
  937. </if>
  938. </set>
  939. <where>
  940. <if test="powermonitorname != null and powermonitorname != ''">
  941. and POWERMONITORNAME = #{powermonitorname}
  942. </if>
  943. <if test="batchno != null and batchno != ''">
  944. and BATCHNO = #{batchno}
  945. </if>
  946. <if test="sitem != null and sitem != ''">
  947. and SITEM = #{sitem}
  948. </if>
  949. <if test="powersystemname != null and powersystemname != ''">
  950. and POWERSYSTEMNAME = #{powersystemname}
  951. </if>
  952. <if test="monitordate != null and monitordate != ''">
  953. and MONITORDATE = #{monitordate}
  954. </if>
  955. <if test="unit != null and unit != ''">
  956. and UNIT = #{unit}
  957. </if>
  958. <if test="analyst != null and analyst != ''">
  959. and ANALYST = #{analyst}
  960. </if>
  961. </where>
  962. </update>
  963. </mapper>