PostCQuery.xml 5.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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.contactName,post.contactMobile,post.contactEmail,
  10. post.jobPlace,post.contactName,post.contactMobile,post.contactEmail,post.workNatureID,post.tagID,company.userName,company.userMobile,company.companyEmail,
  11. company.CompanyName,company.insuredCount,company.bonus,item.`Name` as cultureLevelName,work_nature.Name as
  12. workNatureName,
  13. post.ProfessionID,pro.ProfessionName,pro.parentProfessionID,
  14. company.CompanyName,company.insuredCount,company.bonus,item.`Name` as cultureLevelName,work_nature.Name as
  15. workNatureName,
  16. post.ProfessionID,pro.ProfessionName,pro.parentProfessionID,item2.`Name` as workYearStr
  17. , IFNULL(count(rmgt.RecommendMgtID),0) as recommendNum
  18. , site.SiteID, site.SiteName, inSites.InstitutionID as institutionID, company.RegionCode
  19. from pc_post post
  20. left join pc_company company on post.CompanyID = company.CompanyID
  21. left join sys_dictionary_item item on item.value=post.CultureRank and item.DictionaryCode='CultureLevel'
  22. left join sys_dictionary_item item2 on item2.value=post.workYear and item2.DictionaryCode='WorkYearType'
  23. left join sys_dictionary_item work_nature on work_nature.value=post.WorkNatureID and
  24. work_nature.DictionaryCode='WorkNature'
  25. left join pc_profession pro on post.ProfessionID = pro.ProfessionID
  26. left join pc_recommend_mgt rmgt on post.PostID = rmgt.PostID
  27. left join pc_site site on company.siteID = site.siteID
  28. left join pc_site_institution inSites on site.SiteID = inSites.SiteID
  29. left join pc_institution institution on inSites.institutionID = institution.InstitutionID
  30. <where>
  31. <if test="postIDList != '' and postIDList != null">
  32. and post.postID in (${postIDList})
  33. </if>
  34. <if test="professionName != '' and professionName != null">
  35. and pro.ProfessionName like Concat('%',#{professionName},'%')
  36. </if>
  37. <if test="minCount != null and minCount != ''">
  38. and post.RecruitCount <![CDATA[ >= ]]> #{minCount}
  39. </if>
  40. <if test="maxCount != null and maxCount != ''">
  41. and post.RecruitCount <![CDATA[ <= ]]> #{maxCount}
  42. </if>
  43. <if test="companyName != null and companyName != ''">
  44. and company.CompanyName like Concat('%',#{companyName},'%')
  45. </if>
  46. <if test="RecordStatus != null and RecordStatus != ''">
  47. and post.RecordStatus = #{RecordStatus}
  48. </if>
  49. <if test="companyID != null and companyID != ''">
  50. and post.CompanyID = #{companyID}
  51. </if>
  52. </where>
  53. group by
  54. post.postID,post.workCode,post.workName,post.recruitCount,post.companyID,post.postName,post.recordStatus,post.workNature,post.validDay,
  55. post.workYear,post.cultureRank,post.postDesc,post.maxSalary,post.minSalary,post.welfare,post.postEmail,post.workTime,post.isTrail,post.trailMonths,
  56. post.TrailMaxSalary,post.trailMinSalary,post.createUserID,post.createTime,post.modifyUserID,post.modifyTime,post.validTime,post.startTime,post.endTime,
  57. post.jobPlace,company.userName,company.userMobile,company.companyEmail,company.CompanyName,company.insuredCount,item.`Name`,
  58. post.ProfessionID,pro.ProfessionName,pro.parentProfessionID,site.SiteID,site.SiteName,inSites.InstitutionID,company.RegionCode
  59. order by post.CreateTime desc
  60. </select>
  61. <select id="selectRecommendPostList" resultType="com.hz.employmentsite.vo.companyService.RecommendPostVo">
  62. select post.*,
  63. recommend.recommendID,
  64. jobhunt.JobUserID,
  65. recommend.isRead,
  66. recommend.isSendNotes,
  67. company.CompanyName,
  68. company.InsuredCount
  69. from (select * from pc_post where PostID in (select PostID from pc_jobhunt where JobUserID = #{jobUserID})) post
  70. left join pc_company company on post.CompanyID = company.CompanyID
  71. left join (select * from pc_recommend where JobUserID = #{jobUserID}) recommend
  72. on post.PostID = recommend.PostID
  73. left join pc_jobhunt jobhunt on post.PostID = jobhunt.PostID
  74. where jobhunt.JobUserID = #{jobUserID}
  75. order by post.CreateTime desc
  76. </select>
  77. </mapper>