数据字段存储格式
shape_org_id
20,22,200
网上的:
select id from tb_functional_service_info where 1=1 and range_type=2 and string_to_array(shape_org_id,',') @> array['${rangTypeId}']
@> 这个也没找到对应的解释,怕版本不支持,自己写了另外一个
select id from tb_functional_service_info where 1=1 and range_type=2 and (shape_org_id like '${rangTypeId},%' or shape_org_id like '%,${rangTypeId}' or shape_org_id like '%,${rangTypeId},%')
用多个like就能规避查询20的时候把200也查出来了