feat: Enhance API path handling and normalize company industry names
This commit is contained in:
@@ -43,6 +43,57 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<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,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 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,
|
||||
@@ -70,7 +121,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<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>
|
||||
<if test="industry != null and industry != ''"> and industry = #{industry}</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="code != null and code != ''"> and code = #{code}</if>
|
||||
@@ -102,7 +153,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<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>
|
||||
<if test="industry != null and industry != ''"> and industry = #{industry}</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="code != null and code != ''"> and code = #{code}</if>
|
||||
@@ -115,4 +166,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
select a.* from COMPANY a inner join job b on a.company_id=b.company_id and b.job_id=#{jobId} limit 1
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user