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" />
2025-09-25 11:15:13 +08:00
<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" />
2025-09-25 11:39:57 +08:00
<result property= "notPassReason" column= "not_pass_reason" />
2025-10-09 13:03:20 +08:00
<result property= "registeredAddress" column= "registered_address" />
2025-10-09 18:42:03 +08:00
<result property= "isAbnormal" column= "is_abnormal" />
2025-09-22 17:06:47 +08:00
</resultMap>
<sql id= "selectCompanyVo" >
2025-10-15 10:35:54 +08:00
select company_id, name, location, industry, scale, del_flag, create_by, create_time, update_by, update_time, remark,code,description,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 from company
2025-09-22 17:06:47 +08:00
</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" />
2025-09-24 10:49:59 +08:00
<where > del_flag = '0'
2025-10-14 14:55:46 +08:00
<if test= "name != null and name != ''" > and name like concat('%', cast(#{name, jdbcType=VARCHAR} as varchar), '%')</if>
2025-09-22 17:06:47 +08:00
<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>
2025-10-15 10:35:54 +08:00
<if test= "status != null and status != ''" > and status = #{status}</if>
2025-09-22 17:06:47 +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
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>