select1from(select xx.feiyongje
from gg_wj_zjwj wj,
gg_zjwj_yjcssgyfy2 fy,
gg_zjwj_yjcssgyfy_tkxx xx
where wj.shenqingh = {string}
and wj.rid = {long}
and wj.wenjianjghsjbkey = fy.gg_zjwj_yjcssgyfy2_key
and fy.gg_zjwj_yjcssgyfy2_key = xx.gg_zjwj_yjcssgyfy2_key
and xx.feiyongzl in('40872083405399','40872083415399','40872083425399','40872083525381','40872083535382','40872083545383')) e
where e.feiyongje <=(selectsum(dsx.jiaofeije)from gg_fy_dsxfyjlb dsx,
gg_wj_zjwj wj,
gg_zjwj_yjcssgyfy2 fy,
gg_zjwj_yjcssgyfy_tkxx xx
where wj.shenqingh = {string}
and wj.rid = {long}
and wj.wenjianjghsjbkey = fy.gg_zjwj_yjcssgyfy2_key
and fy.gg_zjwj_yjcssgyfy2_key = xx.gg_zjwj_yjcssgyfy2_key
and(dsx.feiyongzldm between'40872083405340'and'40872083425379'or
dsx.feiyongzldm in('40872083525381','40872083535382','40872083545383'))and dsx.shenqingh = wj.shenqingh
and dsx.shoujuh = xx.feiyongsjh)