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.CompanyMapper">
|
|
|
|
|
|
|
|
|
|
<resultMap type="Company" id="CompanyResult">
|
|
|
|
|
<result property="companyId" column="company_id" />
|
|
|
|
|
<result property="name" column="name" />
|
|
|
|
|
<result property="location" column="location" />
|
|
|
|
|
<result property="industry" column="industry" />
|
|
|
|
|
<result property="scale" column="scale" />
|
|
|
|
|
<result property="code" column="code" />
|
|
|
|
|
<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="description" column="description" />
|
|
|
|
|
<result property="nature" column="nature" />
|
|
|
|
|
<result property="totalRecruitment" column="total_recruitment" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectCompanyVo">
|
|
|
|
|
select company_id, name, location, industry, scale, del_flag, create_by, create_time, update_by, update_time, remark,code,description,nature,total_recruitment from company
|
|
|
|
|
</sql>
|
|
|
|
|
<insert id="batchInsert" parameterType="java.util.List">
|
|
|
|
|
INSERT INTO company (
|
|
|
|
|
name, location, industry, scale, code, description, nature,
|
|
|
|
|
create_by, create_time, del_flag
|
|
|
|
|
) VALUES
|
|
|
|
|
<foreach collection="list" item="company" separator=",">
|
|
|
|
|
(
|
|
|
|
|
#{company.name}, #{company.location}, #{company.industry}, #{company.scale},
|
|
|
|
|
#{company.code}, #{company.description}, #{company.nature},
|
|
|
|
|
#{company.createBy}, #{company.createTime}, #{company.delFlag}
|
|
|
|
|
)
|
|
|
|
|
</foreach>
|
|
|
|
|
</insert>
|
|
|
|
|
<update id="updateJobCountOfCompany">
|
|
|
|
|
UPDATE company c
|
|
|
|
|
SET TOTAL_RECRUITMENT = (
|
|
|
|
|
SELECT COUNT(*)
|
|
|
|
|
FROM job j
|
|
|
|
|
WHERE j.company_id = c.company_id
|
2025-09-22 19:49:06 +08:00
|
|
|
)
|
2025-09-22 17:06:47 +08:00
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<select id="selectCompanyList" parameterType="Company" resultMap="CompanyResult">
|
|
|
|
|
<include refid="selectCompanyVo"/>
|
|
|
|
|
<where> del_flag = 0
|
|
|
|
|
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
|
|
|
|
<if test="location != null and location != ''"> and location = #{location}</if>
|
|
|
|
|
<if test="industry != null and industry != ''"> and industry = #{industry}</if>
|
|
|
|
|
<if test="scale != null and scale != ''"> and scale = #{scale}</if>
|
|
|
|
|
<if test="nature != null and nature != ''"> and nature = #{nature}</if>
|
|
|
|
|
<if test="code != null and code != ''"> and code = #{code}</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
<select id="label" resultMap="CompanyResult">
|
|
|
|
|
SELECT * FROM COMPANY WHERE COMPANY_ID IN (select -1
|
|
|
|
|
<if test="companyNature!=null and companyNature!=''">
|
|
|
|
|
UNION
|
|
|
|
|
SELECT COMPANY_ID FROM COMPANY WHERE nature = #{companyNature}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="targ!=null and targ!=''">
|
|
|
|
|
UNION
|
|
|
|
|
SELECT company_id FROM COMPANY_LABEL WHERE dict_value = #{targ}
|
|
|
|
|
</if>)
|
|
|
|
|
<if test="companyName != null and companyName != ''"> and name like concat('%',#{companyName},'%')</if>
|
|
|
|
|
</select>
|
|
|
|
|
</mapper>
|