EmsProdplanMonthMapper.xml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482
  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.emsprodplanmonth.mapper.EmsProdplanMonthMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.ems.emsprodplanmonth.model.EmsProdplanMonth">
  5. <id column="ID" jdbcType="VARCHAR" property="id" />
  6. <result column="PRODUCTID" jdbcType="VARCHAR" property="productid" />
  7. <result column="WORKPROCID" jdbcType="VARCHAR" property="workprocid" />
  8. <result column="MAY" jdbcType="TIMESTAMP" property="may" />
  9. <result column="WEIGHT_MONTH" jdbcType="DECIMAL" property="weightMonth" />
  10. <result column="WEIGHT_DAY" jdbcType="DECIMAL" property="weightDay" />
  11. <result column="UNIT" jdbcType="VARCHAR" property="unit" />
  12. <result column="JXDAYS" jdbcType="VARCHAR" property="jxdays" />
  13. <result column="CREATETIME" jdbcType="TIMESTAMP" property="createtime" />
  14. <result column="CREATEMAN" jdbcType="VARCHAR" property="createman" />
  15. <result column="UPDATETIME" jdbcType="TIMESTAMP" property="updatetime" />
  16. <result column="UPDATEMAN" jdbcType="VARCHAR" property="updateman" />
  17. <result column="MEMO" jdbcType="VARCHAR" property="memo" />
  18. <result column="STATE" jdbcType="VARCHAR" property="state" />
  19. <result column="YXF_WEIGHT" jdbcType="DECIMAL" property="yxf_weight" />
  20. <result column="KXF_WEIGHT" jdbcType="DECIMAL" property="kxf_weight" />
  21. <result column="SQNO" jdbcType="DECIMAL" property="sqno" />
  22. </resultMap>
  23. <sql id="columns">
  24. ID, PRODUCTID, WORKPROCID, MAY, WEIGHT_MONTH, WEIGHT_DAY, UNIT, JXDAYS, CREATETIME,
  25. CREATEMAN, UPDATETIME, UPDATEMAN, MEMO,STATE,YXF_WEIGHT,KXF_WEIGHT,SQNO
  26. </sql>
  27. <sql id="columns_alias">
  28. t.ID, t.PRODUCTID, t.WORKPROCID, t.MAY, t.WEIGHT_MONTH, t.WEIGHT_DAY, t.UNIT, t.JXDAYS,
  29. t.CREATETIME, t.CREATEMAN, t.UPDATETIME, t.UPDATEMAN, t.MEMO,T.STATE
  30. </sql>
  31. <sql id="select">
  32. SELECT <include refid="columns"/> FROM EMS_PRODPLAN_MONTH
  33. </sql>
  34. <sql id="select_alias">
  35. SELECT <include refid="columns_alias"/> FROM EMS_PRODPLAN_MONTH t
  36. </sql>
  37. <sql id="where">
  38. <where>
  39. <if test="id != null and id != ''">
  40. and ID = #{id}
  41. </if>
  42. <if test="productid != null and productid != ''">
  43. and PRODUCTID = #{productid}
  44. </if>
  45. <if test="workprocid != null and workprocid != ''">
  46. and WORKPROCID in (${workprocid})
  47. </if>
  48. <if test="weightMonth != null">
  49. and WEIGHT_MONTH = #{weightMonth}
  50. </if>
  51. <if test="weightDay != null">
  52. and WEIGHT_DAY = #{weightDay}
  53. </if>
  54. <if test="unit != null and unit != ''">
  55. and UNIT = #{unit}
  56. </if>
  57. <if test="jxdays != null and jxdays != ''">
  58. and JXDAYS = #{jxdays}
  59. </if>
  60. <if test="createman != null and createman != ''">
  61. and CREATEMAN = #{createman}
  62. </if>
  63. <if test="updatetime != null">
  64. and TO_CHAR(UPDATETIME,'yyyy-MM-dd') = #{updatetime}
  65. </if>
  66. <if test="updateman != null and updateman != ''">
  67. and UPDATEMAN = #{updateman}
  68. </if>
  69. <if test="memo != null and memo != ''">
  70. and MEMO = #{memo}
  71. </if>
  72. <if test="state != null and state != ''">
  73. and STATE = #{state}
  74. </if>
  75. <if test="startTime != null and startTime != '' and endTime != null and endTime != '' ">
  76. and MAY between to_date(#{startTime},'yyyy-mm-dd') and to_date(#{endTime},'yyyy-mm-dd')
  77. </if>
  78. </where>
  79. ORDER BY WORKPROCID,MAY
  80. </sql>
  81. <sql id="whereLike">
  82. <where>
  83. <if test="id != null and id != ''">
  84. and ID LIKE '%${id}%'
  85. </if>
  86. <if test="productid != null and productid != ''">
  87. and PRODUCTID LIKE '%${productid}%'
  88. </if>
  89. <if test="workprocid != null and workprocid != ''">
  90. and WORKPROCID LIKE '%${workprocid}%'
  91. </if>
  92. <if test="may != null">
  93. and TO_CHAR(MAY,'yyyy-MM-dd') = #{may}
  94. </if>
  95. <if test="weightMonth != null">
  96. and WEIGHT_MONTH = #{weightMonth}
  97. </if>
  98. <if test="weightDay != null">
  99. and WEIGHT_DAY = #{weightDay}
  100. </if>
  101. <if test="unit != null and unit != ''">
  102. and UNIT LIKE '%${unit}%'
  103. </if>
  104. <if test="jxdays != null and jxdays != ''">
  105. and JXDAYS LIKE '%${jxdays}%'
  106. </if>
  107. <if test="createtime != null">
  108. and TO_CHAR(CREATETIME,'yyyy-MM-dd') = #{createtime}
  109. </if>
  110. <if test="createman != null and createman != ''">
  111. and CREATEMAN LIKE '%${createman}%'
  112. </if>
  113. <if test="updatetime != null">
  114. and TO_CHAR(UPDATETIME,'yyyy-MM-dd') = #{updatetime}
  115. </if>
  116. <if test="updateman != null and updateman != ''">
  117. and UPDATEMAN LIKE '%${updateman}%'
  118. </if>
  119. <if test="memo != null and memo != ''">
  120. and MEMO LIKE '%${memo}%'
  121. </if>
  122. </where>
  123. </sql>
  124. <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  125. delete from EMS_PRODPLAN_MONTH
  126. where ID = #{id,jdbcType=VARCHAR}
  127. </delete>
  128. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  129. delete from EMS_PRODPLAN_MONTH
  130. where 1!=1
  131. <if test="productid != null and productid != ''">
  132. or PRODUCTID = #{productid}
  133. </if>
  134. <if test="workprocid != null and workprocid != ''">
  135. or WORKPROCID = #{workprocid}
  136. </if>
  137. <if test="may != null">
  138. or TO_CHAR(MAY,'yyyy-MM-dd') = '#{may}'
  139. </if>
  140. <if test="weightMonth != null">
  141. or WEIGHT_MONTH = #{weightMonth}
  142. </if>
  143. <if test="weightDay != null">
  144. or WEIGHT_DAY = #{weightDay}
  145. </if>
  146. <if test="unit != null and unit != ''">
  147. or UNIT = #{unit}
  148. </if>
  149. <if test="jxdays != null and jxdays != ''">
  150. or JXDAYS = #{jxdays}
  151. </if>
  152. <if test="createtime != null">
  153. or TO_CHAR(CREATETIME,'yyyy-MM-dd') = '#{createtime}'
  154. </if>
  155. <if test="createman != null and createman != ''">
  156. or CREATEMAN = #{createman}
  157. </if>
  158. <if test="updatetime != null">
  159. or TO_CHAR(UPDATETIME,'yyyy-MM-dd') = '#{updatetime}'
  160. </if>
  161. <if test="updateman != null and updateman != ''">
  162. or UPDATEMAN = #{updateman}
  163. </if>
  164. <if test="memo != null and memo != ''">
  165. or MEMO = #{memo}
  166. </if>
  167. </delete>
  168. <insert id="insert" parameterType="com.steerinfo.ems.emsprodplanmonth.model.EmsProdplanMonth">
  169. insert into EMS_PRODPLAN_MONTH (ID, PRODUCTID, WORKPROCID,
  170. MAY, WEIGHT_MONTH, WEIGHT_DAY,
  171. UNIT, JXDAYS, CREATETIME,
  172. CREATEMAN, UPDATETIME, UPDATEMAN, STATE,
  173. MEMO,YXF_WEIGHT,KXF_WEIGHT,SQNO)
  174. values (#{id,jdbcType=VARCHAR}, #{productid,jdbcType=VARCHAR}, #{workprocid,jdbcType=VARCHAR},
  175. #{may,jdbcType=TIMESTAMP}, #{weightMonth,jdbcType=DECIMAL}, #{weightDay,jdbcType=DECIMAL},
  176. #{unit,jdbcType=VARCHAR}, #{jxdays,jdbcType=VARCHAR}, #{createtime,jdbcType=TIMESTAMP},
  177. #{createman,jdbcType=VARCHAR}, #{updatetime,jdbcType=TIMESTAMP}, #{updateman,jdbcType=VARCHAR},
  178. #{state,jdbcType=VARCHAR}, #{memo,jdbcType=VARCHAR},#{yxf_weight,jdbcType=DECIMAL},#{kxf_weight,jdbcType=DECIMAL},#{sqno,jdbcType=DECIMAL})
  179. </insert>
  180. <insert id="insertSelective" parameterType="com.steerinfo.ems.emsprodplanmonth.model.EmsProdplanMonth">
  181. insert into EMS_PRODPLAN_MONTH
  182. <trim prefix="(" suffix=")" suffixOverrides=",">
  183. <if test="id != null">
  184. ID,
  185. </if>
  186. <if test="productid != null">
  187. PRODUCTID,
  188. </if>
  189. <if test="workprocid != null">
  190. WORKPROCID,
  191. </if>
  192. <if test="may != null">
  193. MAY,
  194. </if>
  195. <if test="weightMonth != null">
  196. WEIGHT_MONTH,
  197. </if>
  198. <if test="weightDay != null">
  199. WEIGHT_DAY,
  200. </if>
  201. <if test="unit != null">
  202. UNIT,
  203. </if>
  204. <if test="jxdays != null">
  205. JXDAYS,
  206. </if>
  207. <if test="createtime != null">
  208. CREATETIME,
  209. </if>
  210. <if test="createman != null">
  211. CREATEMAN,
  212. </if>
  213. <if test="updatetime != null">
  214. UPDATETIME,
  215. </if>
  216. <if test="updateman != null">
  217. UPDATEMAN,
  218. </if>
  219. <if test="memo != null">
  220. MEMO,
  221. </if>
  222. </trim>
  223. <trim prefix="values (" suffix=")" suffixOverrides=",">
  224. <if test="id != null">
  225. #{id,jdbcType=VARCHAR},
  226. </if>
  227. <if test="productid != null">
  228. #{productid,jdbcType=VARCHAR},
  229. </if>
  230. <if test="workprocid != null">
  231. #{workprocid,jdbcType=VARCHAR},
  232. </if>
  233. <if test="may != null">
  234. #{may,jdbcType=TIMESTAMP},
  235. </if>
  236. <if test="weightMonth != null">
  237. #{weightMonth,jdbcType=DECIMAL},
  238. </if>
  239. <if test="weightDay != null">
  240. #{weightDay,jdbcType=DECIMAL},
  241. </if>
  242. <if test="unit != null">
  243. #{unit,jdbcType=VARCHAR},
  244. </if>
  245. <if test="jxdays != null">
  246. #{jxdays,jdbcType=VARCHAR},
  247. </if>
  248. <if test="createtime != null">
  249. #{createtime,jdbcType=TIMESTAMP},
  250. </if>
  251. <if test="createman != null">
  252. #{createman,jdbcType=VARCHAR},
  253. </if>
  254. <if test="updatetime != null">
  255. #{updatetime,jdbcType=TIMESTAMP},
  256. </if>
  257. <if test="updateman != null">
  258. #{updateman,jdbcType=VARCHAR},
  259. </if>
  260. <if test="memo != null">
  261. #{memo,jdbcType=VARCHAR},
  262. </if>
  263. </trim>
  264. </insert>
  265. <update id="updateByPrimaryKey" parameterType="com.steerinfo.ems.emsprodplanmonth.model.EmsProdplanMonth">
  266. update EMS_PRODPLAN_MONTH
  267. set PRODUCTID = #{productid,jdbcType=VARCHAR},
  268. WORKPROCID = #{workprocid,jdbcType=VARCHAR},
  269. MAY = #{may,jdbcType=TIMESTAMP},
  270. WEIGHT_MONTH = #{weightMonth,jdbcType=DECIMAL},
  271. WEIGHT_DAY = #{weightDay,jdbcType=DECIMAL},
  272. UNIT = #{unit,jdbcType=VARCHAR},
  273. JXDAYS = #{jxdays,jdbcType=VARCHAR},
  274. CREATETIME = #{createtime,jdbcType=TIMESTAMP},
  275. CREATEMAN = #{createman,jdbcType=VARCHAR},
  276. UPDATETIME = #{updatetime,jdbcType=TIMESTAMP},
  277. UPDATEMAN = #{updateman,jdbcType=VARCHAR},
  278. MEMO = #{memo,jdbcType=VARCHAR},
  279. YXF_WEIGHT = #{yxf_weight,jdbcType=DECIMAL},
  280. KXF_WEIGHT = #{kxf_weight,jdbcType=DECIMAL}
  281. where ID = #{id,jdbcType=VARCHAR}
  282. </update>
  283. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.ems.emsprodplanmonth.model.EmsProdplanMonth">
  284. update EMS_PRODPLAN_MONTH
  285. <set>
  286. <if test="productid != null">
  287. PRODUCTID = #{productid,jdbcType=VARCHAR},
  288. </if>
  289. <if test="workprocid != null">
  290. WORKPROCID = #{workprocid,jdbcType=VARCHAR},
  291. </if>
  292. <if test="may != null">
  293. MAY = #{may,jdbcType=TIMESTAMP},
  294. </if>
  295. <if test="weightMonth != null">
  296. WEIGHT_MONTH = #{weightMonth,jdbcType=DECIMAL},
  297. </if>
  298. <if test="weightDay != null">
  299. WEIGHT_DAY = #{weightDay,jdbcType=DECIMAL},
  300. </if>
  301. <if test="unit != null">
  302. UNIT = #{unit,jdbcType=VARCHAR},
  303. </if>
  304. <if test="jxdays != null">
  305. JXDAYS = #{jxdays,jdbcType=VARCHAR},
  306. </if>
  307. <if test="createtime != null">
  308. CREATETIME = #{createtime,jdbcType=TIMESTAMP},
  309. </if>
  310. <if test="createman != null">
  311. CREATEMAN = #{createman,jdbcType=VARCHAR},
  312. </if>
  313. <if test="updatetime != null">
  314. UPDATETIME = #{updatetime,jdbcType=TIMESTAMP},
  315. </if>
  316. <if test="updateman != null">
  317. UPDATEMAN = #{updateman,jdbcType=VARCHAR},
  318. </if>
  319. <if test="memo != null">
  320. MEMO = #{memo,jdbcType=VARCHAR},
  321. </if>
  322. </set>
  323. where ID = #{id,jdbcType=VARCHAR}
  324. </update>
  325. <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  326. <include refid="select"/>
  327. where ID = #{id,jdbcType=VARCHAR}
  328. </select>
  329. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  330. <include refid="select"/>
  331. <include refid="where"/>
  332. </select>
  333. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  334. <include refid="select"/>
  335. <include refid="whereLike"/>
  336. </select>
  337. <insert id="batchInsert" parameterType="java.util.List">
  338. insert into EMS_PRODPLAN_MONTH
  339. (ID,
  340. PRODUCTID, WORKPROCID, MAY,
  341. WEIGHT_MONTH, WEIGHT_DAY, UNIT,
  342. JXDAYS, CREATETIME, CREATEMAN,
  343. UPDATETIME, UPDATEMAN, MEMO,STATE
  344. )
  345. ( <foreach collection="list" item="item" separator="union all">
  346. select
  347. #{item.id,jdbcType=VARCHAR},
  348. #{item.productid,jdbcType=VARCHAR}, #{item.workprocid,jdbcType=VARCHAR}, #{item.may,jdbcType=TIMESTAMP},
  349. #{item.weightMonth,jdbcType=DECIMAL}, #{item.weightDay,jdbcType=DECIMAL}, #{item.unit,jdbcType=VARCHAR},
  350. #{item.jxdays,jdbcType=VARCHAR}, #{item.createtime,jdbcType=TIMESTAMP}, #{item.createman,jdbcType=VARCHAR},
  351. #{item.updatetime,jdbcType=TIMESTAMP}, #{item.updateman,jdbcType=VARCHAR}, #{item.memo,jdbcType=VARCHAR},
  352. #{item.state,jdbcType=VARCHAR}
  353. from dual
  354. </foreach> )
  355. </insert>
  356. <update id="batchUpdate" parameterType="java.util.List">
  357. update EMS_PRODPLAN_MONTH
  358. set
  359. ID=
  360. <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
  361. when #{item.id,jdbcType=VARCHAR} then #{item.id,jdbcType=VARCHAR}
  362. </foreach>
  363. ,PRODUCTID=
  364. <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
  365. when #{item.id,jdbcType=VARCHAR} then #{item.productid,jdbcType=VARCHAR}
  366. </foreach>
  367. ,WORKPROCID=
  368. <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
  369. when #{item.id,jdbcType=VARCHAR} then #{item.workprocid,jdbcType=VARCHAR}
  370. </foreach>
  371. ,MAY=
  372. <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
  373. when #{item.id,jdbcType=VARCHAR} then #{item.may,jdbcType=TIMESTAMP}
  374. </foreach>
  375. ,WEIGHT_MONTH=
  376. <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
  377. when #{item.id,jdbcType=VARCHAR} then #{item.weightMonth,jdbcType=DECIMAL}
  378. </foreach>
  379. ,WEIGHT_DAY=
  380. <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
  381. when #{item.id,jdbcType=VARCHAR} then #{item.weightDay,jdbcType=DECIMAL}
  382. </foreach>
  383. ,UNIT=
  384. <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
  385. when #{item.id,jdbcType=VARCHAR} then #{item.unit,jdbcType=VARCHAR}
  386. </foreach>
  387. ,JXDAYS=
  388. <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
  389. when #{item.id,jdbcType=VARCHAR} then #{item.jxdays,jdbcType=VARCHAR}
  390. </foreach>
  391. ,CREATETIME=
  392. <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
  393. when #{item.id,jdbcType=VARCHAR} then #{item.createtime,jdbcType=TIMESTAMP}
  394. </foreach>
  395. ,CREATEMAN=
  396. <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
  397. when #{item.id,jdbcType=VARCHAR} then #{item.createman,jdbcType=VARCHAR}
  398. </foreach>
  399. ,UPDATETIME=
  400. <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
  401. when #{item.id,jdbcType=VARCHAR} then #{item.updatetime,jdbcType=TIMESTAMP}
  402. </foreach>
  403. ,UPDATEMAN=
  404. <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
  405. when #{item.id,jdbcType=VARCHAR} then #{item.updateman,jdbcType=VARCHAR}
  406. </foreach>
  407. ,STATE=
  408. <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
  409. when #{item.id,jdbcType=VARCHAR} then #{item.state,jdbcType=VARCHAR}
  410. </foreach>
  411. ,MEMO=
  412. <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
  413. when #{item.id,jdbcType=VARCHAR} then #{item.memo,jdbcType=VARCHAR}
  414. </foreach>
  415. where ID in
  416. <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
  417. #{item.id,jdbcType=VARCHAR}
  418. </foreach>
  419. </update>
  420. <delete id="batchDelete" parameterType="java.util.List">
  421. delete from EMS_PRODPLAN_MONTH
  422. where ID in
  423. <foreach collection="list" item="id" open="(" close=")" separator=",">
  424. #{id}
  425. </foreach>
  426. </delete>
  427. <!-- 友情提示!!!-->
  428. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  429. <!--获取编辑页面-->
  430. <select id="getDateEdit" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  431. select to_date(#{may},'yyyy-mm-dd') as may, c.productid ,c.workprocid, '0' state , c.unit from (
  432. select a.*,
  433. row_number() over(PARTITION BY a.WORKPROCID order by a.WORKPROCID ) as row_flg
  434. from EMS_PRODPLAN_MONTH a
  435. left join T_RM_WORKPROC b
  436. on a.workprocid = b.id
  437. where a.workprocid not in (select t.workprocid from EMS_PRODPLAN_MONTH t where t.may = to_date(#{may},'yyyy-MM-dd'))
  438. ) c
  439. </select>
  440. <select id="getDateLc" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  441. select t.id,t.may,t.workprocid,t.weight_month,t.unit,t.kxf_weight,t.yxf_weight,t.sqno from EMS_PRODPLAN_MONTH t
  442. <where>
  443. <if test="type != null and type != ''">
  444. <if test="type=='gx'">
  445. and t.workprocid in ('AT2005','AT2006')
  446. </if>
  447. <if test="type =='lg'">
  448. and t.workprocid = 'AT2004'
  449. </if>
  450. <if test="type == 'xg'">
  451. and t.workprocid ='AT2007'
  452. </if>
  453. </if>
  454. <if test="may != null">
  455. and trunc(t.may) = to_date(#{may},'yyyy-mm')
  456. </if>
  457. <if test="workprocid != null and workprocid != '' ">
  458. and t.workprocid = #{workprocid}
  459. </if>
  460. </where>
  461. </select>
  462. <select id="getBymayAndWorkprocid" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  463. select t.* from EMS_PRODPLAN_MONTH t
  464. <where>
  465. <if test="may != null and may != '' " >
  466. and trunc(t.may) = to_date(#{may},'yyyy-mm')
  467. </if>
  468. <if test="workprocid != null and workprocid != '' " >
  469. and t.workprocid = #{workprocid}
  470. </if>
  471. <if test="id != null and id != '' " >
  472. and t.id = #{id}
  473. </if>
  474. </where>
  475. </select>
  476. <select id="getMaxSqno" resultMap="BaseResultMap">
  477. select nvl(max(t.sqno+1),0) sqno from ems_prodplan_month t
  478. </select>
  479. </mapper>