123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380 |
- <?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.RecommendMgtCQuery">
- <select id="getRecommendMgtList" resultType="com.hz.employmentsite.vo.jobUserManager.RecommendMgtVo">
- select a.recommendmgtid,a.postid,a.jobhuntid,a.recommendtype,a.entrystate,a.officialaccountsid,
- a.postisread,a.jobpeopleisread,a.createuserid,a.createtime,a.modifyuserid,a.modifytime,a.remark,
- c.companyname,c.usermobile as companymobile,c.username as companyusername,e.`name`,e.usermobile,
- f.professionname as zpprofessionname,f2.professionname as qzprofessionname,
- dic1.`name` as recommendtypename,dic2.`name` as entrystatename,dic3.`name` as postisreadname,
- dic4.`name` as jobpeopleisreadname,g.`name` as pushname, dic5.`name` as gendername
- ,e.jobuserId,c.companyId
- ,d.workYear
- ,site.SiteID, site.SiteName,inSites.InstitutionID as institutionID,site.RegionCode
- from pc_recommend_mgt a
- inner join pc_post b on a.PostID = b.PostID
- left join pc_company c on b.CompanyID = c.CompanyID
- inner join pc_jobhunt d on a.JobHuntID = d.JobHuntID
- left join pc_jobuser e on d.JobUserID = e.JobuserID
- left join pc_profession f on b.ProfessionID = f.ProfessionID
- left join pc_profession f2 on d.ProfessionID = f2.ProfessionID
- left join (select `Value`,`Name` from sys_dictionary_item where DictionaryCode='RecommendType') dic1 on
- a.RecommendType = dic1.`Value`
- left join (select `Value`,`Name` from sys_dictionary_item where DictionaryCode='EntryState') dic2 on
- a.EntryState = dic2.`Value`
- left join (select `Value`,`Name` from sys_dictionary_item where DictionaryCode='IsRead') dic3 on a.PostIsRead =
- dic3.`Value`
- left join (select `Value`,`Name` from sys_dictionary_item where DictionaryCode='IsRead') dic4 on
- a.JobPeopleIsRead = dic4.`Value`
- left join (select `Value`,`Name` from sys_dictionary_item where DictionaryCode='Gender') dic5 on e.Sex =
- dic5.`Value`
- left join sys_user g on a.CreateUserID = g.UserID
- left join pc_site site on e.SiteID = site.SiteID
- left join pc_site_institution inSites on site.SiteID = inSites.SiteID
- left join pc_institution institution on inSites.institutionID = institution.InstitutionID
- <where>
- <if test="recommendMgtID != '' and recommendMgtID != null">
- and a.RecommendMgtID = #{recommendMgtID}
- </if>
- <if test="name != '' and name != null">
- and e.name like Concat('%',#{name},'%')
- </if>
- <if test="companyName != '' and companyName != null">
- and c.CompanyName like Concat('%',#{companyName},'%')
- </if>
- <if test="recommendType != null">
- and a.RecommendType = #{recommendType}
- </if>
- <if test="entryState != null">
- and a.EntryState = #{entryState}
- </if>
- <if test="pushName != '' and pushName != null">
- and g.Name like Concat('%',#{pushName},'%')
- </if>
- <if test="qzProfessionName != '' and qzProfessionName != null">
- and f2.ProfessionName like Concat('%',#{qzProfessionName},'%')
- </if>
- <if test="zpProfessionName != '' and zpProfessionName != null">
- and f.ProfessionName like Concat('%',#{zpProfessionName},'%')
- </if>
- <if test="siteID != null and siteID != ''">
- and e.siteId = #{siteID}
- </if>
- <if test="regionCode != '' and regionCode != null">
- and e.RegionCode = #{regionCode}
- </if>
- <if test="startDate != null and endDate == null">
- and a.CreateTime <![CDATA[ >= ]]> #{startDate}
- </if>
- <if test="endDate != null and startDate == null">
- and a.CreateTime <![CDATA[ <= ]]> #{endDate}
- </if>
- <if test="startDate != null and endDate != null">
- and a.CreateTime <![CDATA[ >= ]]> #{startDate}
- and a.CreateTime <![CDATA[ <= ]]> #{endDate}
- </if>
- <if test="curLoginUserSiteJobHuntIDs != '' and curLoginUserSiteJobHuntIDs != null">
- and a.JobHuntID in (${curLoginUserSiteJobHuntIDs})
- </if>
- </where>
- order by a.createtime desc
- </select>
- <!-- 推荐岗位信息-->
- <select id="getRecommendCompanyPostList"
- resultType="com.hz.employmentsite.vo.jobUserManager.RecommendCompanyPostVo">
- select a.postid,b.companyID,b.companyname,c.professionname,a.recruitcount,a.starttime,a.endtime,b.companyAddress,
- case when d.recommendmgtid is null then '未推荐' else '已推荐' end as isRecommend,d.recommendMgtID,
- a.professionid,a.maxsalary,a.minsalary,area.name as regionName,site.SiteName,
- (case when (a.contactMobile is null or a.contactMobile = '') then b.userMobile else a.contactMobile end) as contactMobile,
- dic1.`name` as culturerankname, dic2.`name` as workyearname
- from pc_post a
- left join pc_company b on a.CompanyID = b.CompanyID
- left join (select * from area_code where lv = 3) area on b.RegionCode = area.code
- left join (select SiteID,SiteName from pc_site) site on b.SiteID = site.SiteID
- left join pc_profession c on a.ProfessionID = c.ProfessionID
- left join pc_recommend_mgt d on a.PostID = d.PostID and d.JobHuntID = #{jobHuntID}
- left join (select `Value`,`Name` from sys_dictionary_item where DictionaryCode='CultureLevel') dic1 on
- a.CultureRank = dic1.`Value`
- left join (select `Value`,`Name`,`Code` from sys_dictionary_item where DictionaryCode='WorkYearType') dic2 on
- a.WorkYear = dic2.`Value`
- <where>
- <if test="type!=null and type==0">
- and d.RecommendMgtID is null
- and a.RecordStatus = 1
- </if>
- <if test="type!=null and type==1">
- and d.RecommendMgtID is not null
- </if>
- <choose>
- <when test="parentProfessionID != null and parentProfessionID!=''">
- and c.ParentProfessionID = #{parentProfessionID}
- </when>
- <when test="professionID != null and professionID != '' and (inviteProfessionName == null or inviteProfessionName == '') and (companyName == null or companyName == '') ">
- and a.ProfessionID = #{professionID}
- </when>
- <when test="professionID != null and professionID != '' and (inviteProfessionName == null or inviteProfessionName == '') and (companyName != null and companyName != '')">
- and ( a.ProfessionID = #{professionID} or b.CompanyName like Concat('%',#{companyName},'%') )
- </when>
- <when test="(professionID == null or professionID == '') and (inviteProfessionName == null or inviteProfessionName == '') and (companyName != null and companyName != '')">
- and b.CompanyName like Concat('%',#{companyName},'%')
- </when>
- <when test="professionID != null and professionID != '' and inviteProfessionName != null and inviteProfessionName != '' and (companyName == null or companyName == '') ">
- and ( a.ProfessionID = #{professionID} or c.professionname like Concat('%',#{inviteProfessionName},'%') )
- </when>
- <when test="(professionID == null or professionID == '') and inviteProfessionName != null and inviteProfessionName != '' and (companyName == null or companyName == '') ">
- and c.professionname like Concat('%',#{inviteProfessionName},'%')
- </when>
- <when test="professionID != null and professionID != '' and inviteProfessionName != null and inviteProfessionName != '' and companyName != null and companyName!='' ">
- and ( a.ProfessionID = #{professionID} or ( b.CompanyName like Concat('%',#{companyName},'%') and c.professionname like Concat('%',#{inviteProfessionName},'%') ) )
- </when>
- <when test="(professionID == null or professionID == '') and inviteProfessionName != null and inviteProfessionName != '' and companyName != null and companyName!='' ">
- and ( b.CompanyName like Concat('%',#{companyName},'%') and c.professionname like Concat('%',#{inviteProfessionName},'%') )
- </when>
- <otherwise>and 1=1</otherwise>
- </choose>
- <if test="cultureRank!=null and cultureRank!=''">
- and a.CultureRank = #{cultureRank}
- </if>
- <if test="workYear!=null and workYear!=''">
- and a.workYear = #{workYear}
- </if>
- <choose>
- <when test="minSalary!=null and maxSalary!=null">
- and a.MinSalary <![CDATA[<=]]> #{maxSalary} and a.MaxSalary <![CDATA[>=]]> #{minSalary}
- </when>
- <when test="minSalary!=null and minSalary!=''">
- and a.MinSalary <![CDATA[>=]]> #{minSalary}
- </when>
- <when test="maxSalary!=null and maxSalary!=''">
- and a.MaxSalary <![CDATA[<=]]> #{maxSalary}
- </when>
- <otherwise>and 1=1</otherwise>
- </choose>
- <if test="regionNameList!=null and regionNameList!=''">
- and area.name in (${regionNameList})
- </if>
- <if test="siteNameList!=null and siteNameList!=''">
- and site.siteName in (${siteNameList})
- </if>
- </where>
- order by a.CreateTime desc
- </select>
- <!-- 推荐求职人员信息-->
- <select id="getRecommendJobList" resultType="com.hz.employmentsite.vo.jobUserManager.RecommendJobVo">
- select a.jobhuntid,b.jobUserID,b.name as userName,b.usermobile,e.sitename,dic1.`name` as culturerankname,dic2.`name` as
- keypersontypename,a.workyear,a.minsalary,a.maxsalary,area.name as regionName,
- case when d.recommendmgtid is null then '未推荐' else '已推荐' end as
- isrecommend,d.recommendMgtID,a.professionid,c.professionname
- from pc_jobhunt a
- left join pc_jobuser b on a.JobUserID = b.JobUserID
- left join area_code area on b.regionCode = area.code
- left join pc_profession c on a.ProfessionID = c.ProfessionID
- left join pc_site e on b.SiteID = e.SiteID
- left join (select `Value`,`Name` from sys_dictionary_item where DictionaryCode='HighestDegree') dic1 on
- b.CultureRank = dic1.`Value`
- left join (select `Value`,`Name` from sys_dictionary_item where DictionaryCode='KeyPersonType') dic2 on
- b.KeyPersonTypeID = dic2.`Value`
- left join pc_recommend_mgt d on a.JobHuntID = d.JobHuntID and d.PostID = #{postID}
- <where>
- <if test="type!=null and type==0">
- and d.RecommendMgtID is null
- and b.jobStatusID != 1
- </if>
- <if test="type!=null and type==1">
- and d.RecommendMgtID is not null
- </if>
- <if test="userName!=null and userName!=''">
- and b.name like Concat('%',#{userName},'%')
- </if>
- <if test="keyPersonType!=null and keyPersonType!=''">
- and b.KeyPersonTypeID = #{keyPersonType}
- </if>
- <if test="cultureRank!=null and cultureRank!=''">
- and b.CultureRank <![CDATA[<=]]> #{cultureRank}
- </if>
- <if test="regionNameList !=null and regionNameList!=''">
- and area.name in (${regionNameList})
- </if>
- <if test="siteNameList!=null and siteNameList!=''">
- and e.siteName in (${siteNameList})
- </if>
- <choose>
- <when test="parentProfessionID!=null and parentProfessionID!=''">
- and c.ParentProfessionID = #{parentProfessionID}
- </when>
- <when test="professionID!=null and professionID!=''and (huntProfessionName==null or huntProfessionName=='')">
- and a.ProfessionID = #{professionID}
- </when>
- <when test="professionID!=null and professionID!=''and huntProfessionName!=null and huntProfessionName!=''">
- and ( a.ProfessionID = #{professionID} or c.professionname like Concat('%',#{huntProfessionName},'%') )
- </when>
- <otherwise>and 1=1</otherwise>
- </choose>
- <if test="workYear!=null and workYear!=''">
- and a.WorkYear <![CDATA[<=]]> #{workYear}
- </if>
- <choose>
- <when test="minSalary!=null and maxSalary!=null">
- and a.MinSalary <![CDATA[<=]]> #{maxSalary} and a.MaxSalary <![CDATA[>=]]> #{minSalary}
- </when>
- <when test="minSalary!=null and minSalary!=''">
- and a.MinSalary <![CDATA[>=]]> #{minSalary}
- </when>
- <when test="maxSalary!=null and maxSalary!=''">
- and a.MaxSalary <![CDATA[<=]]> #{maxSalary}
- </when>
- <otherwise>and 1=1</otherwise>
- </choose>
- <if test="recommendedJobHuntIDList!='' and recommendedJobHuntIDList!=null">
- and a.jobhuntid not in (${recommendedJobHuntIDList})
- </if>
- </where>
- order by a.CreateTime desc
- </select>
- <select id="getProfessionLevelList" resultType="com.hz.employmentsite.vo.jobUserManager.ProfessionLevel">
- select ProfessionID, ParentProfessionID, ProfessionName, '1' as ProfessionLevel
- from pc_profession
- where ParentProfessionID = ''
- union all
- select a.ProfessionID, a.ParentProfessionID, a.ProfessionName, '2' as ProfessionLevel
- from pc_profession a
- inner join (select ProfessionID from pc_profession where ParentProfessionID = '') b
- on a.ParentProfessionID = b.ProfessionID
- union all
- select c.ProfessionID, c.ParentProfessionID, c.ProfessionName, '3' as ProfessionLevel
- from pc_profession c
- inner join (select a.ProfessionID
- from pc_profession a
- inner join (select ProfessionID from pc_profession where ParentProfessionID = '') b
- on a.ParentProfessionID = b.ProfessionID) bb
- on c.ParentProfessionID = bb.ProfessionID
- </select>
- <select id="getCompanyProfessionLikeList" resultType="com.hz.employmentsite.vo.jobUserManager.ProfessionLevel">
- select aa.ProfessionID, aa.ParentProfessionID, aa.ProfessionName, bb.ProfessionName as ParentProfessionName,
- company.companyName,post.postName
- from (
- select c.ProfessionID, c.ParentProfessionID, c.ProfessionName,c.OrderNo
- from pc_profession c
- inner join (select a.ProfessionID
- from pc_profession a
- inner join (select ProfessionID from pc_profession where ParentProfessionID = '') b
- on a.ParentProfessionID = b.ProfessionID) bb
- on c.ParentProfessionID = bb.ProfessionID
- where 1=1
- <if test="professionName!=null and professionName!=''">
- and c.ProfessionName like Concat('%',#{professionName},'%')
- </if>
- ) aa
- left join pc_profession bb on aa.ParentProfessionID = bb.ProfessionID
- left join pc_post post on aa.ProfessionID = post.ProfessionID
- left join pc_company company on post.companyID = company.companyID
- where 1=1 and post.RecordStatus = 1
- <if test="companyName!=null and companyName!=''">
- and company.companyName = #{companyName}
- </if>
- order by bb.OrderNo,aa.OrderNo
- </select>
- <select id="getProfessionLikeList" resultType="com.hz.employmentsite.vo.jobUserManager.ProfessionLevel">
- select aa.ProfessionID, aa.ParentProfessionID, aa.ProfessionName, bb.ProfessionName as ParentProfessionName
- from (
- select c.ProfessionID, c.ParentProfessionID, c.ProfessionName,c.OrderNo
- from pc_profession c
- inner join (select a.ProfessionID
- from pc_profession a
- inner join (select ProfessionID from pc_profession where ParentProfessionID = '') b
- on a.ParentProfessionID = b.ProfessionID) bb
- on c.ParentProfessionID = bb.ProfessionID
- <where>
- <choose>
- <when test="professionName!=null and professionName!=''">
- and c.ProfessionName like Concat('%',#{professionName},'%')
- </when>
- <otherwise>
- and 1!=1
- </otherwise>
- </choose>
- </where>
- ) aa
- left join pc_profession bb on aa.ParentProfessionID = bb.ProfessionID
- order by bb.OrderNo,aa.OrderNo
- </select>
- <select id="getWorkCategoryLevelList" resultType="com.hz.employmentsite.vo.jobUserManager.WorkCategoryLevel">
- select WorkCategoryID, ParentWorkCategoryID, WorkCategoryName, '1' as WorkCategoryLevel
- from pc_workcategory
- where ParentWorkCategoryID = ''
- union all
- select a.WorkCategoryID, a.ParentWorkCategoryID, a.WorkCategoryName, '2' as WorkCategoryLevel
- from pc_workcategory a
- inner join (select WorkCategoryID from pc_workcategory where ParentWorkCategoryID = '') b
- on a.ParentWorkCategoryID = b.WorkCategoryID
- union all
- select c.WorkCategoryID, c.ParentWorkCategoryID, c.WorkCategoryName, '3' as WorkCategoryLevel
- from pc_workcategory c
- inner join (select a.WorkCategoryID
- from pc_workcategory a
- inner join (select WorkCategoryID from pc_workcategory where ParentWorkCategoryID = '') b
- on a.ParentWorkCategoryID = b.WorkCategoryID) bb
- on c.ParentWorkCategoryID = bb.WorkCategoryID
- </select>
- <select id="getOccupationCategoryList" resultType="com.hz.employmentsite.vo.jobUserManager.OccupationCategory">
- select OccupationalID, ParentOccupationalID, OccupationalName, '1' as OccupationalLevel
- from pc_occupational
- where ParentOccupationalID = '0'
- union all
- select a.OccupationalID, a.ParentOccupationalID, a.OccupationalName, '2' as OccupationalLevel
- from pc_occupational a
- inner join (select OccupationalID from pc_occupational where ParentOccupationalID = '0') b
- on a.ParentOccupationalID = b.OccupationalID
- </select>
- <select id="getAllIndustryList" resultType="com.hz.employmentsite.vo.jobUserManager.IndustryLevel">
- select IndustryID, ParentID, IndustryName, '1' as IndustryLevel
- from pc_industry
- where ParentID = ''
- union all
- select a.IndustryID, a.ParentID, a.IndustryName, '2' as IndustryLevel
- from pc_industry a
- inner join (select IndustryID from pc_industry where ParentID = '') b
- on a.ParentID = b.IndustryID
- </select>
- <select id="getCompanypostToUsermessageList" resultType="java.util.HashMap">
- select a.recommendmgtid,
- e.openId as userOpenId,
- c.companyname,
- c.usermobile as companymobile,
- f.professionname as postName
- from pc_recommend_mgt a
- inner join pc_post b on a.PostID = b.PostID
- inner join pc_company c on b.CompanyID = c.CompanyID
- inner join pc_jobhunt d on a.JobHuntID = d.JobHuntID
- inner join pc_jobuser e on d.JobUserID = e.JobuserID
- inner join pc_profession f on b.ProfessionID = f.ProfessionID
- where (a.isSendUser = 0 || a.isSendUser is null)
- and e.openId is not null
- </select>
- <select id="getUserhuntpostToCompanymessageList" resultType="java.util.HashMap">
- select a.recommendmgtid,
- c.openId as companyOpenId,
- e.`name` as userName,
- e.usermobile,
- f2.professionname as userHuntPostName
- from pc_recommend_mgt a
- inner join pc_post b on a.PostID = b.PostID
- inner join pc_company c on b.CompanyID = c.CompanyID
- inner join pc_jobhunt d on a.JobHuntID = d.JobHuntID
- inner join pc_jobuser e on d.JobUserID = e.JobuserID
- inner join pc_profession f2 on d.ProfessionID = f2.ProfessionID
- where (a.isSendCompany = 0 || a.isSendCompany is null)
- and c.openId is not null
- </select>
- </mapper>
|