RecommendMgtCQuery.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  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,c.username as companyusername,e.`name`,e.usermobile,
  8. f.professionname as zpprofessionname,f2.professionname as qzprofessionname,
  9. dic1.`name` as recommendtypename,dic2.`name` as entrystatename,dic3.`name` as postisreadname,
  10. dic4.`name` as jobpeopleisreadname,g.`name` as pushname, dic5.`name` as gendername
  11. ,e.jobuserId,c.companyId
  12. ,d.workYear
  13. ,site.SiteID, site.SiteName,inSites.InstitutionID as institutionID,site.RegionCode
  14. from pc_recommend_mgt a
  15. inner join pc_post b on a.PostID = b.PostID
  16. left join pc_company c on b.CompanyID = c.CompanyID
  17. inner join pc_jobhunt d on a.JobHuntID = d.JobHuntID
  18. left join pc_jobuser e on d.JobUserID = e.JobuserID
  19. left join pc_profession f on b.ProfessionID = f.ProfessionID
  20. left join pc_profession f2 on d.ProfessionID = f2.ProfessionID
  21. left join (select `Value`,`Name` from sys_dictionary_item where DictionaryCode='RecommendType') dic1 on
  22. a.RecommendType = dic1.`Value`
  23. left join (select `Value`,`Name` from sys_dictionary_item where DictionaryCode='EntryState') dic2 on
  24. a.EntryState = dic2.`Value`
  25. left join (select `Value`,`Name` from sys_dictionary_item where DictionaryCode='IsRead') dic3 on a.PostIsRead =
  26. dic3.`Value`
  27. left join (select `Value`,`Name` from sys_dictionary_item where DictionaryCode='IsRead') dic4 on
  28. a.JobPeopleIsRead = dic4.`Value`
  29. left join (select `Value`,`Name` from sys_dictionary_item where DictionaryCode='Gender') dic5 on e.Sex =
  30. dic5.`Value`
  31. left join sys_user g on a.CreateUserID = g.UserID
  32. left join pc_site site on e.SiteID = site.SiteID
  33. left join pc_site_institution inSites on site.SiteID = inSites.SiteID
  34. left join pc_institution institution on inSites.institutionID = institution.InstitutionID
  35. <where>
  36. <if test="recommendMgtID != '' and recommendMgtID != null">
  37. and a.RecommendMgtID = #{recommendMgtID}
  38. </if>
  39. <if test="name != '' and name != null">
  40. and e.name like Concat('%',#{name},'%')
  41. </if>
  42. <if test="companyName != '' and companyName != null">
  43. and c.CompanyName like Concat('%',#{companyName},'%')
  44. </if>
  45. <if test="recommendType != null">
  46. and a.RecommendType = #{recommendType}
  47. </if>
  48. <if test="entryState != null">
  49. and a.EntryState = #{entryState}
  50. </if>
  51. <if test="pushName != '' and pushName != null">
  52. and g.Name like Concat('%',#{pushName},'%')
  53. </if>
  54. <if test="qzProfessionName != '' and qzProfessionName != null">
  55. and f.ProfessionName like Concat('%',#{qzProfessionName},'%')
  56. </if>
  57. <if test="zpProfessionName != '' and zpProfessionName != null">
  58. and f2.ProfessionName like Concat('%',#{zpProfessionName},'%')
  59. </if>
  60. </where>
  61. order by a.createtime desc
  62. </select>
  63. <!-- 推荐岗位信息-->
  64. <select id="getRecommendCompanyPostList"
  65. resultType="com.hz.employmentsite.vo.jobUserManager.RecommendCompanyPostVo">
  66. select a.postid,b.companyname,c.professionname,a.recruitcount,a.starttime,a.endtime,b.companyAddress,
  67. case when d.recommendmgtid is null then '未推荐' else '已推荐' end as isRecommend,
  68. d.recommendMgtID,a.professionid,a.maxsalary,a.minsalary,
  69. dic1.`name` as culturerankname, dic2.`name` as workyearname
  70. from pc_post a
  71. left join pc_company b on a.CompanyID = b.CompanyID
  72. left join pc_profession c on a.ProfessionID = c.ProfessionID
  73. left join pc_recommend_mgt d on a.PostID = d.PostID and d.JobHuntID = #{jobHuntID}
  74. left join (select `Value`,`Name` from sys_dictionary_item where DictionaryCode='CultureLevel') dic1 on a.CultureRank = dic1.`Value`
  75. left join (select `Value`,`Name` from sys_dictionary_item where DictionaryCode='WorkYearType') dic2 on a.WorkYear = dic2.`Value`
  76. <where>
  77. <if test="type!=null and type==0">
  78. and d.RecommendMgtID is null
  79. </if>
  80. <if test="type!=null and type==1">
  81. and d.RecommendMgtID is not null
  82. </if>
  83. <choose>
  84. <when test="parentProfessionID!=null and parentProfessionID!=''">
  85. and c.ParentProfessionID = #{parentProfessionID}
  86. </when>
  87. <when test="professionID!=null and professionID!=''">
  88. and a.ProfessionID = #{professionID}
  89. </when>
  90. <otherwise>and 1=1</otherwise>
  91. </choose>
  92. <if test="companyName!=null and companyName!=''">
  93. and b.CompanyName like Concat('%',#{companyName},'%')
  94. </if>
  95. <if test="cultureRank!=null and cultureRank!=''">
  96. and a.CultureRank <![CDATA[>=]]> #{cultureRank}
  97. </if>
  98. <if test="workYear!=null">
  99. <choose>
  100. <when test="workYear==1 or workYear==2">
  101. and a.WorkYear = 2
  102. </when>
  103. <when test="workYear==3 or workYear==4 or workYear==5">
  104. and a.WorkYear = 3
  105. </when>
  106. <when test="workYear>5">
  107. and a.WorkYear = 4
  108. </when>
  109. <otherwise>and 1=1</otherwise>
  110. </choose>
  111. </if>
  112. <choose>
  113. <when test="minSalary!=null and maxSalary!=null">
  114. and a.MinSalary <![CDATA[<=]]> #{maxSalary} and a.MaxSalary <![CDATA[>=]]> #{minSalary}
  115. </when>
  116. <when test="minSalary!=null and minSalary!=''">
  117. and a.MinSalary <![CDATA[>=]]> #{minSalary}
  118. </when>
  119. <when test="maxSalary!=null and maxSalary!=''">
  120. and a.MaxSalary <![CDATA[<=]]> #{maxSalary}
  121. </when>
  122. <otherwise>and 1=1</otherwise>
  123. </choose>
  124. </where>
  125. order by a.CreateTime desc
  126. </select>
  127. <!-- 推荐求职人员信息-->
  128. <select id="getRecommendJobList" resultType="com.hz.employmentsite.vo.jobUserManager.RecommendJobVo">
  129. select a.jobhuntid,b.username,b.usermobile,e.sitename,dic1.`name` as culturerankname,dic2.`name` as
  130. keypersontypename,a.workyear,a.minsalary,a.maxsalary,
  131. case when d.recommendmgtid is null then '未推荐' else '已推荐' end as
  132. isrecommend,d.recommendMgtID,a.professionid,c.professionname
  133. from pc_jobhunt a
  134. left join pc_jobuser b on a.JobUserID = b.JobUserID
  135. left join pc_profession c on a.ProfessionID = c.ProfessionID
  136. left join pc_site e on b.SiteID = e.SiteID
  137. left join (select `Value`,`Name` from sys_dictionary_item where DictionaryCode='HighestDegree') dic1 on
  138. b.CultureRank = dic1.`Value`
  139. left join (select `Value`,`Name` from sys_dictionary_item where DictionaryCode='KeyPersonType') dic2 on
  140. b.KeyPersonTypeID = dic2.`Value`
  141. left join pc_recommend_mgt d on a.JobHuntID = d.JobHuntID and d.PostID = #{postID}
  142. <where>
  143. <if test="type!=null and type==0">
  144. and d.RecommendMgtID is null
  145. </if>
  146. <if test="type!=null and type==1">
  147. and d.RecommendMgtID is not null
  148. </if>
  149. <if test="userName!=null and userName!=''">
  150. and b.UserName like Concat('%',#{userName},'%')
  151. </if>
  152. <if test="keyPersonType!=null and keyPersonType!=''">
  153. and b.KeyPersonTypeID = #{keyPersonType}
  154. </if>
  155. <if test="cultureRank!=null and cultureRank!=''">
  156. and b.CultureRank <![CDATA[<=]]> #{cultureRank}
  157. </if>
  158. <choose>
  159. <when test="parentProfessionID!=null and parentProfessionID!=''">
  160. and c.ParentProfessionID = #{parentProfessionID}
  161. </when>
  162. <when test="professionID!=null and professionID!=''">
  163. and a.ProfessionID = #{professionID}
  164. </when>
  165. <otherwise>and 1=1</otherwise>
  166. </choose>
  167. <if test="workYear!=null and workYear!=''">
  168. and a.WorkYear <![CDATA[<=]]> #{workYear}
  169. </if>
  170. <choose>
  171. <when test="minSalary!=null and maxSalary!=null">
  172. and a.MinSalary <![CDATA[<=]]> #{maxSalary} and a.MaxSalary <![CDATA[>=]]> #{minSalary}
  173. </when>
  174. <when test="minSalary!=null and minSalary!=''">
  175. and a.MinSalary <![CDATA[>=]]> #{minSalary}
  176. </when>
  177. <when test="maxSalary!=null and maxSalary!=''">
  178. and a.MaxSalary <![CDATA[<=]]> #{maxSalary}
  179. </when>
  180. <otherwise>and 1=1</otherwise>
  181. </choose>
  182. </where>
  183. order by a.CreateTime desc
  184. </select>
  185. <select id="getProfessionLevelList" resultType="com.hz.employmentsite.vo.jobUserManager.ProfessionLevel">
  186. select ProfessionID, ParentProfessionID, ProfessionName, '1' as ProfessionLevel
  187. from pc_profession
  188. where ParentProfessionID = ''
  189. union all
  190. select a.ProfessionID, a.ParentProfessionID, a.ProfessionName, '2' as ProfessionLevel
  191. from pc_profession a
  192. inner join (select ProfessionID from pc_profession where ParentProfessionID = '') b
  193. on a.ParentProfessionID = b.ProfessionID
  194. union all
  195. select c.ProfessionID, c.ParentProfessionID, c.ProfessionName, '3' as ProfessionLevel
  196. from pc_profession c
  197. inner join (select a.ProfessionID
  198. from pc_profession a
  199. inner join (select ProfessionID from pc_profession where ParentProfessionID = '') b
  200. on a.ParentProfessionID = b.ProfessionID) bb
  201. on c.ParentProfessionID = bb.ProfessionID
  202. </select>
  203. <select id="getOccupationCategoryList" resultType="com.hz.employmentsite.vo.jobUserManager.OccupationCategory">
  204. select OccupationalID, ParentOccupationalID, OccupationalName, '1' as OccupationalLevel
  205. from pc_occupational
  206. where ParentOccupationalID = '0'
  207. union all
  208. select a.OccupationalID, a.ParentOccupationalID, a.OccupationalName, '2' as OccupationalLevel
  209. from pc_occupational a
  210. inner join (select OccupationalID from pc_occupational where ParentOccupationalID = '0') b
  211. on a.ParentOccupationalID = b.OccupationalID
  212. </select>
  213. <select id="getCompanypostToUsermessageList" resultType="java.util.HashMap">
  214. select a.recommendmgtid,
  215. e.openId as userOpenId,
  216. c.companyname,
  217. c.usermobile as companymobile,
  218. b.postName
  219. from pc_recommend_mgt a
  220. inner join pc_post b on a.PostID = b.PostID
  221. inner join pc_company c on b.CompanyID = c.CompanyID
  222. inner join pc_jobhunt d on a.JobHuntID = d.JobHuntID
  223. inner join pc_jobuser e on d.JobUserID = e.JobuserID
  224. where (a.isSendUser = 0 || a.isSendUser is null)
  225. and e.openId is not null
  226. </select>
  227. <select id="getUserhuntpostToCompanymessageList" resultType="java.util.HashMap">
  228. select a.recommendmgtid,
  229. c.openId as companyOpenId,
  230. e.`name` as userName,
  231. e.usermobile,
  232. d.workName as userHuntPostName
  233. from pc_recommend_mgt a
  234. inner join pc_post b on a.PostID = b.PostID
  235. inner join pc_company c on b.CompanyID = c.CompanyID
  236. inner join pc_jobhunt d on a.JobHuntID = d.JobHuntID
  237. inner join pc_jobuser e on d.JobUserID = e.JobuserID
  238. where (a.isSendCompany = 0 || a.isSendCompany is null)
  239. and c.openId is not null
  240. </select>
  241. </mapper>