123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
- <mapper namespace="com.hz.employmentsite.mapper.cquery.PostCQuery">
- <select id="selectPostList" resultType="com.hz.employmentsite.vo.companyService.PostVo">
- select
- post.postID,post.workCode,post.workName,post.recruitCount,post.companyID,post.postName,post.recordStatus,post.workNature,post.validDay,
- post.workYear,post.cultureRank,post.postDesc,post.maxSalary,post.minSalary,post.welfare,post.postEmail,post.workTime,post.isTrail,post.trailMonths,
- post.TrailMaxSalary,post.trailMinSalary,post.createUserID,post.createTime,post.modifyUserID,post.modifyTime,post.validTime,post.startTime,post.endTime,
- post.jobPlace,post.contactName,post.contactMobile,post.contactEmail,post.workNatureID,post.tagID,company.userName,company.userMobile,company.companyEmail,
- company.CompanyName,company.insuredCount,item.`Name` as cultureLevelName,work_nature.Name as
- workNatureName,item2.`Name` as workYearName
- , IFNULL(count(rmgt.RecommendMgtID),0) as recommendNum
- , company.SiteID, site.SiteName, inSites.InstitutionID, company.RegionCode
- , pro.ProfessionName,category.workCategoryName, pro.ProfessionID, pro.parentProfessionID, modifyUser.Name as modifyUserName
- from pc_post post
- left join pc_company company on post.CompanyID = company.CompanyID
- left join sys_dictionary_item item on item.value=post.CultureRank and item.DictionaryCode='CultureLevel'
- left join sys_dictionary_item item2 on item2.value=post.workYear and item2.DictionaryCode='WorkYearType'
- left join sys_dictionary_item work_nature on work_nature.value=post.WorkNatureID and
- work_nature.DictionaryCode='WorkNature'
- left join pc_profession pro on post.ProfessionID = pro.ProfessionID
- left join pc_workcategory category on post.WorkCode = category.workCategoryID
- left join pc_recommend_mgt rmgt on post.PostID = rmgt.PostID
- left join pc_site site on company.SiteID = site.SiteID
- left join pc_site_institution inSites on site.SiteID = inSites.SiteID
- left join pc_institution institution on inSites.institutionID = institution.InstitutionID
- left join sys_user modifyUser on post.ModifyUserID = modifyUser.UserID
- <where>
- <if test="postIDList != '' and postIDList != null">
- and post.postID in (${postIDList})
- </if>
- <if test="professionName != '' and professionName != null">
- and pro.ProfessionName like Concat('%',#{professionName},'%')
- </if>
- <if test="minCount != null and minCount != ''">
- and post.RecruitCount <![CDATA[ >= ]]> #{minCount}
- </if>
- <if test="maxCount != null and maxCount != ''">
- and post.RecruitCount <![CDATA[ <= ]]> #{maxCount}
- </if>
- <if test="companyName != null and companyName != ''">
- and company.CompanyName like Concat('%',#{companyName},'%')
- </if>
- <if test="RecordStatus != null and RecordStatus != ''">
- and post.RecordStatus = #{RecordStatus}
- </if>
- <if test="companyID != null and companyID != ''">
- and post.CompanyID = #{companyID}
- </if>
- <if test="curLoginUserSiteCompanyIDs != '' and curLoginUserSiteCompanyIDs != null">
- and post.companyID in (${curLoginUserSiteCompanyIDs})
- </if>
- <if test="siteID!='' and siteID!=null">
- and company.siteID = #{siteID}
- </if>
- <if test="startDate != null and endDate == null">
- and post.CreateTime <![CDATA[ >= ]]> #{startDate}
- </if>
- <if test="endDate != null and startDate == null">
- and post.CreateTime <![CDATA[ <= ]]> #{endDate}
- </if>
- <if test="startDate != null and endDate != null">
- and post.CreateTime <![CDATA[ >= ]]> #{startDate}
- and post.CreateTime <![CDATA[ <= ]]> #{endDate}
- </if>
- </where>
- group by
- post.postID,post.workCode,post.workName,post.recruitCount,post.companyID,post.postName,post.recordStatus,post.workNature,post.validDay,
- post.workYear,post.cultureRank,post.postDesc,post.maxSalary,post.minSalary,post.welfare,post.postEmail,post.workTime,post.isTrail,post.trailMonths,
- post.TrailMaxSalary,post.trailMinSalary,post.createUserID,post.createTime,post.modifyUserID,post.modifyTime,post.validTime,post.startTime,post.endTime,
- post.jobPlace,post.contactName,post.contactMobile,post.contactEmail,post.workNatureID,post.tagID,company.userName,company.userMobile,company.companyEmail,
- company.CompanyName,company.insuredCount,company.bonus,item.`Name`,work_nature.Name,item2.`Name`
- , company.SiteID, site.SiteName, inSites.InstitutionID, company.RegionCode
- , pro.ProfessionName, pro.ProfessionID, pro.parentProfessionID
- order by post.CreateTime desc
- </select>
- <select id="selectRecommendPostList" resultType="com.hz.employmentsite.vo.companyService.RecommendPostVo">
- select post.*,
- recommend.recommendID,
- jobhunt.JobUserID,
- recommend.isRead,
- recommend.isSendNotes,
- company.CompanyName,
- company.InsuredCount
- from (select * from pc_post where PostID in (select PostID from pc_jobhunt where JobUserID = #{jobUserID})) post
- left join pc_company company on post.CompanyID = company.CompanyID
- left join (select * from pc_recommend where JobUserID = #{jobUserID}) recommend
- on post.PostID = recommend.PostID
- left join pc_jobhunt jobhunt on post.PostID = jobhunt.PostID
- where jobhunt.JobUserID = #{jobUserID}
- order by post.CreateTime desc
- </select>
- <select id="selectCompanyMapPostList" resultType="com.hz.employmentsite.vo.companyService.PostVo">
- SELECT post.PostID,
- prof.ProfessionName,
- post.MinSalary,
- post.MaxSalary,
- post.RecruitCount,
- post.StartTime,
- post.EndTime,
- post.PostDesc,
- (
- SELECT JSON_ARRAYAGG(JSON_OBJECT('labelID', labelTemp.LabelID, 'labelName', labelTemp.LabelName))
- FROM (
- SELECT label.LabelID,
- label.LabelName
- FROM pc_label label
- LEFT JOIN pc_label_post label_post ON label.LabelID = label_post.LabelID
- WHERE label_post.PostID = post.PostID
- ) AS labelTemp
- ) AS labelList
- FROM pc_post post
- LEFT JOIN pc_profession prof ON post.ProfessionID = prof.ProfessionID
- WHERE post.CompanyID = #{companyID}
- </select>
- <select id="selectPostInCompanyIDs" resultType="com.hz.employmentsite.vo.companyService.PostVo">
- SELECT
- post.PostID,
- post.CompanyID,
- profession.ProfessionName
- FROM
- pc_post post
- LEFT JOIN pc_profession profession ON post.ProfessionID = profession.ProfessionID
- WHERE
- post.CompanyID in (${companyIDList})
- </select>
- </mapper>
|