JobUserCQuery.xml 5.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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.hz.employmentsite.mapper.cquery.JobUserCQuery">
  4. <select id="selectJobUserList" resultType="com.hz.employmentsite.vo.jobUserManager.JobUserVo">
  5. select jobuser.* ,gender.name as GenderName,culture.name as
  6. CultureName,
  7. site.SiteName,inSites.InstitutionID as institutionID,
  8. jobstatus.name as
  9. JobStatusName,keytype.name as KeyTypeName,sys_politics.name as politicsStatusName,sys_health.name as healthName,
  10. sys_family.name as familyNatureName,sys_full_time.Name as isFullTimeName,occ_cat.OccupationalName as
  11. occupationalCategoryName,
  12. sys_occ_level.Name as occupationalLevelName,sys_blood_type.Name as bloodTypeName,sys_marital_status.Name as
  13. MaritalStatusName, sys_nation.Name as nationName,
  14. area_region.name as RegionName,area_street.name as StreetName,
  15. (select count(*) from pc_recommend recommend where jobuser.JobUserID = recommend.JobuserID and isRead = 1)as
  16. RecommendedCount
  17. ,case when jobuser.IdentityNumber is not null and jobuser.IdentityNumber <![CDATA[ <> ]]>'' then
  18. TIMESTAMPDIFF(YEAR,STR_TO_DATE(SUBSTRING(jobuser.IdentityNumber, 7, 8),'%Y%m%d'),CURRENT_DATE())
  19. else null end as age
  20. from pc_jobuser jobuser
  21. left join pc_site site on site.SiteID = jobuser.SiteID
  22. left join sys_dictionary_item culture on jobuser.CultureRank = culture.value and
  23. culture.DictionaryCode='HighestDegree'
  24. left join sys_dictionary_item gender on jobuser.Sex = gender.value and gender.DictionaryCode='Gender'
  25. left join sys_dictionary_item jobstatus on jobuser.JobStatusID = jobstatus.value and
  26. jobstatus.DictionaryCode='JobStatus'
  27. left join sys_dictionary_item keytype on jobuser.KeyPersonTypeID = keytype.value and
  28. keytype.DictionaryCode='KeyPersonType'
  29. left join (select * from sys_dictionary_item where DictionaryCode ='PoliticsStatus') sys_politics on
  30. jobuser.PoliticsStatusID = sys_politics.Value
  31. left join (select * from sys_dictionary_item where DictionaryCode ='Health') sys_health on
  32. jobuser.healthID = sys_health.Value
  33. left join (select * from sys_dictionary_item where DictionaryCode ='FamilyNature') sys_family on
  34. jobuser.familyNatureID = sys_family.Value
  35. left join (select * from sys_dictionary_item where DictionaryCode ='IsFullTime') sys_full_time on
  36. jobuser.IsFullTime = sys_full_time.Value
  37. left join pc_occupational occ_cat on
  38. jobuser.OccupationalCategory =
  39. occ_cat.OccupationalID
  40. left join (select * from sys_dictionary_item where DictionaryCode ='OccupationalLevel') sys_occ_level on
  41. jobuser.OccupationalLevel = sys_occ_level.Value
  42. left join (select * from sys_dictionary_item where DictionaryCode ='BloodType') sys_blood_type on
  43. jobuser.BloodTypeID = sys_blood_type.Value
  44. left join (select * from sys_dictionary_item where DictionaryCode ='MaritalStatus') sys_marital_status on
  45. jobuser.MaritalStatusID = sys_marital_status.Value
  46. left join (select * from sys_dictionary_item where DictionaryCode ='NationType') sys_nation on
  47. jobuser.Nation = sys_nation.Value
  48. left join area_code area_region on jobuser.RegionCode = area_region.code
  49. left join area_code area_street on jobuser.StreetCode = area_street.code
  50. left join pc_site_institution inSites on site.SiteID = inSites.SiteID
  51. left join pc_institution institution on inSites.institutionID = institution.InstitutionID
  52. where 1=1
  53. <if test="jobUserIDList != '' and jobUserIDList != null">
  54. and jobuser.jobuserID in (${jobUserIDList})
  55. </if>
  56. <if test="name != '' and name != null">
  57. and jobuser.name like Concat('%',#{name},'%')
  58. </if>
  59. <if test="siteId != null and siteId != ''">
  60. and jobuser.siteId = #{siteId}
  61. </if>
  62. <if test="curLoginUserSiteID!='' and curLoginUserSiteID!=null">
  63. and jobuser.siteId = #{curLoginUserSiteID}
  64. </if>
  65. <if test="jobStatus != null and jobStatus != ''">
  66. and jobuser.jobStatusID = #{jobStatus}
  67. </if>
  68. <if test="sexId != null and sexId != ''">
  69. and jobuser.sex = #{sexId}
  70. </if>
  71. <if test="educationTypeId != null and educationTypeId != ''">
  72. and jobuser.CultureRank = #{educationTypeId}
  73. </if>
  74. <if test="emphasisTypeId != null and emphasisTypeId != ''">
  75. and jobuser.KeyPersonTypeID = #{emphasisTypeId}
  76. </if>
  77. <if test="createUserId != null and createUserId != ''">
  78. and jobuser.CreateUserID = #{createUserId}
  79. </if>
  80. <if test="workTime!='' and workTime!=null">
  81. and Date(jobuser.CreateTime) = Date(#{workTime})
  82. </if>
  83. <if test="regionCode != '' and regionCode != null">
  84. and jobuser.RegionCode = #{regionCode}
  85. </if>
  86. <if test="startDate != null and endDate == null">
  87. and jobuser.CreateTime <![CDATA[ >= ]]> #{startDate}
  88. </if>
  89. <if test="endDate != null and startDate == null">
  90. and jobuser.CreateTime <![CDATA[ <= ]]> #{endDate}
  91. </if>
  92. <if test="startDate != null and endDate != null">
  93. and jobuser.CreateTime <![CDATA[ >= ]]> #{startDate}
  94. and jobuser.CreateTime <![CDATA[ <= ]]> #{endDate}
  95. </if>
  96. order by jobuser.CreateTime desc
  97. </select>
  98. </mapper>