RecommendMgtCQuery.xml 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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.RecommendMgtCQuery">
  4. <select id="getRecommendMgtList" resultType="com.hz.employmentsite.vo.jobUserManager.RecommendMgtVo">
  5. select a.recommendmgtid,a.postid,a.jobhuntid,a.recommendtype,a.entrystate,a.officialaccountsid,
  6. a.postisread,a.jobpeopleisread,a.createuserid,a.createtime,a.modifyuserid,a.modifytime,
  7. c.companyname,c.usermobile as companymobile,e.`name`,e.usermobile,f.professionname,
  8. dic1.`name` as recommendtypename,dic2.`name` as entrystatename,dic3.`name` as postisreadname,
  9. dic4.`name` as jobpeopleisreadname,g.`name` as pushname, dic5.`name` as gendername
  10. from pc_recommend_mgt a
  11. left join pc_post b on a.PostID = b.PostID
  12. left join pc_company c on b.CompanyID = c.CompanyID
  13. left join pc_jobhunt d on a.JobHuntID = d.JobHuntID
  14. left join pc_jobuser e on d.JobUserID = e.JobuserID
  15. left join pc_profession f on b.ProfessionID = f.ProfessionID
  16. left join (select `Value`,`Name` from sys_dictionary_item where DictionaryCode='RecommendType') dic1 on a.RecommendType = dic1.`Value`
  17. left join (select `Value`,`Name` from sys_dictionary_item where DictionaryCode='EntryState') dic2 on a.EntryState = dic2.`Value`
  18. left join (select `Value`,`Name` from sys_dictionary_item where DictionaryCode='IsRead') dic3 on a.PostIsRead = dic3.`Value`
  19. left join (select `Value`,`Name` from sys_dictionary_item where DictionaryCode='IsRead') dic4 on a.JobPeopleIsRead = dic4.`Value`
  20. left join (select `Value`,`Name` from sys_dictionary_item where DictionaryCode='Gender') dic5 on e.Sex = dic5.`Value`
  21. left join sys_user g on a.CreateUserID = g.UserID
  22. <where>
  23. <if test="name != '' and name != null">
  24. and e.name like Concat('%',#{name},'%')
  25. </if>
  26. <if test="companyName != '' and companyName != null">
  27. and c.CompanyName like Concat('%',#{companyName},'%')
  28. </if>
  29. <if test="recommendType != null">
  30. and a.RecommendType = #{recommendType}
  31. </if>
  32. <if test="entryState != null">
  33. and a.EntryState = #{entryState}
  34. </if>
  35. <if test="pushName != '' and pushName != null">
  36. and g.Name like Concat('%',#{pushName},'%')
  37. </if>
  38. <if test="professionID != '' and professionID != null">
  39. and b.ProfessionID = #{professionID}
  40. </if>
  41. </where>
  42. order by a.createtime desc
  43. </select>
  44. <!-- 推荐岗位信息-->
  45. <select id="getRecommendCompanyPostList" resultType="com.hz.employmentsite.vo.jobUserManager.RecommendCompanyPostVo">
  46. select a.postid,b.companyname,c.professionname,a.recruitcount,a.starttime,a.endtime,b.companyAddress,
  47. case when d.recommendmgtid is null then '未推荐' else '已推荐' end as isRecommend,d.recommendMgtID,a.professionid,c.professionname
  48. from pc_post a
  49. left join pc_company b on a.CompanyID = b.CompanyID
  50. left join pc_profession c on a.ProfessionID = c.ProfessionID
  51. left join pc_recommend_mgt d on a.PostID = d.PostID and d.JobHuntID = #{jobHuntID}
  52. <where>
  53. <if test="professionID!=null and professionID!=''">
  54. and a.ProfessionID = #{professionID}
  55. </if>
  56. <if test="companyName!=null and companyName!=''">
  57. and b.CompanyName like Concat('%',#{companyName},'%')
  58. </if>
  59. <if test="type!=null and type==0">
  60. and d.RecommendMgtID is null
  61. </if>
  62. <if test="type!=null and type==1">
  63. and d.RecommendMgtID is not null
  64. </if>
  65. </where>
  66. order by a.CreateTime desc
  67. </select>
  68. <!-- 推荐求职人员信息-->
  69. <select id="getRecommendJobList" resultType="com.hz.employmentsite.vo.jobUserManager.RecommendJobVo">
  70. select a.jobhuntid,b.username,b.usermobile,e.sitename,dic1.`name` as culturerankname,dic2.`name` as keypersontypename,
  71. case when d.recommendmgtid is null then '未推荐' else '已推荐' end as isrecommend,d.recommendMgtID,a.professionid,c.professionname
  72. from pc_jobhunt a
  73. left join pc_jobuser b on a.JobUserID = b.JobUserID
  74. left join pc_profession c on a.ProfessionID = c.ProfessionID
  75. left join pc_site e on b.SiteID = e.SiteID
  76. left join (select `Value`,`Name` from sys_dictionary_item where DictionaryCode='CultureLevel') dic1 on b.CultureRank = dic1.`Value`
  77. left join (select `Value`,`Name` from sys_dictionary_item where DictionaryCode='KeyPersonType') dic2 on b.KeyPersonTypeID = dic2.`Value`
  78. left join pc_recommend_mgt d on a.JobHuntID = d.JobHuntID and d.PostID = #{postID}
  79. <where>
  80. <if test="professionID!=null and professionID!=''">
  81. and a.ProfessionID = #{professionID}
  82. </if>
  83. <if test="userName!=null and userName!=''">
  84. and b.UserName like Concat('%',#{userName},'%')
  85. </if>
  86. <if test="type!=null and type==0">
  87. and d.RecommendMgtID is null
  88. </if>
  89. <if test="type!=null and type==1">
  90. and d.RecommendMgtID is not null
  91. </if>
  92. <if test="keyPersonType!=null and keyPersonType!=''">
  93. and b.KeyPersonTypeID = #{keyPersonType}
  94. </if>
  95. <if test="cultureLeve!=null and cultureLeve!=''">
  96. and b.CultureRank = #{cultureLeve}
  97. </if>
  98. </where>
  99. order by a.CreateTime desc
  100. </select>
  101. <select id="getProfessionLevelList" resultType="com.hz.employmentsite.vo.jobUserManager.ProfessionLevel">
  102. select ProfessionID,ParentProfessionID,ProfessionName,'1' as ProfessionLevel from pc_profession where ParentProfessionID = ''
  103. union all
  104. select a.ProfessionID,a.ParentProfessionID,a.ProfessionName,'2' as ProfessionLevel
  105. from pc_profession a
  106. inner join (select ProfessionID from pc_profession where ParentProfessionID = '' ) b on a.ParentProfessionID=b.ProfessionID
  107. union all
  108. select c.ProfessionID,c.ParentProfessionID,c.ProfessionName,'3' as ProfessionLevel
  109. from pc_profession c
  110. inner join (select a.ProfessionID
  111. from pc_profession a
  112. inner join (select ProfessionID from pc_profession where ParentProfessionID = '' ) b on a.ParentProfessionID=b.ProfessionID) bb
  113. on c.ParentProfessionID=bb.ProfessionID
  114. </select>
  115. </mapper>