当前位置:网站首页>Expenditure budget and adjustment records and use records output use progress construction process records
Expenditure budget and adjustment records and use records output use progress construction process records
2022-06-22 01:41:00 【51CTO】
Requirements describe :
Budget data of funds are available 、 Expenditure adjustment records 、 Expenditure use records , The demand output view shows the progress of fund utilization .
That is, the budget amount 、 Adjusted amount 、 Use frozen amount 、 Amount used 、 Remaining available amount .
Related blueprints :

Demand analysis :
- Basic data : project 、 Budget dimension 、 subject 、 Subject type 、 year
- Budget amount : Source budget data .
- Adjusted amount : Budget amount + Total adjustment
- Freezing amount : Total source usage records ( state : Under approval / frozen ).
- Amount used : Source usage records ( state : complete / Deduction )
- Remaining available amount : amount of money + Adjustment amount + Reduced amount - Freezing amount - Amount used .
Output ideas :
- Adjustment records may have new accounts , So budget data + Adjustment record After the weight is removed, a complete project - subject - Chronology :union.
- After that, the budget amount of the left splicing 、 Adjustment amount 、 Freezing amount 、 Amount used .
- Then calculate the adjusted amount 、 Remaining available amount .
- The budget dimension is... Of the total budget , The year is empty .
- Output result splice item type , Used to calculate total direct expenses and total indirect expenses .
Output record :
1.1 Get budget data tables and fields :uf_jfys xm,km,nf,je,bzlc, ytsmjcsyj
1.2 Get adjustment record table and fields :uf_jftzls xm,km,nf,dzje,zt
1.3 Get usage record tables and fields :uf_jfsyls xm,km,nf,je, zt
1.4 Get account information table and fields :uf_km id,kmlx
1.5 Get project information tables and fields :uf_jfsb id,yswd
2.1 Get the complete project - subject - year
Budget data :select xm,km,nf from uf_jfys

Adjust the data :select xm,km,nf from uf_jftzls

Splicing :select xm,km,nf from uf_jfysunion select xm,km,nf from uf_jftzls

3.1 Splicing project budget dimensions
SELECT
t1.xm,
t1.km,
t1.nf,
xm.yswd
FROM
( SELECT xm, km, nf FROM uf_jfys UNION SELECT xm, km, nf FROM uf_jftzls ) t1
LEFT JOIN uf_jfsb xm ON xm.id = t1.xm

3.2 Splicing account types
SELECT
t1.xm,
t1.km,
t1.nf,
xm.yswd,
km.kmlx
FROM
( SELECT xm, km, nf FROM uf_jfys UNION SELECT xm, km, nf FROM uf_jftzls ) t1
LEFT JOIN uf_jfsb xm ON xm.id = t1.xm
LEFT JOIN uf_km km ON km.id = t1.km

4.1 Splicing budgeting
SELECT
t1.xm,
t1.km,
t1.nf,
xm.yswd,
km.kmlx,
ys.je,
ys.bzlc,
ys.ytsmjcsyj
FROM
( SELECT xm, km, nf FROM uf_jfys UNION SELECT xm, km, nf FROM uf_jftzls ) t1
LEFT JOIN uf_jfsb xm ON xm.id = t1.xm
LEFT JOIN uf_km km ON km.id = t1.km
LEFT JOIN uf_jfys ys ON ys.xm = t1.xm
AND ys.km = t1.km
AND ys.nf = t1.nf

5.1 Calculate the adjustment amount before splicing the adjustment amount ( Complete the adjustment amount 、 Add the amount in the approval 、 Amount to be deducted during approval )
select xm,km,nf,sum(case when zt=5 then dzje end) as wcdz,sum(case when zt>1 and zt<5 and dzje>0 then dzje end) as spdza,sum(case when zt>1 and zt<5 and dzje<0 then dzje end) as spdzb from uf_jftzls group by xm,km,nf

5.2 Splicing adjustment amount
SELECT
t1.xm,
t1.km,
t1.nf,
xm.yswd,
km.kmlx,
ys.je,
ys.bzlc,
ys.ytsmjcsyj,
dz.wcdz,
dz.spdza,
dz.spdzb
FROM
( SELECT xm, km, nf FROM uf_jfys UNION SELECT xm, km, nf FROM uf_jftzls ) t1
LEFT JOIN uf_jfsb xm ON xm.id = t1.xm
LEFT JOIN uf_km km ON km.id = t1.km
LEFT JOIN uf_jfys ys ON ys.xm = t1.xm
AND ys.km = t1.km
AND ys.nf = t1.nf
LEFT JOIN (
SELECT
xm,
km,
nf,
sum( CASE WHEN zt = 5 THEN dzje END ) AS wcdz,
sum( CASE WHEN zt > 1 AND zt < 5 AND dzje > 0 THEN dzje END ) AS spdza,
sum( CASE WHEN zt > 1 AND zt < 5 AND dzje < 0 THEN dzje END ) AS spdzb
FROM
uf_jftzls
GROUP BY
xm,
km,
nf
) dz ON dz.xm = t1.xm
AND dz.km = t1.km
AND dz.nf = t1.nf

