JobUserCQuery.xml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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 CultureName,site.SiteName,jobstatus.name as
  6. JobStatusName,keytype.name as KeyTypeName,sys_politics.name as politicsStatusName,sys_health.name as healthName,
  7. sys_family.name as familyNatureName,sys_full_time.Name as isFullTimeName,sys_occ_category.Name as occupationalCategoryName,
  8. sys_occ_level.Name as occupationalLevelName,sys_blood_type.Name as bloodTypeName,sys_marital_status.Name as MaritalStatusName,
  9. area_region.name as RegionName,area_street.name as StreetName,
  10. (select count(*) from pc_recommend recommend where jobuser.JobUserID = recommend.JobuserID and isRead = 1)as
  11. RecommendedCount
  12. ,case when jobuser.IdentityNumber is not null and jobuser.IdentityNumber <![CDATA[ <> ]]>'' then
  13. TIMESTAMPDIFF(YEAR,STR_TO_DATE(SUBSTRING(jobuser.IdentityNumber, 7, 8),'%Y%m%d'),CURRENT_DATE())
  14. else null end as age
  15. from pc_jobuser jobuser
  16. left join pc_site site on site.SiteID = jobuser.SiteID
  17. left join sys_dictionary_item culture on jobuser.CultureRank = culture.value and
  18. culture.DictionaryCode='HighestDegree'
  19. left join sys_dictionary_item gender on jobuser.Sex = gender.value and gender.DictionaryCode='Gender'
  20. left join sys_dictionary_item jobstatus on jobuser.JobStatusID = jobstatus.value and
  21. jobstatus.DictionaryCode='JobStatus'
  22. left join sys_dictionary_item keytype on jobuser.KeyPersonTypeID = keytype.value and
  23. keytype.DictionaryCode='KeyPersonType'
  24. left join (select * from sys_dictionary_item where DictionaryCode ='PoliticsStatus') sys_politics on
  25. jobuser.PoliticsStatusID = sys_politics.Value
  26. left join (select * from sys_dictionary_item where DictionaryCode ='Health') sys_health on
  27. jobuser.healthID = sys_health.Value
  28. left join (select * from sys_dictionary_item where DictionaryCode ='FamilyNature') sys_family on
  29. jobuser.familyNatureID = sys_family.Value
  30. left join (select * from sys_dictionary_item where DictionaryCode ='IsFullTime') sys_full_time on
  31. jobuser.IsFullTime = sys_full_time.Value
  32. left join (select * from sys_dictionary_item where DictionaryCode ='OccupationalCategory') sys_occ_category on
  33. jobuser.OccupationalCategory = sys_occ_category.Value
  34. left join (select * from sys_dictionary_item where DictionaryCode ='OccupationalLevel') sys_occ_level on
  35. jobuser.OccupationalLevel = sys_occ_level.Value
  36. left join (select * from sys_dictionary_item where DictionaryCode ='BloodType') sys_blood_type on
  37. jobuser.BloodTypeID = sys_blood_type.Value
  38. left join (select * from sys_dictionary_item where DictionaryCode ='MaritalStatus') sys_marital_status on
  39. jobuser.MaritalStatusID = sys_marital_status.Value
  40. left join area_code area_region on jobuser.RegionCode = area_region.code
  41. left join area_code area_street on jobuser.StreetCode = area_street.code
  42. where 1=1
  43. <if test="jobUserIDList != '' and jobUserIDList != null">
  44. and jobuser.jobuserID in (${jobUserIDList})
  45. </if>
  46. <if test="name != '' and name != null">
  47. and jobuser.name like Concat('%',#{name},'%')
  48. </if>
  49. <if test="siteId != null and siteId != ''">
  50. and jobuser.siteId = #{siteId}
  51. </if>
  52. <if test="jobStatus != null and jobStatus != ''">
  53. and jobuser.jobStatusID = #{jobStatus}
  54. </if>
  55. <if test="sexId != null and sexId != ''">
  56. and jobuser.sex = #{sexId}
  57. </if>
  58. <if test="educationTypeId != null and educationTypeId != ''">
  59. and jobuser.CultureRank = #{educationTypeId}
  60. </if>
  61. <if test="emphasisTypeId != null and emphasisTypeId != ''">
  62. and jobuser.KeyPersonTypeID = #{emphasisTypeId}
  63. </if>
  64. <if test="createUserId != null and createUserId != ''">
  65. and jobuser.CreateUserID = #{createUserId}
  66. </if>
  67. <if test="workTime!='' and workTime!=null">
  68. and Date(jobuser.CreateTime) = Date(#{workTime})
  69. </if>
  70. order by jobuser.CreateTime desc
  71. </select>
  72. </mapper>