PostCQuery.xml 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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, createUser.`Name` as createUserName
  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. left join sys_user createUser on post.CreateUserID = createUser.UserID
  29. <where>
  30. <if test="postIDList != '' and postIDList != null">
  31. and post.postID in (${postIDList})
  32. </if>
  33. <if test="professionName != '' and professionName != null">
  34. and pro.ProfessionName like Concat('%',#{professionName},'%')
  35. </if>
  36. <if test="minCount != null and minCount != ''">
  37. and post.RecruitCount <![CDATA[ >= ]]> #{minCount}
  38. </if>
  39. <if test="maxCount != null and maxCount != ''">
  40. and post.RecruitCount <![CDATA[ <= ]]> #{maxCount}
  41. </if>
  42. <if test="companyName != null and companyName != ''">
  43. and company.CompanyName like Concat('%',#{companyName},'%')
  44. </if>
  45. <if test="RecordStatus != null and RecordStatus != ''">
  46. and post.RecordStatus = #{RecordStatus}
  47. </if>
  48. <if test="companyID != null and companyID != ''">
  49. and post.CompanyID = #{companyID}
  50. </if>
  51. <if test="curLoginUserSiteCompanyIDs != '' and curLoginUserSiteCompanyIDs != null">
  52. and post.companyID in (${curLoginUserSiteCompanyIDs})
  53. </if>
  54. <if test="siteID!='' and siteID!=null">
  55. and company.siteID = #{siteID}
  56. </if>
  57. <if test="startDate != null and endDate == null">
  58. and post.CreateTime <![CDATA[ >= ]]> #{startDate}
  59. </if>
  60. <if test="endDate != null and startDate == null">
  61. and post.CreateTime <![CDATA[ <= ]]> #{endDate}
  62. </if>
  63. <if test="startDate != null and endDate != null">
  64. and post.CreateTime <![CDATA[ >= ]]> #{startDate}
  65. and post.CreateTime <![CDATA[ <= ]]> #{endDate}
  66. </if>
  67. <if test="createUserName!='' and createUserName!=null">
  68. and createUser.`Name` like Concat('%',#{createUserName},'%')
  69. </if>
  70. <if test="isAllPost != null and isAllPost == true ">
  71. or post.postID = 'AllPost'
  72. </if>
  73. </where>
  74. group by
  75. post.postID,post.workCode,post.workName,post.recruitCount,post.companyID,post.postName,post.recordStatus,post.workNature,post.validDay,
  76. post.workYear,post.cultureRank,post.postDesc,post.maxSalary,post.minSalary,post.welfare,post.postEmail,post.workTime,post.isTrail,post.trailMonths,
  77. post.TrailMaxSalary,post.trailMinSalary,post.createUserID,post.createTime,post.modifyUserID,post.modifyTime,post.validTime,post.startTime,post.endTime,
  78. post.jobPlace,post.contactName,post.contactMobile,post.contactEmail,post.workNatureID,post.tagID,company.userName,company.userMobile,company.companyEmail,
  79. company.CompanyName,company.insuredCount,company.bonus,item.`Name`,work_nature.Name,item2.`Name`
  80. , company.SiteID, site.SiteName, inSites.InstitutionID, company.RegionCode
  81. , pro.ProfessionName, pro.ProfessionID, pro.parentProfessionID
  82. order by post.CreateTime desc
  83. </select>
  84. <select id="selectRecommendPostList" resultType="com.hz.employmentsite.vo.companyService.RecommendPostVo">
  85. select post.*,
  86. recommend.recommendID,
  87. jobhunt.JobUserID,
  88. recommend.isRead,
  89. recommend.isSendNotes,
  90. company.CompanyName,
  91. company.InsuredCount
  92. from (select * from pc_post where PostID in (select PostID from pc_jobhunt where JobUserID = #{jobUserID})) post
  93. left join pc_company company on post.CompanyID = company.CompanyID
  94. left join (select * from pc_recommend where JobUserID = #{jobUserID}) recommend
  95. on post.PostID = recommend.PostID
  96. left join pc_jobhunt jobhunt on post.PostID = jobhunt.PostID
  97. where jobhunt.JobUserID = #{jobUserID}
  98. order by post.CreateTime desc
  99. </select>
  100. <select id="selectCompanyMapPostList" resultType="com.hz.employmentsite.vo.companyService.PostVo">
  101. SELECT post.PostID,
  102. prof.ProfessionName,
  103. post.MinSalary,
  104. post.MaxSalary,
  105. post.RecruitCount,
  106. post.StartTime,
  107. post.EndTime,
  108. post.PostDesc,
  109. (
  110. SELECT JSON_ARRAYAGG(JSON_OBJECT('labelID', labelTemp.LabelID, 'labelName', labelTemp.LabelName))
  111. FROM (
  112. SELECT label.LabelID,
  113. label.LabelName
  114. FROM pc_label label
  115. LEFT JOIN pc_label_post label_post ON label.LabelID = label_post.LabelID
  116. WHERE label_post.PostID = post.PostID
  117. ) AS labelTemp
  118. ) AS labelList
  119. FROM pc_post post
  120. LEFT JOIN pc_profession prof ON post.ProfessionID = prof.ProfessionID
  121. WHERE post.CompanyID = #{companyID}
  122. </select>
  123. <select id="selectPostInCompanyIDs" resultType="com.hz.employmentsite.vo.companyService.PostVo">
  124. SELECT
  125. post.PostID,
  126. post.CompanyID,
  127. profession.ProfessionName
  128. FROM
  129. pc_post post
  130. LEFT JOIN pc_profession profession ON post.ProfessionID = profession.ProfessionID
  131. WHERE
  132. post.CompanyID in (${companyIDList})
  133. </select>
  134. </mapper>