- Added companyNature field to Company entity and updated related services and mappers. - Removed jobNature field from Job and ESJobDocument entities as it is no longer needed. - Updated CompanyController to handle current company information and synchronization of account codes. - Enhanced CompanyServiceImpl to manage company nature changes and synchronize related job postings. - Updated SQL migrations to add company nature field and associated business dictionary entries. - Refactored job-related services to ensure they reflect the latest company nature information.
206 lines
12 KiB
XML
206 lines
12 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.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="companyNature" column="company_nature" />
|
|
<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" />
|
|
<result property="companyStatus" column="company_status" />
|
|
<result property="isHrs" column="is_hrs" />
|
|
<result property="lcUserid" column="lc_userid" />
|
|
|
|
</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,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
|
|
</sql>
|
|
|
|
<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>
|
|
<insert id="batchInsert" parameterType="java.util.List">
|
|
INSERT INTO company (
|
|
name, location, industry, scale, code, description, nature, company_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.companyNature},
|
|
#{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>
|
|
|
|
<select id="selectCompanyList" parameterType="CompanySearch" 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>
|
|
<include refid="companyIndustryFilter"/>
|
|
<if test="scale != null and scale != ''"> and scale = #{scale}</if>
|
|
<if test="nature != null and nature != ''"> and nature = #{nature}</if>
|
|
<if test="companyNature != null and companyNature != ''"> and company_nature = #{companyNature}</if>
|
|
<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>
|
|
<if test="userId != null"> and user_id = #{userId}</if>
|
|
<if test="isHrs != null and isHrs != ''"> and is_hrs = #{isHrs}</if>
|
|
<if test="startDate != null and startDate != ''">
|
|
and create_time >= #{startDate}
|
|
</if>
|
|
<if test="endDate != null and endDate != ''">
|
|
and create_time <= #{endDate}
|
|
</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 company_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>
|
|
|
|
<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>
|
|
<include refid="companyIndustryFilter"/>
|
|
<if test="scale != null and scale != ''"> and scale = #{scale}</if>
|
|
<if test="nature != null and nature != ''"> and nature = #{nature}</if>
|
|
<if test="companyNature != null and companyNature != ''"> and company_nature = #{companyNature}</if>
|
|
<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>
|
|
|
|
<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>
|
|
|
|
<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,
|
|
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'
|
|
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
|
|
<where> t.del_flag = '0' and su.lc_userid is not null
|
|
<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>
|
|
<if test="companyNature != null and companyNature != ''"> and t.company_nature = #{companyNature}</if>
|
|
<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>
|
|
|
|
</mapper>
|