SELECT
t.id
,t.risk_level
,c.companyname
,t.promise_date
,t.danger_level
,c.city
,c.county
FROM tb_safety_commitment t
inner join tb_base_company c
on company_code = companycode
WHERE
(c.areacode like ‘3702’ || ‘%’ or ‘3702’ is null)
and (c.companyname like null || ‘%’ or null is null)
and (t.risk_level = null or null is null)
and ((t.promise_date between to_date(null,‘yyyy-MM-dd’) and to_date(null,‘yyyy-MM-dd’)) or null is null)
可参考链接:https://blog.youkuaiyun.com/cmz852x/article/details/83314771