LaborManagementMapper.xml 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.xjrsoft.module.personnel.mapper.LaborManagementMapper">
  6. <select id="getPage" parameterType="com.xjrsoft.module.personnel.dto.LaborManagementPageDto" resultType="com.xjrsoft.module.personnel.vo.LaborManagementPageVo">
  7. SELECT t.id,
  8. t.user_name,
  9. t.name,
  10. t1.name AS gender,
  11. t2.start_work_time,
  12. t3.name AS jobState,
  13. t4.name as nature_organization,
  14. t5.name,
  15. t9.name AS job
  16. FROM xjr_user t
  17. inner JOIN base_teacher t2 ON t2.user_id = t.id
  18. LEFT JOIN xjr_dictionary_detail t1
  19. ON t1.code = t.gender
  20. LEFT JOIN xjr_dictionary_detail t3
  21. ON t3.item_id = (SELECT id FROM xjr_dictionary_item WHERE code = 'job_state') AND
  22. t3.value = t2.job_state
  23. LEFT JOIN xjr_dictionary_detail t4 ON t4.code = t2.employ_way
  24. LEFT JOIN xjr_user_dept_relation t7 ON t7.user_id = t.id
  25. LEFT JOIN xjr_department t5 ON t5.id = t7.dept_id
  26. LEFT JOIN xjr_user_post_relation t8 ON t8.user_id = t.id
  27. LEFT JOIN xjr_post t9 ON t9.id = t8.post_id
  28. WHERE t.delete_mark = 0
  29. <if test="dto.userName != null and dto.userName != ''">
  30. AND t.user_name = #{dto.userName}
  31. </if>
  32. <if test="dto.name != null and dto.name != ''">
  33. AND t.name like concat('%', #{dto.name}, '%')
  34. </if>
  35. <if test="dto.gender != null and dto.gender != ''">
  36. AND t1.code = #{dto.gender}
  37. </if>
  38. <if test="dto.startWorkTime != null and dto.endWorkTime != null">
  39. AND t2.start_work_time BETWEEN #{dto.startWorkTime} AND #{dto.endWorkTime}
  40. </if>
  41. <if test="dto.jobState != null">
  42. and t2.job_state = #{dto.jobState}
  43. </if>
  44. <if test="dto.natureOrganization != null">
  45. and t4.nature_organization = #{dto.natureOrganization}
  46. </if>
  47. <if test="dto.job != null">
  48. and t4.job = #{dto.job}
  49. </if>
  50. ORDER BY t.id;
  51. </select>
  52. <select id="listLaborManagementPageVo" resultType="com.xjrsoft.module.personnel.vo.LaborManagementPageVo">
  53. SELECT t.id,
  54. t.user_name,
  55. t.name,
  56. t1.name AS gender,
  57. t2.start_work_time,
  58. t3.name AS jobState,
  59. t4.name as nature_organization,
  60. t5.name,
  61. t9.name AS job
  62. FROM xjr_user t
  63. inner JOIN base_teacher t2 ON t2.user_id = t.id
  64. LEFT JOIN xjr_dictionary_detail t1
  65. ON t1.code = t.gender
  66. LEFT JOIN xjr_dictionary_detail t3
  67. ON t3.item_id = (SELECT id FROM xjr_dictionary_item WHERE code = 'job_state') AND
  68. t3.value = t2.job_state
  69. LEFT JOIN xjr_dictionary_detail t4 ON t4.code = t2.employ_way
  70. LEFT JOIN xjr_user_dept_relation t7 ON t7.user_id = t.id
  71. LEFT JOIN xjr_department t5 ON t5.id = t7.dept_id
  72. LEFT JOIN xjr_user_post_relation t8 ON t8.user_id = t.id
  73. LEFT JOIN xjr_post t9 ON t9.id = t8.post_id
  74. WHERE t.delete_mark = 0
  75. ORDER BY t.id;
  76. </select>
  77. <!--
  78. 工号:xjruser-username;
  79. 姓名:xjruser-name;
  80. 性别:xjruser-gender->xjritem;
  81. 性别id->sjrdition-itemid-code;
  82. 入职时间:baseteacher-startworktime;
  83. 在职状态:baseteacher-jobstate;
  84. 人员类别:wf_teacher_depart-natureorigan;
  85. 任职部门:wf_teacher_depart-deptname-xjrdepart->name;
  86. 工作岗位:wf_teacher_depart-job;
  87. -->
  88. </mapper>