RmsPersonnelMapper.xml 28 KB

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