--查自身结转数量是否不正确
select shqjzhshl,cwjcsl+cksl-bqrsh,bqrsh-cksl, from ymjzhk where spid='SPH00000562' order by jzhh desc
--检查结转库与流水库结转数据是否一致
select jzhh,sum(rkshl),sum(chkshl),sum(rkshl)-sum(chkshl) From splsk where spid='SPH00000562' group by jzhh order by jzhh desc
--对比发现JZH00000040结转库cksl多出了90
--备份要更新数据
select into fr_ymjzhk20190102_SPH00000562 from ymjzhk where spid='SPH00000562' and nian='2018' order by jzhh desc
--更新数据
update ymjzhk set cksl=1616-90,bqxsshl=1616-90,bqysh=bqysh+90,cwjcsl=cwjcsl+90 where spid='SPH00000562' and jzhh='JZH00000040'
update ymjzhk set shqjzhshl=shqjzhshl+90,bqysh=bqysh+90,cwjcsl=cwjcsl+90 where spid='SPH00000562' and jzhh='JZH00000041'
update ymjzhk set shqjzhshl=shqjzhshl+90,bqysh=bqysh+90,cwjcsl=cwjcsl+90 where spid='SPH00000562' and jzhh='JZH00000042'
update ymjzhk set shqjzhshl=shqjzhshl+90,bqysh=bqysh+90,cwjcsl=cwjcsl+90 where spid='SPH00000562' and jzhh='JZH00000043'
update ymjzhk set shqjzhshl=shqjzhshl+90,bqysh=bqysh+90,cwjcsl=cwjcsl+90 where spid='SPH00000562' and jzhh='JZH00000044'
update ymjzhk set shqjzhshl=shqjzhshl+90,bqysh=bqysh+90,cwjcsl=cwjcsl+90 where spid='SPH00000562' and jzhh='JZH00000045'
update ymjzhk set shqjzhshl=shqjzhshl+90,bqysh=bqysh+90,cwjcsl=cwjcsl+90 where spid='SPH00000562' and jzhh='JZH00000046'
update ymjzhk set shqjzhshl=shqjzhshl+90,bqysh=bqysh+90,cwjcsl=cwjcsl+90 where spid='SPH00000562' and jzhh='JZH00000047'
--更新结转数量(容易遗忘)
update spkfjc set shqjzhshl=230+90 where spid='SPH00000562'
update hwsp set jzshl=230+90 where spid='SPH00000562' and hw='HWI00000025'
--检查所有结转数量是否正确
select * from spkfjc where cwsqjzsl<>kcshl
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。