EmsProdplanRoundMapper.xml 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862
  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.emsprodplanround.mapper.EmsProdplanRoundMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.ems.emsprodplanround.model.EmsProdplanRound">
  5. <id column="ID" jdbcType="VARCHAR" property="id" />
  6. <result column="MAY" jdbcType="DATE" property="may" />
  7. <result column="SQNO" jdbcType="DECIMAL" property="sqno" />
  8. <result column="UNITID" jdbcType="VARCHAR" property="unitid" />
  9. <result column="DESCRIBE" jdbcType="VARCHAR" property="describe" />
  10. <result column="STATE" jdbcType="VARCHAR" property="state" />
  11. <result column="GRADES" jdbcType="VARCHAR" property="grades" />
  12. <result column="PLAN_WEIGHT" jdbcType="DECIMAL" property="planWeight" />
  13. <result column="SPECIFICATIONS" jdbcType="VARCHAR" property="specifications" />
  14. <result column="LENGTHS" jdbcType="VARCHAR" property="lengths" />
  15. <result column="CHEMICAL_STANDARD" jdbcType="VARCHAR" property="chemicalStandard" />
  16. <result column="SURFACE_STANDARD" jdbcType="VARCHAR" property="surfaceStandard" />
  17. <result column="MEMO" jdbcType="VARCHAR" property="memo" />
  18. <result column="ISSUED_TIME" jdbcType="TIMESTAMP" property="issuedTime" />
  19. <result column="CREATEMAN" jdbcType="VARCHAR" property="createman" />
  20. <result column="CREATETIME" jdbcType="TIMESTAMP" property="createtime" />
  21. <result column="UPDATEMAN" jdbcType="VARCHAR" property="updateman" />
  22. <result column="UPDATETIME" jdbcType="TIMESTAMP" property="updatetime" />
  23. <result column="TRANSPORT_TYPE" jdbcType="VARCHAR" property="transportType" />
  24. <result column="PURPOSE" jdbcType="VARCHAR" property="purpose" />
  25. <result column="WORKPROC_TYPE" jdbcType="VARCHAR" property="workprocType" />
  26. <result column="MSG_FLAG" jdbcType="VARCHAR" property="msgFlag" />
  27. <result column="READ_FLAG" jdbcType="VARCHAR" property="readFlag" />
  28. <result column="PARENTID" jdbcType="VARCHAR" property="parentid"/>
  29. <result column="IATERAL_AREA" jdbcType="VARCHAR" property="iateralArea"/>
  30. <result column="LENGTH_TIMES_WIDTH" jdbcType="VARCHAR" property="lengthTimesWidth"/>
  31. <result column="DIMENSION" jdbcType="VARCHAR" property="dimension"/>
  32. <result column="STATUS" jdbcType="VARCHAR" property="status"/>
  33. <result column="ERR_MSG" jdbcType="VARCHAR" property="err_msg"/>
  34. <result column="DELIVERY_DATE" jdbcType="TIMESTAMP" property="deliveryDate"/>
  35. <result column="AUDITSTATE" jdbcType="VARCHAR" property="auditState"/>
  36. <result column="GOINFO" jdbcType="VARCHAR" property="goinfo"/>
  37. <result column="FETCH_PLAN_WEIGHT" jdbcType="DECIMAL" property="fetchPlanWeight"/>
  38. <result column="ASCRIPTION" jdbcType="VARCHAR" property="ascription"/>
  39. <result column="TAG" jdbcType="VARCHAR" property="tag"/>
  40. </resultMap>
  41. <sql id="columns">
  42. ID, MAY, SQNO, UNITID, DESCRIBE, STATE, GRADES, PLAN_WEIGHT, SPECIFICATIONS, LENGTHS,
  43. CHEMICAL_STANDARD, SURFACE_STANDARD, MEMO, ISSUED_TIME, CREATEMAN, CREATETIME, UPDATEMAN,
  44. UPDATETIME, TRANSPORT_TYPE, PURPOSE, WORKPROC_TYPE, MSG_FLAG, READ_FLAG,PARENTID,IATERAL_AREA,LENGTH_TIMES_WIDTH,DIMENSION,STATUS,ERR_MSG,GOINFO,FETCH_PLAN_WEIGHT,DELIVERY_DATE,AUDITSTATE,ASCRIPTION,TAG
  45. </sql>
  46. <sql id="columns_alias">
  47. t.ID, t.MAY, t.SQNO, t.UNITID, t.DESCRIBE, t.STATE, t.GRADES, t.PLAN_WEIGHT, t.SPECIFICATIONS,
  48. t.LENGTHS, t.CHEMICAL_STANDARD, t.SURFACE_STANDARD, t.MEMO, t.ISSUED_TIME, t.CREATEMAN,
  49. t.CREATETIME, t.UPDATEMAN, t.UPDATETIME, t.TRANSPORT_TYPE, t.PURPOSE, t.WORKPROC_TYPE,
  50. t.MSG_FLAG, t.READ_FLAG,t.PARENTID,GOINFO,FETCH_PLAN_WEIGHT,t.TAG
  51. </sql>
  52. <sql id="select">
  53. SELECT <include refid="columns"/> FROM EMS_PRODPLAN_ROUND
  54. </sql>
  55. <sql id="select_alias">
  56. SELECT <include refid="columns_alias"/> FROM EMS_PRODPLAN_ROUND t
  57. </sql>
  58. <sql id="where">
  59. <where>
  60. <if test="id != null and id != ''">
  61. and ID = #{id}
  62. </if>
  63. <if test="may != null">
  64. and trunc(MAY) = to_date(#{may},'yyyy-mm-dd')
  65. </if>
  66. <if test="sqno != null and sqno != ''">
  67. and SQNO = #{sqno}
  68. </if>
  69. <if test="unitid != null and unitid != ''">
  70. and UNITID = #{unitid}
  71. </if>
  72. <if test="describe != null and describe != ''">
  73. and DESCRIBE = #{describe}
  74. </if>
  75. <if test="state != null and state != ''">
  76. and STATE = #{state}
  77. </if>
  78. <if test="grades != null and grades != ''">
  79. and GRADES = #{grades}
  80. </if>
  81. <if test="planWeight != null">
  82. and PLAN_WEIGHT = #{planWeight}
  83. </if>
  84. <if test="specifications != null and specifications != ''">
  85. and SPECIFICATIONS = #{specifications}
  86. </if>
  87. <if test="lengths != null and lengths != ''">
  88. and LENGTHS = #{lengths}
  89. </if>
  90. <if test="chemicalStandard != null and chemicalStandard != ''">
  91. and CHEMICAL_STANDARD = #{chemicalStandard}
  92. </if>
  93. <if test="surfaceStandard != null and surfaceStandard != ''">
  94. and SURFACE_STANDARD = #{surfaceStandard}
  95. </if>
  96. <if test="memo != null and memo != ''">
  97. and MEMO = #{memo}
  98. </if>
  99. <if test="issuedTime != null">
  100. and TO_CHAR(ISSUED_TIME,'yyyy-MM-dd') = #{issuedTime}
  101. </if>
  102. <if test="createman != null and createman != ''">
  103. and CREATEMAN = #{createman}
  104. </if>
  105. <if test="createtime != null">
  106. and TO_CHAR(CREATETIME,'yyyy-MM-dd') = #{createtime}
  107. </if>
  108. <if test="updateman != null and updateman != ''">
  109. and UPDATEMAN = #{updateman}
  110. </if>
  111. <if test="updatetime != null">
  112. and TO_CHAR(UPDATETIME,'yyyy-MM-dd') = #{updatetime}
  113. </if>
  114. <if test="transportType != null and transportType != ''">
  115. and TRANSPORT_TYPE = #{transportType}
  116. </if>
  117. <if test="purpose != null and purpose != ''">
  118. and PURPOSE = #{purpose}
  119. </if>
  120. <if test="workprocType != null and workprocType != ''">
  121. and WORKPROC_TYPE = #{workprocType}
  122. </if>
  123. <if test="msgFlag != null and msgFlag != ''">
  124. and MSG_FLAG = #{msgFlag}
  125. </if>
  126. <if test="readFlag != null and readFlag != ''">
  127. and READ_FLAG = #{readFlag}
  128. </if>
  129. <if test="parentid != null and parentid != '' ">
  130. and PARENTID = #{parentid}
  131. </if>
  132. <if test="tag != null and tag != '' ">
  133. and TAG = #{tag}
  134. </if>
  135. ORDER BY CREATETIME DESC
  136. </where>
  137. </sql>
  138. <sql id="whereLike">
  139. <where>
  140. <if test="id != null and id != ''">
  141. and ID LIKE '%${id}%'
  142. </if>
  143. <if test="may != null">
  144. and TO_CHAR(MAY,'yyyy-MM-dd') = #{may}
  145. </if>
  146. <if test="sqno != null and sqno != ''">
  147. and SQNO LIKE '%${sqno}%'
  148. </if>
  149. <if test="unitid != null and unitid != ''">
  150. and UNITID LIKE '%${unitid}%'
  151. </if>
  152. <if test="describe != null and describe != ''">
  153. and DESCRIBE LIKE '%${describe}%'
  154. </if>
  155. <if test="state != null and state != ''">
  156. and STATE LIKE '%${state}%'
  157. </if>
  158. <if test="grades != null and grades != ''">
  159. and GRADES LIKE '%${grades}%'
  160. </if>
  161. <if test="planWeight != null">
  162. and PLAN_WEIGHT = #{planWeight}
  163. </if>
  164. <if test="specifications != null and specifications != ''">
  165. and SPECIFICATIONS LIKE '%${specifications}%'
  166. </if>
  167. <if test="lengths != null and lengths != ''">
  168. and LENGTHS LIKE '%${lengths}%'
  169. </if>
  170. <if test="chemicalStandard != null and chemicalStandard != ''">
  171. and CHEMICAL_STANDARD LIKE '%${chemicalStandard}%'
  172. </if>
  173. <if test="surfaceStandard != null and surfaceStandard != ''">
  174. and SURFACE_STANDARD LIKE '%${surfaceStandard}%'
  175. </if>
  176. <if test="memo != null and memo != ''">
  177. and MEMO LIKE '%${memo}%'
  178. </if>
  179. <if test="issuedTime != null">
  180. and TO_CHAR(ISSUED_TIME,'yyyy-MM-dd') = #{issuedTime}
  181. </if>
  182. <if test="createman != null and createman != ''">
  183. and CREATEMAN LIKE '%${createman}%'
  184. </if>
  185. <if test="createtime != null">
  186. and TO_CHAR(CREATETIME,'yyyy-MM-dd') = #{createtime}
  187. </if>
  188. <if test="updateman != null and updateman != ''">
  189. and UPDATEMAN LIKE '%${updateman}%'
  190. </if>
  191. <if test="updatetime != null">
  192. and TO_CHAR(UPDATETIME,'yyyy-MM-dd') = #{updatetime}
  193. </if>
  194. <if test="transportType != null and transportType != ''">
  195. and TRANSPORT_TYPE LIKE '%${transportType}%'
  196. </if>
  197. <if test="purpose != null and purpose != ''">
  198. and PURPOSE LIKE '%${purpose}%'
  199. </if>
  200. <if test="workprocType != null and workprocType != ''">
  201. and WORKPROC_TYPE LIKE '%${workprocType}%'
  202. </if>
  203. <if test="msgFlag != null and msgFlag != ''">
  204. and MSG_FLAG LIKE '%${msgFlag}%'
  205. </if>
  206. <if test="readFlag != null and readFlag != ''">
  207. and READ_FLAG LIKE '%${readFlag}%'
  208. </if>
  209. <if test="tag != null and tag != ''">
  210. and TAG LIKE '%${tag}%'
  211. </if>
  212. </where>
  213. </sql>
  214. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  215. delete from EMS_PRODPLAN_ROUND
  216. where ID = #{id,jdbcType=VARCHAR}
  217. </delete>
  218. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  219. delete from EMS_PRODPLAN_ROUND
  220. where 1!=1
  221. <if test="may != null">
  222. or TO_CHAR(MAY,'yyyy-MM-dd') = '#{may}'
  223. </if>
  224. <if test="sqno != null and sqno != ''">
  225. or SQNO = #{sqno}
  226. </if>
  227. <if test="unitid != null and unitid != ''">
  228. or UNITID = #{unitid}
  229. </if>
  230. <if test="describe != null and describe != ''">
  231. or DESCRIBE = #{describe}
  232. </if>
  233. <if test="state != null and state != ''">
  234. or STATE = #{state}
  235. </if>
  236. <if test="grades != null and grades != ''">
  237. or GRADES = #{grades}
  238. </if>
  239. <if test="planWeight != null">
  240. or PLAN_WEIGHT = #{planWeight}
  241. </if>
  242. <if test="specifications != null and specifications != ''">
  243. or SPECIFICATIONS = #{specifications}
  244. </if>
  245. <if test="lengths != null and lengths != ''">
  246. or LENGTHS = #{lengths}
  247. </if>
  248. <if test="chemicalStandard != null and chemicalStandard != ''">
  249. or CHEMICAL_STANDARD = #{chemicalStandard}
  250. </if>
  251. <if test="surfaceStandard != null and surfaceStandard != ''">
  252. or SURFACE_STANDARD = #{surfaceStandard}
  253. </if>
  254. <if test="memo != null and memo != ''">
  255. or MEMO = #{memo}
  256. </if>
  257. <if test="issuedTime != null">
  258. or TO_CHAR(ISSUED_TIME,'yyyy-MM-dd') = '#{issuedTime}'
  259. </if>
  260. <if test="createman != null and createman != ''">
  261. or CREATEMAN = #{createman}
  262. </if>
  263. <if test="createtime != null">
  264. or TO_CHAR(CREATETIME,'yyyy-MM-dd') = '#{createtime}'
  265. </if>
  266. <if test="updateman != null and updateman != ''">
  267. or UPDATEMAN = #{updateman}
  268. </if>
  269. <if test="updatetime != null">
  270. or TO_CHAR(UPDATETIME,'yyyy-MM-dd') = '#{updatetime}'
  271. </if>
  272. <if test="transportType != null and transportType != ''">
  273. or TRANSPORT_TYPE = #{transportType}
  274. </if>
  275. <if test="purpose != null and purpose != ''">
  276. or PURPOSE = #{purpose}
  277. </if>
  278. <if test="workprocType != null and workprocType != ''">
  279. or WORKPROC_TYPE = #{workprocType}
  280. </if>
  281. <if test="msgFlag != null and msgFlag != ''">
  282. or MSG_FLAG = #{msgFlag}
  283. </if>
  284. <if test="readFlag != null and readFlag != ''">
  285. or READ_FLAG = #{readFlag}
  286. </if>
  287. <if test="tag != null and tag != ''">
  288. or TAG = #{tag}
  289. </if>
  290. </delete>
  291. <insert id="insert" parameterType="com.steerinfo.ems.emsprodplanround.model.EmsProdplanRound">
  292. insert into EMS_PRODPLAN_ROUND (ID, MAY, SQNO,
  293. UNITID, DESCRIBE, STATE,
  294. GRADES, PLAN_WEIGHT, SPECIFICATIONS,
  295. LENGTHS, CHEMICAL_STANDARD, SURFACE_STANDARD,
  296. MEMO, ISSUED_TIME, CREATEMAN,
  297. CREATETIME, UPDATEMAN, UPDATETIME,
  298. TRANSPORT_TYPE, PURPOSE, WORKPROC_TYPE,
  299. MSG_FLAG, READ_FLAG,PARENTID,IATERAL_AREA,LENGTH_TIMES_WIDTH,DIMENSION,GOINFO,DELIVERY_DATE,AUDITSTATE,ASCRIPTION,TAG)
  300. values (#{id,jdbcType=VARCHAR}, #{may,jdbcType=TIMESTAMP}, #{sqno,jdbcType=DECIMAL},
  301. #{unitid,jdbcType=VARCHAR}, #{describe,jdbcType=VARCHAR}, #{state,jdbcType=VARCHAR},
  302. #{grades,jdbcType=VARCHAR}, #{planWeight,jdbcType=DECIMAL}, #{specifications,jdbcType=VARCHAR},
  303. #{lengths,jdbcType=VARCHAR}, #{chemicalStandard,jdbcType=VARCHAR}, #{surfaceStandard,jdbcType=VARCHAR},
  304. #{memo,jdbcType=VARCHAR}, #{issuedTime,jdbcType=TIMESTAMP}, #{createman,jdbcType=VARCHAR},
  305. #{createtime,jdbcType=TIMESTAMP}, #{updateman,jdbcType=VARCHAR}, #{updatetime,jdbcType=TIMESTAMP},
  306. #{transportType,jdbcType=VARCHAR}, #{purpose,jdbcType=VARCHAR}, #{workprocType,jdbcType=VARCHAR},
  307. #{msgFlag,jdbcType=VARCHAR}, #{readFlag,jdbcType=VARCHAR},#{parentid,jdbcType=VARCHAR},
  308. #{iateralArea,jdbcType=VARCHAR},#{lengthTimesWidth,jdbcType=VARCHAR},
  309. #{dimension,jdbcType=VARCHAR},#{goinfo,jdbcType=VARCHAR},
  310. #{deliveryDate,jdbcType=TIMESTAMP},#{auditState,jdbcType=VARCHAR},#{ascription,jdbcType=VARCHAR},#{tag,jdbcType=VARCHAR})
  311. </insert>
  312. <insert id="insertSelective" parameterType="com.steerinfo.ems.emsprodplanround.model.EmsProdplanRound">
  313. insert into EMS_PRODPLAN_ROUND
  314. <trim prefix="(" suffix=")" suffixOverrides=",">
  315. <if test="id != null">
  316. ID,
  317. </if>
  318. <if test="may != null">
  319. MAY,
  320. </if>
  321. <if test="sqno != null">
  322. SQNO,
  323. </if>
  324. <if test="unitid != null">
  325. UNITID,
  326. </if>
  327. <if test="describe != null">
  328. DESCRIBE,
  329. </if>
  330. <if test="state != null">
  331. STATE,
  332. </if>
  333. <if test="grades != null">
  334. GRADES,
  335. </if>
  336. <if test="planWeight != null">
  337. PLAN_WEIGHT,
  338. </if>
  339. <if test="specifications != null">
  340. SPECIFICATIONS,
  341. </if>
  342. <if test="lengths != null">
  343. LENGTHS,
  344. </if>
  345. <if test="chemicalStandard != null">
  346. CHEMICAL_STANDARD,
  347. </if>
  348. <if test="surfaceStandard != null">
  349. SURFACE_STANDARD,
  350. </if>
  351. <if test="memo != null">
  352. MEMO,
  353. </if>
  354. <if test="issuedTime != null">
  355. ISSUED_TIME,
  356. </if>
  357. <if test="createman != null">
  358. CREATEMAN,
  359. </if>
  360. <if test="createtime != null">
  361. CREATETIME,
  362. </if>
  363. <if test="updateman != null">
  364. UPDATEMAN,
  365. </if>
  366. <if test="updatetime != null">
  367. UPDATETIME,
  368. </if>
  369. <if test="transportType != null">
  370. TRANSPORT_TYPE,
  371. </if>
  372. <if test="purpose != null">
  373. PURPOSE,
  374. </if>
  375. <if test="workprocType != null">
  376. WORKPROC_TYPE,
  377. </if>
  378. <if test="msgFlag != null">
  379. MSG_FLAG,
  380. </if>
  381. <if test="readFlag != null">
  382. READ_FLAG,
  383. </if>
  384. <if test="tag != null">
  385. TAG,
  386. </if>
  387. </trim>
  388. <trim prefix="values (" suffix=")" suffixOverrides=",">
  389. <if test="id != null">
  390. #{id,jdbcType=VARCHAR},
  391. </if>
  392. <if test="may != null">
  393. #{may,jdbcType=TIMESTAMP},
  394. </if>
  395. <if test="sqno != null">
  396. #{sqno,jdbcType=DECIMAL},
  397. </if>
  398. <if test="unitid != null">
  399. #{unitid,jdbcType=VARCHAR},
  400. </if>
  401. <if test="describe != null">
  402. #{describe,jdbcType=VARCHAR},
  403. </if>
  404. <if test="state != null">
  405. #{state,jdbcType=VARCHAR},
  406. </if>
  407. <if test="grades != null">
  408. #{grades,jdbcType=VARCHAR},
  409. </if>
  410. <if test="planWeight != null">
  411. #{planWeight,jdbcType=DECIMAL},
  412. </if>
  413. <if test="specifications != null">
  414. #{specifications,jdbcType=VARCHAR},
  415. </if>
  416. <if test="lengths != null">
  417. #{lengths,jdbcType=VARCHAR},
  418. </if>
  419. <if test="chemicalStandard != null">
  420. #{chemicalStandard,jdbcType=VARCHAR},
  421. </if>
  422. <if test="surfaceStandard != null">
  423. #{surfaceStandard,jdbcType=VARCHAR},
  424. </if>
  425. <if test="memo != null">
  426. #{memo,jdbcType=VARCHAR},
  427. </if>
  428. <if test="issuedTime != null">
  429. #{issuedTime,jdbcType=TIMESTAMP},
  430. </if>
  431. <if test="createman != null">
  432. #{createman,jdbcType=VARCHAR},
  433. </if>
  434. <if test="createtime != null">
  435. #{createtime,jdbcType=TIMESTAMP},
  436. </if>
  437. <if test="updateman != null">
  438. #{updateman,jdbcType=VARCHAR},
  439. </if>
  440. <if test="updatetime != null">
  441. #{updatetime,jdbcType=TIMESTAMP},
  442. </if>
  443. <if test="transportType != null">
  444. #{transportType,jdbcType=VARCHAR},
  445. </if>
  446. <if test="purpose != null">
  447. #{purpose,jdbcType=VARCHAR},
  448. </if>
  449. <if test="workprocType != null">
  450. #{workprocType,jdbcType=VARCHAR},
  451. </if>
  452. <if test="msgFlag != null">
  453. #{msgFlag,jdbcType=VARCHAR},
  454. </if>
  455. <if test="readFlag != null">
  456. #{readFlag,jdbcType=VARCHAR},
  457. </if>
  458. <if test="goinfo != null and goinfo ! = ''">
  459. #{goinfo,jdbcType=VARCHAR}
  460. </if>
  461. <if test="fetchPlanWeight != null ">
  462. #{fetchPlanWeight,jdbcType=DECIMAL}
  463. </if>
  464. <if test="tag != null ">
  465. #{tag,jdbcType=VARCHAR}
  466. </if>
  467. </trim>
  468. </insert>
  469. <update id="updateByPrimaryKey" parameterType="com.steerinfo.ems.emsprodplanround.model.EmsProdplanRound">
  470. update EMS_PRODPLAN_ROUND
  471. set MAY = #{may,jdbcType=TIMESTAMP},
  472. SQNO = #{sqno,jdbcType=DECIMAL},
  473. UNITID = #{unitid,jdbcType=VARCHAR},
  474. DESCRIBE = #{describe,jdbcType=VARCHAR},
  475. STATE = #{state,jdbcType=VARCHAR},
  476. GRADES = #{grades,jdbcType=VARCHAR},
  477. PLAN_WEIGHT = #{planWeight,jdbcType=DECIMAL},
  478. SPECIFICATIONS = #{specifications,jdbcType=VARCHAR},
  479. LENGTHS = #{lengths,jdbcType=VARCHAR},
  480. CHEMICAL_STANDARD = #{chemicalStandard,jdbcType=VARCHAR},
  481. SURFACE_STANDARD = #{surfaceStandard,jdbcType=VARCHAR},
  482. MEMO = #{memo,jdbcType=VARCHAR},
  483. ISSUED_TIME = #{issuedTime,jdbcType=TIMESTAMP},
  484. CREATEMAN = #{createman,jdbcType=VARCHAR},
  485. CREATETIME = #{createtime,jdbcType=TIMESTAMP},
  486. UPDATEMAN = #{updateman,jdbcType=VARCHAR},
  487. UPDATETIME = #{updatetime,jdbcType=TIMESTAMP},
  488. TRANSPORT_TYPE = #{transportType,jdbcType=VARCHAR},
  489. PURPOSE = #{purpose,jdbcType=VARCHAR},
  490. WORKPROC_TYPE = #{workprocType,jdbcType=VARCHAR},
  491. PARENTID = #{parentid,jdbcType=VARCHAR},
  492. IATERAL_AREA = #{iateralArea,jdbcType=VARCHAR},
  493. LENGTH_TIMES_WIDTH = #{lengthTimesWidth,jdbcType=VARCHAR},
  494. DIMENSION = #{dimension,jdbcType=VARCHAR},
  495. GOINFO = #{goinfo,jdbcType=VARCHAR},
  496. TAG = #{tag,jdbcType=VARCHAR}
  497. where ID = #{id,jdbcType=VARCHAR}
  498. </update>
  499. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.ems.emsprodplanround.model.EmsProdplanRound">
  500. update EMS_PRODPLAN_ROUND
  501. <set>
  502. <if test="may != null">
  503. MAY = #{may,jdbcType=TIMESTAMP},
  504. </if>
  505. <if test="sqno != null">
  506. SQNO = #{sqno,jdbcType=DECIMAL},
  507. </if>
  508. <if test="unitid != null">
  509. UNITID = #{unitid,jdbcType=VARCHAR},
  510. </if>
  511. <if test="describe != null">
  512. DESCRIBE = #{describe,jdbcType=VARCHAR},
  513. </if>
  514. <if test="state != null">
  515. STATE = #{state,jdbcType=VARCHAR},
  516. </if>
  517. <if test="grades != null">
  518. GRADES = #{grades,jdbcType=VARCHAR},
  519. </if>
  520. <if test="planWeight != null">
  521. PLAN_WEIGHT = #{planWeight,jdbcType=DECIMAL},
  522. </if>
  523. <if test="specifications != null">
  524. SPECIFICATIONS = #{specifications,jdbcType=VARCHAR},
  525. </if>
  526. <if test="lengths != null">
  527. LENGTHS = #{lengths,jdbcType=VARCHAR},
  528. </if>
  529. <if test="chemicalStandard != null">
  530. CHEMICAL_STANDARD = #{chemicalStandard,jdbcType=VARCHAR},
  531. </if>
  532. <if test="surfaceStandard != null">
  533. SURFACE_STANDARD = #{surfaceStandard,jdbcType=VARCHAR},
  534. </if>
  535. <if test="memo != null">
  536. MEMO = #{memo,jdbcType=VARCHAR},
  537. </if>
  538. <if test="issuedTime != null">
  539. ISSUED_TIME = #{issuedTime,jdbcType=TIMESTAMP},
  540. </if>
  541. <if test="createman != null">
  542. CREATEMAN = #{createman,jdbcType=VARCHAR},
  543. </if>
  544. <if test="createtime != null">
  545. CREATETIME = #{createtime,jdbcType=TIMESTAMP},
  546. </if>
  547. <if test="updateman != null">
  548. UPDATEMAN = #{updateman,jdbcType=VARCHAR},
  549. </if>
  550. <if test="updatetime != null">
  551. UPDATETIME = #{updatetime,jdbcType=TIMESTAMP},
  552. </if>
  553. <if test="transportType != null">
  554. TRANSPORT_TYPE = #{transportType,jdbcType=VARCHAR},
  555. </if>
  556. <if test="purpose != null">
  557. PURPOSE = #{purpose,jdbcType=VARCHAR},
  558. </if>
  559. <if test="workprocType != null">
  560. WORKPROC_TYPE = #{workprocType,jdbcType=VARCHAR},
  561. </if>
  562. <if test="msgFlag != null">
  563. MSG_FLAG = #{msgFlag,jdbcType=VARCHAR},
  564. </if>
  565. <if test="readFlag != null">
  566. READ_FLAG = #{readFlag,jdbcType=VARCHAR},
  567. </if>
  568. <if test="parentid != null and parentid != ''">
  569. PARENTID = #{parentid,jdbcType=VARCHAR},
  570. </if>
  571. <if test="iateralArea != null and iateralArea != ''">
  572. IATERAL_AREA = #{iateralArea,jdbcType=VARCHAR},
  573. </if>
  574. <if test="lengthTimesWidth != null and lengthTimesWidth != ''">
  575. LENGTH_TIMES_WIDTH = #{lengthTimesWidth,jdbcType=VARCHAR},
  576. </if>
  577. <if test="dimension != null and dimension != ''">
  578. DIMENSION = #{dimension,jdbcType=VARCHAR},
  579. </if>
  580. <if test="goinfo != null and goinfo != ''">
  581. GOINFO = #{goinfo,jdbcType=VARCHAR},
  582. </if>
  583. <if test="tag != null and tag != ''">
  584. TAG = #{tag,jdbcType=VARCHAR},
  585. </if>
  586. </set>
  587. where ID = #{id,jdbcType=VARCHAR}
  588. </update>
  589. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  590. <include refid="select"/>
  591. where ID = #{id,jdbcType=VARCHAR}
  592. </select>
  593. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  594. <include refid="select"/>
  595. <include refid="where"/>
  596. </select>
  597. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  598. <include refid="select"/>
  599. <include refid="whereLike"/>
  600. </select>
  601. <insert id="batchInsert" parameterType="java.util.List">
  602. insert into EMS_PRODPLAN_ROUND
  603. (ID,
  604. MAY, SQNO, UNITID,
  605. DESCRIBE, STATE, GRADES,
  606. PLAN_WEIGHT, SPECIFICATIONS, LENGTHS,
  607. CHEMICAL_STANDARD, SURFACE_STANDARD,
  608. MEMO, ISSUED_TIME, CREATEMAN,
  609. CREATETIME, UPDATEMAN, UPDATETIME,
  610. TRANSPORT_TYPE, PURPOSE, WORKPROC_TYPE,
  611. MSG_FLAG, READ_FLAG,TAG)
  612. ( <foreach collection="list" item="item" separator="union all">
  613. select
  614. #{item.id,jdbcType=VARCHAR},
  615. #{item.may,jdbcType=TIMESTAMP}, #{item.sqno,jdbcType=DECIMAL}, #{item.unitid,jdbcType=VARCHAR},
  616. #{item.describe,jdbcType=VARCHAR}, #{item.state,jdbcType=VARCHAR}, #{item.grades,jdbcType=VARCHAR},
  617. #{item.planWeight,jdbcType=DECIMAL}, #{item.specifications,jdbcType=VARCHAR}, #{item.lengths,jdbcType=VARCHAR},
  618. #{item.chemicalStandard,jdbcType=VARCHAR}, #{item.surfaceStandard,jdbcType=VARCHAR},
  619. #{item.memo,jdbcType=VARCHAR}, #{item.issuedTime,jdbcType=TIMESTAMP}, #{item.createman,jdbcType=VARCHAR},
  620. #{item.createtime,jdbcType=TIMESTAMP}, #{item.updateman,jdbcType=VARCHAR}, #{item.updatetime,jdbcType=TIMESTAMP},
  621. #{item.transportType,jdbcType=VARCHAR}, #{item.purpose,jdbcType=VARCHAR}, #{item.workprocType,jdbcType=VARCHAR},
  622. #{item.msgFlag,jdbcType=VARCHAR}, #{item.readFlag,jdbcType=VARCHAR}, #{item.tag,jdbcType=VARCHAR} from dual
  623. </foreach> )
  624. </insert>
  625. <update id="batchUpdate" parameterType="java.util.List">
  626. update EMS_PRODPLAN_ROUND
  627. set
  628. ID=
  629. <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
  630. when #{item.id,jdbcType=VARCHAR} then #{item.id,jdbcType=VARCHAR}
  631. </foreach>
  632. ,MAY=
  633. <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
  634. when #{item.id,jdbcType=VARCHAR} then #{item.may,jdbcType=TIMESTAMP}
  635. </foreach>
  636. ,SQNO=
  637. <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
  638. when #{item.id,jdbcType=VARCHAR} then #{item.sqno,jdbcType=DECIMAL}
  639. </foreach>
  640. ,UNITID=
  641. <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
  642. when #{item.id,jdbcType=VARCHAR} then #{item.unitid,jdbcType=VARCHAR}
  643. </foreach>
  644. ,DESCRIBE=
  645. <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
  646. when #{item.id,jdbcType=VARCHAR} then #{item.describe,jdbcType=VARCHAR}
  647. </foreach>
  648. ,STATE=
  649. <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
  650. when #{item.id,jdbcType=VARCHAR} then #{item.state,jdbcType=VARCHAR}
  651. </foreach>
  652. ,GRADES=
  653. <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
  654. when #{item.id,jdbcType=VARCHAR} then #{item.grades,jdbcType=VARCHAR}
  655. </foreach>
  656. ,PLAN_WEIGHT=
  657. <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
  658. when #{item.id,jdbcType=VARCHAR} then #{item.planWeight,jdbcType=DECIMAL}
  659. </foreach>
  660. ,SPECIFICATIONS=
  661. <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
  662. when #{item.id,jdbcType=VARCHAR} then #{item.specifications,jdbcType=VARCHAR}
  663. </foreach>
  664. ,LENGTHS=
  665. <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
  666. when #{item.id,jdbcType=VARCHAR} then #{item.lengths,jdbcType=VARCHAR}
  667. </foreach>
  668. ,CHEMICAL_STANDARD=
  669. <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
  670. when #{item.id,jdbcType=VARCHAR} then #{item.chemicalStandard,jdbcType=VARCHAR}
  671. </foreach>
  672. ,SURFACE_STANDARD=
  673. <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
  674. when #{item.id,jdbcType=VARCHAR} then #{item.surfaceStandard,jdbcType=VARCHAR}
  675. </foreach>
  676. ,MEMO=
  677. <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
  678. when #{item.id,jdbcType=VARCHAR} then #{item.memo,jdbcType=VARCHAR}
  679. </foreach>
  680. ,ISSUED_TIME=
  681. <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
  682. when #{item.id,jdbcType=VARCHAR} then #{item.issuedTime,jdbcType=TIMESTAMP}
  683. </foreach>
  684. ,CREATEMAN=
  685. <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
  686. when #{item.id,jdbcType=VARCHAR} then #{item.createman,jdbcType=VARCHAR}
  687. </foreach>
  688. ,CREATETIME=
  689. <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
  690. when #{item.id,jdbcType=VARCHAR} then #{item.createtime,jdbcType=TIMESTAMP}
  691. </foreach>
  692. ,UPDATEMAN=
  693. <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
  694. when #{item.id,jdbcType=VARCHAR} then #{item.updateman,jdbcType=VARCHAR}
  695. </foreach>
  696. ,UPDATETIME=
  697. <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
  698. when #{item.id,jdbcType=VARCHAR} then #{item.updatetime,jdbcType=TIMESTAMP}
  699. </foreach>
  700. ,TRANSPORT_TYPE=
  701. <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
  702. when #{item.id,jdbcType=VARCHAR} then #{item.transportType,jdbcType=VARCHAR}
  703. </foreach>
  704. ,PURPOSE=
  705. <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
  706. when #{item.id,jdbcType=VARCHAR} then #{item.purpose,jdbcType=VARCHAR}
  707. </foreach>
  708. ,WORKPROC_TYPE=
  709. <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
  710. when #{item.id,jdbcType=VARCHAR} then #{item.workprocType,jdbcType=VARCHAR}
  711. </foreach>
  712. ,MSG_FLAG=
  713. <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
  714. when #{item.id,jdbcType=VARCHAR} then #{item.msgFlag,jdbcType=VARCHAR}
  715. </foreach>
  716. ,READ_FLAG=
  717. <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
  718. when #{item.id,jdbcType=VARCHAR} then #{item.readFlag,jdbcType=VARCHAR}
  719. </foreach>
  720. ,TAG=
  721. <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
  722. when #{item.id,jdbcType=VARCHAR} then #{item.tag,jdbcType=VARCHAR}
  723. </foreach>
  724. where ID in
  725. <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
  726. #{item.id,jdbcType=VARCHAR}
  727. </foreach>
  728. </update>
  729. <delete id="batchDelete" parameterType="java.util.List">
  730. delete from EMS_PRODPLAN_ROUND
  731. where ID in
  732. <foreach collection="list" item="id" open="(" close=")" separator=",">
  733. #{id}
  734. </foreach>
  735. </delete>
  736. <!-- 友情提示!!!-->
  737. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  738. <!--获取超出重量-->
  739. <!--获取超出重量-->
  740. <select id="getbeyondWeight" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  741. select nvl(sum(t.plan_weight),0) plan_weight from EMS_PRODPLAN_ROUND t
  742. <where>
  743. <if test="parentid != null and parentid !='' ">
  744. and t.parentid = #{parentid}
  745. </if>
  746. <if test="may != null ">
  747. and trunc(t.may) = to_date(#{may},'yyyy-mm-dd')
  748. </if>
  749. </where>
  750. </select>
  751. <select id="getSumPlanWeight" parameterType="java.lang.String" resultMap="BaseResultMap">
  752. select nvl(sum(t.plan_weight),0) plan_weight from EMS_PRODPLAN_ROUND t where id = #{id}
  753. <!-- parameterType="java.util.List" t.id in-->
  754. <!-- <foreach collection="list" item="id" open="(" close=")" separator=",">-->
  755. <!-- #{id}-->
  756. <!-- </foreach>-->
  757. </select>
  758. <select id="getMaxidAsGm" parameterType="com.steerinfo.ems.emsprodplanround.model.EmsProdplanRound" resultType="java.lang.String">
  759. select #{parentid} || '-' || to_char(nvl(max(substr(ID, 18, 2) + 1), 1),'fm00') as id
  760. from ems_prodplan_round
  761. where
  762. parentid = #{parentid}
  763. AND ID like
  764. '%'||(SELECT 'G-' || substr(#{parentid}, 3) FROM dual)||'%'
  765. </select>
  766. <select id="getMaxidAsSC" parameterType="com.steerinfo.ems.emsprodplanround.model.EmsProdplanRound" resultType="java.lang.String">
  767. SELECT 'N-' || substr(#{parentid}, 3) ||'-'||
  768. to_char(nvl(max(substr(ID, 18, 2) + 1), 1),'fm00') AS ID
  769. FROM ems_prodplan_round
  770. where
  771. ID LIKE
  772. '%'||(SELECT 'N-' || substr(#{parentid}, 3) FROM dual )||'%'
  773. </select>
  774. <select id="getbasespecbillet" resultMap="BaseResultMap">
  775. select distinct SPECIFICATIONS from ems_gm_pc_jh
  776. where SPECIFICATIONS not like '%null%'
  777. and WORKPROC_TYPE = 'AT2007'
  778. </select>
  779. <!---->
  780. <select id="getiateralArea" resultMap="BaseResultMap">
  781. select distinct IATERAL_AREA from ems_prodplan_round
  782. where IATERAL_AREA not like '%null%'
  783. </select>
  784. <!---->
  785. <select id="getdimension" resultMap="BaseResultMap">
  786. select distinct dimension from ems_prodplan_round
  787. where dimension not like '%null%'
  788. </select>
  789. <!---->
  790. <select id="getsurfaceStandard" resultMap="BaseResultMap">
  791. select distinct SURFACE_STANDARD
  792. from ems_prodplan_round
  793. where SURFACE_STANDARD not like '%null%'
  794. </select>
  795. <!---->
  796. <select id="getAuditDate" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  797. <include refid="select"/>
  798. <where>
  799. <if test="workprocType != null and workprocType != '' ">
  800. and WORKPROC_TYPE = #{workprocType}
  801. </if>
  802. <if test="startTime != null and startTime != '' and endTime != null and endTime != '' ">
  803. and MAY BETWEEN to_date(#{startTime},'yyyy-mm-dd') and to_date(#{endTime},'yyyy-mm-dd')
  804. </if>
  805. and AUDITSTATE in ('1','2','3')
  806. </where>
  807. </select>
  808. <!---->
  809. <select id="updateAuditState" parameterType="com.steerinfo.ems.emsprodplanround.model.EmsProdplanRound" resultType="Integer">
  810. UPDATE ems_prodplan_round
  811. <set>
  812. <if test="auditState != null and auditState != '' ">
  813. AUDITSTATE = #{auditState}
  814. </if>
  815. </set>
  816. <where>
  817. <if test="id != null and id != '' ">
  818. ID = #{id}
  819. </if>
  820. </where>
  821. </select>
  822. <!---->
  823. <select id="getRounds" parameterType="com.steerinfo.ems.emsprodplanround.model.EmsProdplanRound" resultMap="BaseResultMap">
  824. <include refid="select"/>
  825. <where>
  826. <if test="parentid != null and parentid != '' ">
  827. and parentid =#{parentid}
  828. </if>
  829. and id like '%G-%'
  830. </where>
  831. </select>
  832. <select id="getchemicalStandard" resultMap="BaseResultMap">
  833. select distinct CHEMICAL_STANDARD
  834. from ems_prodplan_round
  835. where CHEMICAL_STANDARD not like '%null%'
  836. </select>
  837. <select id="getTableDetailAsRadio" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  838. <include refid="select"/>
  839. <where>
  840. <if test="id != null and id != '' ">
  841. and PARENTID in (${id})
  842. </if>
  843. <if test="state != null and state != '' ">
  844. and STATE != #{state}
  845. </if>
  846. </where>
  847. order by state
  848. </select>
  849. <select id="getLastIssuedData" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  850. SELECT * FROM (<include refid="select"/>
  851. WHERE ISSUED_TIME is not null AND STATE IN ('1','2') AND WORKPROC_TYPE=#{workprocType} AND ID LIKE '${id}%' ORDER BY ISSUED_TIME desc)
  852. WHERE rownum=1
  853. </select>
  854. <select id="getPlanCount" resultType="java.math.BigDecimal">
  855. select case when sum(ABS(PLAN_WEIGHT)) is null then 0 else sum(ABS(PLAN_WEIGHT)) end heji from ems_prodplan_round
  856. <where>
  857. <if test="parentid != null and parentid != '' ">
  858. and PARENTID = #{parentid}
  859. </if>
  860. </where>
  861. </select>
  862. </mapper>