6.1 Splice frozen amount 、 Calculate before deducting the amount
SELECT xm, km, nf, sum( CASE WHEN zt = 5 THEN je END ) AS wcsy, sum( CASE WHEN zt > 1
AND zt < 5 THEN
je
END
) AS spdj
FROM
uf_jfsyls
GROUP BY
xm,
km,
nf

6.2 Splice frozen amount 、 Deduction amount
SELECT
t1.xm,
t1.km,
t1.nf,
xm.yswd,
km.kmlx,
ys.je,
ys.bzlc,
ys.ytsmjcsyj,
dz.wcdz,
dz.spdza,
dz.spdzb,
sy.syje,
sy.spdj
FROM
( SELECT xm, km, nf FROM uf_jfys UNION SELECT xm, km, nf FROM uf_jftzls ) t1
LEFT JOIN uf_jfsb xm ON xm.id = t1.xm
LEFT JOIN uf_km km ON km.id = t1.km
LEFT JOIN uf_jfys ys ON ys.xm = t1.xm
AND ys.km = t1.km
AND ys.nf = t1.nf
LEFT JOIN (
SELECT
xm,
km,
nf,
sum( CASE WHEN zt = 5 THEN dzje END ) AS wcdz,
sum( CASE WHEN zt > 1 AND zt < 5 AND dzje > 0 THEN dzje END ) AS spdza,
sum( CASE WHEN zt > 1 AND zt < 5 AND dzje < 0 THEN dzje END ) AS spdzb
FROM
uf_jftzls
GROUP BY
xm,
km,
nf
) dz ON dz.xm = t1.xm
AND dz.km = t1.km
AND dz.nf = t1.nf
LEFT JOIN (
SELECT
xm,
km,
nf,
sum( CASE WHEN zt = 5 THEN je END ) AS syje,
sum( CASE WHEN zt > 1 AND zt < 5 THEN je END ) AS spdj
FROM
uf_jfsyls
GROUP BY
xm,
km,
nf
) sy ON sy.xm = t1.xm
AND sy.km = t1.km
AND sy.nf = t1.nf

7.1 If it is blank, it will be calculated as 0
SELECT
t1.xm,
t1.km,
t1.nf,
xm.yswd,
km.kmlx,
isnull( ys.je, 0 ) AS je,
ys.bzlc,
ys.ytsmjcsyj,
isnull( dz.wcdz, 0 ) AS wcdz,
isnull( dz.spdza, 0 ) AS spdza,
isnull( dz.spdzb, 0 ) AS spdzb,
isnull( sy.syje, 0 ) AS syje,
isnull( sy.spdj, 0 ) AS spdj
FROM
( SELECT xm, km, nf FROM uf_jfys UNION SELECT xm, km, nf FROM uf_jftzls ) t1
LEFT JOIN uf_jfsb xm ON xm.id = t1.xm
LEFT JOIN uf_km km ON km.id = t1.km
LEFT JOIN uf_jfys ys ON ys.xm = t1.xm
AND ys.km = t1.km
AND ys.nf = t1.nf
LEFT JOIN (
SELECT
xm,
km,
nf,
sum( CASE WHEN zt = 5 THEN dzje END ) AS wcdz,
sum( CASE WHEN zt > 1 AND zt < 5 AND dzje > 0 THEN dzje END ) AS spdza,
sum( CASE WHEN zt > 1 AND zt < 5 AND dzje < 0 THEN dzje END ) AS spdzb
FROM
uf_jftzls
GROUP BY
xm,
km,
nf
) dz ON dz.xm = t1.xm
AND dz.km = t1.km
AND dz.nf = t1.nf
LEFT JOIN (
SELECT
xm,
km,
nf,
sum( CASE WHEN zt = 5 THEN je END ) AS syje,
sum( CASE WHEN zt > 1 AND zt < 5 THEN je END ) AS spdj
FROM
uf_jfsyls
GROUP BY
xm,
km,
nf
) sy ON sy.xm = t1.xm
AND sy.km = t1.km
AND sy.nf = t1.nf

