2026-01-09 20:13:01 +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" />
2026-07-16 15:05:53 +08:00
<result property= "companyNature" column= "company_nature" />
2026-01-09 20:13:01 +08:00
<result property= "totalRecruitment" column= "total_recruitment" />
<result property= "userId" column= "user_id" />
<result property= "businessLicenseUrl" column= "business_license_url" />
<result property= "idCardPictureUrl" column= "id_card_picture_url" />
<result property= "idCardPictureBackUrl" column= "id_card_picture_back_url" />
<result property= "powerOfAttorneyUrl" column= "power_of_attorneyUrl" />
<result property= "contactPerson" column= "contact_person" />
<result property= "contactPersonPhone" column= "contact_person_phone" />
<result property= "status" column= "status" />
<result property= "notPassReason" column= "not_pass_reason" />
<result property= "registeredAddress" column= "registered_address" />
<result property= "isAbnormal" column= "is_abnormal" />
<result property= "enterpriseType" column= "enterprise_type" />
<result property= "isImpCompany" column= "is_imp_company" />
<result property= "impCompanyType" column= "imp_company_type" />
<result property= "legalPerson" column= "legal_person" />
<result property= "legalIdCard" column= "legal_id_card" />
<result property= "legalPhone" column= "legal_phone" />
2026-07-09 18:32:38 +08:00
<result property= "companyStatus" column= "company_status" />
2026-07-11 21:04:36 +08:00
<result property= "isHrs" column= "is_hrs" />
2026-07-11 22:27:14 +08:00
<result property= "lcUserid" column= "lc_userid" />
2026-01-09 20:13:01 +08:00
</resultMap>
<sql id= "selectCompanyVo" >
2026-07-16 15:05:53 +08:00
select company_id, name, location, industry, scale, del_flag, create_by, create_time, update_by, update_time, remark,code,description,nature,company_nature,total_recruitment,registered_address,contact_person,contact_person_phone,is_abnormal,not_pass_reason,status,case when status='2' then update_time else null end reject_time,is_imp_company,imp_company_type,enterprise_type,legal_person,legal_id_card,legal_phone,is_hrs from company
2026-01-09 20:13:01 +08:00
</sql>
2026-07-03 13:19:47 +08:00
<sql id= "companyIndustryFilter" >
<if test= "industry != null and industry != ''" >
<choose >
<when test= "industry == '食品产业' or industry == '食品加工'" >
and (
industry in ('食品加工', '食品产业', '绿色有机食品', '食品/饮料/酒水')
or industry like '%食品%'
or industry like '%饮料%'
or industry like '%酒%'
)
</when>
<when test= "industry == '纺织服装'" >
and (
industry = '纺织服装'
or industry like '%纺织%'
or industry like '%服装%'
)
</when>
<when test= "industry == '装备制造'" >
and (
industry = '装备制造'
or industry like '%装备%'
or industry like '%制造%'
or industry like '%机械%'
or industry like '%设备%'
)
</when>
<when test= "industry == '其他'" >
and (
industry is null
or (
coalesce(industry, '') not in ('食品加工', '食品产业', '绿色有机食品', '食品/饮料/酒水', '纺织服装', '装备制造')
and coalesce(industry, '') not like '%食品%'
and coalesce(industry, '') not like '%饮料%'
and coalesce(industry, '') not like '%酒%'
and coalesce(industry, '') not like '%纺织%'
and coalesce(industry, '') not like '%服装%'
and coalesce(industry, '') not like '%装备%'
and coalesce(industry, '') not like '%制造%'
and coalesce(industry, '') not like '%机械%'
and coalesce(industry, '') not like '%设备%'
)
)
</when>
<otherwise >
and industry = #{industry}
</otherwise>
</choose>
</if>
</sql>
2026-01-09 20:13:01 +08:00
<insert id= "batchInsert" parameterType= "java.util.List" >
INSERT INTO company (
2026-07-16 15:05:53 +08:00
name, location, industry, scale, code, description, nature, company_nature,
2026-01-09 20:13:01 +08:00
create_by, create_time, del_flag
) VALUES
<foreach collection= "list" item= "company" separator= "," >
(
#{company.name}, #{company.location}, #{company.industry}, #{company.scale},
2026-07-16 15:05:53 +08:00
#{company.code}, #{company.description}, #{company.nature}, #{company.companyNature},
2026-01-09 20:13:01 +08:00
#{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
)
</update>
2026-06-03 15:16:41 +08:00
<select id= "selectCompanyList" parameterType= "CompanySearch" resultMap= "CompanyResult" >
2026-01-09 20:13:01 +08:00
<include refid= "selectCompanyVo" />
<where > del_flag = '0'
<if test= "name != null and name != ''" > and name like concat('%', cast(#{name, jdbcType=VARCHAR} as varchar), '%')</if>
<if test= "location != null and location != ''" > and location = #{location}</if>
2026-07-03 13:19:47 +08:00
<include refid= "companyIndustryFilter" />
2026-01-09 20:13:01 +08:00
<if test= "scale != null and scale != ''" > and scale = #{scale}</if>
<if test= "nature != null and nature != ''" > and nature = #{nature}</if>
2026-07-16 15:05:53 +08:00
<if test= "companyNature != null and companyNature != ''" > and company_nature = #{companyNature}</if>
2026-01-09 20:13:01 +08:00
<if test= "code != null and code != ''" > and code = #{code}</if>
<if test= "status != null and status != ''" > and status = #{status}</if>
<if test= "companyId != null and companyId != ''" > and company_id = #{companyId}</if>
2026-07-16 15:05:53 +08:00
<if test= "userId != null" > and user_id = #{userId}</if>
2026-07-11 21:04:36 +08:00
<if test= "isHrs != null and isHrs != ''" > and is_hrs = #{isHrs}</if>
2026-06-03 15:16:41 +08:00
<if test= "startDate != null and startDate != ''" >
and create_time >= #{startDate}
</if>
<if test= "endDate != null and endDate != ''" >
and create_time < = #{endDate}
</if>
2026-01-09 20:13:01 +08:00
</where>
</select>
<select id= "label" resultMap= "CompanyResult" >
SELECT * FROM COMPANY WHERE COMPANY_ID IN (select -1
<if test= "companyNature!=null and companyNature!=''" >
UNION
2026-07-16 15:05:53 +08:00
SELECT COMPANY_ID FROM COMPANY WHERE company_nature = #{companyNature}
2026-01-09 20:13:01 +08:00
</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>
<select id= "selectLikeCompanyList" parameterType= "Company" resultMap= "CompanyResult" >
<include refid= "selectCompanyVo" />
<where > del_flag = '0'
<if test= "name != null and name != ''" > and name like concat('%', cast(#{name, jdbcType=VARCHAR} as varchar), '%')</if>
<if test= "location != null and location != ''" > and location = #{location}</if>
2026-07-03 13:19:47 +08:00
<include refid= "companyIndustryFilter" />
2026-01-09 20:13:01 +08:00
<if test= "scale != null and scale != ''" > and scale = #{scale}</if>
<if test= "nature != null and nature != ''" > and nature = #{nature}</if>
2026-07-16 15:05:53 +08:00
<if test= "companyNature != null and companyNature != ''" > and company_nature = #{companyNature}</if>
2026-01-09 20:13:01 +08:00
<if test= "code != null and code != ''" > and code = #{code}</if>
<if test= "status != null and status != ''" > and status = #{status}</if>
</where>
LIMIT 50
</select>
<select id= "selectCompanyByJobId" resultType= "com.ruoyi.common.core.domain.entity.Company" >
select a.* from COMPANY a inner join job b on a.company_id=b.company_id and b.job_id=#{jobId} limit 1
</select>
2026-07-09 18:32:38 +08:00
<update id= "updateStatus" parameterType= "Company" >
update COMPANY set company_status=#{companyStatus},update_time=#{updateTime},update_by=#{updateBy} where company_id=#{companyId} and del_flag='0'
</update>
2026-07-11 22:27:14 +08:00
<select id= "selectAdminCompanyList" parameterType= "CompanySearch" resultMap= "CompanyResult" >
select t.company_id, t.name, t.location, t.industry, t.scale, t.del_flag, t.create_by, t.create_time, t.update_by, t.update_time, t.remark,t.code,t.description,
2026-07-16 15:05:53 +08:00
t.nature,t.company_nature,t.total_recruitment,t.registered_address,t.contact_person,t.contact_person_phone,t.is_abnormal,t.not_pass_reason,t.status,case when t.status='2'
2026-07-11 22:27:14 +08:00
then t.update_time else null end reject_time,t.is_imp_company,t.imp_company_type,t.enterprise_type,t.legal_person,t.legal_id_card,t.legal_phone,t.is_hrs,
su.lc_userid from company t
left join sys_user su on t.code=su.id_card
2026-07-12 13:13:07 +08:00
<where > t.del_flag = '0' and su.lc_userid is not null
2026-07-11 22:27:14 +08:00
<if test= "name != null and name != ''" > and t.name like concat('%', cast(#{name, jdbcType=VARCHAR} as varchar), '%')</if>
<if test= "scale != null and scale != ''" > and t.scale = #{scale}</if>
<if test= "nature != null and nature != ''" > and t.nature = #{nature}</if>
2026-07-16 15:05:53 +08:00
<if test= "companyNature != null and companyNature != ''" > and t.company_nature = #{companyNature}</if>
2026-07-11 22:27:14 +08:00
<if test= "code != null and code != ''" > and t.code = #{code}</if>
<if test= "status != null and status != ''" > and t.status = #{status}</if>
<if test= "companyId != null and companyId != ''" > and t.company_id = #{companyId}</if>
<if test= "isHrs != null and isHrs != ''" > and t.is_hrs = #{isHrs}</if>
<if test= "startDate != null and startDate != ''" >
and t.create_time >= #{startDate}
</if>
<if test= "endDate != null and endDate != ''" >
and t.create_time < = #{endDate}
</if>
</where>
</select>
2026-07-03 13:19:47 +08:00
</mapper>