基本思路
var
QrySQL, WheSQL :string;
begin
QrySQL :='select * from Table1 where 1=1 ';
WheSQL :='';
//加入组合条件
if condi_1=True then
WheSQL :=WheSQL + ' and field_1='''+condi_1+'''';
if condi_2=True then
WheSQL :=WheSQL + ' and field_2='''+condi_2+'''';
......
if WheSQL<>'' then
//执行 (QrySQL+WheSQL)