RmsPersonnelMapper.xml 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621
  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.dil.mapper.RmsPersonnelMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.RmsPersonnel">
  5. <id column="PERSONNEL_ID" jdbcType="DECIMAL" property="personnelId" />
  6. <result column="PERSONNEL_JOB_NUMBER" jdbcType="VARCHAR" property="personnelJobNumber" />
  7. <result column="PERSONNEL_POST" jdbcType="VARCHAR" property="personnelPost" />
  8. <result column="PERSONNEL_NAME" jdbcType="VARCHAR" property="personnelName" />
  9. <result column="PERSONNEL_DEPARTMENT_ID" jdbcType="DECIMAL" property="departmentId" />
  10. <result column="PERSONNEL_WORKSHOPID" jdbcType="VARCHAR" property="personnelWorkshopid" />
  11. <result column="PERSONNEL_SHIFTS" jdbcType="VARCHAR" property="personnelShifts" />
  12. <result column="PERSONNEL_TEAM" jdbcType="VARCHAR" property="personnelTeam" />
  13. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
  14. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
  15. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
  16. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
  17. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
  18. <result column="EAS_PERSONNEL_ID" jdbcType="DECIMAL" property="easPersonnelId" />
  19. <result column="DELETED" jdbcType="DECIMAL" property="deleted" />
  20. <result column="USERNAME" jdbcType="VARCHAR" property="username" />
  21. <result column="PASSWORD" jdbcType="VARCHAR" property="password" />
  22. </resultMap>
  23. <sql id="columns">
  24. PERSONNEL_ID, PERSONNEL_JOB_NUMBER, PERSONNEL_POST, PERSONNEL_NAME, PERSONNEL_DEPARTMENT_ID, PERSONNEL_WORKSHOPID,
  25. PERSONNEL_SHIFTS, PERSONNEL_TEAM, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
  26. UPDATE_TIME, INSERT_UPDATE_REMARK, EAS_PERSONNEL_ID, DELETED, USERNAME, PASSWORD
  27. </sql>
  28. <sql id="columns_alias">
  29. t.PERSONNEL_ID, t.PERSONNEL_JOB_NUMBER, t.PERSONNEL_POST, t.PERSONNEL_NAME, t.PERSONNEL_DEPARTMENT_ID,
  30. t.PERSONNEL_WORKSHOPID, t.PERSONNEL_SHIFTS, t.PERSONNEL_TEAM, t.INSERT_USERNAME,
  31. t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.EAS_PERSONNEL_ID,
  32. t.DELETED, t.USERNAME, t.PASSWORD
  33. </sql>
  34. <sql id="select">
  35. SELECT <include refid="columns"/> FROM RMS_PERSONNEL
  36. </sql>
  37. <sql id="select_alias">
  38. SELECT <include refid="columns_alias"/> FROM RMS_PERSONNEL t
  39. </sql>
  40. <sql id="where">
  41. <where>
  42. <if test="personnelId != null">
  43. and PERSONNEL_ID = #{personnelId}
  44. </if>
  45. <if test="personnelJobNumber != null and personnelJobNumber != ''">
  46. and PERSONNEL_JOB_NUMBER = #{personnelJobNumber}
  47. </if>
  48. <if test="personnelPost != null and personnelPost != ''">
  49. and PERSONNEL_POST = #{personnelPost}
  50. </if>
  51. <if test="personnelName != null and personnelName != ''">
  52. and PERSONNEL_NAME = #{personnelName}
  53. </if>
  54. <if test="departmentId != null">
  55. and PERSONNEL_DEPARTMENT_ID = #{departmentId}
  56. </if>
  57. <if test="personnelWorkshopid != null and personnelWorkshopid != ''">
  58. and PERSONNEL_WORKSHOPID = #{personnelWorkshopid}
  59. </if>
  60. <if test="personnelShifts != null and personnelShifts != ''">
  61. and PERSONNEL_SHIFTS = #{personnelShifts}
  62. </if>
  63. <if test="personnelTeam != null and personnelTeam != ''">
  64. and PERSONNEL_TEAM = #{personnelTeam}
  65. </if>
  66. <if test="insertUsername != null and insertUsername != ''">
  67. and INSERT_USERNAME = #{insertUsername}
  68. </if>
  69. <if test="insertTime != null">
  70. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  71. </if>
  72. <if test="updateUsername != null and updateUsername != ''">
  73. and UPDATE_USERNAME = #{updateUsername}
  74. </if>
  75. <if test="updateTime != null">
  76. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  77. </if>
  78. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  79. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  80. </if>
  81. <if test="easPersonnelId != null">
  82. and EAS_PERSONNEL_ID = #{easPersonnelId}
  83. </if>
  84. <if test="deleted != null">
  85. and DELETED = #{deleted}
  86. </if>
  87. <if test="username != null and username != ''">
  88. and USERNAME = #{username}
  89. </if>
  90. <if test="password != null and password != ''">
  91. and PASSWORD = #{password}
  92. </if>
  93. </where>
  94. </sql>
  95. <sql id="whereLike">
  96. <where>
  97. <if test="personnelId != null">
  98. and PERSONNEL_ID = #{personnelId}
  99. </if>
  100. <if test="personnelJobNumber != null and personnelJobNumber != ''">
  101. and PERSONNEL_JOB_NUMBER LIKE '%${personnelJobNumber}%'
  102. </if>
  103. <if test="personnelPost != null and personnelPost != ''">
  104. and PERSONNEL_POST LIKE '%${personnelPost}%'
  105. </if>
  106. <if test="personnelName != null and personnelName != ''">
  107. and PERSONNEL_NAME LIKE '%${personnelName}%'
  108. </if>
  109. <if test="departmentId != null">
  110. and PERSONNEL_DEPARTMENT_ID = #{departmentId}
  111. </if>
  112. <if test="personnelWorkshopid != null and personnelWorkshopid != ''">
  113. and PERSONNEL_WORKSHOPID LIKE '%${personnelWorkshopid}%'
  114. </if>
  115. <if test="personnelShifts != null and personnelShifts != ''">
  116. and PERSONNEL_SHIFTS LIKE '%${personnelShifts}%'
  117. </if>
  118. <if test="personnelTeam != null and personnelTeam != ''">
  119. and PERSONNEL_TEAM LIKE '%${personnelTeam}%'
  120. </if>
  121. <if test="insertUsername != null and insertUsername != ''">
  122. and INSERT_USERNAME LIKE '%${insertUsername}%'
  123. </if>
  124. <if test="insertTime != null">
  125. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  126. </if>
  127. <if test="updateUsername != null and updateUsername != ''">
  128. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  129. </if>
  130. <if test="updateTime != null">
  131. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  132. </if>
  133. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  134. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  135. </if>
  136. <if test="easPersonnelId != null">
  137. and EAS_PERSONNEL_ID = #{easPersonnelId}
  138. </if>
  139. <if test="deleted != null">
  140. and DELETED = #{deleted}
  141. </if>
  142. <if test="username != null and username != ''">
  143. and USERNAME LIKE '%${username}%'
  144. </if>
  145. <if test="password != null and password != ''">
  146. and PASSWORD LIKE '%${password}%'
  147. </if>
  148. </where>
  149. </sql>
  150. <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
  151. delete from RMS_PERSONNEL
  152. where PERSONNEL_ID = #{personnelId,jdbcType=DECIMAL}
  153. </delete>
  154. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  155. delete from RMS_PERSONNEL
  156. where 1!=1
  157. <if test="personnelJobNumber != null and personnelJobNumber != ''">
  158. or PERSONNEL_JOB_NUMBER = #{personnelJobNumber}
  159. </if>
  160. <if test="personnelPost != null and personnelPost != ''">
  161. or PERSONNEL_POST = #{personnelPost}
  162. </if>
  163. <if test="personnelName != null and personnelName != ''">
  164. or PERSONNEL_NAME = #{personnelName}
  165. </if>
  166. <if test="departmentId != null">
  167. or PERSONNEL_DEPARTMENT_ID = #{departmentId}
  168. </if>
  169. <if test="personnelWorkshopid != null and personnelWorkshopid != ''">
  170. or PERSONNEL_WORKSHOPID = #{personnelWorkshopid}
  171. </if>
  172. <if test="personnelShifts != null and personnelShifts != ''">
  173. or PERSONNEL_SHIFTS = #{personnelShifts}
  174. </if>
  175. <if test="personnelTeam != null and personnelTeam != ''">
  176. or PERSONNEL_TEAM = #{personnelTeam}
  177. </if>
  178. <if test="insertUsername != null and insertUsername != ''">
  179. or INSERT_USERNAME = #{insertUsername}
  180. </if>
  181. <if test="insertTime != null">
  182. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  183. </if>
  184. <if test="updateUsername != null and updateUsername != ''">
  185. or UPDATE_USERNAME = #{updateUsername}
  186. </if>
  187. <if test="updateTime != null">
  188. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  189. </if>
  190. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  191. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  192. </if>
  193. <if test="easPersonnelId != null">
  194. or EAS_PERSONNEL_ID = #{easPersonnelId}
  195. </if>
  196. <if test="deleted != null">
  197. or DELETED = #{deleted}
  198. </if>
  199. <if test="username != null and username != ''">
  200. or USERNAME = #{username}
  201. </if>
  202. <if test="password != null and password != ''">
  203. or PASSWORD = #{password}
  204. </if>
  205. </delete>
  206. <insert id="insert" parameterType="com.steerinfo.dil.model.RmsPersonnel">
  207. insert into RMS_PERSONNEL (PERSONNEL_ID, PERSONNEL_JOB_NUMBER,
  208. PERSONNEL_POST, PERSONNEL_NAME, PERSONNEL_DEPARTMENT_ID,
  209. PERSONNEL_WORKSHOPID, PERSONNEL_SHIFTS, PERSONNEL_TEAM,
  210. INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
  211. UPDATE_TIME, INSERT_UPDATE_REMARK, EAS_PERSONNEL_ID,
  212. DELETED, USERNAME, PASSWORD
  213. )
  214. values (#{personnelId,jdbcType=DECIMAL}, #{personnelJobNumber,jdbcType=VARCHAR},
  215. #{personnelPost,jdbcType=VARCHAR}, #{personnelName,jdbcType=VARCHAR}, #{departmentId,jdbcType=DECIMAL},
  216. #{personnelWorkshopid,jdbcType=VARCHAR}, #{personnelShifts,jdbcType=VARCHAR}, #{personnelTeam,jdbcType=VARCHAR},
  217. #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR},
  218. #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{easPersonnelId,jdbcType=DECIMAL},
  219. #{deleted,jdbcType=DECIMAL}, #{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}
  220. )
  221. </insert>
  222. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.RmsPersonnel">
  223. insert into RMS_PERSONNEL
  224. <trim prefix="(" suffix=")" suffixOverrides=",">
  225. <if test="personnelId != null">
  226. PERSONNEL_ID,
  227. </if>
  228. <if test="personnelJobNumber != null">
  229. PERSONNEL_JOB_NUMBER,
  230. </if>
  231. <if test="personnelPost != null">
  232. PERSONNEL_POST,
  233. </if>
  234. <if test="personnelName != null">
  235. PERSONNEL_NAME,
  236. </if>
  237. <if test="departmentId != null">
  238. PERSONNEL_DEPARTMENT_ID,
  239. </if>
  240. <if test="personnelWorkshopid != null">
  241. PERSONNEL_WORKSHOPID,
  242. </if>
  243. <if test="personnelShifts != null">
  244. PERSONNEL_SHIFTS,
  245. </if>
  246. <if test="personnelTeam != null">
  247. PERSONNEL_TEAM,
  248. </if>
  249. <if test="insertUsername != null">
  250. INSERT_USERNAME,
  251. </if>
  252. <if test="insertTime != null">
  253. INSERT_TIME,
  254. </if>
  255. <if test="updateUsername != null">
  256. UPDATE_USERNAME,
  257. </if>
  258. <if test="updateTime != null">
  259. UPDATE_TIME,
  260. </if>
  261. <if test="insertUpdateRemark != null">
  262. INSERT_UPDATE_REMARK,
  263. </if>
  264. <if test="easPersonnelId != null">
  265. EAS_PERSONNEL_ID,
  266. </if>
  267. <if test="deleted != null">
  268. DELETED,
  269. </if>
  270. <if test="username != null">
  271. USERNAME,
  272. </if>
  273. <if test="password != null">
  274. PASSWORD,
  275. </if>
  276. </trim>
  277. <trim prefix="values (" suffix=")" suffixOverrides=",">
  278. <if test="personnelId != null">
  279. #{personnelId,jdbcType=DECIMAL},
  280. </if>
  281. <if test="personnelJobNumber != null">
  282. #{personnelJobNumber,jdbcType=VARCHAR},
  283. </if>
  284. <if test="personnelPost != null">
  285. #{personnelPost,jdbcType=VARCHAR},
  286. </if>
  287. <if test="personnelName != null">
  288. #{personnelName,jdbcType=VARCHAR},
  289. </if>
  290. <if test="departmentId != null">
  291. #{departmentId,jdbcType=DECIMAL},
  292. </if>
  293. <if test="personnelWorkshopid != null">
  294. #{personnelWorkshopid,jdbcType=VARCHAR},
  295. </if>
  296. <if test="personnelShifts != null">
  297. #{personnelShifts,jdbcType=VARCHAR},
  298. </if>
  299. <if test="personnelTeam != null">
  300. #{personnelTeam,jdbcType=VARCHAR},
  301. </if>
  302. <if test="insertUsername != null">
  303. #{insertUsername,jdbcType=VARCHAR},
  304. </if>
  305. <if test="insertTime != null">
  306. #{insertTime,jdbcType=TIMESTAMP},
  307. </if>
  308. <if test="updateUsername != null">
  309. #{updateUsername,jdbcType=VARCHAR},
  310. </if>
  311. <if test="updateTime != null">
  312. #{updateTime,jdbcType=TIMESTAMP},
  313. </if>
  314. <if test="insertUpdateRemark != null">
  315. #{insertUpdateRemark,jdbcType=VARCHAR},
  316. </if>
  317. <if test="easPersonnelId != null">
  318. #{easPersonnelId,jdbcType=DECIMAL},
  319. </if>
  320. <if test="deleted != null">
  321. #{deleted,jdbcType=DECIMAL},
  322. </if>
  323. <if test="username != null">
  324. #{username,jdbcType=VARCHAR},
  325. </if>
  326. <if test="password != null">
  327. #{password,jdbcType=VARCHAR},
  328. </if>
  329. </trim>
  330. </insert>
  331. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.RmsPersonnel">
  332. update RMS_PERSONNEL
  333. set PERSONNEL_JOB_NUMBER = #{personnelJobNumber,jdbcType=VARCHAR},
  334. PERSONNEL_POST = #{personnelPost,jdbcType=VARCHAR},
  335. PERSONNEL_NAME = #{personnelName,jdbcType=VARCHAR},
  336. PERSONNEL_DEPARTMENT_ID = #{departmentId,jdbcType=DECIMAL},
  337. PERSONNEL_WORKSHOPID = #{personnelWorkshopid,jdbcType=VARCHAR},
  338. PERSONNEL_SHIFTS = #{personnelShifts,jdbcType=VARCHAR},
  339. PERSONNEL_TEAM = #{personnelTeam,jdbcType=VARCHAR},
  340. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  341. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  342. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  343. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  344. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  345. EAS_PERSONNEL_ID = #{easPersonnelId,jdbcType=DECIMAL},
  346. DELETED = #{deleted,jdbcType=DECIMAL},
  347. USERNAME = #{username,jdbcType=VARCHAR},
  348. PASSWORD = #{password,jdbcType=VARCHAR}
  349. where PERSONNEL_ID = #{personnelId,jdbcType=DECIMAL}
  350. </update>
  351. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.RmsPersonnel">
  352. update RMS_PERSONNEL
  353. <set>
  354. <if test="personnelJobNumber != null">
  355. PERSONNEL_JOB_NUMBER = #{personnelJobNumber,jdbcType=VARCHAR},
  356. </if>
  357. <if test="personnelPost != null">
  358. PERSONNEL_POST = #{personnelPost,jdbcType=VARCHAR},
  359. </if>
  360. <if test="personnelName != null">
  361. PERSONNEL_NAME = #{personnelName,jdbcType=VARCHAR},
  362. </if>
  363. <if test="departmentId != null">
  364. PERSONNEL_DEPARTMENT_ID = #{departmentId,jdbcType=DECIMAL},
  365. </if>
  366. <if test="personnelWorkshopid != null">
  367. PERSONNEL_WORKSHOPID = #{personnelWorkshopid,jdbcType=VARCHAR},
  368. </if>
  369. <if test="personnelShifts != null">
  370. PERSONNEL_SHIFTS = #{personnelShifts,jdbcType=VARCHAR},
  371. </if>
  372. <if test="personnelTeam != null">
  373. PERSONNEL_TEAM = #{personnelTeam,jdbcType=VARCHAR},
  374. </if>
  375. <if test="insertUsername != null">
  376. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  377. </if>
  378. <if test="insertTime != null">
  379. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  380. </if>
  381. <if test="updateUsername != null">
  382. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  383. </if>
  384. <if test="updateTime != null">
  385. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  386. </if>
  387. <if test="insertUpdateRemark != null">
  388. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  389. </if>
  390. <if test="easPersonnelId != null">
  391. EAS_PERSONNEL_ID = #{easPersonnelId,jdbcType=DECIMAL},
  392. </if>
  393. <if test="deleted != null">
  394. DELETED = #{deleted,jdbcType=DECIMAL},
  395. </if>
  396. <if test="username != null">
  397. USERNAME = #{username,jdbcType=VARCHAR},
  398. </if>
  399. <if test="password != null">
  400. PASSWORD = #{password,jdbcType=VARCHAR},
  401. </if>
  402. </set>
  403. where PERSONNEL_ID = #{personnelId,jdbcType=DECIMAL}
  404. </update>
  405. <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
  406. <include refid="select"/>
  407. where PERSONNEL_ID = #{personnelId,jdbcType=DECIMAL}
  408. </select>
  409. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  410. <include refid="select"/>
  411. <include refid="where"/>
  412. </select>
  413. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  414. <include refid="select"/>
  415. <include refid="whereLike"/>
  416. </select>
  417. <insert id="batchInsert" parameterType="java.util.List">
  418. insert into RMS_PERSONNEL
  419. (PERSONNEL_ID,
  420. PERSONNEL_JOB_NUMBER, PERSONNEL_POST,
  421. PERSONNEL_NAME, PERSONNEL_DEPARTMENT_ID, PERSONNEL_WORKSHOPID,
  422. PERSONNEL_SHIFTS, PERSONNEL_TEAM,
  423. INSERT_USERNAME, INSERT_TIME,
  424. UPDATE_USERNAME, UPDATE_TIME,
  425. INSERT_UPDATE_REMARK, EAS_PERSONNEL_ID,
  426. DELETED, USERNAME, PASSWORD
  427. )
  428. ( <foreach collection="list" item="item" separator="union all">
  429. select
  430. #{item.personnelId,jdbcType=DECIMAL},
  431. #{item.personnelJobNumber,jdbcType=VARCHAR}, #{item.personnelPost,jdbcType=VARCHAR},
  432. #{item.personnelName,jdbcType=VARCHAR}, #{item.departmentId,jdbcType=DECIMAL}, #{item.personnelWorkshopid,jdbcType=VARCHAR},
  433. #{item.personnelShifts,jdbcType=VARCHAR}, #{item.personnelTeam,jdbcType=VARCHAR},
  434. #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
  435. #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
  436. #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.easPersonnelId,jdbcType=DECIMAL},
  437. #{item.deleted,jdbcType=DECIMAL}, #{item.username,jdbcType=VARCHAR}, #{item.password,jdbcType=VARCHAR}
  438. from dual
  439. </foreach> )
  440. </insert>
  441. <update id="batchUpdate" parameterType="java.util.List">
  442. update RMS_PERSONNEL
  443. set
  444. PERSONNEL_ID=
  445. <foreach collection="list" item="item" index="index" separator=" " open="case PERSONNEL_ID" close="end">
  446. when #{item.personnelId,jdbcType=DECIMAL} then #{item.personnelId,jdbcType=DECIMAL}
  447. </foreach>
  448. ,PERSONNEL_JOB_NUMBER=
  449. <foreach collection="list" item="item" index="index" separator=" " open="case PERSONNEL_ID" close="end">
  450. when #{item.personnelId,jdbcType=DECIMAL} then #{item.personnelJobNumber,jdbcType=VARCHAR}
  451. </foreach>
  452. ,PERSONNEL_POST=
  453. <foreach collection="list" item="item" index="index" separator=" " open="case PERSONNEL_ID" close="end">
  454. when #{item.personnelId,jdbcType=DECIMAL} then #{item.personnelPost,jdbcType=VARCHAR}
  455. </foreach>
  456. ,PERSONNEL_NAME=
  457. <foreach collection="list" item="item" index="index" separator=" " open="case PERSONNEL_ID" close="end">
  458. when #{item.personnelId,jdbcType=DECIMAL} then #{item.personnelName,jdbcType=VARCHAR}
  459. </foreach>
  460. ,PERSONNEL_DEPARTMENT_ID=
  461. <foreach collection="list" item="item" index="index" separator=" " open="case PERSONNEL_ID" close="end">
  462. when #{item.personnelId,jdbcType=DECIMAL} then #{item.departmentId,jdbcType=DECIMAL}
  463. </foreach>
  464. ,PERSONNEL_WORKSHOPID=
  465. <foreach collection="list" item="item" index="index" separator=" " open="case PERSONNEL_ID" close="end">
  466. when #{item.personnelId,jdbcType=DECIMAL} then #{item.personnelWorkshopid,jdbcType=VARCHAR}
  467. </foreach>
  468. ,PERSONNEL_SHIFTS=
  469. <foreach collection="list" item="item" index="index" separator=" " open="case PERSONNEL_ID" close="end">
  470. when #{item.personnelId,jdbcType=DECIMAL} then #{item.personnelShifts,jdbcType=VARCHAR}
  471. </foreach>
  472. ,PERSONNEL_TEAM=
  473. <foreach collection="list" item="item" index="index" separator=" " open="case PERSONNEL_ID" close="end">
  474. when #{item.personnelId,jdbcType=DECIMAL} then #{item.personnelTeam,jdbcType=VARCHAR}
  475. </foreach>
  476. ,INSERT_USERNAME=
  477. <foreach collection="list" item="item" index="index" separator=" " open="case PERSONNEL_ID" close="end">
  478. when #{item.personnelId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  479. </foreach>
  480. ,INSERT_TIME=
  481. <foreach collection="list" item="item" index="index" separator=" " open="case PERSONNEL_ID" close="end">
  482. when #{item.personnelId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  483. </foreach>
  484. ,UPDATE_USERNAME=
  485. <foreach collection="list" item="item" index="index" separator=" " open="case PERSONNEL_ID" close="end">
  486. when #{item.personnelId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  487. </foreach>
  488. ,UPDATE_TIME=
  489. <foreach collection="list" item="item" index="index" separator=" " open="case PERSONNEL_ID" close="end">
  490. when #{item.personnelId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  491. </foreach>
  492. ,INSERT_UPDATE_REMARK=
  493. <foreach collection="list" item="item" index="index" separator=" " open="case PERSONNEL_ID" close="end">
  494. when #{item.personnelId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  495. </foreach>
  496. ,EAS_PERSONNEL_ID=
  497. <foreach collection="list" item="item" index="index" separator=" " open="case PERSONNEL_ID" close="end">
  498. when #{item.personnelId,jdbcType=DECIMAL} then #{item.easPersonnelId,jdbcType=DECIMAL}
  499. </foreach>
  500. ,DELETED=
  501. <foreach collection="list" item="item" index="index" separator=" " open="case PERSONNEL_ID" close="end">
  502. when #{item.personnelId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
  503. </foreach>
  504. ,USERNAME=
  505. <foreach collection="list" item="item" index="index" separator=" " open="case PERSONNEL_ID" close="end">
  506. when #{item.personnelId,jdbcType=DECIMAL} then #{item.username,jdbcType=VARCHAR}
  507. </foreach>
  508. ,PASSWORD=
  509. <foreach collection="list" item="item" index="index" separator=" " open="case PERSONNEL_ID" close="end">
  510. when #{item.personnelId,jdbcType=DECIMAL} then #{item.password,jdbcType=VARCHAR}
  511. </foreach>
  512. where PERSONNEL_ID in
  513. <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
  514. #{item.personnelId,jdbcType=DECIMAL}
  515. </foreach>
  516. </update>
  517. <delete id="batchDelete" parameterType="java.util.List">
  518. delete from RMS_PERSONNEL
  519. where PERSONNEL_ID in
  520. <foreach collection="list" item="id" open="(" close=")" separator=",">
  521. #{id}
  522. </foreach>
  523. </delete>
  524. <!-- 友情提示!!!-->
  525. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  526. <!-- 得到人员信息下拉 -->
  527. <select id="getPersonnelList" parameterType="java.util.Map" resultType="java.util.Map">
  528. SELECT *
  529. FROM (
  530. SELECT
  531. RP.PERSONNEL_ID AS "personnelId",
  532. RP.PERSONNEL_JOB_NUMBER AS "personnelJobNumber",
  533. RP.PERSONNEL_NAME AS "personnelName",
  534. RP.PERSONNEL_POST AS "personnelPost",
  535. RS.SHIPPER_NAME AS "shipperName",
  536. RP.PERSONNEL_WORKSHOPID AS "personnelWorkshopid",
  537. RP.PERSONNEL_SHIFTS AS "personnelShifts",
  538. RS.SHIPPER_ID AS "shipperId",
  539. RP.PERSONNEL_DEPARTMENT_ID AS "departmentId",
  540. RP.PERSONNEL_TEAM AS "personnelTeam"
  541. FROM RMS_PERSONNEL RP
  542. LEFT JOIN RMS_SHIPPER RS
  543. ON RP.PERSONNEL_DEPARTMENT_ID=RS.SHIPPER_ID
  544. WHERE RP.DELETED != 1
  545. ORDER BY RP.INSERT_TIME DESC
  546. )
  547. <where>
  548. <if test="personnelJobNumber!= null">
  549. and
  550. <foreach collection="personnelJobNumber" item="item" open="(" separator="," close=")">
  551. "personnelJobNumber" in #{item}
  552. </foreach>
  553. </if>
  554. <if test="personnelName!= null">
  555. and
  556. <foreach collection="personnelName" item="item" open="(" separator="," close=")">
  557. "personnelName" in #{item}
  558. </foreach>
  559. </if>
  560. <if test="personnelPost!= null">
  561. and
  562. <foreach collection="personnelPost" item="item" open="(" separator="," close=")">
  563. "personnelPost" in #{item}
  564. </foreach>
  565. </if>
  566. <if test="shipperName!= null">
  567. and
  568. <foreach collection="shipperName" item="item" open="(" separator="," close=")">
  569. "shipperName" in #{item}
  570. </foreach>
  571. </if>
  572. <if test="personnelWorkshopid!= null">
  573. and
  574. <foreach collection="personnelWorkshopid" item="item" open="(" separator="," close=")">
  575. "personnelWorkshopld" in #{item}
  576. </foreach>
  577. </if>
  578. <if test="personnelShifts!= null">
  579. and
  580. <foreach collection="personnelShifts" item="item" open="(" separator="," close=")">
  581. "personnelShifts" in #{item}
  582. </foreach>
  583. </if>
  584. <if test="departmentId!= null">
  585. and
  586. <foreach collection="departmentId" item="item" open="(" separator="," close=")">
  587. "departmentId" in #{item}
  588. </foreach>
  589. </if>
  590. <if test="personnelTeam!= null">
  591. and
  592. <foreach collection="personnelTeam" item="item" open="(" separator="," close=")">
  593. "personnelTeam" in #{item}
  594. </foreach>
  595. </if>
  596. </where>
  597. </select>
  598. <!-- 根据id值展示人员信息-->
  599. <select id="selectPersonnelById" resultType="java.util.LinkedHashMap">
  600. SELECT
  601. RP.PERSONNEL_ID AS "personnelId",
  602. RP.PERSONNEL_DEPARTMENT_ID AS "departmentId",
  603. RP.PERSONNEL_JOB_NUMBER AS "personnelJobNumber",
  604. RP.PERSONNEL_NAME AS "personnelName",
  605. RP.PERSONNEL_POST AS "personnelPost",
  606. RP.PERSONNEL_WORKSHOPID AS "personnelWorkshopid",
  607. RP.PERSONNEL_SHIFTS AS "personnelShifts",
  608. RP.PERSONNEL_TEAM AS "personnelTeam"
  609. FROM RMS_PERSONNEL RP
  610. WHERE RP.PERSONNEL_ID=#{id}
  611. </select>
  612. <!-- 获得托运人信息-->
  613. <select id="getShipperId" resultType="java.util.LinkedHashMap">
  614. SELECT RS.SHIPPER_ID AS "id",
  615. RS.SHIPPER_ID AS "value",
  616. RS.SHIPPER_NAME AS "label"
  617. FROM RMS_SHIPPER RS
  618. WHERE RS.DELETED!=1
  619. </select>
  620. </mapper>