PostCQuery.xml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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.PostCQuery">
  4. <select id="selectPostList" resultType="com.hz.employmentsite.vo.companyService.PostVo">
  5. select
  6. post.postID,post.workCode,post.workName,post.recruitCount,post.companyID,post.postName,post.recordStatus,post.workNature,post.validDay,
  7. post.workYear,post.cultureRank,post.postDesc,post.maxSalary,post.minSalary,post.welfare,post.postEmail,post.workTime,post.isTrail,post.trailMonths,
  8. post.TrailMaxSalary,post.trailMinSalary,post.createUserID,post.createTime,post.modifyUserID,post.modifyTime,post.validTime,post.startTime,post.endTime,
  9. post.jobPlace,post.contactName,post.contactMobile,post.contactEmail,post.workNatureID,post.tagID,company.userName,company.userMobile,company.companyEmail,
  10. company.CompanyName,company.insuredCount,item.`Name` as cultureLevelName,work_nature.Name as
  11. workNatureName,item2.`Name` as workYearName
  12. , IFNULL(count(rmgt.RecommendMgtID),0) as recommendNum
  13. , company.SiteID, site.SiteName, inSites.InstitutionID, company.RegionCode
  14. , pro.ProfessionName,category.workCategoryName, pro.ProfessionID, pro.parentProfessionID, modifyUser.Name as modifyUserName
  15. from pc_post post
  16. left join pc_company company on post.CompanyID = company.CompanyID
  17. left join sys_dictionary_item item on item.value=post.CultureRank and item.DictionaryCode='CultureLevel'
  18. left join sys_dictionary_item item2 on item2.value=post.workYear and item2.DictionaryCode='WorkYearType'
  19. left join sys_dictionary_item work_nature on work_nature.value=post.WorkNatureID and
  20. work_nature.DictionaryCode='WorkNature'
  21. left join pc_profession pro on post.ProfessionID = pro.ProfessionID
  22. left join pc_workcategory category on post.WorkCode = category.workCategoryID
  23. left join pc_recommend_mgt rmgt on post.PostID = rmgt.PostID
  24. left join pc_site site on company.SiteID = site.SiteID
  25. left join pc_site_institution inSites on site.SiteID = inSites.SiteID
  26. left join pc_institution institution on inSites.institutionID = institution.InstitutionID
  27. left join sys_user modifyUser on post.ModifyUserID = modifyUser.UserID
  28. <where>
  29. <if test="postIDList != '' and postIDList != null">
  30. and post.postID in (${postIDList})
  31. </if>
  32. <if test="professionName != '' and professionName != null">
  33. and pro.ProfessionName like Concat('%',#{professionName},'%')
  34. </if>
  35. <if test="minCount != null and minCount != ''">
  36. and post.RecruitCount <![CDATA[ >= ]]> #{minCount}
  37. </if>
  38. <if test="maxCount != null and maxCount != ''">
  39. and post.RecruitCount <![CDATA[ <= ]]> #{maxCount}
  40. </if>
  41. <if test="companyName != null and companyName != ''">
  42. and company.CompanyName like Concat('%',#{companyName},'%')
  43. </if>
  44. <if test="RecordStatus != null and RecordStatus != ''">
  45. and post.RecordStatus = #{RecordStatus}
  46. </if>
  47. <if test="companyID != null and companyID != ''">
  48. and post.CompanyID = #{companyID}
  49. </if>
  50. <if test="curLoginUserSiteCompanyIDs != '' and curLoginUserSiteCompanyIDs != null">
  51. and post.companyID in (${curLoginUserSiteCompanyIDs})
  52. </if>
  53. <if test="siteID!='' and siteID!=null">
  54. and company.siteID = #{siteID}
  55. </if>
  56. <if test="startDate != null and endDate == null">
  57. and post.CreateTime <![CDATA[ >= ]]> #{startDate}
  58. </if>
  59. <if test="endDate != null and startDate == null">
  60. and post.CreateTime <![CDATA[ <= ]]> #{endDate}
  61. </if>
  62. <if test="startDate != null and endDate != null">
  63. and post.CreateTime <![CDATA[ >= ]]> #{startDate}
  64. and post.CreateTime <![CDATA[ <= ]]> #{endDate}
  65. </if>
  66. </where>
  67. group by
  68. post.postID,post.workCode,post.workName,post.recruitCount,post.companyID,post.postName,post.recordStatus,post.workNature,post.validDay,
  69. post.workYear,post.cultureRank,post.postDesc,post.maxSalary,post.minSalary,post.welfare,post.postEmail,post.workTime,post.isTrail,post.trailMonths,
  70. post.TrailMaxSalary,post.trailMinSalary,post.createUserID,post.createTime,post.modifyUserID,post.modifyTime,post.validTime,post.startTime,post.endTime,
  71. post.jobPlace,post.contactName,post.contactMobile,post.contactEmail,post.workNatureID,post.tagID,company.userName,company.userMobile,company.companyEmail,
  72. company.CompanyName,company.insuredCount,company.bonus,item.`Name`,work_nature.Name,item2.`Name`
  73. , company.SiteID, site.SiteName, inSites.InstitutionID, company.RegionCode
  74. , pro.ProfessionName, pro.ProfessionID, pro.parentProfessionID
  75. order by post.CreateTime desc
  76. </select>
  77. <select id="selectRecommendPostList" resultType="com.hz.employmentsite.vo.companyService.RecommendPostVo">
  78. select post.*,
  79. recommend.recommendID,
  80. jobhunt.JobUserID,
  81. recommend.isRead,
  82. recommend.isSendNotes,
  83. company.CompanyName,
  84. company.InsuredCount
  85. from (select * from pc_post where PostID in (select PostID from pc_jobhunt where JobUserID = #{jobUserID})) post
  86. left join pc_company company on post.CompanyID = company.CompanyID
  87. left join (select * from pc_recommend where JobUserID = #{jobUserID}) recommend
  88. on post.PostID = recommend.PostID
  89. left join pc_jobhunt jobhunt on post.PostID = jobhunt.PostID
  90. where jobhunt.JobUserID = #{jobUserID}
  91. order by post.CreateTime desc
  92. </select>
  93. <select id="selectCompanyMapPostList" resultType="com.hz.employmentsite.vo.companyService.PostVo">
  94. SELECT post.PostID,
  95. prof.ProfessionName,
  96. post.MinSalary,
  97. post.MaxSalary,
  98. post.RecruitCount,
  99. post.StartTime,
  100. post.EndTime,
  101. post.PostDesc,
  102. (
  103. SELECT JSON_ARRAYAGG(JSON_OBJECT('labelID', labelTemp.LabelID, 'labelName', labelTemp.LabelName))
  104. FROM (
  105. SELECT label.LabelID,
  106. label.LabelName
  107. FROM pc_label label
  108. LEFT JOIN pc_label_post label_post ON label.LabelID = label_post.LabelID
  109. WHERE label_post.PostID = post.PostID
  110. ) AS labelTemp
  111. ) AS labelList
  112. FROM pc_post post
  113. LEFT JOIN pc_profession prof ON post.ProfessionID = prof.ProfessionID
  114. WHERE post.CompanyID = #{companyID}
  115. </select>
  116. <select id="selectPostInCompanyIDs" resultType="com.hz.employmentsite.vo.companyService.PostVo">
  117. SELECT
  118. post.PostID,
  119. post.CompanyID,
  120. profession.ProfessionName
  121. FROM
  122. pc_post post
  123. LEFT JOIN pc_profession profession ON post.ProfessionID = profession.ProfessionID
  124. WHERE
  125. post.CompanyID in (${companyIDList})
  126. </select>
  127. </mapper>