[阅读: 420] 2005-03-21 00:57:16
select s.splsid,
s.wzjbxxId,
s.SpZt,
s.splzbID,
s.StepID,
s.StartTime,
(select top 1 stepid
from spldyb
where splzbid = s.splzbid
and stepid > s.stepid
order by stepid asc) nextStepid,
s.dqtpzt, -- 当前票数
d.tptgbl, -- 投票通过比率
(select count(1)
from groupitem
where groupid =1 ) tprs, -- 投票人数
--d.tptgbl/tprs dqbl, -- 当前投票通过比率
w.zt,
w.zz,
w.gpdm,
w.gpmc,
w.xghy,
w.bgrq,
w.bgflmc,
w.tzjymc,
w.zyxmc,
w.wzmjmc
from spls s, vwwzjbxx2 w, spldyb d
where d.splx = 2
and d.groupRoleID like '%1%'
and s.splzbid = d.splzbid
and s.stepid = d.stepid
and s.Spzt in (1)
and s.IsStepFinish = 0
and s.splsid not in (select splsid from tpls where tprid = 220)
and s.stepid <> 99
and w.wzjbxxid = s.wzjbxxid
and w.scbz <> 1