TRmActItemMapper.xml 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975
  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.trmactitem.mapper.TRmActItemMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.ems.trmactitem.model.TRmActItem">
  5. <id column="ITEMID" jdbcType="VARCHAR" property="itemid" />
  6. <result column="ITEMNAME" jdbcType="VARCHAR" property="itemname" />
  7. <result column="ITEMDESC" jdbcType="VARCHAR" property="itemdesc" />
  8. <result column="ITEMTYPE" jdbcType="VARCHAR" property="itemtype" />
  9. <result column="PROPERTYID" jdbcType="VARCHAR" property="propertyid" />
  10. <result column="WORKPROCID" jdbcType="VARCHAR" property="workprocid" />
  11. <result column="ENERGYID" jdbcType="VARCHAR" property="energyid" />
  12. <result column="UNITID" jdbcType="VARCHAR" property="unitid" />
  13. <result column="USEFLAG" jdbcType="VARCHAR" property="useflag" />
  14. <result column="ISSETTLE" jdbcType="VARCHAR" property="issettle" />
  15. <result column="DIGITS" jdbcType="DECIMAL" property="digits" />
  16. <result column="STATE" jdbcType="VARCHAR" property="state" />
  17. <result column="CLOCK" jdbcType="VARCHAR" property="clock" />
  18. <result column="USERID" jdbcType="VARCHAR" property="userid" />
  19. <result column="MODIFICATIONTIME" jdbcType="VARCHAR" property="modificationtime" />
  20. <result column="DEFAULTVALUE" jdbcType="DECIMAL" property="defaultvalue" />
  21. <result column="SHOWNO" jdbcType="DECIMAL" property="showno" />
  22. <result column="ISUP" jdbcType="VARCHAR" property="isup" />
  23. <result column="FID" jdbcType="VARCHAR" property="fid" />
  24. <result column="ASSOCIATEID" jdbcType="VARCHAR" property="associateid" />
  25. <result column="DEFAULMAN" jdbcType="VARCHAR" property="defaulman" />
  26. <result column="MINTIMEGRANID" jdbcType="VARCHAR" property="mintimegranid" />
  27. <result column="SEQNO" jdbcType="DECIMAL" property="seqno" />
  28. <result column="BZ" jdbcType="VARCHAR" property="bz" />
  29. <result column="RTPITEMID" jdbcType="VARCHAR" property="rtpitemid" />
  30. </resultMap>
  31. <sql id="columns">
  32. ITEMID, ITEMNAME, ITEMDESC, ITEMTYPE, PROPERTYID, WORKPROCID, ENERGYID, UNITID, USEFLAG,
  33. ISSETTLE, DIGITS, STATE, CLOCK, USERID, MODIFICATIONTIME, DEFAULTVALUE, SHOWNO, ISUP,
  34. FID, ASSOCIATEID, DEFAULMAN, MINTIMEGRANID, SEQNO, BZ
  35. </sql>
  36. <sql id="columns_alias">
  37. t.ITEMID, t.ITEMNAME, t.ITEMDESC, t.ITEMTYPE, t.PROPERTYID, t.WORKPROCID, t.ENERGYID,
  38. t.UNITID, t.USEFLAG, t.ISSETTLE, t.DIGITS, t.STATE, t.CLOCK, t.USERID, t.MODIFICATIONTIME,
  39. t.DEFAULTVALUE, t.SHOWNO, t.ISUP, t.FID, t.ASSOCIATEID, t.DEFAULMAN, t.MINTIMEGRANID,
  40. t.SEQNO, t.BZ
  41. </sql>
  42. <sql id="select">
  43. SELECT <include refid="columns"/> FROM T_RM_ACT_ITEM t
  44. </sql>
  45. <sql id="select_alias">
  46. SELECT <include refid="columns_alias"/> FROM T_RM_ACT_ITEM t
  47. </sql>
  48. <sql id="where">
  49. <where>
  50. <if test="itemname != null and itemname != ''">
  51. and ITEMNAME LIKE '%${itemname}%'
  52. </if>
  53. <if test="itemdesc != null and itemdesc != ''">
  54. and ITEMDESC = #{itemdesc}
  55. </if>
  56. <if test="itemtype != null and itemtype != ''">
  57. and ITEMTYPE = #{itemtype}
  58. </if>
  59. <if test="propertyid != null and propertyid != ''">
  60. and PROPERTYID = #{propertyid}
  61. </if>
  62. <if test="workprocid != null and workprocid != ''">
  63. and WORKPROCID = #{workprocid}
  64. </if>
  65. <if test="energyid != null and energyid != ''">
  66. and ENERGYID = #{energyid}
  67. </if>
  68. <if test="unitid != null and unitid != ''">
  69. and UNITID = #{unitid}
  70. </if>
  71. <if test="useflag != null and useflag != ''">
  72. and USEFLAG = #{useflag}
  73. </if>
  74. <if test="issettle != null and issettle != ''">
  75. and ISSETTLE = #{issettle}
  76. </if>
  77. <if test="digits != null">
  78. and DIGITS = #{digits}
  79. </if>
  80. <if test="state != null and state != ''">
  81. and STATE = #{state}
  82. </if>
  83. <if test="clock != null and clock != ''">
  84. and CLOCK = #{clock}
  85. </if>
  86. <if test="userid != null and userid != ''">
  87. and USERID = #{userid}
  88. </if>
  89. <if test="modificationtime != null and modificationtime != ''">
  90. and MODIFICATIONTIME = #{modificationtime}
  91. </if>
  92. <if test="defaultvalue != null">
  93. and DEFAULTVALUE = #{defaultvalue}
  94. </if>
  95. <if test="showno != null">
  96. and SHOWNO = #{showno}
  97. </if>
  98. <if test="isup != null and isup != ''">
  99. and ISUP = #{isup}
  100. </if>
  101. <if test="fid != null and fid != ''">
  102. and FID = #{fid}
  103. </if>
  104. <if test="associateid != null and associateid != ''">
  105. and ASSOCIATEID = #{associateid}
  106. </if>
  107. <if test="defaulman != null and defaulman != ''">
  108. and DEFAULMAN = #{defaulman}
  109. </if>
  110. <if test="mintimegranid != null and mintimegranid != ''">
  111. and MINTIMEGRANID = #{mintimegranid}
  112. </if>
  113. <if test="seqno != null">
  114. and SEQNO = #{seqno}
  115. </if>
  116. <if test="bz != null and bz != ''">
  117. and BZ = #{bz}
  118. </if>
  119. </where>
  120. </sql>
  121. <sql id="whereLike">
  122. <where>
  123. <if test="itemid != null and itemid != ''">
  124. and t.ITEMID in (${itemid})
  125. </if>
  126. <if test="itemname != null and itemname != ''">
  127. and t.ITEMNAME LIKE '%${itemname}%'
  128. </if>
  129. <if test="itemdesc != null and itemdesc != ''">
  130. and t.ITEMDESC LIKE '%${itemdesc}%'
  131. </if>
  132. <if test="itemtype != null and itemtype != ''">
  133. and t.ITEMTYPE LIKE '%${itemtype}%'
  134. </if>
  135. <if test="propertyid != null and propertyid != ''">
  136. ${propertyid}
  137. </if>
  138. <if test="workprocid != null and workprocid != ''">
  139. ${workprocid}
  140. </if>
  141. <if test="energyid != null and energyid != ''">
  142. ${energyid}
  143. </if>
  144. <if test="unitid != null and unitid != ''">
  145. and t.UNITID LIKE '%${unitid}%'
  146. </if>
  147. <if test="useflag != null and useflag != ''">
  148. and t.USEFLAG =#{useflag}
  149. </if>
  150. <if test="seqno != null">
  151. and t.SEQNO LIKE '%${seqno}%'
  152. </if>
  153. <if test="issettle != null and issettle != ''">
  154. and t.ISSETTLE LIKE '%${issettle}%'
  155. </if>
  156. <if test="digits != null">
  157. and t.DIGITS = #{digits}
  158. </if>
  159. <if test="state !=null and state !='' ">
  160. and t.STATE =#{state}
  161. </if>
  162. <if test="defaultvalue != null">
  163. and t.DEFAULTVALUE = #{defaultvalue}
  164. </if>
  165. <if test="mintimegranid !=null and mintimegranid !='' ">
  166. and t.MINTIMEGRANID =#{mintimegranid}
  167. </if>
  168. <if test="bz !=null and bz !='' ">
  169. and t.BZ LIKE '%${bz}%'
  170. </if>
  171. <if test="fid != null and fid !='' ">
  172. and (t.FID = #{fid} or t.ITEMID = #{fid})
  173. </if>
  174. <if test="measureid != null and measureid != ''">
  175. and exists
  176. (select id from FORMULA where sourcecode like '%[${measureid}]%' and code = t.itemid)
  177. </if>
  178. </where>
  179. </sql>
  180. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  181. delete from T_RM_ACT_ITEM
  182. where ITEMID = #{itemid,jdbcType=VARCHAR}
  183. </delete>
  184. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  185. delete from T_RM_ACT_ITEM
  186. where 1!=1
  187. <if test="itemname != null and itemname != ''">
  188. or ITEMNAME = #{itemname}
  189. </if>
  190. <if test="itemdesc != null and itemdesc != ''">
  191. or ITEMDESC = #{itemdesc}
  192. </if>
  193. <if test="itemtype != null and itemtype != ''">
  194. or ITEMTYPE = #{itemtype}
  195. </if>
  196. <if test="propertyid != null and propertyid != ''">
  197. or PROPERTYID = #{propertyid}
  198. </if>
  199. <if test="workprocid != null and workprocid != ''">
  200. or WORKPROCID = #{workprocid}
  201. </if>
  202. <if test="energyid != null and energyid != ''">
  203. or ENERGYID = #{energyid}
  204. </if>
  205. <if test="unitid != null and unitid != ''">
  206. or UNITID = #{unitid}
  207. </if>
  208. <if test="useflag != null and useflag != ''">
  209. or USEFLAG = #{useflag}
  210. </if>
  211. <if test="issettle != null and issettle != ''">
  212. or ISSETTLE = #{issettle}
  213. </if>
  214. <if test="digits != null">
  215. or DIGITS = #{digits}
  216. </if>
  217. <if test="state != null and state != ''">
  218. or STATE = #{state}
  219. </if>
  220. <if test="clock != null and clock != ''">
  221. or CLOCK = #{clock}
  222. </if>
  223. <if test="userid != null and userid != ''">
  224. or USERID = #{userid}
  225. </if>
  226. <if test="modificationtime != null and modificationtime != ''">
  227. or MODIFICATIONTIME = #{modificationtime}
  228. </if>
  229. <if test="defaultvalue != null">
  230. or DEFAULTVALUE = #{defaultvalue}
  231. </if>
  232. <if test="showno != null">
  233. or SHOWNO = #{showno}
  234. </if>
  235. <if test="isup != null and isup != ''">
  236. or ISUP = #{isup}
  237. </if>
  238. <if test="fid != null and fid != ''">
  239. or FID = #{fid}
  240. </if>
  241. <if test="associateid != null and associateid != ''">
  242. or ASSOCIATEID = #{associateid}
  243. </if>
  244. <if test="defaulman != null and defaulman != ''">
  245. or DEFAULMAN = #{defaulman}
  246. </if>
  247. <if test="mintimegranid != null and mintimegranid != ''">
  248. or MINTIMEGRANID = #{mintimegranid}
  249. </if>
  250. <if test="seqno != null">
  251. or SEQNO = #{seqno}
  252. </if>
  253. <if test="bz != null and bz != ''">
  254. or BZ = #{bz}
  255. </if>
  256. </delete>
  257. <insert id="insert" parameterType="com.steerinfo.ems.trmactitem.model.TRmActItem">
  258. insert into T_RM_ACT_ITEM (ITEMID, ITEMNAME, ITEMDESC,
  259. ITEMTYPE, PROPERTYID, WORKPROCID,
  260. ENERGYID, UNITID, USEFLAG,
  261. ISSETTLE, DIGITS, STATE,
  262. CLOCK, USERID, MODIFICATIONTIME,
  263. DEFAULTVALUE, SHOWNO, ISUP,
  264. FID, ASSOCIATEID, DEFAULMAN,
  265. MINTIMEGRANID, SEQNO, BZ
  266. )
  267. values (#{itemid,jdbcType=VARCHAR}, #{itemname,jdbcType=VARCHAR}, #{itemdesc,jdbcType=VARCHAR},
  268. #{itemtype,jdbcType=VARCHAR}, #{propertyid,jdbcType=VARCHAR}, #{workprocid,jdbcType=VARCHAR},
  269. #{energyid,jdbcType=VARCHAR}, #{unitid,jdbcType=VARCHAR}, #{useflag,jdbcType=VARCHAR},
  270. #{issettle,jdbcType=VARCHAR}, #{digits,jdbcType=DECIMAL}, #{state,jdbcType=VARCHAR},
  271. #{clock,jdbcType=VARCHAR}, #{userid,jdbcType=VARCHAR}, #{modificationtime,jdbcType=VARCHAR},
  272. #{defaultvalue,jdbcType=DECIMAL}, #{showno,jdbcType=DECIMAL}, #{isup,jdbcType=VARCHAR},
  273. #{fid,jdbcType=VARCHAR}, #{associateid,jdbcType=VARCHAR}, #{defaulman,jdbcType=VARCHAR},
  274. #{mintimegranid,jdbcType=VARCHAR}, #{seqno,jdbcType=DECIMAL}, #{bz,jdbcType=VARCHAR}
  275. )
  276. </insert>
  277. <insert id="insertSelective" parameterType="com.steerinfo.ems.trmactitem.model.TRmActItem">
  278. insert into T_RM_ACT_ITEM
  279. <trim prefix="(" suffix=")" suffixOverrides=",">
  280. <if test="itemid != null">
  281. ITEMID,
  282. </if>
  283. <if test="itemname != null">
  284. ITEMNAME,
  285. </if>
  286. <if test="itemdesc != null">
  287. ITEMDESC,
  288. </if>
  289. <if test="itemtype != null">
  290. ITEMTYPE,
  291. </if>
  292. <if test="propertyid != null">
  293. PROPERTYID,
  294. </if>
  295. <if test="workprocid != null">
  296. WORKPROCID,
  297. </if>
  298. <if test="energyid != null">
  299. ENERGYID,
  300. </if>
  301. <if test="unitid != null">
  302. UNITID,
  303. </if>
  304. <if test="useflag != null">
  305. USEFLAG,
  306. </if>
  307. <if test="issettle != null">
  308. ISSETTLE,
  309. </if>
  310. <if test="digits != null">
  311. DIGITS,
  312. </if>
  313. <if test="state != null">
  314. STATE,
  315. </if>
  316. <if test="clock != null">
  317. CLOCK,
  318. </if>
  319. <if test="userid != null">
  320. USERID,
  321. </if>
  322. <if test="modificationtime != null">
  323. MODIFICATIONTIME,
  324. </if>
  325. <if test="defaultvalue != null">
  326. DEFAULTVALUE,
  327. </if>
  328. <if test="showno != null">
  329. SHOWNO,
  330. </if>
  331. <if test="isup != null">
  332. ISUP,
  333. </if>
  334. <if test="fid != null">
  335. FID,
  336. </if>
  337. <if test="associateid != null">
  338. ASSOCIATEID,
  339. </if>
  340. <if test="defaulman != null">
  341. DEFAULMAN,
  342. </if>
  343. <if test="mintimegranid != null">
  344. MINTIMEGRANID,
  345. </if>
  346. <if test="seqno != null">
  347. SEQNO,
  348. </if>
  349. <if test="bz != null">
  350. BZ,
  351. </if>
  352. </trim>
  353. <trim prefix="values (" suffix=")" suffixOverrides=",">
  354. <if test="itemid != null">
  355. #{itemid,jdbcType=VARCHAR},
  356. </if>
  357. <if test="itemname != null">
  358. #{itemname,jdbcType=VARCHAR},
  359. </if>
  360. <if test="itemdesc != null">
  361. #{itemdesc,jdbcType=VARCHAR},
  362. </if>
  363. <if test="itemtype != null">
  364. #{itemtype,jdbcType=VARCHAR},
  365. </if>
  366. <if test="propertyid != null">
  367. #{propertyid,jdbcType=VARCHAR},
  368. </if>
  369. <if test="workprocid != null">
  370. #{workprocid,jdbcType=VARCHAR},
  371. </if>
  372. <if test="energyid != null">
  373. #{energyid,jdbcType=VARCHAR},
  374. </if>
  375. <if test="unitid != null">
  376. #{unitid,jdbcType=VARCHAR},
  377. </if>
  378. <if test="useflag != null">
  379. #{useflag,jdbcType=VARCHAR},
  380. </if>
  381. <if test="issettle != null">
  382. #{issettle,jdbcType=VARCHAR},
  383. </if>
  384. <if test="digits != null">
  385. #{digits,jdbcType=DECIMAL},
  386. </if>
  387. <if test="state != null">
  388. #{state,jdbcType=VARCHAR},
  389. </if>
  390. <if test="clock != null">
  391. #{clock,jdbcType=VARCHAR},
  392. </if>
  393. <if test="userid != null">
  394. #{userid,jdbcType=VARCHAR},
  395. </if>
  396. <if test="modificationtime != null">
  397. #{modificationtime,jdbcType=VARCHAR},
  398. </if>
  399. <if test="defaultvalue != null">
  400. #{defaultvalue,jdbcType=DECIMAL},
  401. </if>
  402. <if test="showno != null">
  403. #{showno,jdbcType=DECIMAL},
  404. </if>
  405. <if test="isup != null">
  406. #{isup,jdbcType=VARCHAR},
  407. </if>
  408. <if test="fid != null">
  409. #{fid,jdbcType=VARCHAR},
  410. </if>
  411. <if test="associateid != null">
  412. #{associateid,jdbcType=VARCHAR},
  413. </if>
  414. <if test="defaulman != null">
  415. #{defaulman,jdbcType=VARCHAR},
  416. </if>
  417. <if test="mintimegranid != null">
  418. #{mintimegranid,jdbcType=VARCHAR},
  419. </if>
  420. <if test="seqno != null">
  421. #{seqno,jdbcType=DECIMAL},
  422. </if>
  423. <if test="bz != null">
  424. #{bz,jdbcType=VARCHAR},
  425. </if>
  426. </trim>
  427. </insert>
  428. <update id="updateByPrimaryKey" parameterType="com.steerinfo.ems.trmactitem.model.TRmActItem">
  429. update T_RM_ACT_ITEM
  430. set ITEMNAME = #{itemname,jdbcType=VARCHAR},
  431. ITEMDESC = #{itemdesc,jdbcType=VARCHAR},
  432. ITEMTYPE = #{itemtype,jdbcType=VARCHAR},
  433. PROPERTYID = #{propertyid,jdbcType=VARCHAR},
  434. WORKPROCID = #{workprocid,jdbcType=VARCHAR},
  435. ENERGYID = #{energyid,jdbcType=VARCHAR},
  436. UNITID = #{unitid,jdbcType=VARCHAR},
  437. USEFLAG = #{useflag,jdbcType=VARCHAR},
  438. ISSETTLE = #{issettle,jdbcType=VARCHAR},
  439. DIGITS = #{digits,jdbcType=DECIMAL},
  440. STATE = #{state,jdbcType=VARCHAR},
  441. CLOCK = #{clock,jdbcType=VARCHAR},
  442. USERID = #{userid,jdbcType=VARCHAR},
  443. MODIFICATIONTIME = #{modificationtime,jdbcType=VARCHAR},
  444. DEFAULTVALUE = #{defaultvalue,jdbcType=DECIMAL},
  445. SHOWNO = #{showno,jdbcType=DECIMAL},
  446. ISUP = #{isup,jdbcType=VARCHAR},
  447. FID = #{fid,jdbcType=VARCHAR},
  448. ASSOCIATEID = #{associateid,jdbcType=VARCHAR},
  449. DEFAULMAN = #{defaulman,jdbcType=VARCHAR},
  450. MINTIMEGRANID = #{mintimegranid,jdbcType=VARCHAR},
  451. SEQNO = #{seqno,jdbcType=DECIMAL},
  452. BZ = #{bz,jdbcType=VARCHAR}
  453. where ITEMID = #{itemid,jdbcType=VARCHAR}
  454. </update>
  455. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.ems.trmactitem.model.TRmActItem">
  456. update T_RM_ACT_ITEM
  457. <set>
  458. <if test="itemname != null">
  459. ITEMNAME = #{itemname,jdbcType=VARCHAR},
  460. </if>
  461. <if test="itemdesc != null">
  462. ITEMDESC = #{itemdesc,jdbcType=VARCHAR},
  463. </if>
  464. <if test="itemtype != null">
  465. ITEMTYPE = #{itemtype,jdbcType=VARCHAR},
  466. </if>
  467. <if test="propertyid != null">
  468. PROPERTYID = #{propertyid,jdbcType=VARCHAR},
  469. </if>
  470. <if test="workprocid != null">
  471. WORKPROCID = #{workprocid,jdbcType=VARCHAR},
  472. </if>
  473. <if test="energyid != null">
  474. ENERGYID = #{energyid,jdbcType=VARCHAR},
  475. </if>
  476. <if test="unitid != null">
  477. UNITID = #{unitid,jdbcType=VARCHAR},
  478. </if>
  479. <if test="useflag != null">
  480. USEFLAG = #{useflag,jdbcType=VARCHAR},
  481. </if>
  482. <if test="issettle != null">
  483. ISSETTLE = #{issettle,jdbcType=VARCHAR},
  484. </if>
  485. <if test="digits != null">
  486. DIGITS = #{digits,jdbcType=DECIMAL},
  487. </if>
  488. <if test="state != null">
  489. STATE = #{state,jdbcType=VARCHAR},
  490. </if>
  491. <if test="clock != null">
  492. CLOCK = #{clock,jdbcType=VARCHAR},
  493. </if>
  494. <if test="userid != null">
  495. USERID = #{userid,jdbcType=VARCHAR},
  496. </if>
  497. <if test="modificationtime != null">
  498. MODIFICATIONTIME = #{modificationtime,jdbcType=VARCHAR},
  499. </if>
  500. <if test="defaultvalue != null">
  501. DEFAULTVALUE = #{defaultvalue,jdbcType=DECIMAL},
  502. </if>
  503. <if test="showno != null">
  504. SHOWNO = #{showno,jdbcType=DECIMAL},
  505. </if>
  506. <if test="isup != null">
  507. ISUP = #{isup,jdbcType=VARCHAR},
  508. </if>
  509. <if test="fid != null">
  510. FID = #{fid,jdbcType=VARCHAR},
  511. </if>
  512. <if test="associateid != null">
  513. ASSOCIATEID = #{associateid,jdbcType=VARCHAR},
  514. </if>
  515. <if test="defaulman != null">
  516. DEFAULMAN = #{defaulman,jdbcType=VARCHAR},
  517. </if>
  518. <if test="mintimegranid != null">
  519. MINTIMEGRANID = #{mintimegranid,jdbcType=VARCHAR},
  520. </if>
  521. <if test="seqno != null">
  522. SEQNO = #{seqno,jdbcType=DECIMAL},
  523. </if>
  524. <if test="bz != null">
  525. BZ = #{bz,jdbcType=VARCHAR},
  526. </if>
  527. </set>
  528. where ITEMID = #{itemid,jdbcType=VARCHAR}
  529. </update>
  530. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  531. <include refid="select"/>
  532. where ITEMID = #{itemid,jdbcType=VARCHAR}
  533. </select>
  534. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  535. <include refid="select"/>
  536. <include refid="where"/>
  537. order by showno
  538. </select>
  539. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  540. <include refid="select"/>
  541. <include refid="whereLike"/>
  542. order by showno
  543. </select>
  544. <insert id="batchInsert" parameterType="java.util.List">
  545. insert into T_RM_ACT_ITEM
  546. (ITEMID,
  547. ITEMNAME, ITEMDESC, ITEMTYPE,
  548. PROPERTYID, WORKPROCID, ENERGYID,
  549. UNITID, USEFLAG, ISSETTLE,
  550. DIGITS, STATE, CLOCK,
  551. USERID, MODIFICATIONTIME, DEFAULTVALUE,
  552. SHOWNO, ISUP, FID,
  553. ASSOCIATEID, DEFAULMAN, MINTIMEGRANID,
  554. SEQNO, BZ)
  555. ( <foreach collection="list" item="item" separator="union all">
  556. select
  557. #{item.itemid,jdbcType=VARCHAR},
  558. #{item.itemname,jdbcType=VARCHAR}, #{item.itemdesc,jdbcType=VARCHAR}, #{item.itemtype,jdbcType=VARCHAR},
  559. #{item.propertyid,jdbcType=VARCHAR}, #{item.workprocid,jdbcType=VARCHAR}, #{item.energyid,jdbcType=VARCHAR},
  560. #{item.unitid,jdbcType=VARCHAR}, #{item.useflag,jdbcType=VARCHAR}, #{item.issettle,jdbcType=VARCHAR},
  561. #{item.digits,jdbcType=DECIMAL}, #{item.state,jdbcType=VARCHAR}, #{item.clock,jdbcType=VARCHAR},
  562. #{item.userid,jdbcType=VARCHAR}, #{item.modificationtime,jdbcType=VARCHAR}, #{item.defaultvalue,jdbcType=DECIMAL},
  563. #{item.showno,jdbcType=DECIMAL}, #{item.isup,jdbcType=VARCHAR}, #{item.fid,jdbcType=VARCHAR},
  564. #{item.associateid,jdbcType=VARCHAR}, #{item.defaulman,jdbcType=VARCHAR}, #{item.mintimegranid,jdbcType=VARCHAR},
  565. #{item.seqno,jdbcType=DECIMAL}, #{item.bz,jdbcType=VARCHAR} from dual
  566. </foreach> )
  567. </insert>
  568. <update id="batchUpdate" parameterType="java.util.List">
  569. update T_RM_ACT_ITEM
  570. set
  571. ITEMID=
  572. <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
  573. when #{item.itemid,jdbcType=VARCHAR} then #{item.itemid,jdbcType=VARCHAR}
  574. </foreach>
  575. ,ITEMNAME=
  576. <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
  577. when #{item.itemid,jdbcType=VARCHAR} then #{item.itemname,jdbcType=VARCHAR}
  578. </foreach>
  579. ,ITEMDESC=
  580. <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
  581. when #{item.itemid,jdbcType=VARCHAR} then #{item.itemdesc,jdbcType=VARCHAR}
  582. </foreach>
  583. ,ITEMTYPE=
  584. <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
  585. when #{item.itemid,jdbcType=VARCHAR} then #{item.itemtype,jdbcType=VARCHAR}
  586. </foreach>
  587. ,PROPERTYID=
  588. <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
  589. when #{item.itemid,jdbcType=VARCHAR} then #{item.propertyid,jdbcType=VARCHAR}
  590. </foreach>
  591. ,WORKPROCID=
  592. <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
  593. when #{item.itemid,jdbcType=VARCHAR} then #{item.workprocid,jdbcType=VARCHAR}
  594. </foreach>
  595. ,ENERGYID=
  596. <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
  597. when #{item.itemid,jdbcType=VARCHAR} then #{item.energyid,jdbcType=VARCHAR}
  598. </foreach>
  599. ,UNITID=
  600. <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
  601. when #{item.itemid,jdbcType=VARCHAR} then #{item.unitid,jdbcType=VARCHAR}
  602. </foreach>
  603. ,USEFLAG=
  604. <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
  605. when #{item.itemid,jdbcType=VARCHAR} then #{item.useflag,jdbcType=VARCHAR}
  606. </foreach>
  607. ,ISSETTLE=
  608. <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
  609. when #{item.itemid,jdbcType=VARCHAR} then #{item.issettle,jdbcType=VARCHAR}
  610. </foreach>
  611. ,DIGITS=
  612. <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
  613. when #{item.itemid,jdbcType=VARCHAR} then #{item.digits,jdbcType=DECIMAL}
  614. </foreach>
  615. ,STATE=
  616. <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
  617. when #{item.itemid,jdbcType=VARCHAR} then #{item.state,jdbcType=VARCHAR}
  618. </foreach>
  619. ,CLOCK=
  620. <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
  621. when #{item.itemid,jdbcType=VARCHAR} then #{item.clock,jdbcType=VARCHAR}
  622. </foreach>
  623. ,USERID=
  624. <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
  625. when #{item.itemid,jdbcType=VARCHAR} then #{item.userid,jdbcType=VARCHAR}
  626. </foreach>
  627. ,MODIFICATIONTIME=
  628. <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
  629. when #{item.itemid,jdbcType=VARCHAR} then #{item.modificationtime,jdbcType=VARCHAR}
  630. </foreach>
  631. ,DEFAULTVALUE=
  632. <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
  633. when #{item.itemid,jdbcType=VARCHAR} then #{item.defaultvalue,jdbcType=DECIMAL}
  634. </foreach>
  635. ,SHOWNO=
  636. <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
  637. when #{item.itemid,jdbcType=VARCHAR} then #{item.showno,jdbcType=DECIMAL}
  638. </foreach>
  639. ,ISUP=
  640. <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
  641. when #{item.itemid,jdbcType=VARCHAR} then #{item.isup,jdbcType=VARCHAR}
  642. </foreach>
  643. ,FID=
  644. <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
  645. when #{item.itemid,jdbcType=VARCHAR} then #{item.fid,jdbcType=VARCHAR}
  646. </foreach>
  647. ,ASSOCIATEID=
  648. <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
  649. when #{item.itemid,jdbcType=VARCHAR} then #{item.associateid,jdbcType=VARCHAR}
  650. </foreach>
  651. ,DEFAULMAN=
  652. <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
  653. when #{item.itemid,jdbcType=VARCHAR} then #{item.defaulman,jdbcType=VARCHAR}
  654. </foreach>
  655. ,MINTIMEGRANID=
  656. <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
  657. when #{item.itemid,jdbcType=VARCHAR} then #{item.mintimegranid,jdbcType=VARCHAR}
  658. </foreach>
  659. ,SEQNO=
  660. <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
  661. when #{item.itemid,jdbcType=VARCHAR} then #{item.seqno,jdbcType=DECIMAL}
  662. </foreach>
  663. ,BZ=
  664. <foreach collection="list" item="item" index="index" separator=" " open="case ITEMID" close="end">
  665. when #{item.itemid,jdbcType=VARCHAR} then #{item.bz,jdbcType=VARCHAR}
  666. </foreach>
  667. where ITEMID in
  668. <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
  669. #{item.itemid,jdbcType=VARCHAR}
  670. </foreach>
  671. </update>
  672. <delete id="batchDelete" parameterType="java.util.List">
  673. delete from T_RM_ACT_ITEM
  674. where ITEMID in
  675. <foreach collection="list" item="id" open="(" close=")" separator=",">
  676. #{id}
  677. </foreach>
  678. </delete>
  679. <!-- 友情提示!!!-->
  680. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  681. <!--查询下拉框-->
  682. <select id="getIdAndName" parameterType="string" resultMap="BaseResultMap">
  683. SELECT ITEMNAME,ITEMID FROM T_RM_ACT_ITEM
  684. <where>
  685. <if test="itemtype != null and itemtype != ''">
  686. and ITEMTYPE = #{itemtype}
  687. </if>
  688. </where>
  689. ORDER BY ITEMNAME
  690. </select>
  691. <!--供需项目数据维护结果区-->
  692. <select id="getActitemDetalts" parameterType="java.util.HashMap" resultType = "Map">
  693. SELECT * FROM VM_ACTITEM_DETAILTS t
  694. <where>
  695. <if test="timegranid != null and timegranid !=''">
  696. AND t.timegranid=#{timegranid}
  697. </if>
  698. <if test="clock != null and clock != ''">
  699. and t.CLOCK &gt;= #{clock}
  700. </if>
  701. <if test="clocke != null and clocke != ''">
  702. and t.CLOCK &lt;= #{clocke}
  703. </if>
  704. <if test="workprocid != null and workprocid!='' ">
  705. AND workprocid in (${workprocid})
  706. </if>
  707. <if test="energyid!=null and energyid!='' ">
  708. AND energyid in (${energyid})
  709. </if>
  710. <if test="energytypeid!=null and energytypeid!='' ">
  711. AND energytypeid in (${energytypeid})
  712. </if>
  713. <if test="propertyid != null and propertyid !='' ">
  714. AND propertyid in (${propertyid})
  715. </if>
  716. <if test="itemid != null and itemid !='' ">
  717. AND t.itemid in (${itemid})
  718. </if>
  719. <if test="itemname !=null and itemname !='' ">
  720. AND t.itemname LIKE '%${itemname}%'
  721. </if>
  722. <if test="itemdesc != null and itemdesc != ''">
  723. and t.itemdesc like '%${itemdesc}%'
  724. </if>
  725. <if test="issettle != null and issettle != ''">
  726. and t.issettle = ${issettle}
  727. </if>
  728. <if test="measureid != null and measureid != ''">
  729. and exists
  730. (select id from FORMULA where sourcecode like '%[${measureid}]%' and code = t.itemid)
  731. </if>
  732. </where>
  733. order by t.clock desc,t.seqno
  734. </select>
  735. <!--查询计划项目维护结果区-->
  736. <select id="getPlanitemDetalts" parameterType="java.util.HashMap" resultType="Map">
  737. SELECT * from VM_PLANITEM_DETAIL
  738. <where>
  739. <if test="timegranid != null and timegranid !=''">
  740. AND timegranid=#{timegranid}
  741. </if>
  742. <if test="clock !=null and clock!='' ">
  743. AND clock =#{clock}
  744. </if>
  745. <if test="workprocid != null and workprocid!='' ">
  746. AND workprocid in (${workprocid})
  747. </if>
  748. <if test="energyid!=null and energyid!='' ">
  749. AND energyid in (${energyid})
  750. </if>
  751. <if test="propertyid != null and propertyid !='' ">
  752. AND propertyid in (${propertyid})
  753. </if>
  754. <if test="itemid != null and itemid !='' ">
  755. AND itemid LIKE #{itemid}
  756. </if>
  757. <if test="itemname !=null and itemname !='' ">
  758. AND itemname LIKE #{itemname}
  759. </if>
  760. <if test="state != null and state !=''">
  761. AND STATE =#{state,jdbcType=VARCHAR}
  762. </if>
  763. <if test="clock != null and clock !='' ">
  764. AND CLOCK=#{clock,jdbcType=VARCHAR}
  765. </if>
  766. <if test="userid != null and userid!='' ">
  767. AND USERID=#{userid,jdbcType=VARCHAR}
  768. </if>
  769. <if test="modificationtime != null and modificationtime != '' ">
  770. AND MODIFICATIONTIME=#{modificationtime,jdbcType=VARCHAR}
  771. </if>
  772. <if test="defaultvalue != null">
  773. and DEFAULTVALUE = #{defaultvalue}
  774. </if>
  775. </where>
  776. order by workprocid
  777. </select>
  778. <!--实绩项目维护定时任务查询-->
  779. <select id="getforsj" resultMap="BaseResultMap" parameterType="string">
  780. SELECT ITEMID,DIGITS, energyid,workprocid FROM T_RM_ACT_ITEM WHERE USEFLAG='1' and itemtype='R'
  781. <if test="mintimegranid != null and mintimegranid !=''">
  782. and MINTIMEGRANID=#{mintimegranid}
  783. </if>
  784. order by seqno
  785. </select>
  786. <!-- 项目定时任务查询 -->
  787. <select id="getitems" resultMap="BaseResultMap" parameterType="string">
  788. SELECT ITEMID,DIGITS, energyid,workprocid,MINTIMEGRANID FROM T_RM_ACT_ITEM
  789. <where>
  790. <if test="itemtype !=null and itemtype!=''">
  791. AND ITEMTYPE = #{itemtype}
  792. </if>
  793. AND USEFLAG='1'
  794. </where>
  795. order by seqno
  796. </select>
  797. <!-- 获取实绩项目信息,按seqno排序 -->
  798. <select id="selectActr" resultMap="BaseResultMap" parameterType="java.util.HashMap">
  799. select ITEMID, ITEMNAME, ITEMDESC, ITEMTYPE, PROPERTYID, WORKPROCID, ENERGYID, UNITID,
  800. USEFLAG, SEQNO, ISSETTLE, DIGITS,STATE,CLOCK,USERID,MODIFICATIONTIME,DEFAULTVALUE, FID,
  801. DEFAULMAN,MINTIMEGRANID, ISUP
  802. from T_RM_ACT_ITEM
  803. <where>
  804. <if test="itemid != null and itemid!= ''">
  805. and ITEMID in (${itemid})
  806. </if>
  807. <if test="itemname != null and itemname != ''">
  808. and ITEMNAME LIKE '%${itemname}%'
  809. </if>
  810. <if test="itemdesc != null and itemdesc != ''">
  811. and ITEMDESC = #{itemdesc}
  812. </if>
  813. <if test="propertyid != null and propertyid != ''">
  814. and PROPERTYID in (${propertyid})
  815. </if>
  816. <if test="workprocid != null and workprocid != ''">
  817. and WORKPROCID in (${workprocid})
  818. </if>
  819. <if test="energyid != null and energyid != ''">
  820. and ENERGYID in (${energyid})
  821. </if>
  822. <if test="unitid != null and unitid != ''">
  823. and UNITID = #{unitid}
  824. </if>
  825. <if test="fid != null and fid != ''">
  826. and FID = #{fid}
  827. </if>
  828. <if test="useflag != null and useflag != ''">
  829. and USEFLAG = #{useflag}
  830. </if>
  831. <if test="seqno != null">
  832. and SEQNO = #{seqno}
  833. </if>
  834. <if test="issettle != null and issettle != ''">
  835. and ISSETTLE = #{issettle}
  836. </if>
  837. <if test="digits != null">
  838. and DIGITS = #{digits}
  839. </if>
  840. <if test="defaultvalue != null">
  841. and DEFAULTVALUE = #{defaultvalue}
  842. </if>
  843. <if test="mintimegranid != null and mintimegranid != ''">
  844. and MINTIMEGRANID = #{mintimegranid}
  845. </if>
  846. <if test="itemtype != null and itemtype != ''">
  847. and ITEMTYPE = #{itemtype}
  848. </if>
  849. <if test="measureid != null and measureid != ''">
  850. and exists
  851. (select id from FORMULA where sourcecode like '%[${measureid}]%' and code = itemid)
  852. </if>
  853. AND USEFLAG='1'
  854. </where>
  855. order by seqno
  856. </select>
  857. <!--供需项目数据维护结果区-->
  858. <select id="getBalanceData" parameterType="java.util.HashMap" resultType = "Map">
  859. SELECT t.*, r.apportvalue rav FROM VM_BALANCEITEM_DETAIL t left join VM_ACTITEM_DETAILTS r
  860. on t.clock = r.clock and t.energyid = r.energyid and t.timegranid = r.timegranid
  861. and t.propertyid = r.propertyid and t.workprocid = r.workprocid
  862. <where>
  863. <if test="timegranid != null and timegranid !=''">
  864. AND t.timegranid=#{timegranid}
  865. </if>
  866. <if test="clock != null and clock != ''">
  867. and t.CLOCK &gt;= #{clock}
  868. </if>
  869. <if test="clocke != null and clocke != ''">
  870. and t.CLOCK &lt;= #{clocke}
  871. </if>
  872. <if test="propertyid != null and propertyid != ''">
  873. and t.PROPERTYID in (${propertyid})
  874. </if>
  875. <if test="workprocid != null and workprocid != ''">
  876. and t.WORKPROCID in (${workprocid})
  877. </if>
  878. <if test="energyid != null and energyid != ''">
  879. and t.ENERGYID in (${energyid})
  880. </if>
  881. <if test="itemid != null and itemid !='' ">
  882. and t.itemid in (${itemid})
  883. </if>
  884. <if test="itemname !=null and itemname !='' ">
  885. AND t.itemname LIKE '%${itemname}%'
  886. </if>
  887. <if test="itemdesc != null and itemdesc != ''">
  888. and t.itemdesc like '%${itemdesc}%'
  889. </if>
  890. <if test="measureid != null and measureid != ''">
  891. and exists
  892. (select id from FORMULA where sourcecode like '%[${measureid}]%' and code = t.itemid)
  893. </if>
  894. </where>
  895. order by t.clock desc,t.seqno
  896. </select>
  897. <select id="queryLikew" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  898. <include refid="select_alias"/>
  899. left join T_RM_WORKPROC w on t.workprocid = w.id
  900. <include refid="whereLike"/>
  901. order by w.seqno, t.showno
  902. </select>
  903. <select id="queryLikef" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  904. <include refid="select_alias"/>
  905. left join T_RM_WORKPROC w on t.workprocid = w.id
  906. <include refid="whereLike"/>
  907. order by w.seqno, t.showno
  908. </select>
  909. <!-- 上报关联产量查询 -->
  910. <select id="getProItems" resultType = "Map">
  911. select substr(it,0, instr(it||'/','/')-1) itemid,substr(it,instr(it||'/','/')) rate from
  912. (select distinct(fid) it from T_RM_ACT_ITEM where itemtype='W' and fid is not null and useflag='1' and state='1')
  913. </select>
  914. <!-- 上报关联能耗查询 -->
  915. <select id="getAssItems" resultType = "Map">
  916. select substr(it,0, instr(it||'/','/')-1) itemid,substr(it,instr(it||'/','/')) rate from
  917. (select distinct(associateid) it from T_RM_ACT_ITEM where itemtype='W' and associateid is not null and useflag='1')
  918. </select>
  919. <!-- 获取上报关联产量列表 -->
  920. <select id="listpv" parameterType="java.util.HashMap" resultType = "Map">
  921. select t.clock,t.timegranid,t.apportvalue, apportvalue,p.itemname,t.itemid,p.workprocid,
  922. pt.name pname,
  923. p.unitid,
  924. p.rtpitemid,
  925. t.bz2 as bz,
  926. t.qrtime as uptime,
  927. t.qrman as upuser,
  928. t.rtpvalue as productwvalue
  929. from T_RM_WORKPROC_PRODUCT_VALUE t inner join T_RM_WORKPROC_PRODUCT p on t.itemid = p.itemid
  930. inner join T_RM_PRODUCT pt on pt.id = p.productid
  931. where t.timegranid = 'MONTH' and t.itemid in (${cpid})
  932. <if test="clock != null and clock != ''">
  933. and t.CLOCK &gt;= #{clock}
  934. </if>
  935. <if test="clocke != null and clocke != ''">
  936. and t.CLOCK &lt;= #{clocke}
  937. </if>
  938. <if test="pname !=null and pname !='' ">
  939. and pt.name LIKE '%${pname}%'
  940. </if>
  941. <if test="itemname !=null and itemname !='' ">
  942. and p.itemname LIKE '%${itemname}%'
  943. </if>
  944. <if test="itemid != null and itemid !='' ">
  945. and t.itemid like '%${itemid}%'
  946. </if>
  947. <if test="workprocid != null and workprocid != ''">
  948. and p.WORKPROCID in (${workprocid})
  949. </if>
  950. <if test="rtpitemid != null and rtpitemid != ''">
  951. and p.RTPITEMID in (${rtpitemid})
  952. </if>
  953. <if test="state != null and state != ''">
  954. <if test="state == '0'.toString()">
  955. and t.rtpvalue is null
  956. </if>
  957. <if test="state == '1'.toString()">
  958. and t.rtpvalue is not null
  959. </if>
  960. </if>
  961. order by clock desc,p.workprocid
  962. </select>
  963. </mapper>