|
@@ -47,7 +47,8 @@
|
47
|
47
|
<select id="queryByBH" resultMap="StaBudgetapprovalMap">
|
48
|
48
|
select *
|
49
|
49
|
from sta_BudgetApproval
|
50
|
|
- where BH like #{bh}+'%' order by ID desc
|
|
50
|
+ where BH like #{bh} + '%'
|
|
51
|
+ order by ID desc
|
51
|
52
|
</select>
|
52
|
53
|
|
53
|
54
|
<!--查询指定行数据-->
|
|
@@ -255,30 +256,42 @@
|
255
|
256
|
|
256
|
257
|
<!--新增-->
|
257
|
258
|
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
258
|
|
- insert into sta_BudgetApproval(SQMC, XMMC, XMID, BH, NF, FYLB, SQJE, SQSM, FJ, SQRXM, SQR, SQSJ, ERPBH, KYBG, XMLX, XMFZR, SSBM, SFBYJ, SFBZ, SPZT, NYS, BZ)
|
259
|
|
- values (#{sqmc}, #{xmmc}, #{xmid}, #{bh}, #{nf}, #{fylb}, #{sqje}, #{sqsm}, #{fj}, #{sqrxm}, #{sqr}, GETDATE(), #{erpbh}, #{kybg}, #{xmlx}, #{xmfzr}, #{ssbm}, 0, 0, '未提交', #{nys}, #{bz})
|
|
259
|
+ insert into sta_BudgetApproval(SQMC, XMMC, XMID, BH, NF, FYLB, SQJE, SQSM, FJ, SQRXM, SQR, SQSJ, ERPBH, KYBG,
|
|
260
|
+ XMLX, XMFZR, SSBM, SFBYJ, SFBZ, SPZT, NYS, BZ)
|
|
261
|
+ values (#{sqmc}, #{xmmc}, #{xmid}, #{bh}, #{nf}, #{fylb}, #{sqje}, #{sqsm}, #{fj}, #{sqrxm}, #{sqr}, GETDATE(),
|
|
262
|
+ #{erpbh}, #{kybg}, #{xmlx}, #{xmfzr}, #{ssbm}, 0, 0, '未提交', #{nys}, #{bz})
|
260
|
263
|
</insert>
|
261
|
264
|
<insert id="insertImprest" keyProperty="id" useGeneratedKeys="true">
|
262
|
|
- insert into sta_BudgetApproval(SQMC, BH,SQSM , NF, SQJE, SQRXM, SQR, SQSJ, SFBYJ, SFBZ, SPZT)
|
263
|
|
- values (#{sqmc}, #{bh}, #{sqsm},#{nf}, #{sqje}, #{sqrxm}, #{sqr}, #{sqsj}, 1, 0, '未提交')
|
|
265
|
+ insert into sta_BudgetApproval(SQMC, BH, SQSM, NF, SQJE, SQRXM, SQR, SQSJ, SFBYJ, SFBZ, SPZT)
|
|
266
|
+ values (#{sqmc}, #{bh}, #{sqsm}, #{nf}, #{sqje}, #{sqrxm}, #{sqr}, #{sqsj}, 1, 0, '未提交')
|
264
|
267
|
</insert>
|
265
|
268
|
|
266
|
269
|
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
267
|
|
- insert into sta_BudgetApproval(XMMC, XMID, BH, SQSM, SQJE, FYLB, BBM, FJ, SHZT, NF, SQR, SQRXM, SQSJ, SQMC, SPZT, KYFYXX, BZJE, BXPZ, BZJE2, SFBYJ, KYBG, ERPBH, XMLX, XMFZR, SSBM, SFBZ, SMWJ, BHSJE, SF, NYS, BZ)
|
|
270
|
+ insert into sta_BudgetApproval(XMMC, XMID, BH, SQSM, SQJE, FYLB, BBM, FJ, SHZT, NF, SQR, SQRXM, SQSJ, SQMC,
|
|
271
|
+ SPZT, KYFYXX, BZJE, BXPZ, BZJE2, SFBYJ, KYBG, ERPBH, XMLX, XMFZR, SSBM, SFBZ, SMWJ, BHSJE, SF, NYS, BZ)
|
268
|
272
|
values
|
269
|
273
|
<foreach collection="entities" item="entity" separator=",">
|
270
|
|
- (#{entity.xmmc}, #{entity.xmid}, #{entity.bh}, #{entity.sqsm}, #{entity.sqje}, #{entity.fylb}, #{entity.bbm}, #{entity.fj}, #{entity.shzt}, #{entity.nf}, #{entity.sqrxm}, #{entity.sqr}, #{entity.sqsj}, #{entity.sqmc},
|
271
|
|
- #{entity.spzt}, #{entity.kyfyxx}, #{entity.bzje}, #{entity.bxpz}, #{entity.bzje2}, #{entity.sfbyj}, #{entity.kybg}, #{entity.erpbh}, #{entity.xmlx}, #{entity.xmfzr}, #{entity.ssbm}, #{entity.sfbz}, #{entity.smwj},
|
|
274
|
+ (#{entity.xmmc}, #{entity.xmid}, #{entity.bh}, #{entity.sqsm}, #{entity.sqje}, #{entity.fylb},
|
|
275
|
+ #{entity.bbm}, #{entity.fj}, #{entity.shzt}, #{entity.nf}, #{entity.sqrxm}, #{entity.sqr}, #{entity.sqsj},
|
|
276
|
+ #{entity.sqmc},
|
|
277
|
+ #{entity.spzt}, #{entity.kyfyxx}, #{entity.bzje}, #{entity.bxpz}, #{entity.bzje2}, #{entity.sfbyj},
|
|
278
|
+ #{entity.kybg}, #{entity.erpbh}, #{entity.xmlx}, #{entity.xmfzr}, #{entity.ssbm}, #{entity.sfbz},
|
|
279
|
+ #{entity.smwj},
|
272
|
280
|
#{entity.bhsje}, #{entity.sf}, #{entity.nys}, #{entity.bz})
|
273
|
281
|
</foreach>
|
274
|
282
|
</insert>
|
275
|
283
|
|
276
|
284
|
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
277
|
|
- insert into sta_BudgetApproval(XMMC, XMID, BH, SQSM, SQJE, FYLB, BBM, FJ, SHZT, NF, SQR, SQRXM, SQSJ, SQMC, SPZT, KYFYXX, BZJE, BXPZ, BZJE2, SFBYJ, KYBG, ERPBH, XMLX, XMFZR, SSBM, SFBZ, SMWJ, BHSJE, SF, NYS, BZ)
|
|
285
|
+ insert into sta_BudgetApproval(XMMC, XMID, BH, SQSM, SQJE, FYLB, BBM, FJ, SHZT, NF, SQR, SQRXM, SQSJ, SQMC,
|
|
286
|
+ SPZT, KYFYXX, BZJE, BXPZ, BZJE2, SFBYJ, KYBG, ERPBH, XMLX, XMFZR, SSBM, SFBZ, SMWJ, BHSJE, SF, NYS, BZ)
|
278
|
287
|
values
|
279
|
288
|
<foreach collection="entities" item="entity" separator=",">
|
280
|
|
- (#{entity.xmmc}, #{entity.xmid}, #{entity.bh}, #{entity.sqsm}, #{entity.sqje}, #{entity.fylb}, #{entity.bbm}, #{entity.fj}, #{entity.shzt}, #{entity.nf}, #{entity.sqrxm}, #{entity.sqr}, #{entity.sqsj}, #{entity.sqmc},
|
281
|
|
- #{entity.spzt}, #{entity.kyfyxx}, #{entity.bzje}, #{entity.bxpz}, #{entity.bzje2}, #{entity.sfbyj}, #{entity.kybg}, #{entity.erpbh}, #{entity.xmlx}, #{entity.xmfzr}, #{entity.ssbm}, #{entity.sfbz}, #{entity.smwj},
|
|
289
|
+ (#{entity.xmmc}, #{entity.xmid}, #{entity.bh}, #{entity.sqsm}, #{entity.sqje}, #{entity.fylb},
|
|
290
|
+ #{entity.bbm}, #{entity.fj}, #{entity.shzt}, #{entity.nf}, #{entity.sqrxm}, #{entity.sqr}, #{entity.sqsj},
|
|
291
|
+ #{entity.sqmc},
|
|
292
|
+ #{entity.spzt}, #{entity.kyfyxx}, #{entity.bzje}, #{entity.bxpz}, #{entity.bzje2}, #{entity.sfbyj},
|
|
293
|
+ #{entity.kybg}, #{entity.erpbh}, #{entity.xmlx}, #{entity.xmfzr}, #{entity.ssbm}, #{entity.sfbz},
|
|
294
|
+ #{entity.smwj},
|
282
|
295
|
#{entity.bhsje}, #{entity.sf}, ##{entity.nys}, #{entity.bz})
|
283
|
296
|
</foreach>
|
284
|
297
|
on duplicate key update
|
|
@@ -318,13 +331,13 @@
|
318
|
331
|
<update id="update">
|
319
|
332
|
update sta_BudgetApproval
|
320
|
333
|
set SQJE = #{sqje},
|
321
|
|
- FJ = #{fj},
|
322
|
|
- BZ = #{bz},
|
|
334
|
+ FJ = #{fj},
|
|
335
|
+ BZ = #{bz},
|
323
|
336
|
SQMC = #{sqmc},
|
324
|
337
|
SQSM = #{sqsm}
|
325
|
338
|
where ID = #{id}
|
326
|
339
|
</update>
|
327
|
|
-<!-- 修改方法-->
|
|
340
|
+ <!-- 修改方法-->
|
328
|
341
|
<!--通过主键修改基础数据-->
|
329
|
342
|
<update id="updateImprest">
|
330
|
343
|
update sta_BudgetApproval
|
|
@@ -334,35 +347,37 @@
|
334
|
347
|
SQSM = #{sqsm}
|
335
|
348
|
where ID = #{id}
|
336
|
349
|
</update>
|
337
|
|
-<!-- 修改方法-->
|
|
350
|
+ <!-- 修改方法-->
|
338
|
351
|
<!--备用金关联项目-->
|
339
|
352
|
<update id="ImprestConnect">
|
340
|
353
|
update sta_BudgetApproval
|
341
|
|
- set XMMC = #{xmmc},
|
342
|
|
- XMID = #{xmid},
|
343
|
|
- FYLB = #{fylb},
|
344
|
|
- FJ = #{fj},
|
|
354
|
+ set XMMC = #{xmmc},
|
|
355
|
+ XMID = #{xmid},
|
|
356
|
+ FYLB = #{fylb},
|
|
357
|
+ FJ = #{fj},
|
345
|
358
|
ERPBH = #{erpbh},
|
346
|
|
- XMLX = #{xmlx},
|
|
359
|
+ XMLX = #{xmlx},
|
347
|
360
|
XMFZR = #{xmfzr},
|
348
|
|
- SSBM = #{ssbm},
|
349
|
|
- NYS = #{nys},
|
350
|
|
- BZ = #{bz}
|
|
361
|
+ SSBM = #{ssbm},
|
|
362
|
+ NYS = #{nys},
|
|
363
|
+ BZ = #{bz}
|
351
|
364
|
where ID = #{id}
|
352
|
365
|
</update>
|
353
|
366
|
<!--通过主键修改其它数据-->
|
354
|
367
|
<update id="updateOthers">
|
355
|
368
|
update sta_BudgetApproval
|
356
|
369
|
set ERPBH = #{erpbh},
|
357
|
|
- XMLX = #{xmlx},
|
|
370
|
+ XMLX = #{xmlx},
|
358
|
371
|
XMFZR = #{xmfzr},
|
359
|
|
- SSBM = #{ssbm}
|
|
372
|
+ SSBM = #{ssbm}
|
360
|
373
|
where ID = #{id}
|
361
|
374
|
</update>
|
362
|
375
|
|
363
|
376
|
<!--通过主键删除-->
|
364
|
377
|
<delete id="deleteById">
|
365
|
|
- delete from sta_BudgetApproval where ID = #{id}
|
|
378
|
+ delete
|
|
379
|
+ from sta_BudgetApproval
|
|
380
|
+ where ID = #{id}
|
366
|
381
|
</delete>
|
367
|
382
|
|
368
|
383
|
<!--获取费用申请列表-->
|
|
@@ -372,7 +387,7 @@
|
372
|
387
|
where id in (select dkyfzrid from
|
373
|
388
|
(select DISTINCT zwmc,SUBSTRING(dkyfzr, number,CHARINDEX(',',dkyfzr+',',number)-number) as dkyfzrid
|
374
|
389
|
from prj_Project WITH(nolock) ,master..spt_values with(nolock) where number >= 1 and len(DKYFZR) > number
|
375
|
|
- and SUBSTRING(','+DKYFZR,number,1)=',' and ID = b.XMID) t)) B for xml path('')),1,1,'')) as DKYFZRXM
|
|
390
|
+ and SUBSTRING(','+DKYFZR,number,1)=',' and ID = b.XMID) t)) B for xml path('')),1,1,'')) as DKYFZRXM
|
376
|
391
|
from sta_BudgetApproval b
|
377
|
392
|
left join base_ProjectType t on t.XMLX = b.XMLX
|
378
|
393
|
left join prj_Project p on p.ID = b.XMID
|
|
@@ -380,13 +395,16 @@
|
380
|
395
|
left join prj_AnnualBudgetDetail g on g.ID = b.FYLB
|
381
|
396
|
left join base_Person r on r.ID = b.XMFZR
|
382
|
397
|
where b.SFBYJ = 0
|
383
|
|
- -- and b.SPZT != '审批结束'
|
|
398
|
+ -- and b.SPZT != '审批结束'
|
384
|
399
|
<if test="userId != null and userId != ''">
|
385
|
400
|
and (b.SQR = #{userId} or #{userId} in (select SHR from prj_ApproveRecord where XMID = b.ID))
|
386
|
401
|
</if>
|
387
|
402
|
<if test="sqmc != null and sqmc != ''">
|
388
|
403
|
and b.SQMC like '%'+#{sqmc}+'%'
|
389
|
404
|
</if>
|
|
405
|
+ <if test="fylb != null and fylb != ''">
|
|
406
|
+ and g.FYMC like '%'+#{fylb}+'%'
|
|
407
|
+ </if>
|
390
|
408
|
<if test="spzt != null and spzt != ''">
|
391
|
409
|
and b.SPZT = #{spzt}
|
392
|
410
|
</if>
|
|
@@ -489,7 +507,7 @@
|
489
|
507
|
where id in (select dkyfzrid from
|
490
|
508
|
(select DISTINCT zwmc,SUBSTRING(dkyfzr, number,CHARINDEX(',',dkyfzr+',',number)-number) as dkyfzrid
|
491
|
509
|
from prj_Project WITH(nolock) ,master..spt_values with(nolock) where number >= 1 and len(DKYFZR) > number
|
492
|
|
- and SUBSTRING(','+DKYFZR,number,1)=',' and ID = b.XMID) t)) B for xml path('')),1,1,'')) as DKYFZRXM
|
|
510
|
+ and SUBSTRING(','+DKYFZR,number,1)=',' and ID = b.XMID) t)) B for xml path('')),1,1,'')) as DKYFZRXM
|
493
|
511
|
from sta_BudgetApproval b
|
494
|
512
|
left join base_ProjectType t on t.XMLX = b.XMLX
|
495
|
513
|
left join prj_Project p on p.ID = b.XMID
|
|
@@ -551,7 +569,7 @@
|
551
|
569
|
where id in (select dkyfzrid from
|
552
|
570
|
(select DISTINCT zwmc,SUBSTRING(dkyfzr, number,CHARINDEX(',',dkyfzr+',',number)-number) as dkyfzrid
|
553
|
571
|
from prj_Project WITH(nolock) ,master..spt_values with(nolock) where number >= 1 and len(DKYFZR) > number
|
554
|
|
- and SUBSTRING(','+DKYFZR,number,1)=',' and ID = b.XMID) t)) B for xml path('')),1,1,'')) as DKYFZRXM
|
|
572
|
+ and SUBSTRING(','+DKYFZR,number,1)=',' and ID = b.XMID) t)) B for xml path('')),1,1,'')) as DKYFZRXM
|
555
|
573
|
from sta_BudgetApproval b
|
556
|
574
|
left join base_ProjectType t on t.XMLX = b.XMLX
|
557
|
575
|
left join prj_Project p on p.ID = b.XMID
|
|
@@ -574,6 +592,9 @@
|
574
|
592
|
<if test="xmmc != null and xmmc != ''">
|
575
|
593
|
and b.XMMC like '%'+#{xmmc}+'%'
|
576
|
594
|
</if>
|
|
595
|
+ <if test="fylb != null and fylb != ''">
|
|
596
|
+ and g.FYMC like '%'+#{fylb}+'%'
|
|
597
|
+ </if>
|
577
|
598
|
<if test="ssbmmc != null and ssbmmc != ''">
|
578
|
599
|
and d.dept_name like '%'+#{ssbm}+'%'
|
579
|
600
|
</if>
|
|
@@ -614,7 +635,7 @@
|
614
|
635
|
WHEN b.SPZT = '作废' THEN 999
|
615
|
636
|
END
|
616
|
637
|
ASC,
|
617
|
|
- b.SQSJ DESC
|
|
638
|
+ b.SQSJ DESC
|
618
|
639
|
</select>
|
619
|
640
|
|
620
|
641
|
|
|
@@ -626,7 +647,7 @@
|
626
|
647
|
where id in (select dkyfzrid from
|
627
|
648
|
(select DISTINCT zwmc,SUBSTRING(dkyfzr, number,CHARINDEX(',',dkyfzr+',',number)-number) as dkyfzrid
|
628
|
649
|
from prj_Project WITH(nolock) ,master..spt_values with(nolock) where number >= 1 and len(DKYFZR) > number
|
629
|
|
- and SUBSTRING(','+DKYFZR,number,1)=',' and ID = b.XMID) t)) B for xml path('')),1,1,'')) as DKYFZRXM
|
|
650
|
+ and SUBSTRING(','+DKYFZR,number,1)=',' and ID = b.XMID) t)) B for xml path('')),1,1,'')) as DKYFZRXM
|
630
|
651
|
from sta_BudgetApproval b
|
631
|
652
|
left join base_ProjectType t on t.XMLX = b.XMLX
|
632
|
653
|
left join prj_Project p on p.ID = b.XMID
|
|
@@ -680,7 +701,7 @@
|
680
|
701
|
<delete id="batchDelete" parameterType="java.util.ArrayList">
|
681
|
702
|
delete from sta_BudgetApproval
|
682
|
703
|
where ID in
|
683
|
|
- <foreach item="item" index="index" collection="idList" open = "(" separator = "," close = ")">
|
|
704
|
+ <foreach item="item" index="index" collection="idList" open="(" separator="," close=")">
|
684
|
705
|
#{item}
|
685
|
706
|
</foreach>
|
686
|
707
|
</delete>
|
|
@@ -694,20 +715,38 @@
|
694
|
715
|
<!--通过主键修改审批状态-->
|
695
|
716
|
<update id="updateSpzt">
|
696
|
717
|
update sta_BudgetApproval
|
697
|
|
- set SPZT = #{spzt}, BH=#{bh}
|
|
718
|
+ set SPZT = #{spzt},
|
|
719
|
+ BH=#{bh}
|
698
|
720
|
where ID = #{id}
|
699
|
721
|
</update>
|
700
|
722
|
|
701
|
723
|
<!--获取费用申请信息-->
|
702
|
724
|
<select id="getFysqById" resultMap="StaBudgetapprovalMap">
|
703
|
|
- select b.*, t.XMLXMC, d.dept_name as SSBMMC, g.FYMC as FYLBMC, r.XM as XMFZRXM,
|
704
|
|
- (select MC from base_ProjectBudget g1 where g1.BM = g.FJ) as FJMC,
|
705
|
|
- case when b.SFBYJ = 1 then '是' else '否' end as SFBYJMC, case when b.SFBZ = 1 then '是' else '否' end as SFBZMC,
|
706
|
|
- (SELECT STUFF((SELECT ','+XM from (select xm from base_Person
|
707
|
|
- where id in (select dkyfzrid from
|
708
|
|
- (select DISTINCT zwmc,SUBSTRING(dkyfzr, number,CHARINDEX(',',dkyfzr+',',number)-number) as dkyfzrid
|
709
|
|
- from prj_Project WITH(nolock) ,master..spt_values with(nolock) where number >= 1 and len(DKYFZR) > number
|
710
|
|
- and SUBSTRING(','+DKYFZR,number,1)=',' and ID = b.XMID) t)) B for xml path('')),1,1,'')) as DKYFZRXM
|
|
725
|
+ select b.*,
|
|
726
|
+ t.XMLXMC,
|
|
727
|
+ d.dept_name as SSBMMC,
|
|
728
|
+ g.FYMC as FYLBMC,
|
|
729
|
+ r.XM as XMFZRXM,
|
|
730
|
+ (select MC from base_ProjectBudget g1 where g1.BM = g.FJ) as FJMC,
|
|
731
|
+ case when b.SFBYJ = 1 then '是' else '否' end as SFBYJMC,
|
|
732
|
+ case when b.SFBZ = 1 then '是' else '否' end as SFBZMC,
|
|
733
|
+ (SELECT STUFF((SELECT ',' + XM
|
|
734
|
+ from (select xm
|
|
735
|
+ from base_Person
|
|
736
|
+ where id in (select dkyfzrid
|
|
737
|
+ from (select DISTINCT zwmc,
|
|
738
|
+ SUBSTRING(dkyfzr, number,
|
|
739
|
+ CHARINDEX(',', dkyfzr + ',', number) -
|
|
740
|
+ number) as dkyfzrid
|
|
741
|
+ from prj_Project WITH(nolock) ,master..spt_values
|
|
742
|
+ with (nolock)
|
|
743
|
+ where number >= 1
|
|
744
|
+ and len(DKYFZR)
|
|
745
|
+ > number
|
|
746
|
+ and SUBSTRING (','+DKYFZR
|
|
747
|
+ , number
|
|
748
|
+ , 1)=','
|
|
749
|
+ and ID = b.XMID) t)) B for xml path ('')),1,1,'')) as DKYFZRXM
|
711
|
750
|
from sta_BudgetApproval b
|
712
|
751
|
left join base_ProjectType t on t.XMLX = b.XMLX
|
713
|
752
|
left join prj_Project p on p.ID = b.XMID
|
|
@@ -751,11 +790,11 @@
|
751
|
790
|
<!--更新报账数据-->
|
752
|
791
|
<update id="updateReimburse">
|
753
|
792
|
update sta_BudgetApproval
|
754
|
|
- set SFBZ = 1,
|
755
|
|
- BXPZ = #{bxpz},
|
756
|
|
- BZJE = #{bzje},
|
|
793
|
+ set SFBZ = 1,
|
|
794
|
+ BXPZ = #{bxpz},
|
|
795
|
+ BZJE = #{bzje},
|
757
|
796
|
BHSJE = #{bhsje},
|
758
|
|
- SF = #{sf}
|
|
797
|
+ SF = #{sf}
|
759
|
798
|
where ID = #{id}
|
760
|
799
|
</update>
|
761
|
800
|
|
|
@@ -768,7 +807,7 @@
|
768
|
807
|
BHSJE = null,
|
769
|
808
|
SF = null
|
770
|
809
|
where ID in
|
771
|
|
- <foreach item="item" index="index" collection="idList" open = "(" separator = "," close = ")">
|
|
810
|
+ <foreach item="item" index="index" collection="idList" open="(" separator="," close=")">
|
772
|
811
|
#{item}
|
773
|
812
|
</foreach>
|
774
|
813
|
</update>
|
|
@@ -778,43 +817,68 @@
|
778
|
817
|
update sta_BudgetApproval
|
779
|
818
|
set SPZT = '作废'
|
780
|
819
|
where ID in
|
781
|
|
- <foreach item="item" index="index" collection="idList" open = "(" separator = "," close = ")">
|
|
820
|
+ <foreach item="item" index="index" collection="idList" open="(" separator="," close=")">
|
782
|
821
|
#{item}
|
783
|
822
|
</foreach>
|
784
|
823
|
</delete>
|
785
|
824
|
|
786
|
825
|
<!--项目总体费用信息-->
|
787
|
826
|
<select id="getXmFyInfo" resultMap="StaBudgetapprovalMap">
|
788
|
|
- select b.NYS, (ISNULL(SUM(b.BZJE),0)+ISNULL((select SUM(SQJE) from sta_BudgetApproval where BZJE is NULL and NYS = #{nys1} and SPZT != '作废' and SFBYJ =0),0)) as SQJE,
|
789
|
|
- SUM(b.BZJE) as BZJE,
|
|
827
|
+ select b.NYS,
|
|
828
|
+ (ISNULL(SUM(b.BZJE), 0) + ISNULL((select SUM(SQJE)
|
|
829
|
+ from sta_BudgetApproval
|
|
830
|
+ where BZJE is NULL
|
|
831
|
+ and NYS = #{nys1}
|
|
832
|
+ and SPZT != '作废' and SFBYJ =0),0)) as SQJE,
|
|
833
|
+ SUM(b.BZJE) as BZJE,
|
790
|
834
|
(select YSJE from prj_AnnualBudgetDetail where NYS = b.NYS and FJ = '') as YSJE
|
791
|
835
|
from sta_BudgetApproval b
|
792
|
|
- where b.NYS = #{nys} and b.SPZT != '作废' and b.SFBYJ =0
|
|
836
|
+ where b.NYS = #{nys}
|
|
837
|
+ and b.SPZT != '作废' and b.SFBYJ =0
|
793
|
838
|
GROUP BY b.NYS
|
794
|
839
|
</select>
|
795
|
840
|
|
796
|
841
|
<!--项目分项费用信息-->
|
797
|
842
|
<select id="getKmFyInfo" resultMap="StaBudgetapprovalMap" parameterType="map">
|
798
|
|
- select b.NYS, b.FYLB, (ISNULL(SUM(b.BZJE),0)+ISNULL((select SUM(SQJE) from sta_BudgetApproval where BZJE is NULL and NYS = #{nys1} and FYLB = #{fylb1} and SPZT != '作废' and SFBYJ =0),0)) as SQJE,
|
799
|
|
- SUM(b.BZJE) as BZJE,
|
|
843
|
+ select b.NYS,
|
|
844
|
+ b.FYLB,
|
|
845
|
+ (ISNULL(SUM(b.BZJE), 0) + ISNULL((select SUM(SQJE)
|
|
846
|
+ from sta_BudgetApproval
|
|
847
|
+ where BZJE is NULL
|
|
848
|
+ and NYS = #{nys1}
|
|
849
|
+ and FYLB = #{fylb1}
|
|
850
|
+ and SPZT != '作废' and SFBYJ =0),0)) as SQJE,
|
|
851
|
+ SUM(b.BZJE) as BZJE,
|
800
|
852
|
(select YSJE from prj_AnnualBudgetDetail where NYS = b.NYS and ID = b.FYLB) as YSJE
|
801
|
853
|
from sta_BudgetApproval b
|
802
|
|
- where b.NYS = #{nys} and b.FYLB = #{fylb} and b.SPZT != '作废' and b.SFBYJ =0
|
|
854
|
+ where b.NYS = #{nys}
|
|
855
|
+ and b.FYLB = #{fylb}
|
|
856
|
+ and b.SPZT != '作废' and b.SFBYJ =0
|
803
|
857
|
GROUP BY b.NYS, b.FYLB
|
804
|
858
|
</select>
|
805
|
859
|
|
806
|
860
|
<!--未关联项目备用金 -->
|
807
|
861
|
<select id="unassociated" resultMap="StaBudgetapprovalMap" parameterType="map">
|
808
|
|
- SELECT * FROM sta_BudgetApproval WHERE SFBYJ = 1 AND XMMC IS NULL AND SPZT='审批结束'
|
|
862
|
+ SELECT *
|
|
863
|
+ FROM sta_BudgetApproval
|
|
864
|
+ WHERE SFBYJ = 1
|
|
865
|
+ AND XMMC IS NULL
|
|
866
|
+ AND SPZT = '审批结束'
|
809
|
867
|
</select>
|
810
|
868
|
|
811
|
869
|
<!--项目备用金信息-->
|
812
|
870
|
<select id="getByjInfo" resultMap="StaBudgetapprovalMap">
|
813
|
|
- select b.NYS, (ISNULL(SUM(b.BZJE),0)+ISNULL((select SUM(SQJE) from sta_BudgetApproval where BZJE is NULL and NYS = #{nys1} and SPZT != '作废' and SFBYJ =1),0)) as SQJE,
|
814
|
|
- SUM(b.BZJE) as BZJE,
|
|
871
|
+ select b.NYS,
|
|
872
|
+ (ISNULL(SUM(b.BZJE), 0) + ISNULL((select SUM(SQJE)
|
|
873
|
+ from sta_BudgetApproval
|
|
874
|
+ where BZJE is NULL
|
|
875
|
+ and NYS = #{nys1}
|
|
876
|
+ and SPZT != '作废' and SFBYJ =1),0)) as SQJE,
|
|
877
|
+ SUM(b.BZJE) as BZJE,
|
815
|
878
|
(select YSJE from prj_AnnualBudgetDetail where NYS = b.NYS and FJ = '') as YSJE
|
816
|
879
|
from sta_BudgetApproval b
|
817
|
|
- where b.NYS = #{nys} and b.SPZT != '作废' and b.SFBYJ =1
|
|
880
|
+ where b.NYS = #{nys}
|
|
881
|
+ and b.SPZT != '作废' and b.SFBYJ =1
|
818
|
882
|
GROUP BY b.NYS
|
819
|
883
|
</select>
|
820
|
884
|
</mapper>
|