postgres 不存在则插入
$query = "insert into inspectionunit(inspectionunitid,inspectionunitname)
select '$inspectionunitid','$unitname' from (select 1) tmp where not
exists (select 1 from inspectionunit where inspectionunitname='$unitname')";
$query = "insert into inspectionunit(inspectionunitid,inspectionunitname)
select '$inspectionunitid','$unitname' from (select 1) tmp where not
exists (select 1 from inspectionunit where inspectionunitname='$unitname')";