7.2 Calculate the adjusted amount and the available amount
SELECT
t1.xm,
t1.km,
t1.nf,
xm.yswd,
km.kmlx,
isnull( ys.je, 0 ) AS je,
isnull( ys.je, 0 ) + isnull( dz.wcdz, 0 ) AS dzhje,
ys.bzlc,
ys.ytsmjcsyj,
isnull( dz.wcdz, 0 ) AS wcdz,
isnull( dz.spdza, 0 ) AS spdza,
isnull( dz.spdzb, 0 ) AS spdzb,
isnull( sy.syje, 0 ) AS syje,
isnull( sy.spdj, 0 ) AS spdj,
isnull( ys.je, 0 ) + isnull( dz.wcdz, 0 ) + isnull( dz.spdza, 0 ) - isnull( sy.syje, 0 ) - isnull( sy.spdj, 0 ) AS kyje
FROM
( SELECT xm, km, nf FROM uf_jfys UNION SELECT xm, km, nf FROM uf_jftzls ) t1
LEFT JOIN uf_jfsb xm ON xm.id = t1.xm
LEFT JOIN uf_km km ON km.id = t1.km
LEFT JOIN uf_jfys ys ON ys.xm = t1.xm
AND ys.km = t1.km
AND ys.nf = t1.nf
LEFT JOIN (
SELECT
xm,
km,
nf,
sum( CASE WHEN zt = 5 THEN dzje END ) AS wcdz,
sum( CASE WHEN zt > 1 AND zt < 5 AND dzje > 0 THEN dzje END ) AS spdza,
sum( CASE WHEN zt > 1 AND zt < 5 AND dzje < 0 THEN dzje END ) AS spdzb
FROM
uf_jftzls
GROUP BY
xm,
km,
nf
) dz ON dz.xm = t1.xm
AND dz.km = t1.km
AND dz.nf = t1.nf
LEFT JOIN (
SELECT
xm,
km,
nf,
sum( CASE WHEN zt = 5 THEN je END ) AS syje,
sum( CASE WHEN zt > 1 AND zt < 5 THEN je END ) AS spdj
FROM
uf_jfsyls
GROUP BY
xm,
km,
nf
) sy ON sy.xm = t1.xm
AND sy.km = t1.km
AND sy.nf = t1.nf

8.1 Create view
CREATE VIEW jfyssyjd AS

8.2 Query validation

8.3 Add a unique value field before creating a virtual table :
concat(t1.xm,'-',t1.km,'-',t1.nf) as id,

8.4 Update the view
ALTER VIEW jfyssyjd AS

9.1 Create a virtual table

9.2 Set fields

9.3 Create a query list

9.4 Set display field

9.5 Multiple query criteria are allowed

9.6 Set up statistics

9.7 See the effect

边栏推荐
- ASEMI肖特基二极管1N5819参数,1N5819代换,1N5819货源
- Apache Doris实时数据分析保姆级使用教程
- Documenter l'utilisation de webcraper
- Panic: permission denied problems encountered when using gomonkey mock functions and methods and Solutions
- LCP 17. Quick calculation robot
- How to use the low code platform of the Internet of things for report management?
- ASEMI快恢复二极管FR107参数,FR107实物,FR107应用
- LeetCode 5242. 兼具大小写的最好英文字母
- The 8th "Internet +" competition - Bi ran, an outstanding architect of Baidu, interprets the proposition of industrial circuit
- Google multi user anti Association tool
猜你喜欢

LeetCode 5242. 兼具大小写的最好英文字母

【Proteus仿真】INT0和INT1中断计数

依靠可信AI的鲁棒性有效识别深度伪造,帮助银行对抗身份欺诈

第八届“互联网+”大赛|百度杰出架构师毕然解读产业赛道命题

Point cloud registration -- 4pcs principle and Application

华为云发布桌面IDE-CodeArts
![[cyw20189] VII. Detailed explanation of HCI command format](/img/ba/c61d4868e6c5da8460541c62649880.png)
[cyw20189] VII. Detailed explanation of HCI command format

第 19 章 基于语音识别的信号灯图像模拟控制技术

Intranet learning notes (3)

带你区分几种并行
随机推荐
基于 LVM 创建和扩展 XFS 文件系统
Jpom 简介: 简而轻的低侵入式在线构建、自动部署、日常运维、项目监控软件
Principle and Countermeasure of anti Association browser
isnull() ifnull() nullif()
Redis implements distributed locks
php-admin部署-解决全部错误
Show you how to distinguish several kinds of parallelism
内网学习笔记(9)
对标Copilot,国内首个:自然语言一键生成方法级代码aiXcoder XL来了
What does container cloud mean? What is the difference with fortress machine?
第 24 章 基于 Simulink 进行图像和视频处理--matlab深度学习实战整理
Documenter l'utilisation de webcraper
[solution] Ming Chu Liang Zao video edge computing gateway solution
Unlovable STL
Use of listctl virtual mode under wince
Pyechart drawing word cloud
亚马逊测评浏览器,亚马逊测评风控核心知识点
How to use the low code platform of the Internet of things for report management?
求一个防关联检测工具,浏览器指纹在线检测
Want to join a big factory? Reading this article may help you