str_fee:='where <20><><EFBFBD><EFBFBD><>(<28><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>+<2B><><EFBFBD>뿪Ʊ) and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ<>1 and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
str_fee:='where <20><><EFBFBD><EFBFBD><>(<28><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>+<2B><><EFBFBD>뿪Ʊ) and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ<>1 and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
str_fee:=str_fee+'and (<28><><EFBFBD><EFBFBD><><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and <20><><EFBFBD><EFBFBD><><3E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>)';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
else begin
if wwDBComboBox1.Text<>'' then begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox1.Text+'''';
end;
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
3,8:
begin
str_fee:='where '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
else begin
if wwDBComboBox1.Text<>'' then begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox1.Text+'''';
end;
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
4:
begin
str_fee:='where '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
else begin
if wwDBComboBox1.Text<>'' then begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox1.Text+'''';
end;
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
6: //<2F>շ<EFBFBD><D5B7><EFBFBD><EFBFBD><EFBFBD>
begin
str_fee:='where '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
str_fee:=str_fee+'and (<28><><EFBFBD><EFBFBD><><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and <20><><EFBFBD><EFBFBD><><3E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>)';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
// if not strtobool(get_parameters_value(46,'true')) then
// str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
end;
end;
{
if RxDBLookupCombo2.DisplayValues[1]<>''then
str_fee:=str_fee+' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo2.DisplayValues[1]+'''';
}
str:=Trim(ComboBoxObjseae.Text);
if (Str<>'') and (length(Str)>10) then
str_fee:=str_fee+' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+Trim(Copy(Str,11,length(Str)-10))+'''';
if RxDBLookupCombo6.DisplayValues[1]<>''then
str_fee:=str_fee+' and <20>ұ<EFBFBD>='+''''+RxDBLookupCombo6.DisplayValues[0]+'''';
if RxDBLookupCombo7.DisplayValues[1]<>''then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo7.DisplayValues[1]+'''';
{
if Trim(Edit20.Text)<>'' then begin
str_fee:=str_fee+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit20.Text)+''')';
end;
}
str_op:='';
if Edit4.text<>''then
str_op:=str_op+' and t_op_seae.ί<>б<EFBFBD><D0B1><EFBFBD> like '+''''+'%'+Edit4.text+'%'+'''';
if Edit2.text<>''then
str_op:=str_op+' and t_op_seae.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5> like '+''''+'%'+Edit2.text+'%'+'''';
if Edit13.text<>''then
str_op:=str_op+' and t_op_seae.<2E><><EFBFBD>쵥<EFBFBD><ECB5A5> like '+''''+'%'+Edit13.text+'%'+'''';
if Edit32.text<>''then
str_op:=str_op+' and t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> like '+''''+'%'+Edit32.text+'%'+'''';
if Edit3.text<>''then
str_op:=str_op+' and t_op_seae.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5> like '+''''+'%'+Edit3.text+'%'+'''';
if Edit21.text<>''then
str_op:=str_op+' and t_op_seae.<2E><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD> like '+''''+'%'+Edit21.text+'%'+'''';
if wwDBLookupCombo1.text<>''then
str_op:=str_op+' and t_op_seae.<2E><><EFBFBD><EFBFBD> like '+''''+'%'+wwDBLookupCombo1.text+'%'+'''';
if Edit31.text<>''then
str_op:=str_op+' and t_op_seae.<2E><><EFBFBD><EFBFBD> like '+''''+'%'+Edit31.text+'%'+'''';
if wwDBDateTimePicker1.text<>''then
str_op:=str_op+' and t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker1.text+'''';
if wwDBDateTimePicker2.text<>''then
str_op:=str_op+' and t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker2.text+'''';
if wwDBDateTimePicker3.text<>''then
str_op:=str_op+' and t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>='+''''+wwDBDateTimePicker3.text+'''';
if wwDBDateTimePicker4.text<>''then
str_op:=str_op+' and t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><='+''''+wwDBDateTimePicker4.text+'''';
if Trim(Edit20.Text)<>'' then begin
str_op:=str_op+' and <20><><EFBFBD><EFBFBD> in (select distinct <20><><EFBFBD><EFBFBD> from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit20.Text)+''')';
end;
if strtoint(bs_text.text)=8 then
str_op:='where t_op_seae.<2E><><EFBFBD><EFBFBD>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and t_op_seae.<2E><><EFBFBD><EFBFBD> in (select distinct <20><><EFBFBD><EFBFBD> from v_ch_fee '+str_fee+')'+str_op
else begin
str_op:='where t_op_seae.<2E><><EFBFBD><EFBFBD> in (select distinct <20><><EFBFBD><EFBFBD> from v_ch_fee '+str_fee+')'+str_op;
end;
case strtoint(bs_text.text) of
1,7:
begin
str_op:=str_op+' and '+open_data('1002','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>Ա','<27>ͷ<EFBFBD>Ա','<27><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
2,6:
begin
str_op:=str_op+' and '+open_data('1004','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>Ա','<27>ͷ<EFBFBD>Ա','<27><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
3,4:
begin
str_op:=str_op+' and '+open_data('1003','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>Ա','<27>ͷ<EFBFBD>Ա','<27><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
end;
op_str:='select * from t_op_seae '+str_op
+default_sort(53,'t_op_seae','','desc');
case strtoint(bs_text.text) of
1:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-<2D><><EFBFBD>뿪Ʊ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit19.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit19.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-<2D><><EFBFBD>뿪Ʊ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end;
7:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-<2D><><EFBFBD>뿪Ʊ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit20.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit20.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-<2D><><EFBFBD>뿪Ʊ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit20.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit20.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit20.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit20.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit20.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit20.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit20.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit20.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+str_fee+' and <20><><EFBFBD><EFBFBD> in (select <20><><EFBFBD><EFBFBD> from t_op_seae where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>) order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD> in (select <20><><EFBFBD><EFBFBD> from t_op_seae where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>) group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
// if (bs_text.Text<>'3') and (do_ban1.DataSet.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring<>'<27><><EFBFBD><EFBFBD>') then
// RE:=true;
try
t_rate.open;
if bsSkinTabSheet1.Showing then
begin
delete_do_type_num:=1;
if ((strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7')) then
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
str_fee:=str_fee+'and (<28><><EFBFBD><EFBFBD><><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and <20><><EFBFBD><EFBFBD><><3E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>)';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
else begin
if wwDBComboBox2.Text<>'' then begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox2.Text+'''';
end;
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
3:
begin
str_fee:='where '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'end)<>0 and ((<28><><EFBFBD><EFBFBD>>0 and <20><><EFBFBD><EFBFBD>>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (<28><><EFBFBD><EFBFBD><0 and <20><><EFBFBD><EFBFBD><=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)) '
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
else begin
if wwDBComboBox2.Text<>'' then begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox2.Text+'''';
end;
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
4:
begin
str_fee:='where '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'end)<>0 and ((<28><><EFBFBD><EFBFBD>>0 and <20><><EFBFBD><EFBFBD>>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (<28><><EFBFBD><EFBFBD><0 and <20><><EFBFBD><EFBFBD><=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)) '
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
else begin
if wwDBComboBox2.Text<>'' then begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox2.Text+'''';
end;
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
6:
begin
str_fee:='where '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'end)<>0 and ((<28><><EFBFBD><EFBFBD>>0 and <20><><EFBFBD><EFBFBD>>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (<28><><EFBFBD><EFBFBD><0 and <20><><EFBFBD><EFBFBD><=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)) '
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
str_fee:=str_fee+'and (<28><><EFBFBD><EFBFBD><><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and <20><><EFBFBD><EFBFBD><><3E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>)';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
// str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
end;
end;
{
if RxDBLookupCombo1.DisplayValues[1]<>''then
str_fee:=str_fee+' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo1.DisplayValues[1]+'''';
}
str:=Trim(ComboBoxObjseai.Text);
if (Str<>'') and (length(Str)>10) then
str_fee:=str_fee+' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+Trim(Copy(Str,11,length(Str)-10))+'''';
if RxDBLookupCombo9.DisplayValues[1]<>''then
str_fee:=str_fee+' and <20>ұ<EFBFBD>='+''''+RxDBLookupCombo9.DisplayValues[0]+'''';
if RxDBLookupCombo8.DisplayValues[1]<>''then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo8.DisplayValues[1]+'''';
{
if Trim(Edit22.Text)<>'' then begin
str_fee:=str_fee+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit22.Text)+''')';
end;
}
str_op:='';
if Edit1.text<>''then
str_op:=str_op+' and t_op_seai.ί<>б<EFBFBD><D0B1><EFBFBD> like '+''''+'%'+Edit1.text+'%'+'''';
if Edit5.text<>''then
str_op:=str_op+' and t_op_seai.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5> like '+''''+'%'+Edit5.text+'%'+'''';
if Edit14.text<>''then
str_op:=str_op+' and t_op_seai.<2E><><EFBFBD>쵥<EFBFBD><ECB5A5> like '+''''+'%'+Edit14.text+'%'+'''';
if Edit23.text<>''then
str_op:=str_op+' and t_op_seai.<2E><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD> like '+''''+'%'+Edit23.text+'%'+'''';
if Edit6.text<>''then
str_op:=str_op+' and t_op_seai.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5> like '+''''+'%'+Edit6.text+'%'+'''';
if wwDBDateTimePicker5.text<>''then
str_op:=str_op+' and t_op_seai.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker5.text+'''';
if wwDBDateTimePicker7.text<>''then
str_op:=str_op+' and t_op_seai.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker7.text+'''';
if wwDBDateTimePicker6.text<>''then
str_op:=str_op+' and t_op_seai.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>='+''''+wwDBDateTimePicker6.text+'''';
if wwDBDateTimePicker8.text<>''then
str_op:=str_op+' and t_op_seai.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><='+''''+wwDBDateTimePicker8.text+'''';
if Trim(Edit22.Text)<>'' then begin
str_op:=str_op+' and <20><><EFBFBD><EFBFBD> in (select distinct <20><><EFBFBD><EFBFBD> from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit22.Text)+''')';
end;
str_op:='where t_op_seai.<2E><><EFBFBD><EFBFBD> in (select distinct <20><><EFBFBD><EFBFBD> from v_ch_fee '+str_fee+')'+str_op;
case strtoint(bs_text.text) of
1,7:
begin
str_op:=str_op+' and '+open_data('1002','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>Ա','<27>ͷ<EFBFBD>Ա','<27><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
2:
begin
str_op:=str_op+' and '+open_data('1004','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>Ա','<27>ͷ<EFBFBD>Ա','<27><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
3,4:
begin
str_op:=str_op+' and '+open_data('1003','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>Ա','<27>ͷ<EFBFBD>Ա','<27><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
end;
op_str:='select * from t_op_seai '+str_op+default_sort(54,'t_op_seai','','desc');
case strtoint(bs_text.text) of
1:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-<2D><><EFBFBD>뿪Ʊ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit22.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit22.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-<2D><><EFBFBD>뿪Ʊ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end;
7:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-<2D><><EFBFBD>뿪Ʊ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit22.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit22.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-<2D><><EFBFBD>뿪Ʊ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit22.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit22.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit22.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit22.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit22.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit22.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit22.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit22.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
str_fee:=str_fee+'and (<28><><EFBFBD><EFBFBD><><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and <20><><EFBFBD><EFBFBD><><3E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>)';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
else begin
if wwDBComboBox3.Text<>'' then begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox3.Text+'''';
end;
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
3:
begin
str_fee:='where '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'end)<>0 and ((<28><><EFBFBD><EFBFBD>>0 and <20><><EFBFBD><EFBFBD>>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (<28><><EFBFBD><EFBFBD><0 and <20><><EFBFBD><EFBFBD><=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>))'
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
else begin
if wwDBComboBox3.Text<>'' then begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox3.Text+'''';
end;
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
4:
begin
str_fee:='where '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'end)<>0 and ((<28><><EFBFBD><EFBFBD>>0 and <20><><EFBFBD><EFBFBD>>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (<28><><EFBFBD><EFBFBD><0 and <20><><EFBFBD><EFBFBD><=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)) '
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
else begin
if wwDBComboBox3.Text<>'' then begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox3.Text+'''';
end;
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
6:
begin
str_fee:='where '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'end)<>0 and ((<28><><EFBFBD><EFBFBD>>0 and <20><><EFBFBD><EFBFBD>>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (<28><><EFBFBD><EFBFBD><0 and <20><><EFBFBD><EFBFBD><=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>))'
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
str_fee:=str_fee+'and (<28><><EFBFBD><EFBFBD><><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and <20><><EFBFBD><EFBFBD><><3E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>)';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
// if not strtobool(get_parameters_value(46,'true')) then
// str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
end;
end;
{
if RxDBLookupCombo3.DisplayValues[1]<>''then
str_fee:=str_fee+' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo3.DisplayValues[1]+'''';
}
str:=Trim(ComboBoxObjaire.Text);
if (Str<>'') and (length(Str)>10) then
str_fee:=str_fee+' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+Trim(Copy(Str,11,length(Str)-10))+'''';
if RxDBLookupCombo11.DisplayValues[1]<>''then
str_fee:=str_fee+' and <20>ұ<EFBFBD>='+''''+RxDBLookupCombo11.DisplayValues[0]+'''';
if RxDBLookupCombo10.DisplayValues[1]<>''then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo10.DisplayValues[1]+'''';
{
if Trim(Edit24.Text)<>'' then begin
str_fee:=str_fee+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit24.Text)+''')';
end;
}
str_op:='';
if Edit8.text<>''then
str_op:=str_op+' and t_op_aire.ί<>б<EFBFBD><D0B1><EFBFBD> like '+''''+'%'+Edit8.text+'%'+'''';
if Edit9.text<>''then
str_op:=str_op+' and t_op_aire.<2E><><EFBFBD>˵<EFBFBD><CBB5><EFBFBD> like '+''''+'%'+Edit9.text+'%'+'''';
if Edit10.text<>''then
str_op:=str_op+' and t_op_aire.<2E><><EFBFBD>˵<EFBFBD><CBB5><EFBFBD> like '+''''+'%'+Edit10.text+'%'+'''';
if Edit25.text<>''then
str_op:=str_op+' and t_op_aire.<2E><><EFBFBD>쵥<EFBFBD><ECB5A5> like '+''''+'%'+Edit25.text+'%'+'''';
if Edit26.text<>''then
str_op:=str_op+' and t_op_aire.<2E><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD> like '+''''+'%'+Edit26.text+'%'+'''';
if wwDBDateTimePicker9.text<>''then
str_op:=str_op+' and t_op_aire.һ<>̿<EFBFBD><CCBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker9.text+'''';
if wwDBDateTimePicker11.text<>''then
str_op:=str_op+' and t_op_aire.һ<>̿<EFBFBD><CCBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker11.text+'''';
if wwDBDateTimePicker10.text<>''then
str_op:=str_op+' and t_op_aire.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>='+''''+wwDBDateTimePicker10.text+'''';
if wwDBDateTimePicker12.text<>''then
str_op:=str_op+' and t_op_aire.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><='+''''+wwDBDateTimePicker12.text+'''';
if Trim(Edit24.Text)<>'' then begin
str_op:=str_op+' and <20><><EFBFBD><EFBFBD> in (select distinct <20><><EFBFBD><EFBFBD> from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit24.Text)+''')';
end;
str_op:='where t_op_aire.<2E><><EFBFBD><EFBFBD> in (select distinct <20><><EFBFBD><EFBFBD> from v_ch_fee '+str_fee+')'+str_op;
case strtoint(bs_text.text) of
1,7:
begin
str_op:=str_op+' and '+open_data('1002','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>Ա','<27>ͷ<EFBFBD>Ա','no','no');
end;
2:
begin
str_op:=str_op+' and '+open_data('1004','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>Ա','<27>ͷ<EFBFBD>Ա','no','no');
end;
3,4:
begin
str_op:=str_op+' and '+open_data('1003','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>Ա','<27>ͷ<EFBFBD>Ա','<27><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
end;
op_str:='select * from t_op_aire '+str_op+default_sort(55,'t_op_aire','','desc');
case strtoint(bs_text.text) of
1:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-<2D><><EFBFBD>뿪Ʊ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit24.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit24.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-<2D><><EFBFBD>뿪Ʊ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end;
7:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-<2D><><EFBFBD>뿪Ʊ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit24.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit24.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-<2D><><EFBFBD>뿪Ʊ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit24.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit24.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit24.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit24.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit24.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit24.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit24.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit24.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox4.Text+'''';
end;
end;
end;
2:
begin
str_fee:='where '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
str_fee:=str_fee+'and (<28><><EFBFBD><EFBFBD><><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and <20><><EFBFBD><EFBFBD><><3E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>)';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
else begin
if wwDBComboBox4.Text<>'' then begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox4.Text+'''';
end;
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
3:
begin
str_fee:='where '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'end)<>0 and ((<28><><EFBFBD><EFBFBD>>0 and <20><><EFBFBD><EFBFBD>>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (<28><><EFBFBD><EFBFBD><0 and <20><><EFBFBD><EFBFBD><=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)) '
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
else begin
if wwDBComboBox4.Text<>'' then begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox4.Text+'''';
end;
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
4:
begin
str_fee:='where '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'end)<>0 and ((<28><><EFBFBD><EFBFBD>>0 and <20><><EFBFBD><EFBFBD>>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (<28><><EFBFBD><EFBFBD><0 and <20><><EFBFBD><EFBFBD><=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)) '
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
else begin
if wwDBComboBox4.Text<>'' then begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox4.Text+'''';
end;
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
6:
begin
str_fee:='where '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'end)<>0 and ((<28><><EFBFBD><EFBFBD>>0 and <20><><EFBFBD><EFBFBD>>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (<28><><EFBFBD><EFBFBD><0 and <20><><EFBFBD><EFBFBD><=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)) '
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
str_fee:=str_fee+'and (<28><><EFBFBD><EFBFBD><><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and <20><><EFBFBD><EFBFBD><><3E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>)';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
// if not strtobool(get_parameters_value(46,'true')) then
// str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
end;
end;
{
if RxDBLookupCombo4.DisplayValues[1]<>''then
str_fee:=str_fee+' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo4.DisplayValues[1]+'''';
}
str:=Trim(ComboBoxObjairi.Text);
if (Str<>'') and (length(Str)>10) then
str_fee:=str_fee+' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+Trim(Copy(Str,11,length(Str)-10))+'''';
if RxDBLookupCombo13.DisplayValues[1]<>''then
str_fee:=str_fee+' and <20>ұ<EFBFBD>='+''''+RxDBLookupCombo13.DisplayValues[0]+'''';
if RxDBLookupCombo12.DisplayValues[1]<>''then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo12.DisplayValues[1]+'''';
{
if Trim(Edit27.Text)<>'' then begin
str_fee:=str_fee+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit27.Text)+''')';
end;
}
str_op:='';
if Edit7.text<>''then
str_op:=str_op+' and t_op_airi.ί<>б<EFBFBD><D0B1><EFBFBD> like '+''''+'%'+Edit7.text+'%'+'''';
if Edit11.text<>''then
str_op:=str_op+' and t_op_airi.<2E><><EFBFBD>˵<EFBFBD><CBB5><EFBFBD> like '+''''+'%'+Edit11.text+'%'+'''';
if Edit12.text<>''then
str_op:=str_op+' and t_op_airi.<2E><><EFBFBD>˵<EFBFBD><CBB5><EFBFBD> like '+''''+'%'+Edit12.text+'%'+'''';
if Edit28.text<>''then
str_op:=str_op+' and t_op_airi.<2E><><EFBFBD>쵥<EFBFBD><ECB5A5> like '+''''+'%'+Edit28.text+'%'+'''';
if Edit29.text<>''then
str_op:=str_op+' and t_op_airi.<2E><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD> like '+''''+'%'+Edit29.text+'%'+'''';
if wwDBDateTimePicker13.text<>''then
str_op:=str_op+' and t_op_airi.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker13.text+'''';
if wwDBDateTimePicker15.text<>''then
str_op:=str_op+' and t_op_airi.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker15.text+'''';
if wwDBDateTimePicker14.text<>''then
str_op:=str_op+' and t_op_airi.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>='+''''+wwDBDateTimePicker14.text+'''';
if wwDBDateTimePicker16.text<>''then
str_op:=str_op+' and t_op_airi.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><='+''''+wwDBDateTimePicker16.text+'''';
if Trim(Edit27.Text)<>'' then begin
str_op:=str_op+' and <20><><EFBFBD><EFBFBD> in (select distinct <20><><EFBFBD><EFBFBD> from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit27.Text)+''')';
end;
str_op:='where t_op_airi.<2E><><EFBFBD><EFBFBD> in (select distinct <20><><EFBFBD><EFBFBD> from v_ch_fee '+str_fee+')'+str_op;
case strtoint(bs_text.text) of
1,7:
begin
str_op:=str_op+' and '+open_data('1002','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>Ա','<27>ͷ<EFBFBD>Ա','no','no');
end;
2:
begin
str_op:=str_op+' and '+open_data('1004','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>Ա','<27>ͷ<EFBFBD>Ա','no','no');
end;
3,4:
begin
str_op:=str_op+' and '+open_data('1003','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>Ա','<27>ͷ<EFBFBD>Ա','<27><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
end;
op_str:='select * from t_op_airi '+str_op+default_sort(56,'t_op_airi','','desc');
case strtoint(bs_text.text) of
1:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-<2D><><EFBFBD>뿪Ʊ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit27.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit27.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-<2D><><EFBFBD>뿪Ʊ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end;
7:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-<2D><><EFBFBD>뿪Ʊ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit27.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit27.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-<2D><><EFBFBD>뿪Ʊ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit27.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit27.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit27.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit27.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit27.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit27.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit27.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit27.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
// if (bs_text.Text<>'3') and (do_ban1.DataSet.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring<>'<27><><EFBFBD><EFBFBD>') then
// RE:=true;
try
t_rate.open;
if bsSkinTabSheet1.Showing then
begin
delete_do_type_num:=1;
if ((strtobool(get_parameters_value(83,'false'))) and (bs_text.Text<>'1') and (bs_text.Text<>'7')) then
str_fee:='where <20><><EFBFBD><EFBFBD><>(<28><><EFBFBD>뿪Ʊ+<2B><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ<>1'
// str_fee:='where <20><><EFBFBD><EFBFBD><>(<28><><EFBFBD>뿪Ʊ+<2B><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ<>1 and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
else begin
if (wwDBComboBox31.Text<>'') and (wwDBComboBox31.text<>'ȫ<><C8AB>') then begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox31.Text+'''';
end;
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
if (strtobool(get_parameters_value(64,'false'))=true) then begin
if if_open('206') or if_open('207') or if_open('208') or if_open('209') then begin
end else begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD><>1 ';
end;
end;
{
str_fee:='where '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
else begin
if (wwDBComboBox31.Text<>'') and (wwDBComboBox31.text<>'ȫ<><C8AB>') then begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox31.Text+'''';
end;
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
if (strtobool(get_parameters_value(64,'false'))=true) then begin
if if_open('206') or if_open('207') or if_open('208') or if_open('209') then begin
end else begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD><>1 ';
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'end)<>0 and ((<28><><EFBFBD><EFBFBD>>0 and <20><><EFBFBD><EFBFBD>>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (<28><><EFBFBD><EFBFBD><0 and <20><><EFBFBD><EFBFBD><=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)) '
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
else begin
if (wwDBComboBox31.Text<>'') and (wwDBComboBox31.text<>'ȫ<><C8AB>') then begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox31.Text+'''';
end;
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
if (strtobool(get_parameters_value(64,'false'))=true) then begin
if if_open('206') or if_open('207') or if_open('208') or if_open('209') then begin
end else begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD><>1 ';
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'end)<>0 and ((<28><><EFBFBD><EFBFBD>>0 and <20><><EFBFBD><EFBFBD>>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (<28><><EFBFBD><EFBFBD><0 and <20><><EFBFBD><EFBFBD><=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>))'
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
else begin
if (wwDBComboBox31.Text<>'') and (wwDBComboBox31.text<>'ȫ<><C8AB>') then begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox31.Text+'''';
end;
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
if (strtobool(get_parameters_value(64,'false'))=true) then begin
if if_open('206') or if_open('207') or if_open('208') or if_open('209') then begin
end else begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD><>1 ';
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'end)<>0 and ((<28><><EFBFBD><EFBFBD>>0 and <20><><EFBFBD><EFBFBD>>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (<28><><EFBFBD><EFBFBD><0 and <20><><EFBFBD><EFBFBD><=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)) '
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
{ str_fee:='where '
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'end)<>0 and ((<28><><EFBFBD><EFBFBD>>0 and <20><><EFBFBD><EFBFBD>>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (<28><><EFBFBD><EFBFBD><0 and <20><><EFBFBD><EFBFBD><=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)) '
+' and <20><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
}
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
else begin
if (wwDBComboBox31.Text<>'') and (wwDBComboBox31.text<>'ȫ<><C8AB>') then begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox31.Text+'''';
end;
end;
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and <20>Ƿ<EFBFBD><C7B7>渶<>1 ';
if (strtobool(get_parameters_value(64,'false'))=true) then begin
if if_open('206') or if_open('207') or if_open('208') or if_open('209') then begin
end else begin
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD><>1 ';
end;
end;
end;
end;
{
if RxDBLookupCombo5.DisplayValues[1]<>''then
str_fee:=str_fee+' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo5.DisplayValues[1]+'''';
}
{
str:=Trim(ComboBoxObjbscard.Text);
if (Str<>'') and (length(Str)>10) then
str_fee:=str_fee+' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+Trim(Copy(Str,11,length(Str)-10))+'''';
}
if acust<>'' then
str_fee:=str_fee+' and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+acust+'''';
if RxDBLookupCombo15.DisplayValues[1]<>''then
str_fee:=str_fee+' and <20>ұ<EFBFBD>='+''''+RxDBLookupCombo15.DisplayValues[0]+'''';
if RxDBLookupCombo16.DisplayValues[1]<>''then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo16.DisplayValues[1]+'''';
if wwDBDateTimePicker21.text<>''then
str_fee:=str_fee+' and ¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker21.text+'''';
if wwDBDateTimePicker22.text<>''then
str_fee:=str_fee+' and ¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker22.text+'''';
if Trim(Edit36.Text)<>'' then begin
str_fee:=str_fee+' and EXISTS (select 1 from t_ch_fee_do d left join t_ch_invoice i on (i.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=d.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) where t_ch_fee.CH_ID=d.CH_ID AND d.<2E><><EFBFBD><EFBFBD>=1 and i.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ='''+Trim(Edit36.Text)+''')';
end;
str_op:='';
if Edit15.text<>''then
str_op:=str_op+' and v_op_bscard_all.ί<>б<EFBFBD><D0B1><EFBFBD> like '+''''+'%'+Edit15.text+'%'+'''';
if Edit34.text<>''then
str_op:=str_op+' and v_op_bscard_all.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5> like '+''''+'%'+Edit34.text+'%'+'''';
if Edit16.text<>''then
str_op:=str_op+' and (v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD> like '+''''+'%'+Edit16.text+'%'+''' or v_op_bscard_all.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5> like '+''''+'%'+Edit16.text+'%'+''' or v_op_bscard_all.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5> like '+''''+'%'+Edit16.text+'%'+''' or v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> like '+''''+'%'+Edit16.text+'%'+''' or v_op_bscard_all.ί<>б<EFBFBD><D0B1><EFBFBD> like '+''''+'%'+Edit16.text+'%'+''')';
if Edit17.text<>''then
str_op:=str_op+' and v_op_bscard_all.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5> like '+''''+'%'+Edit17.text+'%'+'''';
if Edit18.text<>''then
str_op:=str_op+' and (v_op_bscard_all.<2E><><EFBFBD>쵥<EFBFBD><ECB5A5> like '+''''+'%'+Edit18.text+'%'+''' or v_op_bscard_all.<2E><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD> like '+''''+'%'+Edit18.text+'%'+''')';
if Edit33.text<>''then
str_op:=str_op+' and v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> like '+''''+'%'+Edit33.text+'%'+'''';
if wwDBComboBox46.text<>''then
str_op:=str_op+' and v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+wwDBComboBox46.text+'''';
if DBComboBoxEh2.Text<>''then
str_op:=str_op+' and v_op_bscard_all.<2E><>Դ<EFBFBD><D4B4>ϸ='+''''+DBComboBoxEh2.Text+'''';
if Mblnos<>'' then
begin
str_op:=str_op+' and v_op_bscard_all.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5> in ('+Mblnos+')';
end;
if wwDBLookupCombo49.text<>''then
str_op:=str_op+' and v_op_bscard_all.<2E><><EFBFBD><EFBFBD> like '+''''+'%'+wwDBLookupCombo49.text+'%'+'''';
if Edit30.text<>''then
str_op:=str_op+' and v_op_bscard_all.<2E><><EFBFBD><EFBFBD> like '+''''+'%'+Edit30.text+'%'+'''';
if aCuster<>'' then
str_op:=str_op+' and v_op_bscard_all.ί<>е<EFBFBD>λ like '+''''+'%'+aCuster+'%'+'''';
{
if Edit18.text<>''then
str_op:=str_op+' and v_op_bscard.'+Label2.Caption+' like '+''''+'%'+Edit18.text+'%'+'''';
}
if wwDBDateTimePicker17.text<>''then
str_op:=str_op+' and v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker17.text+'''';
if wwDBDateTimePicker19.text<>''then
str_op:=str_op+' and v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker19.text+'''';
if wwDBDateTimePicker18.text<>''then
str_op:=str_op+' and v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>='+''''+wwDBDateTimePicker18.text+'''';
if wwDBDateTimePicker20.text<>''then
str_op:=str_op+' and v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><='+''''+wwDBDateTimePicker20.text+'''';
if wwDBComboBox5.text='<27><>' then
str_op:=str_op+' and v_op_bscard_all.<2E>Ƿ<EFBFBD><C7B7>˲<EFBFBD>=1 ';
if wwDBComboBox5.text='<27><>' then
str_op:=str_op+' and (v_op_bscard_all.<2E>Ƿ<EFBFBD><C7B7>˲<EFBFBD>=0 OR v_op_bscard_all.<2E>Ƿ<EFBFBD><C7B7>˲<EFBFBD> IS NULL) ';
if Trim(Edit19.Text)<>'' then
begin
str_op:=str_op+' and v_op_bscard_all.<2E><><EFBFBD><EFBFBD> in (select distinct <20><><EFBFBD><EFBFBD> from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit19.Text)+''')';
end;
if Trim(Edit35.Text)<>'' then
begin
str_op:=str_op+' and v_op_bscard_all.<2E><><EFBFBD><EFBFBD> in (select distinct ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_ch_fee_do where <20><><EFBFBD><EFBFBD>=1 and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> in ( select <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_ch_invoice where (<28>Ƿ<EFBFBD><C7B7>շ<EFBFBD>=0 or <20>Ƿ<EFBFBD><C7B7>շ<EFBFBD> is null) and (<28>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>=0 or <20>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD> is null ) and <20><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ='''+Trim(Edit35.Text)+'''))';
end;
if (strtoint(bs_text.text)=2) and strtobool(get_parameters_value(152,'true')) then
begin
str_op:=str_op+' and ((v_op_bscard_all.<2E><><EFBFBD><EFBFBD>״̬=''<27><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>'' and v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>'') or v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><>''<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>'')';
end;
{
if strtoint(bs_text.text)=7 then
begin
str_op:=str_op+' and v_op_bscard_all.<2E><><EFBFBD><EFBFBD>״̬ in(''<27><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>'',''<27>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>'') ';
end;
}
if strtoint(bs_text.text)=8 then
str_op:='where v_op_bscard_all.<2E><><EFBFBD><EFBFBD>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and v_op_bscard_all.<2E><><EFBFBD><EFBFBD> in (select distinct <20><><EFBFBD><EFBFBD> from v_ch_fee '+str_fee+')'+str_op
else
begin
str_op:='where v_op_bscard_all.<2E><><EFBFBD><EFBFBD> in (select distinct <20><><EFBFBD><EFBFBD> from v_ch_fee '+str_fee+')'+str_op;
end;
case strtoint(bs_text.text) of
1,7:
begin
str_op:=str_op+' and '+open_data('1002','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>Ա','<27>ͷ<EFBFBD>Ա','<27><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
sDate:=FormatDateTime('yyyy',Now);
nyear:=StrToInt64Def(sDate,2019);
nyear:=nyear+1;
sDate:=inttostr(nyear)+'-'+'01'+'-'+'01';
str_op:=str_op+' and v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><'''+sDate+'''';
end;
2,6:
begin
str_op:=str_op+' and '+open_data('1004','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>Ա','<27>ͷ<EFBFBD>Ա','<27><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
3,4:
begin
str_op:=str_op+' and '+open_data('1003','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>Ա','<27>ͷ<EFBFBD>Ա','<27><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
+',v_op_bscard_all.<2E><><EFBFBD>쵥<EFBFBD><ECB5A5>, v_op_bscard_all.<2E><><EFBFBD>ĺ<EFBFBD> as <20><><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD>ĺ<EFBFBD> as USD,v_op_bscard_all.<2E><><EFBFBD>ĺ<EFBFBD> as RMB'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN ''<27><>'' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END ) as δ<><CEB4>USD '
+','
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN ''<27><>'' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when ''RMB'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as δ<><CEB4>RMB '
+','
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN ''<27><>'' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END ) as δ<><CEB4>USD '
+','
+'SUM( CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN ''<27><>'' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when ''RMB'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END ) as δ<><CEB4>RMB '
+' from v_op_bscard_all v_op_bscard_all With(NoLock) ';
if acust<>'' then
op_str:=op_str+' Left Join t_ch_fee t_ch_fee on v_op_bscard_all.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> and t_ch_fee.<2E><><EFBFBD><EFBFBD>״̬ in(''<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'',''<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'',''<27><>ֹ<EFBFBD><EFBFBD>'') and t_ch_fee.<2E><><EFBFBD><EFBFBD><>t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+acust+''''
else
op_str:=op_str+' Left Join t_ch_fee t_ch_fee on v_op_bscard_all.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> and t_ch_fee.<2E><><EFBFBD><EFBFBD>״̬ in(''<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'',''<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'',''<27><>ֹ<EFBFBD><EFBFBD>'') and t_ch_fee.<2E><><EFBFBD><EFBFBD><>t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ';
op_str:=op_str+' Left Join t_op_gain t_op_gain on v_op_bscard_all.<2E><><EFBFBD><EFBFBD>=t_op_gain.<2E><><EFBFBD><EFBFBD> ';
op_str:=op_str
+str_op
+' group by v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.ҵ<><D2B5>״̬,v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>״̬'
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN ''<27><>'' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD>뿪Ʊ-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> else 0 end) ELSE 0 END ) as δ<><CEB4>USD '
+','
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN ''<27><>'' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when ''RMB'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD>뿪Ʊ-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as δ<><CEB4>RMB '
+','
+'SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN ''<27><>'' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD>뿪Ʊ-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> else 0 end) ELSE 0 END ) as δ<><CEB4>USD '
+','
+'SUM( CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN ''<27><>'' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when ''RMB'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD>뿪Ʊ-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> else 0 end) ELSE 0 END ) as δ<><CEB4>RMB '
+' from v_op_bscard_all v_op_bscard_all With(NoLock) ';
if acust<>'' then
op_str:=op_str+' Left Join t_ch_fee t_ch_fee on v_op_bscard_all.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> and t_ch_fee.<2E><><EFBFBD><EFBFBD>״̬ in(''<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'',''<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'',''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'',''<27><>ֹ<EFBFBD><EFBFBD>'') and t_ch_fee.<2E><><EFBFBD><EFBFBD><>(t_ch_fee.<2E><><EFBFBD>뿪Ʊ+t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) and <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+acust+''''
else
op_str:=op_str+' Left Join t_ch_fee t_ch_fee on v_op_bscard_all.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD> and t_ch_fee.<2E><><EFBFBD><EFBFBD>״̬ in(''<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'',''<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'',''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'',''<27><>ֹ<EFBFBD><EFBFBD>'') and t_ch_fee.<2E><><EFBFBD><EFBFBD><>(t_ch_fee.<2E><><EFBFBD>뿪Ʊ+t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '; //<2F><><EFBFBD><EFBFBD><>(<28><><EFBFBD>뿪Ʊ+<2B><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>)
op_str:=op_str+' Left Join t_op_gain t_op_gain on v_op_bscard_all.<2E><><EFBFBD><EFBFBD>=t_op_gain.<2E><><EFBFBD><EFBFBD> ';
op_str:=op_str
+str_op
+' group by v_op_bscard_all.<2E><><EFBFBD><EFBFBD>,v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.ҵ<><D2B5>״̬,v_op_bscard_all.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,v_op_bscard_all.<2E><><EFBFBD><EFBFBD>״̬'
+' from v_op_bscard_all v_op_bscard_all With(NoLock) '+str_op
+default_sort(53,'v_op_bscard_all','','desc');
end;
end;
{
op_str:='select * from v_op_bscard_all '+str_op
+default_sort(53,'v_op_bscard_all','','desc');
}
case strtoint(bs_text.text) of
1:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-<2D><><EFBFBD>뿪Ʊ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><>ע from t_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit19.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit19.Text)+''')';
end;
if Trim(Edit35.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select ch_id from t_ch_fee_do where <20><><EFBFBD><EFBFBD>=1 and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> in ( select <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_ch_invoice where (<28>Ƿ<EFBFBD><C7B7>շ<EFBFBD>=0 or <20>Ƿ<EFBFBD><C7B7>շ<EFBFBD> is null) and (<28>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>=0 or <20>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD> is null ) and <20><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ='''+Trim(Edit35.Text)+'''))';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-<2D><><EFBFBD>뿪Ʊ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
end;
7:
begin
fee_str:='select <20><><EFBFBD><EFBFBD>,CH_ID,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-<2D><><EFBFBD>뿪Ʊ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><>ע from t_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit19.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit19.Text)+''')';
end;
if Trim(Edit35.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select ch_id from t_ch_fee_do where <20><><EFBFBD><EFBFBD>=1 and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> in ( select <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_ch_invoice where (<28>Ƿ<EFBFBD><C7B7>շ<EFBFBD>=0 or <20>Ƿ<EFBFBD><C7B7>շ<EFBFBD> is null) and (<28>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>=0 or <20>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD> is null ) and <20><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ='''+Trim(Edit35.Text)+'''))';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-<2D><><EFBFBD>뿪Ʊ) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit19.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit19.Text)+''')';
end;
if Trim(Edit35.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select ch_id from t_ch_fee_do where <20><><EFBFBD><EFBFBD>=1 and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> in ( select <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_ch_invoice where (<28>Ƿ<EFBFBD><C7B7>շ<EFBFBD>=0 or <20>Ƿ<EFBFBD><C7B7>շ<EFBFBD> is null) and (<28>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>=0 or <20>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD> is null ) and <20><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ='''+Trim(Edit35.Text)+'''))';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit19.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit19.Text)+''')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit19.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit19.Text)+''')';
end;
if Trim(Edit35.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select ch_id from t_ch_fee_do where <20><><EFBFBD><EFBFBD>=1 and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> in ( select <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_ch_invoice where (<28>Ƿ<EFBFBD><C7B7>շ<EFBFBD>=0 or <20>Ƿ<EFBFBD><C7B7>շ<EFBFBD> is null) and (<28>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>=0 or <20>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD> is null ) and <20><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ='''+Trim(Edit35.Text)+'''))';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit19.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit19.Text)+''')';
end;
if Trim(Edit35.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select ch_id from t_ch_fee_do where <20><><EFBFBD><EFBFBD>=1 and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> in ( select <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_ch_invoice where (<28>Ƿ<EFBFBD><C7B7>շ<EFBFBD>=0 or <20>Ƿ<EFBFBD><C7B7>շ<EFBFBD> is null) and (<28>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>=0 or <20>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD> is null ) and <20><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ='''+Trim(Edit35.Text)+'''))';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>';
if Trim(Edit19.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select CH_ID from v_dui_fee where <20><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>='''+Trim(Edit19.Text)+''')';
end;
if Trim(Edit35.Text)<>'' then begin
fee_str:=fee_str+' and CH_ID in (select ch_id from t_ch_fee_do where <20><><EFBFBD><EFBFBD>=1 and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> in ( select <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_ch_invoice where (<28>Ƿ<EFBFBD><C7B7>շ<EFBFBD>=0 or <20>Ƿ<EFBFBD><C7B7>շ<EFBFBD> is null) and (<28>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>=0 or <20>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD> is null ) and <20><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> ='''+Trim(Edit35.Text)+'''))';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD> group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+str_fee+' and <20><><EFBFBD><EFBFBD> in (select <20><><EFBFBD><EFBFBD> from v_op_bscard_all where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>) order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'end) as δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from v_ch_fee '
+str_fee+' and <20><><EFBFBD><EFBFBD> in (select <20><><EFBFBD><EFBFBD> from v_op_bscard_all where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:<3A><><EFBFBD><EFBFBD>) group by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> order by <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>';
str_fee:=' and c.<2E><><EFBFBD><EFBFBD><>(c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>+c.<2E><><EFBFBD>뿪Ʊ) and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
7:
begin
str_fee:=' and c.<2E><><EFBFBD><EFBFBD><>(c.<2E><><EFBFBD>뿪Ʊ+c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
2:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
3,8:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'end)<>0 and ((<28><><EFBFBD><EFBFBD>>0 and <20><><EFBFBD><EFBFBD>>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (<28><><EFBFBD><EFBFBD><0 and <20><><EFBFBD><EFBFBD><=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)) '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
4:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'end)<>0 and ((<28><><EFBFBD><EFBFBD>>0 and <20><><EFBFBD><EFBFBD>>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (<28><><EFBFBD><EFBFBD><0 and <20><><EFBFBD><EFBFBD><=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>))'
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
6:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
end;
if RxDBLookupCombo15.DisplayValues[1]<>''then
str_fee:=str_fee+' and c.<2E>ұ<EFBFBD>='+''''+RxDBLookupCombo15.DisplayValues[0]+'''';
if RxDBLookupCombo16.DisplayValues[1]<>''then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo16.DisplayValues[1]+'''';
if (wwDBComboBox31.Text<>'') and (wwDBComboBox31.text<>'ȫ<><C8AB>') then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox31.Text+'''';
if Edit15.text<>''then
str_fee:=str_fee+' and b.ί<>б<EFBFBD><D0B1><EFBFBD> like '+''''+'%'+Edit15.text+'%'+'''';
if Edit34.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5> like '+''''+'%'+Edit34.text+'%'+'''';
if Edit16.text<>''then
str_fee:=str_fee+' and (b.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5> like '+''''+'%'+Edit16.text+'%'+''' or b.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5> like '+''''+'%'+Edit16.text+'%'+''' or b.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> like '+''''+'%'+Edit16.text+'%'+''' or b.ί<>б<EFBFBD><D0B1><EFBFBD> like '+''''+'%'+Edit16.text+'%'+''')';
if Edit17.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD>쵥<EFBFBD><ECB5A5> like '+''''+'%'+Edit17.text+'%'+'''';
if wwDBComboBox46.text<>''then
str_fee:=str_fee+' and b.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+wwDBComboBox46.text+'''';
if Edit18.text<>''then
str_fee:=str_fee+' and b.'+Label2.Caption+' like '+''''+'%'+Edit18.text+'%'+'''';
if wwDBLookupCombo49.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD> like '+''''+'%'+wwDBLookupCombo49.text+'%'+'''';
if Edit30.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD> like '+''''+'%'+Edit30.text+'%'+'''';
if wwDBDateTimePicker17.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker17.text+'''';
if wwDBDateTimePicker19.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker19.text+'''';
if wwDBDateTimePicker18.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>='+''''+wwDBDateTimePicker18.text+'''';
if wwDBDateTimePicker20.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><='+''''+wwDBDateTimePicker20.text+'''';
str_fee:=' and c.<2E><><EFBFBD><EFBFBD><>(c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>+c.<2E><><EFBFBD>뿪Ʊ) and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
7:
begin
str_fee:=' and c.<2E><><EFBFBD><EFBFBD><>(c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>+c.<2E><><EFBFBD>뿪Ʊ) and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
2:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
3:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
4:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
6:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
// if not strtobool(get_parameters_value(46,'true')) then
// str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
end;
end;
if Edit7.text<>''then
str_fee:=str_fee+' and b.ί<>б<EFBFBD><D0B1><EFBFBD> like '+''''+'%'+Edit7.text+'%'+'''';
if Edit11.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD>˵<EFBFBD><CBB5><EFBFBD> like '+''''+'%'+Edit11.text+'%'+'''';
if Edit12.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD>˵<EFBFBD><CBB5><EFBFBD> like '+''''+'%'+Edit12.text+'%'+'''';
if wwDBDateTimePicker13.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker13.text+'''';
if wwDBDateTimePicker15.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker15.text+'''';
if wwDBDateTimePicker14.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>='+''''+wwDBDateTimePicker14.text+'''';
if wwDBDateTimePicker16.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><='+''''+wwDBDateTimePicker16.text+'''';
str_fee:=' and c.<2E><><EFBFBD><EFBFBD><>(c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>+c.<2E><><EFBFBD>뿪Ʊ) and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
7:
begin
str_fee:=' and c.<2E><><EFBFBD><EFBFBD><>(c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>+c.<2E><><EFBFBD>뿪Ʊ) and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
2:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
3:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
4:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
6:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
// if not strtobool(get_parameters_value(46,'true')) then
// str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
end;
end;
if Edit8.text<>''then
str_fee:=str_fee+' and b.ί<>б<EFBFBD><D0B1><EFBFBD> like '+''''+'%'+Edit8.text+'%'+'''';
if Edit9.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD>˵<EFBFBD><CBB5><EFBFBD> like '+''''+'%'+Edit9.text+'%'+'''';
if Edit10.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD>˵<EFBFBD><CBB5><EFBFBD> like '+''''+'%'+Edit10.text+'%'+'''';
if wwDBDateTimePicker9.text<>''then
str_fee:=str_fee+' and b.һ<>̿<EFBFBD><CCBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker9.text+'''';
if wwDBDateTimePicker11.text<>''then
str_fee:=str_fee+' and b.һ<>̿<EFBFBD><CCBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker11.text+'''';
if wwDBDateTimePicker10.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>='+''''+wwDBDateTimePicker10.text+'''';
if wwDBDateTimePicker12.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><='+''''+wwDBDateTimePicker12.text+'''';
str_fee:=' and c.<2E><><EFBFBD><EFBFBD><>(c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>+c.<2E><><EFBFBD>뿪Ʊ) and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
7:
begin
str_fee:=' and c.<2E><><EFBFBD><EFBFBD><>(c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>+c.<2E><><EFBFBD>뿪Ʊ) and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
2:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
3:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
4:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
6:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
// str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
end;
end;
if Edit1.text<>''then
str_fee:=str_fee+' and b.ί<>б<EFBFBD><D0B1><EFBFBD> like '+''''+'%'+Edit1.text+'%'+'''';
if Edit5.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5> like '+''''+'%'+Edit5.text+'%'+'''';
if Edit14.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD>쵥<EFBFBD><ECB5A5> like '+''''+'%'+Edit14.text+'%'+'''';
if Edit6.text<>''then
str_fee:=str_fee+' and b.'+Label6.Caption+' like '+''''+'%'+Edit6.text+'%'+'''';
if wwDBDateTimePicker5.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker5.text+'''';
if wwDBDateTimePicker7.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker7.text+'''';
if wwDBDateTimePicker6.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>='+''''+wwDBDateTimePicker6.text+'''';
if wwDBDateTimePicker8.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><='+''''+wwDBDateTimePicker8.text+'''';
str_fee:=' and c.<2E><><EFBFBD><EFBFBD><>(c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>+c.<2E><><EFBFBD>뿪Ʊ) and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
7:
begin
str_fee:=' and c.<2E><><EFBFBD><EFBFBD><>(c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>+c.<2E><><EFBFBD>뿪Ʊ) and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
2:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
3,8:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
4:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
6:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
// if not strtobool(get_parameters_value(46,'true')) then
// str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
end;
end;
if Edit4.text<>''then
str_fee:=str_fee+' and b.ί<>б<EFBFBD><D0B1><EFBFBD> like '+''''+'%'+Edit4.text+'%'+'''';
if Edit2.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5> like '+''''+'%'+Edit2.text+'%'+'''';
if Edit13.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD>쵥<EFBFBD><ECB5A5> like '+''''+'%'+Edit13.text+'%'+'''';
if Edit3.text<>''then
str_fee:=str_fee+' and b.'+Label2.Caption+' like '+''''+'%'+Edit3.text+'%'+'''';
if wwDBDateTimePicker1.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker1.text+'''';
if wwDBDateTimePicker2.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker2.text+'''';
if wwDBDateTimePicker3.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>='+''''+wwDBDateTimePicker3.text+'''';
if wwDBDateTimePicker4.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><='+''''+wwDBDateTimePicker4.text+'''';
str_fee:=' and c.<2E><><EFBFBD><EFBFBD><>(c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>+c.<2E><><EFBFBD>뿪Ʊ) and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
7:
begin
str_fee:=' and c.<2E><><EFBFBD><EFBFBD><>(c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>+c.<2E><><EFBFBD>뿪Ʊ) and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
2:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
3,8:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
4:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
if not strtobool(get_parameters_value(46,'true')) then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
6:
begin
str_fee:=' and '
+'(case c.<2E><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'else(case when c.<2E><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(c.<2E><><EFBFBD><EFBFBD>-c.<2E><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+' and c.<2E><><EFBFBD><EFBFBD>״̬ in ('+''''+'<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'+''''+','+''''+'<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''
+','+''''+'<27><>ֹ<EFBFBD><EFBFBD>'+''''+')';
if not bsSkinCheckRadioBox4.Checked then
str_fee:=str_fee+' and c.<2E>Ƿ<EFBFBD><C7B7>渶<>1 ';
end;
end;
if RxDBLookupCombo15.DisplayValues[1]<>''then
str_fee:=str_fee+' and c.<2E>ұ<EFBFBD>='+''''+RxDBLookupCombo15.DisplayValues[0]+'''';
if RxDBLookupCombo16.DisplayValues[1]<>''then
str_fee:=str_fee+' and c.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo16.DisplayValues[1]+'''';
if (wwDBComboBox31.Text<>'') and (wwDBComboBox31.text<>'ȫ<><C8AB>') then
str_fee:=str_fee+' and <20><><EFBFBD><EFBFBD>='+''''+wwDBComboBox31.Text+'''';
if Edit15.text<>''then
str_fee:=str_fee+' and b.ί<>б<EFBFBD><D0B1><EFBFBD> like '+''''+'%'+Edit15.text+'%'+'''';
if Edit16.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5> like '+''''+'%'+Edit16.text+'%'+'''';
if Edit17.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD>쵥<EFBFBD><ECB5A5> like '+''''+'%'+Edit17.text+'%'+'''';
if wwDBComboBox46.text<>''then
str_fee:=str_fee+' and b.ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+wwDBComboBox46.text+'''';
if Edit18.text<>''then
str_fee:=str_fee+' and b.'+Label2.Caption+' like '+''''+'%'+Edit18.text+'%'+'''';
if wwDBDateTimePicker17.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker17.text+'''';
if wwDBDateTimePicker19.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker19.text+'''';
if wwDBDateTimePicker18.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>='+''''+wwDBDateTimePicker18.text+'''';
if wwDBDateTimePicker20.text<>''then
str_fee:=str_fee+' and b.<2E><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><='+''''+wwDBDateTimePicker20.text+'''';
SQL.Add('Select <20><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C>ո<EFBFBD><D5B8><EFBFBD><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD> from v_fee_do_dc where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+sno+'''');
sql.add('when t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> in (''<27><><EFBFBD><EFBFBD><EFBFBD>յ<EFBFBD><D5B5><EFBFBD>'',''ŷ<><EFBFBD><DEB7><EFBFBD><EFBFBD>뾳ժҪ<D5AA>յ<EFBFBD><D5B5><EFBFBD>'',''ŷ<>˷<EFBFBD><CBB7><EFBFBD><EFBFBD>뾳ժҪ<D5AA>ֵ<EFBFBD><D6B5><EFBFBD>'',''<27><><EFBFBD><EFBFBD>˾<EFBFBD>յ<EFBFBD><D5B5><EFBFBD>'') then ''<27>յ<EFBFBD><D5B5><EFBFBD>''');
sql.add('else case when t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''CFS<46><53>'' then ''<27><>վ<EFBFBD><D5BE>''');
sql.add(' and t_ch_fee.<2E><><EFBFBD><EFBFBD>״̬ in (''<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'',''<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'',''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'',''<27><>ֹɾ<D6B9><C9BE>'',''<27><>ֹ<EFBFBD><EFBFBD>'') and t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<27><>'' ');
{
sDate:=FormatDateTime('YYYY',Now);
nyear:=StrToInt64(sDate);
nyear:=nyear+1;
sDate:=inttostr(nyear)+'-'+'01'+'01';
str_op:=str_op+' and v_op_bscard_all.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><'''+sDate+'''';
sql.add(' and t_ch_fee.<2E><><EFBFBD><EFBFBD><>(t_ch_fee.<2E><><EFBFBD>뿪Ʊ+t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>)');
}
end;
3: begin
sql.add('and ');
sql.add('(case <20><><EFBFBD><EFBFBD> when ''<27><>'' then (case when <20><><EFBFBD><EFBFBD>>0 then ');
sql.add('(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) ');
sql.add(' ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) ');
sql.add(' THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) ');
sql.add(' else(case when <20><><EFBFBD><EFBFBD>>0 then ');
sql.add(' (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) ');
sql.add(' ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) ');
sql.add(' THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) ');
sql.add('end)<>0 and ((<28><><EFBFBD><EFBFBD>>0 and <20><><EFBFBD><EFBFBD>>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (<28><><EFBFBD><EFBFBD><0 and <20><><EFBFBD><EFBFBD><=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)) ');
sql.add(' and t_ch_fee.<2E><><EFBFBD><EFBFBD>״̬ in (''<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'',''<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'',''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'',''<27><>ֹɾ<D6B9><C9BE>'',''<27><>ֹ<EFBFBD><EFBFBD>'') and t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<27><>'' ');
end;
4: begin
sql.add('and ');
sql.add('(case <20><><EFBFBD><EFBFBD> when ''<27><>'' then (case when <20><><EFBFBD><EFBFBD>>0 then ');
sql.add('(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) ');
sql.add(' ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) ');
sql.add(' THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) ');
sql.add(' else(case when <20><><EFBFBD><EFBFBD>>0 then ');
sql.add(' (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) ');
sql.add(' ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) ');
sql.add(' THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) ');
sql.add('end)<>0 and ((<28><><EFBFBD><EFBFBD>>0 and <20><><EFBFBD><EFBFBD>>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (<28><><EFBFBD><EFBFBD><0 and <20><><EFBFBD><EFBFBD><=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)) ');
sql.add(' and t_ch_fee.<2E><><EFBFBD><EFBFBD>״̬ in (''<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'',''<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'',''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'',''<27><>ֹɾ<D6B9><C9BE>'',''<27><>ֹ<EFBFBD><EFBFBD>'') and t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<27><>'' ');
end
end;
open;First;
while not Eof do
begin
if kbmbscard.Locate('MBLNO;FeeName;AMT;CURRENCY;ISOK',vararrayof([trim(FieldByName('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').AsString),FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString,FieldByName('<27><><EFBFBD><EFBFBD>').AsString,FieldByName('<27>ұ<EFBFBD>').AsString,false]),[]) then
sql.add(', SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN ''<27><>'' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when ''RMB'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD>뿪Ʊ else 0 end) ELSE 0 END ) as <20><><EFBFBD><EFBFBD> ');
sql.add(',');
sql.add('SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN ''<27><>'' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD>뿪Ʊ else 0 end) ELSE 0 END) as <20><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD> ');
end;
3: begin
sql.add(', SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN ''<27><>'' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when ''RMB'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END ) as <20><><EFBFBD><EFBFBD> ');
sql.add(',');
sql.add('SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN ''<27><>'' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD> ');
end;
4: begin
sql.add(', SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN ''<27><>'' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when ''RMB'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END ) as <20><><EFBFBD><EFBFBD> ');
sql.add(',');
sql.add('SUM(CASE t_ch_fee.<2E><><EFBFBD><EFBFBD> WHEN ''<27><>'' THEN (case t_ch_fee.<2E>ұ<EFBFBD> when ''USD'' then t_ch_fee.<2E><><EFBFBD><EFBFBD>-t_ch_fee.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> else 0 end) ELSE 0 END) as <20><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD> ');
end;
end;
sql.add('from t_op_seae ');
sql.add('Left Join t_ch_fee on t_op_seae.<2E><><EFBFBD><EFBFBD>=t_ch_fee.<2E><><EFBFBD><EFBFBD>');
sql.add(' and t_ch_fee.<2E><><EFBFBD><EFBFBD>״̬ in (''<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'',''<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'',''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'',''<27><>ֹɾ<D6B9><C9BE>'',''<27><>ֹ<EFBFBD><EFBFBD>'') and t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<27><>'' ');
end;
3: begin
sql.add('and ');
sql.add('(case <20><><EFBFBD><EFBFBD> when ''<27><>'' then (case when <20><><EFBFBD><EFBFBD>>0 then ');
sql.add('(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) ');
sql.add(' ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) ');
sql.add(' THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>) end) end) ');
sql.add(' else(case when <20><><EFBFBD><EFBFBD>>0 then ');
sql.add(' (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) ');
sql.add(' ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) ');
sql.add(' THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) ');
sql.add('end)<>0 and ((<28><><EFBFBD><EFBFBD>>0 and <20><><EFBFBD><EFBFBD>>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (<28><><EFBFBD><EFBFBD><0 and <20><><EFBFBD><EFBFBD><=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)) ');
sql.add(' and t_ch_fee.<2E><><EFBFBD><EFBFBD>״̬ in (''<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'',''<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'',''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'',''<27><>ֹɾ<D6B9><C9BE>'',''<27><>ֹ<EFBFBD><EFBFBD>'') and t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<27><>'' ');
end;
4: begin
sql.add('and ');
sql.add('(case <20><><EFBFBD><EFBFBD> when ''<27><>'' then (case when <20><><EFBFBD><EFBFBD>>0 then ');
sql.add('(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ');
sql.add(' ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ');
sql.add(' THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) end) ');
sql.add(' else(case when <20><><EFBFBD><EFBFBD>>0 then ');
sql.add(' (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) ');
sql.add(' ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) ');
sql.add(' THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) end) end) ');
sql.add('end)<>0 and ((<28><><EFBFBD><EFBFBD>>0 and <20><><EFBFBD><EFBFBD>>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) or (<28><><EFBFBD><EFBFBD><0 and <20><><EFBFBD><EFBFBD><=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)) ');
sql.add(' and t_ch_fee.<2E><><EFBFBD><EFBFBD>״̬ in (''<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'',''<27><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>'',''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'',''<27><>ֹɾ<D6B9><C9BE>'',''<27><>ֹ<EFBFBD><EFBFBD>'') and t_ch_fee.<2E><><EFBFBD><EFBFBD>=''<27><>'' ');
end
end;
sql.add('Group by t_op_seae.<2E><><EFBFBD>ᵥ<EFBFBD><E1B5A5>,t_op_seae.<2E><><EFBFBD><EFBFBD>Ա,t_op_seae.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
// showmessage(SQL.Text);
open;First;
while not Eof do
begin
if kbmbscardttl.Locate('MBLNO;AMT;USDAMT',vararrayof([FieldByName('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').AsString,FormatFloat('0.00;-0.00;0.00',FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat),FormatFloat('0.00;-0.00;0.00',FieldByName('<27><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>').AsFloat)]),[]) then
+'(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+' and <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+'''' ;
if kbmbscardFee.FieldByName('FeeNames').AsString<>'' then
begin
fee_str:=fee_str+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> in ('+kbmbscardFee.FieldByName('FeeNames').AsString+')';
end;
fee_str:=fee_str+' order by CH_ID';
sum_str:='select <20><><EFBFBD><EFBFBD>,<2C>ұ<EFBFBD>,sum(<28><><EFBFBD><EFBFBD>) as <20><><EFBFBD><EFBFBD>,sum(case <20><><EFBFBD><EFBFBD> when '+''''+'<27><>'+''''+' then (case when <20><><EFBFBD><EFBFBD>>0 then '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) '
+'(CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) THEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
+'ELSE (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) end) else (CASE WHEN (<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)>(<28><><EFBFBD><EFBFBD>-<2D><><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD>) '
aAdoQuery.SQL.Text:='select <20><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>Ա,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>״̬ from t_op_seae where <20><><EFBFBD>ᵥ<EFBFBD><E1B5A5>='''+kbmVsl.FieldByName('MBLNO').AsString+''' AND ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27><>ͨ<EFBFBD><CDA8>'' ';