RecommendMgtCQuery.xml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. <select id="getRecommendCompanyPostList" resultType="com.hz.employmentsite.vo.jobUserManager.RecommendCompanyPostVo">
  45. select a.postid,b.companyname,c.professionname,a.recruitcount,a.starttime,a.endtime,
  46. case when d.recommendmgtid is null then '未推荐' else '已推荐' end as isRecommend,d.recommendMgtID
  47. from pc_post a
  48. left join pc_company b on a.CompanyID = b.CompanyID
  49. left join pc_profession c on a.ProfessionID = c.ProfessionID
  50. left join pc_recommend_mgt d on a.PostID = d.PostID and d.JobHuntID = #{jobHuntID}
  51. <where>
  52. <if test="professionID!=null and professionID!=''">
  53. and a.ProfessionID = #{professionID}
  54. </if>
  55. <if test="companyName!=null and companyName!=''">
  56. and b.CompanyName like Concat('%',#{companyName},'%')
  57. </if>
  58. <if test="type!=null and type==0">
  59. and d.RecommendMgtID is null
  60. </if>
  61. <if test="type!=null and type==1">
  62. and d.RecommendMgtID is not null
  63. </if>
  64. </where>
  65. order by a.CreateTime desc
  66. </select>
  67. <select id="getRecommendJobList" resultType="com.hz.employmentsite.vo.jobUserManager.RecommendJobVo">
  68. select a.jobhuntid,b.username,b.usermobile,e.sitename,dic1.`name` as culturerankname,dic2.`name` as keypersontypename,
  69. case when d.recommendmgtid is null then '未推荐' else '已推荐' end as isrecommend,d.recommendMgtID
  70. from pc_jobhunt a
  71. left join pc_jobuser b on a.JobUserID = b.JobUserID
  72. left join pc_profession c on a.ProfessionID = c.ProfessionID
  73. left join pc_site e on b.SiteID = e.SiteID
  74. left join (select `Value`,`Name` from sys_dictionary_item where DictionaryCode='CultureLevel') dic1 on b.CultureRank = dic1.`Value`
  75. left join (select `Value`,`Name` from sys_dictionary_item where DictionaryCode='KeyPersonType') dic2 on b.KeyPersonTypeID = dic2.`Value`
  76. left join pc_recommend_mgt d on a.JobHuntID = d.JobHuntID and d.PostID = #{postID}
  77. <where>
  78. <if test="professionID!=null and professionID!=''">
  79. and a.ProfessionID = #{professionID}
  80. </if>
  81. <if test="userName!=null and userName!=''">
  82. and b.UserName like Concat('%',#{userName},'%')
  83. </if>
  84. <if test="type!=null and type==0">
  85. and d.RecommendMgtID is null
  86. </if>
  87. <if test="type!=null and type==1">
  88. and d.RecommendMgtID is not null
  89. </if>
  90. <if test="keyPersonType!=null and keyPersonType!=''">
  91. and b.KeyPersonTypeID = #{keyPersonType}
  92. </if>
  93. <if test="cultureLeve!=null and cultureLeve!=''">
  94. and b.CultureRank = #{cultureLeve}
  95. </if>
  96. </where>
  97. order by a.CreateTime desc
  98. </select>
  99. </mapper>