JobUserCQuery.xml 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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,
  8. (select count(*) from pc_recommend recommend where jobuser.JobUserID = recommend.JobuserID and isRead = 1)as
  9. RecommendedCount
  10. ,case when jobuser.IdentityNumber is not null and jobuser.IdentityNumber <![CDATA[ <> ]]>'' then
  11. TIMESTAMPDIFF(YEAR,STR_TO_DATE(SUBSTRING(jobuser.IdentityNumber, 7, 8),'%Y%m%d'),CURRENT_DATE())
  12. else null end as age
  13. from pc_jobuser jobuser
  14. left join pc_site site on site.SiteID = jobuser.SiteID
  15. left join sys_dictionary_item culture on jobuser.CultureRank = culture.value and
  16. culture.DictionaryCode='CultureLevel'
  17. left join sys_dictionary_item gender on jobuser.Sex = gender.value and gender.DictionaryCode='Gender'
  18. left join sys_dictionary_item jobstatus on jobuser.JobStatusID = jobstatus.value and
  19. jobstatus.DictionaryCode='JobStatus'
  20. left join sys_dictionary_item keytype on jobuser.KeyPersonTypeID = keytype.value and
  21. keytype.DictionaryCode='KeyPersonType'
  22. left join (select * from sys_dictionary_item where DictionaryCode ='PoliticsStatus') sys_politics on
  23. jobuser.PoliticsStatusID = sys_politics.Value
  24. left join (select * from sys_dictionary_item where DictionaryCode ='Health') sys_health on
  25. jobuser.healthID = sys_health.Value
  26. left join (select * from sys_dictionary_item where DictionaryCode ='FamilyNature') sys_family on
  27. jobuser.familyNatureID = sys_family.Value
  28. where 1=1
  29. <if test="jobUserIDList != '' and jobUserIDList != null">
  30. and jobuser.jobuserID in (${jobUserIDList})
  31. </if>
  32. <if test="name != '' and name != null">
  33. and jobuser.name like Concat('%',#{name},'%')
  34. </if>
  35. <if test="siteId != null and siteId != ''">
  36. and jobuser.siteId = #{siteId}
  37. </if>
  38. <if test="jobStatus != null and jobStatus != ''">
  39. and jobuser.jobStatusID = #{jobStatus}
  40. </if>
  41. <if test="sexId != null and sexId != ''">
  42. and jobuser.sex = #{sexId}
  43. </if>
  44. <if test="educationTypeId != null and educationTypeId != ''">
  45. and jobuser.CultureRank = #{educationTypeId}
  46. </if>
  47. <if test="emphasisTypeId != null and emphasisTypeId != ''">
  48. and jobuser.KeyPersonTypeID = #{emphasisTypeId}
  49. </if>
  50. <if test="createUserId != null and createUserId != ''">
  51. and jobuser.CreateUserID = #{createUserId}
  52. </if>
  53. <if test="workTime!='' and workTime!=null">
  54. and Date(jobuser.CreateTime) = Date(#{workTime})
  55. </if>
  56. order by jobuser.CreateTime desc
  57. </select>
  58. </mapper>