2025-09-22 17:06:47 +08:00
<?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.ruoyi.cms.mapper.JobMapper" >
<resultMap type= "Job" id= "JobResult" >
<result property= "jobId" column= "job_id" />
<result property= "jobTitle" column= "job_title" />
<result property= "minSalary" column= "min_salary" />
<result property= "maxSalary" column= "max_salary" />
<result property= "education" column= "education" />
<result property= "experience" column= "experience" />
<result property= "companyName" column= "company_name" />
<result property= "jobLocation" column= "job_location" />
<result property= "postingDate" column= "posting_date" />
<result property= "vacancies" column= "vacancies" />
<result property= "delFlag" column= "del_flag" />
<result property= "createBy" column= "create_by" />
<result property= "createTime" column= "create_time" />
<result property= "updateBy" column= "update_by" />
<result property= "updateTime" column= "update_time" />
<result property= "remark" column= "remark" />
<result property= "latitude" column= "latitude" />
<result property= "longitude" column= "longitude" />
<result property= "view" column= "view" />
<result property= "companyId" column= "company_id" />
<result property= "isHot" column= "is_hot" />
<result property= "dataSource" column= "data_source" />
<result property= "jobUrl" column= "job_url" />
<result property= "rowId" column= "row_id" />
<result property= "jobCategory" column= "job_category" />
<result property= "isExplain" column= "is_explain" />
<result property= "explainUrl" column= "explain_url" />
<result property= "cover" column= "cover" />
2025-09-30 18:32:20 +08:00
<result property= "jobType" column= "job_type" />
2025-10-29 19:10:46 +08:00
</resultMap>
<resultMap type= "com.ruoyi.cms.domain.Job" id= "JobEsResult" >
<result property= "jobId" column= "job_id" />
<result property= "jobTitle" column= "job_title" />
<result property= "minSalary" column= "min_salary" />
<result property= "maxSalary" column= "max_salary" />
<result property= "education" column= "education" />
<result property= "experience" column= "experience" />
<result property= "companyName" column= "company_name" />
<result property= "jobLocation" column= "job_location" />
<result property= "postingDate" column= "posting_date" />
<result property= "vacancies" column= "vacancies" />
<result property= "delFlag" column= "del_flag" />
<result property= "createBy" column= "create_by" />
<result property= "createTime" column= "create_time" />
<result property= "updateBy" column= "update_by" />
<result property= "updateTime" column= "update_time" />
<result property= "remark" column= "remark" />
<result property= "latitude" column= "latitude" />
<result property= "longitude" column= "longitude" />
<result property= "view" column= "view" />
<result property= "companyId" column= "company_id" />
<result property= "isHot" column= "is_hot" />
<result property= "applyNum" column= "apply_num" />
<result property= "dataSource" column= "data_source" />
<result property= "jobLocationAreaCode" column= "job_location_area_code" />
<result property= "description" column= "description" />
<result property= "isPublish" column= "is_publish" />
<result property= "dataSource" column= "data_source" />
<result property= "jobUrl" column= "job_url" />
<result property= "rowId" column= "row_id" />
<result property= "jobCategory" column= "job_category" />
<result property= "isExplain" column= "is_explain" />
<result property= "explainUrl" column= "explain_url" />
<result property= "cover" column= "cover" />
<result property= "jobType" column= "job_type" />
<result property= "type" column= "type" />
<result property= "industry" column= "industry" />
<result property= "scale" column= "scale" />
<result property= "companyNature" column= "company_nature" />
<result property= "code" column= "code" />
<association property= "companyVo" resultMap= "CompanyResult" />
</resultMap>
<resultMap type= "com.ruoyi.cms.domain.vo.CompanyVo" id= "CompanyResult" >
<result property= "companyId" column= "company_id" />
<result property= "name" column= "name" />
<result property= "companyDescription" column= "company_description" />
<collection property= "companyContactList" ofType= "com.ruoyi.common.core.domain.entity.CompanyContact"
resultMap="CompanyContactResult"/>
</resultMap>
<resultMap type= "com.ruoyi.common.core.domain.entity.CompanyContact" id= "CompanyContactResult" >
<result property= "contactPerson" column= "contact_person" />
<result property= "contactPersonPhone" column= "contact_person_phone" />
2025-09-22 17:06:47 +08:00
</resultMap>
<sql id= "selectJobVo" >
2025-09-30 18:32:20 +08:00
select job_id, job_title, min_salary, max_salary, education, experience, company_name, job_location, posting_date, vacancies, del_flag, create_by, create_time, update_by, update_time, remark, latitude, longitude, "view", company_id , is_hot ,apply_num,is_publish, description,job_location_area_code,data_source,job_url,job_category,is_explain,explain_url,cover,job_type from job
2025-09-22 17:06:47 +08:00
</sql>
<insert id= "insertBatchRowWork" >
INSERT INTO row_work (
TaskId, TaskName, Std_class, SF, ZCMC, Aca112, Acb22a, Aac011, Acb240,
Recruit_Num, Acb202, Aab302, Acb241, Salary, SalaryLow, SalaryHight, Aae397,
AAB004, AAB022, AAB019, AAE006, AAB092, ORG, ACE760, AAE004, AAE005,
Num_employers, Experience, Highlight, Minimum_age, Maximum_age, Sex,
IndustryType, IndustrySub, AAB019_OK, Aac011_OK, Experience_OK, Num_OK,
Collect_time, ClearFlag, Province, City, County, importdate, YearMonth,
IsRepeat, latitude, longitude
) VALUES
<foreach collection= "list" item= "job" separator= "," >
(
#{job.TaskId}, #{job.TaskName}, #{job.Std_class}, #{job.SF}, #{job.ZCMC}, #{job.Aca112}, #{job.Acb22a},
#{job.Aac011}, #{job.Acb240}, #{job.Recruit_Num}, #{job.Acb202}, #{job.Aab302}, #{job.Acb241}, #{job.Salary},
#{job.SalaryLow}, #{job.SalaryHight}, #{job.Aae397}, #{job.AAB004}, #{job.AAB022}, #{job.AAB019},
#{job.AAE006}, #{job.AAB092}, #{job.ORG}, #{job.ACE760}, #{job.AAE004}, #{job.AAE005}, #{job.Num_employers},
#{job.Experience}, #{job.Highlight}, #{job.Minimum_age}, #{job.Maximum_age}, #{job.Sex},
#{job.IndustryType}, #{job.IndustrySub}, #{job.AAB019_OK}, #{job.Aac011_OK}, #{job.Experience_OK},
#{job.Num_OK}, #{job.Collect_time}, #{job.ClearFlag}, #{job.Province}, #{job.City}, #{job.County},
#{job.importdate}, #{job.YearMonth}, #{job.IsRepeat}, #{job.latitude}, #{job.longitude}
)
</foreach>
</insert>
<insert id= "batchInsert" >
INSERT INTO job (
job_title, min_salary, max_salary, education, experience, company_name, job_location,
2025-09-24 12:16:23 +08:00
job_location_area_code, posting_date, vacancies, latitude, longitude, "view", company_id,
2025-09-22 17:06:47 +08:00
is_hot, apply_num, description, is_publish, data_source, job_url, remark, del_flag,
2025-09-30 18:32:20 +08:00
create_by, create_time, row_id, job_category,jobType
2025-09-22 17:06:47 +08:00
) VALUES
<foreach collection= "list" item= "job" separator= "," >
(
#{job.jobTitle}, #{job.minSalary}, #{job.maxSalary}, #{job.education}, #{job.experience},
#{job.companyName}, #{job.jobLocation}, #{job.jobLocationAreaCode}, #{job.postingDate},
#{job.vacancies}, #{job.latitude}, #{job.longitude}, #{job.view}, #{job.companyId},
#{job.isHot}, #{job.applyNum}, #{job.description}, #{job.isPublish}, #{job.dataSource},
#{job.jobUrl}, #{job.remark}, #{job.delFlag}, #{job.createBy}, #{job.createTime},
2025-09-30 18:32:20 +08:00
#{job.rowId}, #{job.jobCategory},#{job.jobType}
2025-09-22 17:06:47 +08:00
)
</foreach>
</insert>
<insert id= "insertBatchRowWorkTmp" >
INSERT INTO row_work_tmp (
TaskId, TaskName, Std_class, SF, ZCMC, Aca112, Acb22a, Aac011, Acb240,
Recruit_Num, Acb202, Aab302, Acb241, Salary, SalaryLow, SalaryHight, Aae397,
AAB004, AAB022, AAB019, AAE006, AAB092, ORG, ACE760, AAE004, AAE005,
Num_employers, Experience, Highlight, Minimum_age, Maximum_age, Sex,
IndustryType, IndustrySub, AAB019_OK, Aac011_OK, Experience_OK, Num_OK,
Collect_time, ClearFlag, Province, City, County, importdate, YearMonth,
IsRepeat, latitude, longitude
) VALUES
<foreach collection= "list" item= "job" separator= "," >
(
#{job.TaskId}, #{job.TaskName}, #{job.Std_class}, #{job.SF}, #{job.ZCMC}, #{job.Aca112}, #{job.Acb22a},
#{job.Aac011}, #{job.Acb240}, #{job.Recruit_Num}, #{job.Acb202}, #{job.Aab302}, #{job.Acb241}, #{job.Salary},
#{job.SalaryLow}, #{job.SalaryHight}, #{job.Aae397}, #{job.AAB004}, #{job.AAB022}, #{job.AAB019},
#{job.AAE006}, #{job.AAB092}, #{job.ORG}, #{job.ACE760}, #{job.AAE004}, #{job.AAE005}, #{job.Num_employers},
#{job.Experience}, #{job.Highlight}, #{job.Minimum_age}, #{job.Maximum_age}, #{job.Sex},
#{job.IndustryType}, #{job.IndustrySub}, #{job.AAB019_OK}, #{job.Aac011_OK}, #{job.Experience_OK},
#{job.Num_OK}, #{job.Collect_time}, #{job.ClearFlag}, #{job.Province}, #{job.City}, #{job.County},
#{job.importdate}, #{job.YearMonth}, #{job.IsRepeat}, #{job.latitude}, #{job.longitude}
)
</foreach>
</insert>
<update id= "isHot" >
UPDATE job
SET is_hot = 1
WHERE job_id IN (
select b.job_id
from(
SELECT job_id
FROM job
2025-09-24 12:16:23 +08:00
ORDER BY "view" DESC
2025-09-22 17:06:47 +08:00
LIMIT 10)
as b
);
</update>
<select id= "selectJobList" parameterType= "Job" resultMap= "JobResult" >
<include refid= "selectJobVo" />
2025-09-24 10:49:59 +08:00
<where > del_flag = '0'
2025-09-22 17:06:47 +08:00
<if test= "jobTitle != null and jobTitle != ''" > and job_title = #{jobTitle}</if>
<if test= "minSalary != null " > and min_salary = #{minSalary}</if>
<if test= "maxSalary != null " > and max_salary = #{maxSalary}</if>
<if test= "education != null and education != ''" > and education = #{education}</if>
<if test= "experience != null and experience != ''" > and experience = #{experience}</if>
2025-10-14 14:57:41 +08:00
<if test= "companyName != null and companyName != ''" > and company_name like concat('%', cast(#{companyName, jdbcType=VARCHAR} as varchar), '%')</if>
2025-09-22 17:06:47 +08:00
<if test= "jobLocation != null and jobLocation != ''" > and job_location = #{jobLocation}</if>
2025-09-24 12:19:33 +08:00
<if test= "postingDate != null and postingDate!=''" > and posting_date = #{postingDate}</if>
2025-09-22 17:06:47 +08:00
<if test= "vacancies != null " > and vacancies = #{vacancies}</if>
<if test= "latitude != null " > and latitude = #{latitude}</if>
<if test= "longitude != null " > and longitude = #{longitude}</if>
2025-09-24 12:16:23 +08:00
<if test= "view != null " > and "view" = #{view}</if>
2025-09-22 17:06:47 +08:00
<if test= "companyId != null " > and company_id = #{companyId}</if>
<if test= "isHot != null " > and is_hot = #{isHot}</if>
<if test= "applyNum != null " > and apply_num = #{applyNum}</if>
2025-09-30 18:32:20 +08:00
<if test= "code != null " > and company_id in(select company_id from company where code=#{code})</if>
<if test= "compensation!=null " >
<if test= "compensation==0 " >
and min_salary < 1750
</if>
<if test= "compensation==1 " >
and max_salary < 2000 and min_salary > = 1750
</if>
<if test= "compensation==2 " >
and max_salary < 3000 and min_salary > = 2000
</if>
<if test= "compensation==3 " >
and max_salary < 4000 and min_salary > = 3000
</if>
<if test= "compensation==4 " >
and max_salary < 5000 and min_salary > = 4000
</if>
<if test= "compensation==5 " >
and min_salary > 5000
</if>
</if>
2025-09-22 17:06:47 +08:00
</where>
order by is_explain desc
</select>
<select id= "selectAppJobList" resultType= "com.ruoyi.cms.domain.query.ESJobSearch" >
<include refid= "selectJobVo" />
2025-09-24 10:49:59 +08:00
<where > del_flag = '0'
2025-09-22 17:06:47 +08:00
<if test= "jobTitle != null and jobTitle != ''" > and job_title = #{jobTitle}</if>
<if test= "minSalary != null " > and min_salary = #{minSalary}</if>
<if test= "maxSalary != null " > and max_salary = #{maxSalary}</if>
<if test= "education != null and education != ''" > and education = #{education}</if>
<if test= "experience != null and experience != ''" > and experience = #{experience}</if>
2025-10-14 14:57:41 +08:00
<if test= "companyName != null and companyName != ''" > and company_name like concat('%', cast(#{companyName, jdbcType=VARCHAR} as varchar), '%')</if>
2025-09-22 17:06:47 +08:00
<if test= "jobLocation != null and jobLocation != ''" > and job_location = #{jobLocation}</if>
2025-09-24 12:19:33 +08:00
<if test= "postingDate != null and postingDate!='' " > and posting_date = #{postingDate}</if>
2025-09-22 17:06:47 +08:00
<if test= "vacancies != null " > and vacancies = #{vacancies}</if>
<if test= "latitude != null " > and latitude = #{latitude}</if>
<if test= "longitude != null " > and longitude = #{longitude}</if>
2025-09-24 12:16:23 +08:00
<if test= "view != null " > and "view" = #{view}</if>
2025-09-22 17:06:47 +08:00
<if test= "companyId != null " > and company_id = #{companyId}</if>
<if test= "isHot != null " > and is_hot = #{isHot}</if>
<if test= "applyNum != null " > and apply_num = #{applyNum}</if>
<if test= "isPublish != null " > and is_publish = #{isPublish}</if>
<if test= "countyIds!=null and countyIds.size!=0" >
and job_location_area_code in <foreach collection= "countyIds" index= "item" close= ")" open= "(" >
#{item}
</foreach>
</if>
</where>
</select>
<select id= "selectAllRowWork" resultType= "com.ruoyi.cms.domain.RowWork" >
select Id, TaskId, TaskName, Std_class, SF, ZCMC, Aca112, Acb22a, Aac011, Acb240,
Recruit_Num, Acb202, Aab302, Acb241, Salary, SalaryLow, SalaryHight, Aae397,
AAB004, AAB022, AAB019, AAE006, AAB092, ORG as "ORG", ACE760, AAE004, AAE005,
Num_employers, Experience, Highlight, Minimum_age, Maximum_age, Sex,
IndustryType, IndustrySub, AAB019_OK, Aac011_OK, Experience_OK, Num_OK,
Collect_time, ClearFlag, Province, City, County, importdate, YearMonth,
IsRepeat, latitude, longitude,Std_class as JobCategory from row_work
</select>
2025-10-21 14:49:58 +08:00
<select id= "selectRowCompany" resultType= "com.ruoyi.common.core.domain.entity.Company" >
2025-09-22 17:06:47 +08:00
SELECT *
2025-10-09 21:49:17 +08:00
FROM (
SELECT
AAB004 AS name,
MIN(AAE006) AS location,
MIN(IndustryType) as remark,
MIN(IndustrySub) as industry,
MIN(Num_OK) as scale,
MIN(AAB092) as description,
MIN(AAB019_OK) as nature
FROM row_work
GROUP BY AAB004
) AS b
WHERE NOT EXISTS (
SELECT 1
FROM company
WHERE b.name = company.name
)
2025-09-22 17:06:47 +08:00
</select>
2025-10-29 19:10:46 +08:00
<select id= "selectAllJob" resultMap= "JobEsResult" >
SELECT j.*,c.industry,c.scale,c.nature as company_nature,c.code,c.description as company_description,c.name,c.company_id,t.contact_person,t.contact_person_phone FROM job as j
left join company as c on c.company_id = j.company_id and j.del_flag='0' and c.del_flag='0'
left join company_contact as t on t.company_id=j.company_id and t.del_flag='0' where c.company_id='1' limit #{offset},#{batchSize}
2025-09-22 17:06:47 +08:00
</select>
<select id= "selectAllInsertRowWork" resultType= "com.ruoyi.cms.domain.RowWork" >
select Id, TaskId, TaskName, Std_class, SF, ZCMC, Aca112, Acb22a, Aac011, Acb240,
Recruit_Num, Acb202, Aab302, Acb241, Salary, SalaryLow, SalaryHight, Aae397,
AAB004, AAB022, AAB019, AAE006, AAB092, ORG as "ORG", ACE760, AAE004, AAE005,
Num_employers, Experience, Highlight, Minimum_age, Maximum_age, Sex,
IndustryType, IndustrySub, AAB019_OK, Aac011_OK, Experience_OK, Num_OK,
Collect_time, ClearFlag, Province, City, County, importdate, YearMonth,
IsRepeat, latitude, longitude,Std_class as JobCategory from row_work where not exists(
select 1
from job
where job.row_id = row_work.id
) AND id IN ( SELECT max(id) FROM row_work GROUP BY Aca112,Acb22a)
</select>
<select id= "selectVectorJob" resultType= "com.ruoyi.cms.domain.VectorJob" >
SELECT
ANY_VALUE(job_id) as job_id,
j.job_title,
ed.dict_label as education,
ex.dict_label as experience,
j.company_name,
j.job_location,
j.description,
ar.dict_label as area,
ab.dict_label as nature,
ac.dict_label as scale,
concat(j.min_salary,"元-",j.max_salary,"元") as salary
FROM
job as j
inner join company as c on c.company_id = j.company_id
inner join qd.bussiness_dict_data as ed on ed.dict_type = 'education' and ed.dict_value = j.education
inner join qd.bussiness_dict_data as ex on ex.dict_type = 'experience' and ex.dict_value = j.experience
left join qd.bussiness_dict_data as ar on ar.dict_type = 'area' and ar.dict_value = j.job_location_area_code
left join qd.bussiness_dict_data as ab on ab.dict_type = 'company_nature' and ab.dict_value = c.nature
left join qd.bussiness_dict_data as ac on ac.dict_type = 'scale' and ac.dict_value = c.scale
where job_id =#{jobId}
</select>
2025-10-23 17:07:02 +08:00
<sql id= "selectAppUserResult" >
select a.user_id, a.name, a.age, a.sex, a.birth_date, a.education, a.political_affiliation, a.phone, a.avatar, a.salary_min, a.salary_max, a.area, a.status, a.del_flag, a.login_ip, a.login_date, a.create_by, a.create_time, a.update_by, a.update_time, a.remark,a.job_title_id,a.is_recommend,a.id_card,a.work_experience,a.is_company_user from job_apply e
</sql>
<select id= "selectApplyJobUserList" resultType= "com.ruoyi.common.core.domain.entity.AppUser" >
<include refid= "selectAppUserResult" /> inner join app_user a on e.user_id =a.user_id and a.del_flag='0'
where e.del_flag='0' and e.job_id=#{jobId}
</select>
2025-09-22 17:06:47 +08:00
</mapper>