257 lines
15 KiB
XML
257 lines
15 KiB
XML
<?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" />
|
|
<result property="jobType" column="job_type" />
|
|
</resultMap>
|
|
|
|
<sql id="selectJobVo">
|
|
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
|
|
</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,
|
|
job_location_area_code, posting_date, vacancies, latitude, longitude, "view", company_id,
|
|
is_hot, apply_num, description, is_publish, data_source, job_url, remark, del_flag,
|
|
create_by, create_time, row_id, job_category,jobType
|
|
) 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},
|
|
#{job.rowId}, #{job.jobCategory},#{job.jobType}
|
|
)
|
|
</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
|
|
ORDER BY "view" DESC
|
|
LIMIT 10)
|
|
as b
|
|
);
|
|
</update>
|
|
|
|
<select id="selectJobList" parameterType="Job" resultMap="JobResult">
|
|
<include refid="selectJobVo"/>
|
|
<where> del_flag = '0'
|
|
<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>
|
|
<if test="companyName != null and companyName != ''"> and company_name like concat('%', cast(#{companyName, jdbcType=VARCHAR} as varchar), '%')</if>
|
|
<if test="jobLocation != null and jobLocation != ''"> and job_location = #{jobLocation}</if>
|
|
<if test="postingDate != null and postingDate!=''"> and posting_date = #{postingDate}</if>
|
|
<if test="vacancies != null "> and vacancies = #{vacancies}</if>
|
|
<if test="latitude != null "> and latitude = #{latitude}</if>
|
|
<if test="longitude != null "> and longitude = #{longitude}</if>
|
|
<if test="view != null "> and "view" = #{view}</if>
|
|
<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="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>
|
|
</where>
|
|
order by is_explain desc
|
|
</select>
|
|
<select id="selectAppJobList" resultType="com.ruoyi.cms.domain.query.ESJobSearch">
|
|
<include refid="selectJobVo"/>
|
|
<where> del_flag = '0'
|
|
<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>
|
|
<if test="companyName != null and companyName != ''"> and company_name like concat('%', cast(#{companyName, jdbcType=VARCHAR} as varchar), '%')</if>
|
|
<if test="jobLocation != null and jobLocation != ''"> and job_location = #{jobLocation}</if>
|
|
<if test="postingDate != null and postingDate!='' "> and posting_date = #{postingDate}</if>
|
|
<if test="vacancies != null "> and vacancies = #{vacancies}</if>
|
|
<if test="latitude != null "> and latitude = #{latitude}</if>
|
|
<if test="longitude != null "> and longitude = #{longitude}</if>
|
|
<if test="view != null "> and "view" = #{view}</if>
|
|
<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>
|
|
<select id="selectRowCompany" resultType="com.ruoyi.common.core.domain.entity.Company">
|
|
SELECT *
|
|
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
|
|
)
|
|
</select>
|
|
<select id="selectAllJob" resultType="com.ruoyi.cms.domain.Job">
|
|
SELECT j.*,c.industry,c.scale,c.nature as company_nature FROM job as j
|
|
left join company as c on c.company_id = j.company_id limit #{offset},#{batchSize}
|
|
</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>
|
|
</mapper> |