like “#{xxxx}” 会报错
${}是可以的,但是会有sql注入 所以使用concat进行拼接
select * from dywl_ads
LEFT JOIN dywl_ads_check
on
dywl_ads.id = dywl_ads_check.ads_id
LEFT JOIN dywl_dictionary
on
dywl_ads.port_id = dywl_dictionary.code
where
1=1
and dywl_ads.company_type_code = #{typeCode}
and dywl_ads.company_type = #{typeName}
and dywl_ads.city like concat(’%’,#{city},’%’)
and dywl_dictionary.title_cn= #{port}
and dywl_dictionary.parent_id= 7
and dywl_ads_check.check_status = 3