OrgHumanResourceMapper.xml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481
  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.goafanti.common.dao.OrgHumanResourceMapper" >
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.OrgHumanResource" >
  5. <id column="id" property="id" jdbcType="VARCHAR" />
  6. <result column="uid" property="uid" jdbcType="VARCHAR" />
  7. <result column="firm_total" property="firmTotal" jdbcType="INTEGER" />
  8. <result column="tech_total" property="techTotal" jdbcType="INTEGER" />
  9. <result column="firm_in_service" property="firmInService" jdbcType="INTEGER" />
  10. <result column="tech_in_service" property="techInService" jdbcType="INTEGER" />
  11. <result column="firm_part_time" property="firmPartTime" jdbcType="INTEGER" />
  12. <result column="tech_part_time" property="techPartTime" jdbcType="INTEGER" />
  13. <result column="firm_temporary" property="firmTemporary" jdbcType="INTEGER" />
  14. <result column="tech_temporary" property="techTemporary" jdbcType="INTEGER" />
  15. <result column="firm_foreign" property="firmForeign" jdbcType="INTEGER" />
  16. <result column="tech_foreign" property="techForeign" jdbcType="INTEGER" />
  17. <result column="firm_abroad" property="firmAbroad" jdbcType="INTEGER" />
  18. <result column="tech_abroad" property="techAbroad" jdbcType="INTEGER" />
  19. <result column="firm_core" property="firmCore" jdbcType="INTEGER" />
  20. <result column="tech_core" property="techCore" jdbcType="INTEGER" />
  21. <result column="doctor" property="doctor" jdbcType="INTEGER" />
  22. <result column="master" property="master" jdbcType="INTEGER" />
  23. <result column="undergraduate" property="undergraduate" jdbcType="INTEGER" />
  24. <result column="college" property="college" jdbcType="INTEGER" />
  25. <result column="senior_title" property="seniorTitle" jdbcType="INTEGER" />
  26. <result column="intermediate_title" property="intermediateTitle" jdbcType="INTEGER" />
  27. <result column="junior_title" property="juniorTitle" jdbcType="INTEGER" />
  28. <result column="senior_mechanic" property="seniorMechanic" jdbcType="INTEGER" />
  29. <result column="below_thirty" property="belowThirty" jdbcType="INTEGER" />
  30. <result column="thirtyone_to_thirtyfour" property="thirtyoneToThirtyfour" jdbcType="INTEGER" />
  31. <result column="fortyone_to_fifty" property="fortyoneToFifty" jdbcType="INTEGER" />
  32. <result column="above_fifty" property="aboveFifty" jdbcType="INTEGER" />
  33. <result column="year" property="year" jdbcType="INTEGER" />
  34. <result column="new_employment" property="newEmployment" jdbcType="INTEGER" />
  35. <result column="graduate_number" property="graduateNumber" jdbcType="INTEGER" />
  36. <result column="roster_url" property="rosterUrl" jdbcType="VARCHAR" />
  37. <result column="social_security_url" property="socialSecurityUrl" jdbcType="VARCHAR" />
  38. <result column="deleted_sign" property="deletedSign" jdbcType="INTEGER" />
  39. </resultMap>
  40. <sql id="Base_Column_List" >
  41. id, uid, firm_total, tech_total, firm_in_service, tech_in_service, firm_part_time,
  42. tech_part_time, firm_temporary, tech_temporary, firm_foreign, tech_foreign, firm_abroad,
  43. tech_abroad, firm_core, tech_core, doctor, master, undergraduate, college,
  44. senior_title, intermediate_title, junior_title, senior_mechanic, below_thirty,
  45. thirtyone_to_thirtyfour, fortyone_to_fifty, above_fifty, year, new_employment, graduate_number,
  46. roster_url, social_security_url, deleted_sign
  47. </sql>
  48. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
  49. select
  50. <include refid="Base_Column_List" />
  51. from org_human_resource
  52. where id = #{id,jdbcType=VARCHAR}
  53. </select>
  54. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
  55. delete from org_human_resource
  56. where id = #{id,jdbcType=VARCHAR}
  57. </delete>
  58. <insert id="insert" parameterType="com.goafanti.common.model.OrgHumanResource" >
  59. insert into org_human_resource (id, uid, firm_total,
  60. tech_total, firm_in_service, tech_in_service,
  61. firm_part_time, tech_part_time, firm_temporary,
  62. tech_temporary, firm_foreign, tech_foreign,
  63. firm_abroad, tech_abroad, firm_core,
  64. tech_core, doctor, master,
  65. undergraduate, college, senior_title,
  66. intermediate_title, junior_title, senior_mechanic,
  67. below_thirty, thirtyone_to_thirtyfour, fortyone_to_fifty,
  68. above_fifty, year, new_employment, graduate_number, roster_url, social_security_url, deleted_sign)
  69. values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{firmTotal,jdbcType=INTEGER},
  70. #{techTotal,jdbcType=INTEGER}, #{firmInService,jdbcType=INTEGER}, #{techInService,jdbcType=INTEGER},
  71. #{firmPartTime,jdbcType=INTEGER}, #{techPartTime,jdbcType=INTEGER}, #{firmTemporary,jdbcType=INTEGER},
  72. #{techTemporary,jdbcType=INTEGER}, #{firmForeign,jdbcType=INTEGER}, #{techForeign,jdbcType=INTEGER},
  73. #{firmAbroad,jdbcType=INTEGER}, #{techAbroad,jdbcType=INTEGER}, #{firmCore,jdbcType=INTEGER},
  74. #{techCore,jdbcType=INTEGER}, #{doctor,jdbcType=INTEGER}, #{master,jdbcType=INTEGER},
  75. #{undergraduate,jdbcType=INTEGER}, #{college,jdbcType=INTEGER}, #{seniorTitle,jdbcType=INTEGER},
  76. #{intermediateTitle,jdbcType=INTEGER}, #{juniorTitle,jdbcType=INTEGER}, #{seniorMechanic,jdbcType=INTEGER},
  77. #{belowThirty,jdbcType=INTEGER}, #{thirtyoneToThirtyfour,jdbcType=INTEGER}, #{fortyoneToFifty,jdbcType=INTEGER},
  78. #{aboveFifty,jdbcType=INTEGER}, #{year,jdbcType=INTEGER}, #{newEmployment,jdbcType=INTEGER}, #{graduateNumber,jdbcType=INTEGER},
  79. #{rosterUrl,jdbcType=VARCHAR}, #{socialSecurityUrl,jdbcType=VARCHAR},
  80. #{deletedSign,jdbcType=INTEGER})
  81. </insert>
  82. <insert id="insertSelective" parameterType="com.goafanti.common.model.OrgHumanResource" >
  83. insert into org_human_resource
  84. <trim prefix="(" suffix=")" suffixOverrides="," >
  85. <if test="id != null" >
  86. id,
  87. </if>
  88. <if test="uid != null" >
  89. uid,
  90. </if>
  91. <if test="firmTotal != null" >
  92. firm_total,
  93. </if>
  94. <if test="techTotal != null" >
  95. tech_total,
  96. </if>
  97. <if test="firmInService != null" >
  98. firm_in_service,
  99. </if>
  100. <if test="techInService != null" >
  101. tech_in_service,
  102. </if>
  103. <if test="firmPartTime != null" >
  104. firm_part_time,
  105. </if>
  106. <if test="techPartTime != null" >
  107. tech_part_time,
  108. </if>
  109. <if test="firmTemporary != null" >
  110. firm_temporary,
  111. </if>
  112. <if test="techTemporary != null" >
  113. tech_temporary,
  114. </if>
  115. <if test="firmForeign != null" >
  116. firm_foreign,
  117. </if>
  118. <if test="techForeign != null" >
  119. tech_foreign,
  120. </if>
  121. <if test="firmAbroad != null" >
  122. firm_abroad,
  123. </if>
  124. <if test="techAbroad != null" >
  125. tech_abroad,
  126. </if>
  127. <if test="firmCore != null" >
  128. firm_core,
  129. </if>
  130. <if test="techCore != null" >
  131. tech_core,
  132. </if>
  133. <if test="doctor != null" >
  134. doctor,
  135. </if>
  136. <if test="master != null" >
  137. master,
  138. </if>
  139. <if test="undergraduate != null" >
  140. undergraduate,
  141. </if>
  142. <if test="college != null" >
  143. college,
  144. </if>
  145. <if test="seniorTitle != null" >
  146. senior_title,
  147. </if>
  148. <if test="intermediateTitle != null" >
  149. intermediate_title,
  150. </if>
  151. <if test="juniorTitle != null" >
  152. junior_title,
  153. </if>
  154. <if test="seniorMechanic != null" >
  155. senior_mechanic,
  156. </if>
  157. <if test="belowThirty != null" >
  158. below_thirty,
  159. </if>
  160. <if test="thirtyoneToThirtyfour != null" >
  161. thirtyone_to_thirtyfour,
  162. </if>
  163. <if test="fortyoneToFifty != null" >
  164. fortyone_to_fifty,
  165. </if>
  166. <if test="aboveFifty != null" >
  167. above_fifty,
  168. </if>
  169. <if test="year != null" >
  170. year,
  171. </if>
  172. <if test="newEmployment != null" >
  173. new_employment,
  174. </if>
  175. <if test="graduateNumber != null" >
  176. graduate_number,
  177. </if>
  178. <if test="rosterUrl != null" >
  179. roster_url,
  180. </if>
  181. <if test="socialSecurityUrl != null">
  182. social_security_url,
  183. </if>
  184. <if test="deletedSign != null">
  185. deleted_sign,
  186. </if>
  187. </trim>
  188. <trim prefix="values (" suffix=")" suffixOverrides="," >
  189. <if test="id != null" >
  190. #{id,jdbcType=VARCHAR},
  191. </if>
  192. <if test="uid != null" >
  193. #{uid,jdbcType=VARCHAR},
  194. </if>
  195. <if test="firmTotal != null" >
  196. #{firmTotal,jdbcType=INTEGER},
  197. </if>
  198. <if test="techTotal != null" >
  199. #{techTotal,jdbcType=INTEGER},
  200. </if>
  201. <if test="firmInService != null" >
  202. #{firmInService,jdbcType=INTEGER},
  203. </if>
  204. <if test="techInService != null" >
  205. #{techInService,jdbcType=INTEGER},
  206. </if>
  207. <if test="firmPartTime != null" >
  208. #{firmPartTime,jdbcType=INTEGER},
  209. </if>
  210. <if test="techPartTime != null" >
  211. #{techPartTime,jdbcType=INTEGER},
  212. </if>
  213. <if test="firmTemporary != null" >
  214. #{firmTemporary,jdbcType=INTEGER},
  215. </if>
  216. <if test="techTemporary != null" >
  217. #{techTemporary,jdbcType=INTEGER},
  218. </if>
  219. <if test="firmForeign != null" >
  220. #{firmForeign,jdbcType=INTEGER},
  221. </if>
  222. <if test="techForeign != null" >
  223. #{techForeign,jdbcType=INTEGER},
  224. </if>
  225. <if test="firmAbroad != null" >
  226. #{firmAbroad,jdbcType=INTEGER},
  227. </if>
  228. <if test="techAbroad != null" >
  229. #{techAbroad,jdbcType=INTEGER},
  230. </if>
  231. <if test="firmCore != null" >
  232. #{firmCore,jdbcType=INTEGER},
  233. </if>
  234. <if test="techCore != null" >
  235. #{techCore,jdbcType=INTEGER},
  236. </if>
  237. <if test="doctor != null" >
  238. #{doctor,jdbcType=INTEGER},
  239. </if>
  240. <if test="master != null" >
  241. #{master,jdbcType=INTEGER},
  242. </if>
  243. <if test="undergraduate != null" >
  244. #{undergraduate,jdbcType=INTEGER},
  245. </if>
  246. <if test="college != null" >
  247. #{college,jdbcType=INTEGER},
  248. </if>
  249. <if test="seniorTitle != null" >
  250. #{seniorTitle,jdbcType=INTEGER},
  251. </if>
  252. <if test="intermediateTitle != null" >
  253. #{intermediateTitle,jdbcType=INTEGER},
  254. </if>
  255. <if test="juniorTitle != null" >
  256. #{juniorTitle,jdbcType=INTEGER},
  257. </if>
  258. <if test="seniorMechanic != null" >
  259. #{seniorMechanic,jdbcType=INTEGER},
  260. </if>
  261. <if test="belowThirty != null" >
  262. #{belowThirty,jdbcType=INTEGER},
  263. </if>
  264. <if test="thirtyoneToThirtyfour != null" >
  265. #{thirtyoneToThirtyfour,jdbcType=INTEGER},
  266. </if>
  267. <if test="fortyoneToFifty != null" >
  268. #{fortyoneToFifty,jdbcType=INTEGER},
  269. </if>
  270. <if test="aboveFifty != null" >
  271. #{aboveFifty,jdbcType=INTEGER},
  272. </if>
  273. <if test="year != null" >
  274. #{year,jdbcType=INTEGER},
  275. </if>
  276. <if test="newEmployment != null" >
  277. #{newEmployment,jdbcType=INTEGER},
  278. </if>
  279. <if test="graduateNumber != null" >
  280. #{graduateNumber,jdbcType=INTEGER},
  281. </if>
  282. <if test="rosterUrl != null" >
  283. #{rosterUrl,jdbcType=VARCHAR},
  284. </if>
  285. <if test="socialSecurityUrl != null">
  286. #{socialSecurityUrl,jdbcType=VARCHAR},
  287. </if>
  288. <if test="deletedSign != null">
  289. #{deleted_sign,jdbcType=INTEGER},
  290. </if>
  291. </trim>
  292. </insert>
  293. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.OrgHumanResource" >
  294. update org_human_resource
  295. <set >
  296. <if test="uid != null" >
  297. uid = #{uid,jdbcType=VARCHAR},
  298. </if>
  299. <if test="firmTotal != null" >
  300. firm_total = #{firmTotal,jdbcType=INTEGER},
  301. </if>
  302. <if test="techTotal != null" >
  303. tech_total = #{techTotal,jdbcType=INTEGER},
  304. </if>
  305. <if test="firmInService != null" >
  306. firm_in_service = #{firmInService,jdbcType=INTEGER},
  307. </if>
  308. <if test="techInService != null" >
  309. tech_in_service = #{techInService,jdbcType=INTEGER},
  310. </if>
  311. <if test="firmPartTime != null" >
  312. firm_part_time = #{firmPartTime,jdbcType=INTEGER},
  313. </if>
  314. <if test="techPartTime != null" >
  315. tech_part_time = #{techPartTime,jdbcType=INTEGER},
  316. </if>
  317. <if test="firmTemporary != null" >
  318. firm_temporary = #{firmTemporary,jdbcType=INTEGER},
  319. </if>
  320. <if test="techTemporary != null" >
  321. tech_temporary = #{techTemporary,jdbcType=INTEGER},
  322. </if>
  323. <if test="firmForeign != null" >
  324. firm_foreign = #{firmForeign,jdbcType=INTEGER},
  325. </if>
  326. <if test="techForeign != null" >
  327. tech_foreign = #{techForeign,jdbcType=INTEGER},
  328. </if>
  329. <if test="firmAbroad != null" >
  330. firm_abroad = #{firmAbroad,jdbcType=INTEGER},
  331. </if>
  332. <if test="techAbroad != null" >
  333. tech_abroad = #{techAbroad,jdbcType=INTEGER},
  334. </if>
  335. <if test="firmCore != null" >
  336. firm_core = #{firmCore,jdbcType=INTEGER},
  337. </if>
  338. <if test="techCore != null" >
  339. tech_core = #{techCore,jdbcType=INTEGER},
  340. </if>
  341. <if test="doctor != null" >
  342. doctor = #{doctor,jdbcType=INTEGER},
  343. </if>
  344. <if test="master != null" >
  345. master = #{master,jdbcType=INTEGER},
  346. </if>
  347. <if test="undergraduate != null" >
  348. undergraduate = #{undergraduate,jdbcType=INTEGER},
  349. </if>
  350. <if test="college != null" >
  351. college = #{college,jdbcType=INTEGER},
  352. </if>
  353. <if test="seniorTitle != null" >
  354. senior_title = #{seniorTitle,jdbcType=INTEGER},
  355. </if>
  356. <if test="intermediateTitle != null" >
  357. intermediate_title = #{intermediateTitle,jdbcType=INTEGER},
  358. </if>
  359. <if test="juniorTitle != null" >
  360. junior_title = #{juniorTitle,jdbcType=INTEGER},
  361. </if>
  362. <if test="seniorMechanic != null" >
  363. senior_mechanic = #{seniorMechanic,jdbcType=INTEGER},
  364. </if>
  365. <if test="belowThirty != null" >
  366. below_thirty = #{belowThirty,jdbcType=INTEGER},
  367. </if>
  368. <if test="thirtyoneToThirtyfour != null" >
  369. thirtyone_to_thirtyfour = #{thirtyoneToThirtyfour,jdbcType=INTEGER},
  370. </if>
  371. <if test="fortyoneToFifty != null" >
  372. fortyone_to_fifty = #{fortyoneToFifty,jdbcType=INTEGER},
  373. </if>
  374. <if test="aboveFifty != null" >
  375. above_fifty = #{aboveFifty,jdbcType=INTEGER},
  376. </if>
  377. <if test="year != null" >
  378. year = #{year,jdbcType=INTEGER},
  379. </if>
  380. <if test="newEmployment != null" >
  381. new_employment = #{newEmployment,jdbcType=INTEGER},
  382. </if>
  383. <if test="graduateNumber != null" >
  384. graduate_number = #{graduateNumber,jdbcType=INTEGER},
  385. </if>
  386. <if test="rosterUrl != null" >
  387. roster_url = #{rosterUrl,jdbcType=VARCHAR},
  388. </if>
  389. <if test="socialSecurityUrl != null">
  390. social_security_url = #{socialSecurityUrl,jdbcType=VARCHAR},
  391. </if>
  392. <if test="deletedSign != null">
  393. deleted_sign = #{deletedSign,jdbcType=INTEGER},
  394. </if>
  395. </set>
  396. where id = #{id,jdbcType=VARCHAR}
  397. </update>
  398. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.OrgHumanResource" >
  399. update org_human_resource
  400. set uid = #{uid,jdbcType=VARCHAR},
  401. firm_total = #{firmTotal,jdbcType=INTEGER},
  402. tech_total = #{techTotal,jdbcType=INTEGER},
  403. firm_in_service = #{firmInService,jdbcType=INTEGER},
  404. tech_in_service = #{techInService,jdbcType=INTEGER},
  405. firm_part_time = #{firmPartTime,jdbcType=INTEGER},
  406. tech_part_time = #{techPartTime,jdbcType=INTEGER},
  407. firm_temporary = #{firmTemporary,jdbcType=INTEGER},
  408. tech_temporary = #{techTemporary,jdbcType=INTEGER},
  409. firm_foreign = #{firmForeign,jdbcType=INTEGER},
  410. tech_foreign = #{techForeign,jdbcType=INTEGER},
  411. firm_abroad = #{firmAbroad,jdbcType=INTEGER},
  412. tech_abroad = #{techAbroad,jdbcType=INTEGER},
  413. firm_core = #{firmCore,jdbcType=INTEGER},
  414. tech_core = #{techCore,jdbcType=INTEGER},
  415. doctor = #{doctor,jdbcType=INTEGER},
  416. master = #{master,jdbcType=INTEGER},
  417. undergraduate = #{undergraduate,jdbcType=INTEGER},
  418. college = #{college,jdbcType=INTEGER},
  419. senior_title = #{seniorTitle,jdbcType=INTEGER},
  420. intermediate_title = #{intermediateTitle,jdbcType=INTEGER},
  421. junior_title = #{juniorTitle,jdbcType=INTEGER},
  422. senior_mechanic = #{seniorMechanic,jdbcType=INTEGER},
  423. below_thirty = #{belowThirty,jdbcType=INTEGER},
  424. thirtyone_to_thirtyfour = #{thirtyoneToThirtyfour,jdbcType=INTEGER},
  425. fortyone_to_fifty = #{fortyoneToFifty,jdbcType=INTEGER},
  426. above_fifty = #{aboveFifty,jdbcType=INTEGER},
  427. year = #{year,jdbcType=INTEGER},
  428. new_employment = #{newEmployment,jdbcType=INTEGER},
  429. graduate_number = #{graduateNumber,jdbcType=INTEGER},
  430. roster_url = #{rosterUrl,jdbcType=VARCHAR},
  431. social_security_url = #{socialSecurityUrl,jdbcType=VARCHAR},
  432. deleted_sign = #{deletedSign,jdbcType=INTEGER}
  433. where id = #{id,jdbcType=VARCHAR}
  434. </update>
  435. <select id="findOrgHumanResourceListByPage" parameterType="java.lang.String" resultMap="BaseResultMap">
  436. select
  437. <include refid="Base_Column_List" />
  438. from org_human_resource
  439. where deleted_sign = 0
  440. <if test="uid != null">
  441. and uid = #{uid,jdbcType=VARCHAR}
  442. </if>
  443. <if test="year != null">
  444. and year = #{year,jdbcType=INTEGER}
  445. </if>
  446. order by year desc
  447. <if test="page_sql != null">
  448. ${page_sql}
  449. </if>
  450. </select>
  451. <select id="findOrgHumanResourceCount" resultType="java.lang.Integer" parameterType="String">
  452. select count(1) from
  453. org_human_resource
  454. where deleted_sign = 0
  455. <if test="uid != null">
  456. and uid = #{uid,jdbcType=VARCHAR}
  457. </if>
  458. <if test="year != null">
  459. and year = #{year,jdbcType=INTEGER}
  460. </if>
  461. </select>
  462. <update id="batchDeleteByPrimaryKey" parameterType="java.util.List">
  463. update org_human_resource set deleted_sign = 1
  464. where id in
  465. <foreach item="item" index="index" collection="list" open="(" separator="," close=")">
  466. #{item}
  467. </foreach>
  468. </update>
  469. <select id="selectOrgHumanResourceByUidAndYear" resultMap="BaseResultMap" >
  470. select
  471. <include refid="Base_Column_List" />
  472. from org_human_resource
  473. where year = #{0} and uid = #{1}
  474. </select>
  475. </mapper>