comparison ehis.数据统计.营业收入.运营情况汇总.XML @ 1:be9328b4ea2d

Up:杩愯惀鎯呭喌姹囨; Fix锛欳lear initial commit
author Schmit <liny.jii@nnsui.com>
date Sun, 08 Sep 2024 17:07:59 +0800
parents
children
comparison
equal deleted inserted replaced
0:82daac2d2ee3 1:be9328b4ea2d
1 <?xml version="1.0" encoding="UTF-8"?>
2 <report report-id="ehis.鏁版嵁缁熻.钀ヤ笟鏀跺叆.杩愯惀鎯呭喌姹囨" title="杩愯惀鎯呭喌姹囨" seq="0" is-detail="true">
3 <description>杩愯惀鎯呭喌姹囨</description>
4 <attrs>
5 <attr key="datasource" value="default"/>
6 <attr key="leftFixedColCount" value="0"/>
7 <attr key="rightFixedColCount" value="0"/>
8 <attr key="showTotalRow" value="false"/>
9 <attr key="showRowIndex" value="true"/>
10 <attr key="showColIndex" value="false"/>
11 <attr key="showColLine" value="true"/>
12 <attr key="showRowLine" value="true"/>
13 <attr key="showHeader" value="false"/>
14 <attr key="showTools" value="false"/>
15 <attr key="trackMouseOver" value="true"/>
16 <attr key="defaultColWidth" value="100"/>
17 <attr key="rowNoColWidth" value="40"/>
18 <attr key="pageType" value="A4"/>
19 <attr key="pageDirect" value="V"/>
20 <attr key="pageFontSize" value="11"/>
21 <attr key="pageSize" value="297,210"/>
22 <attr key="pageMargin" value="10,10,10,10"/>
23 <attr key="pageMaxRowCount" value="50"/>
24 <attr key="autoSizeCol" value="0" />
25 </attrs>
26
27 <params>
28 <param id="jgxs">
29 <sql>
30 <![CDATA[
31 select count(1) col into #t from
32 (
33 select 鏈烘瀯ID value,鍚嶇О text from bas_鏈烘瀯 where 鏈烘瀯ID=${user.companyPartyId}
34 union all
35 select 鏈烘瀯ID value,鍚嶇О text from bas_鏈烘瀯 where isnull(绠$悊鏈烘瀯ID,'')=${user.companyPartyId}
36 ) a
37 ;
38 select case when col>1 then 'false' else 'true' end aaa from #t
39 ]]>
40 </sql>
41 </param>
42 <param id="mrjg">
43 <sql>
44 <![CDATA[
45 select ${user.companyPartyId} id
46 ]]>
47 </sql>
48 </param>
49 </params>
50
51 <enums>
52 <enum id="tjjg">
53 <sql>
54 <![CDATA[
55 select 鏈烘瀯ID value,鍚嶇О text from bas_鏈烘瀯 where 鏈烘瀯ID=${user.companyPartyId}
56 union all
57 select 鏈烘瀯ID value,鍚嶇О text from bas_鏈烘瀯 where isnull(绠$悊鏈烘瀯ID,'')=${user.companyPartyId}
58 ]]>
59 </sql>
60 </enum>
61 </enums>
62
63 <header-items>
64 <header-item id="缁熻鏈烘瀯" type="enum" enum-id="tjjg" title="缁熻鏈烘瀯" default="${mrjg}" hidden="${jgxs}" value-col="value" use-like='false' text-col="text" width="250" trigger-query="false"/>
65 <header-item id="鏃堕棿" type="datetimerange" title="缁熻鏃堕棿" default="浠婂ぉ" width="190" trigger-query="false"/>
66 <header-item id="鏌ユ壘" type="text" width="150" use-like="false" title="鏌ユ壘" hidden="true" empty-text="璇疯緭鍏ユ煡鎵句俊鎭" trigger-query="false"/>
67 </header-items>
68
69 <select>
70 <field id="鍒嗙被" title="鍒嗙被"><![CDATA[鍒嗙被]]></field>
71 <field id="鍒1" title="鍒1"><![CDATA[鍒1]]></field>
72 <field id="鍒1鍊" title="鍒1鍊"><![CDATA[鍒1鍊糫]></field>
73 <field id="鍒2" title="鍒2"><![CDATA[鍒2]]></field>
74 <field id="鍒2鍊" title="鍒2鍊"><![CDATA[鍒2鍊糫]></field>
75 <field id="鍒3" title="鍒3"> <![CDATA[鍒3]]></field>
76 <field id="鍒3鍊" title="鍒3鍊"> <![CDATA[鍒3鍊糫]></field>
77 <field id="鍒4" title="鍒4"> <![CDATA[鍒4]]></field>
78 <field id="鍒4鍊" title="鍒4鍊"> <![CDATA[鍒4鍊糫]></field>
79 </select>
80
81 <from>
82 <![CDATA[
83 (
84 select
85 '闂ㄨ瘖鎯呭喌' 鍒嗙被,'鎸傚彿浜烘暟' 鍒1,gh.鎸傚彿浜烘暟 鍒1鍊,'鎸傚彿閲戦' 鍒2,cast(gh.鎸傚彿閲戦 as nvarchar(10)) 鍒2鍊,
86 '棣栬瘖浜烘暟' 鍒3,gh.棣栬瘖浜烘暟 鍒3鍊,'澶嶈瘖浜烘暟' 鍒4,gh.澶嶈瘖浜烘暟 鍒4鍊
87 from #jg jg
88 left join #gh gh on jg.鏈烘瀯ID=gh.鏈烘瀯ID
89 union all
90 select
91 '闂ㄨ瘖鎯呭喌' 鍒嗙被,'闂ㄨ瘖浜烘' 鍒1,mzjs.闂ㄨ瘖浜烘 鍒1鍊,'鎬婚噾棰' 鍒2,cast(mzjs.鎬婚噾棰 as nvarchar(10)) 鍒2鍊,
92 '鍖讳繚閲戦' 鍒3,mzjs.鎶ラ攢閲戦 鍒3鍊,'鐜伴噾閲戦' 鍒4,mzzf.鐜伴噾鏀粯 鍒4鍊
93 from #jg jg
94 left join #mzjs mzjs on jg.鏈烘瀯ID=mzjs.鏈烘瀯ID
95 left join #mzzf mzzf on jg.鏈烘瀯ID=mzzf.鏈烘瀯ID
96 union all
97 select
98 '闂ㄨ瘖鎯呭喌' 鍒嗙被,'澶勬柟鎬绘暟' 鍒1,mzcf.澶勬柟鎬绘暟 鍒1鍊,'鑽搧閲戦' 鍒2,cast(mzcf.鑽搧閲戦 as nvarchar(10)) 鍒2鍊,
99 '璇婄枟閲戦' 鍒3,mzcf.璇婄枟閲戦 鍒3鍊,'澶勬柟鍧囬' 鍒4,case when mzcf.澶勬柟鎬绘暟<>0 then cast(mzjs.鎬婚噾棰/mzcf.澶勬柟鎬绘暟 as decimal(10,2)) else null end 鍒4鍊
100 from #jg jg
101 left join #mzcf mzcf on jg.鏈烘瀯ID=mzcf.鏈烘瀯ID
102 left join #mzjs mzjs on jg.鏈烘瀯ID=mzjs.鏈烘瀯ID
103 union all
104 select
105 '闂ㄨ瘖鎯呭喌' 鍒嗙被,'鑷垂浜烘' 鍒1,mzjs.鑷垂浜烘 鍒1鍊,'鍖讳繚浜烘' 鍒2,cast(mzjs.鍖讳繚浜烘 as nvarchar(10)) 鍒2鍊,
106 '鏅氶棬璇婃暟' 鍒3,mzjs.鏅氶棬璇婁汉娆 鍒3鍊,'鐗圭梾浜烘' 鍒4,mzjs.鐗圭梾浜烘 鍒4鍊
107 from #jg jg
108 left join #mzjs mzjs on jg.鏈烘瀯ID=mzjs.鏈烘瀯ID
109 union all
110 select
111 '浣忛櫌鎯呭喌' 鍒嗙被,'鍏ラ櫌鎬讳汉鏁' 鍒1,ry.鍏ラ櫌鎬讳汉鏁 鍒1鍊,'褰撳墠鍦ㄩ櫌鎬讳汉鏁' 鍒2,cast(zy.鍦ㄩ櫌鎬讳汉鏁 as nvarchar(10)) 鍒2鍊,
112 '鍑洪櫌鎬讳汉鏁' 鍒3,cy.鍑洪櫌鎬讳汉鏁 鍒3鍊,'缁撶畻鎬讳汉鏁' 鍒4,zyjs.缁撶畻鎬讳汉鏁 鍒4鍊
113 from #jg jg
114 left join #ry ry on jg.鏈烘瀯ID=ry.鏈烘瀯ID
115 left join #cy cy on jg.鏈烘瀯ID=cy.鏈烘瀯ID
116 left join #zyjs zyjs on jg.鏈烘瀯ID=zyjs.鏈烘瀯ID
117 left join #zy zy on jg.鏈烘瀯ID=zy.鏈烘瀯ID
118 union all
119 select
120 '浣忛櫌鎯呭喌' 鍒嗙被,'缁撶畻閲戦' 鍒1,zyjs.缁撶畻閲戦 鍒1鍊,'鑱屽伐閲戦' 鍒2,cast(zyjs.鑱屽伐閲戦 as nvarchar(10)) 鍒2鍊,
121 '灞呮皯閲戦' 鍒3,zyjs.灞呮皯閲戦 鍒3鍊,'鑷垂閲戦' 鍒4,zyjs.鑷垂閲戦 鍒4鍊
122 from #jg jg
123 left join #zyjs zyjs on jg.鏈烘瀯ID=zyjs.鏈烘瀯ID
124 union all
125 select
126 '浣忛櫌鎯呭喌' 鍒嗙被,'棰勪氦鏀跺叆' 鍒1,zyyj.棰勪氦鏀跺叆 鍒1鍊,'鑽搧鏀跺叆' 鍒2,cast(zycf.鑽搧鏀跺叆 as nvarchar(10)) 鍒2鍊,
127 '璇婄枟鏀跺叆' 鍒3,zycf.璇婄枟鏀跺叆 鍒3鍊,'鍖婚櫌鎵挎媴' 鍒4,zyjs.鍖婚櫌鎵挎媴 鍒4鍊
128 from #jg jg
129 left join #zyjs zyjs on jg.鏈烘瀯ID=zyjs.鏈烘瀯ID
130 left join #zyyj zyyj on jg.鏈烘瀯ID=zyyj.鏈烘瀯ID
131 left join #zycf zycf on jg.鏈烘瀯ID=zycf.鏈烘瀯ID
132 union all
133 select null,'',null,'宸ヤ綔閲忔儏鍐(鍖婚櫌瀹為檯宸','浣滈噺鎯呭喌,涓庣粨绠','鏁版嵁鏃犲叧)',null,null,null
134 union all
135 select
136 null,'鎬昏垂鐢',t.鎬婚噾棰,'鑽搧閲戦',cast(t.鑽搧閲戦 as nvarchar(10)) ,'璇婄枟閲戦',t.璇婄枟閲戦,null,null
137 from #gzl t
138 union all
139 select null,'',null,'鍚勯」鏀跺叆椤圭洰璐圭敤鎯呭喌','(缁撶畻鏁版嵁)','',null,null,null
140 union all
141 select
142 null,a.鏀跺叆椤圭洰,a.閲戦,b.鏀跺叆椤圭洰,cast(b.閲戦 as nvarchar(10)) ,c.鏀跺叆椤圭洰,c.閲戦,d.鏀跺叆椤圭洰,d.閲戦
143 from #a a
144 left join #b b on a.px+1=b.px
145 left join #c c on a.px+2=c.px
146 left join #d d on a.px+3=d.px
147 union all
148 select null, '鍚堣' ,sum(t.閲戦),null,null,null,null,null,null
149 from #srxm t
150 ) t
151 ]]>
152 </from>
153
154 <with>
155 <![CDATA[
156
157 with t as (
158 select
159 gh.鐧昏鏈烘瀯ID 鏈烘瀯ID,
160 count(distinct gh.妗fID) 鎸傚彿浜烘暟,
161 count(distinct case when isnull(jzjl.鍒濊瘖,'鏄')='鏄' then jzjl.妗fID else null end) 棣栬瘖浜烘暟,
162 count(distinct case when isnull(jzjl.鍒濊瘖,'鏄')='鍚' then jzjl.妗fID else null end) 澶嶈瘖浜烘暟,
163 sum(js.閲戦) 鎸傚彿閲戦
164 from reg_鎸傚彿 gh
165 inner join opd_璁板綍 jzjl on gh.鎸傚彿ID=jzjl.鎸傚彿ID
166 inner join opc_璁板綍_缁撶畻 js on gh.缁撶畻ID=js.缁撶畻ID
167 where gh.灏辫瘖鏃ユ湡 between ${鏃堕棿_START} and ${鏃堕棿_END} and gh.鐧昏鏈烘瀯ID=${缁熻鏈烘瀯}
168 group by gh.鐧昏鏈烘瀯ID
169 )
170 select * into #gh from t;
171 select
172 js.缁撶畻鏈烘瀯ID 鏈烘瀯ID,
173 count(distinct jl.妗fID+'-'+jl.寮鍗曞尰鐢烮D+'-'+convert(nvarchar(10),jl.鐧昏鏃堕棿,120)) 闂ㄨ瘖浜烘,
174 sum(js.閲戦) 鎬婚噾棰,
175 sum(js.鎶ラ攢閲戦) 鎶ラ攢閲戦,
176 COUNT(DISTINCT (case when ybjs.缁撶畻ID IS NULL THEN jl.妗fID+'-'+jl.寮鍗曞尰鐢烮D+'-'+convert(nvarchar(10),jl.鐧昏鏃堕棿,120) ELSE NULL END)) 鑷垂浜烘,
177 COUNT(DISTINCT (case when ybjs.缁撶畻ID IS NOT NULL THEN jl.妗fID+'-'+jl.寮鍗曞尰鐢烮D+'-'+convert(nvarchar(10),jl.鐧昏鏃堕棿,120) ELSE NULL END)) 鍖讳繚浜烘,
178 count(distinct (case when jzlb.鍚嶇О in ('闂ㄨ瘖鎱㈢壒鐥') then jl.妗fID+'-'+jl.寮鍗曞尰鐢烮D+'-'+convert(nvarchar(10),jl.鐧昏鏃堕棿,120) else null end)) 鐗圭梾浜烘,
179 count(distinct (case when jzlb.鍚嶇О not in ('闂ㄨ瘖鎱㈢壒鐥') then jl.妗fID+'-'+jl.寮鍗曞尰鐢烮D+'-'+convert(nvarchar(10),jl.鐧昏鏃堕棿,120) else null end)) 鏅氶棬璇婁汉娆
180 into #mzjs
181 from opc_璁板綍 jl
182 inner join opc_璁板綍_缁撶畻 js on jl.璁板綍ID=js.璁板綍ID
183 left join yb_灏辫瘖缁撶畻璁板綍 ybjs on js.缁撶畻ID=ybjs.缁撶畻ID
184 left join bas_灏辫瘖绫诲埆 jzlb on jl.鍖荤枟绫诲埆ID=jzlb.鍖荤枟绫诲埆ID AND jl.灏辫瘖绫诲埆ID=jzlb.灏辫瘖绫诲埆ID
185 where js.缁撶畻鏃堕棿 between ${鏃堕棿_START} and ${鏃堕棿_END} and js.缁撶畻鏈烘瀯ID=${缁熻鏈烘瀯}
186 and jl.澶勬柟鏉ユ簮<>'闂ㄨ瘖鎸傚彿'
187 group by js.缁撶畻鏈烘瀯ID
188
189
190 select
191 js.缁撶畻鏈烘瀯ID 鏈烘瀯ID,
192 sum(case when zffs.鍚嶇О='鐜伴噾' then zf.鏀粯閲戦 else null end) 鐜伴噾鏀粯,
193 sum(case when zffs.鍚嶇О!='鐜伴噾' then zf.鏀粯閲戦 else null end) 鍏朵粬鏀粯
194 into #mzzf
195 from opc_璁板綍_缁撶畻 js
196 inner join opc_璁板綍 jl on js.璁板綍ID=jl.璁板綍ID
197 inner join opc_璁板綍_缁撶畻_鏀粯 zf on js.缁撶畻ID=zf.缁撶畻ID
198 inner join bas_鏀粯鏂瑰紡 zffs on zf.鏀粯鏂瑰紡ID=zffs.鏀粯鏂瑰紡ID
199 where js.缁撶畻鏃堕棿 between ${鏃堕棿_START} and ${鏃堕棿_END} and js.缁撶畻鏈烘瀯ID=${缁熻鏈烘瀯}
200 and jl.澶勬柟鏉ユ簮<>'闂ㄨ瘖鎸傚彿'
201 group by js.缁撶畻鏈烘瀯ID
202
203
204 --cf
205 select
206 js.缁撶畻鏈烘瀯ID 鏈烘瀯ID,
207 count(distinct fymx.澶勬柟ID) 澶勬柟鎬绘暟,
208 sum(case when xm.绫诲埆ID in ('5','6','7','8') then mx.閲戦 else null end) 鑽搧閲戦,
209 sum(case when xm.绫诲埆ID not in ('5','6','7','8') then mx.閲戦 else null end) 璇婄枟閲戦
210 into #mzcf
211 from opc_璁板綍_鏄庣粏 mx
212 inner join opc_璁板綍_缁撶畻 js on mx.缁撶畻ID=js.缁撶畻ID
213 inner join bas_鏀惰垂椤圭洰 xm on mx.椤圭洰ID=xm.椤圭洰ID
214 left join opd_澶勬柟_鍖诲槺_璐圭敤 fymx on mx.鍖诲槺鏄庣粏ID=fymx.鏄庣粏ID
215 where js.缁撶畻鏃堕棿 between ${鏃堕棿_START} and ${鏃堕棿_END} AND js.缁撶畻鏈烘瀯ID=${缁熻鏈烘瀯}
216 group by js.缁撶畻鏈烘瀯ID
217
218 --浣忛櫌
219 select jl.鐧昏鏈烘瀯ID 鏈烘瀯ID, count(1) 鍏ラ櫌鎬讳汉鏁 into #ry
220 from ihm_璁板綍 jl
221 where jl.鍏ラ櫌鏃堕棿 between ${鏃堕棿_START} and ${鏃堕棿_END} AND 鐧昏鏈烘瀯ID=${缁熻鏈烘瀯}
222 group by jl.鐧昏鏈烘瀯ID
223
224 select
225 jl.鐧昏鏈烘瀯ID 鏈烘瀯ID,
226 count(1) 鍦ㄩ櫌鎬讳汉鏁
227 into #zy
228 from ihm_璁板綍 jl
229 where jl.鐘舵 in ('鍦ㄥ簥','寰呭垎')
230 group by jl.鐧昏鏈烘瀯ID
231
232
233
234 select
235 jl.鐧昏鏈烘瀯ID 鏈烘瀯ID, count(1) 鍑洪櫌鎬讳汉鏁 into #cy
236 from ihm_璁板綍 jl
237 where jl.鍑洪櫌鏃堕棿 between ${鏃堕棿_START} and ${鏃堕棿_END}
238 group by jl.鐧昏鏈烘瀯ID
239
240 select js.缁撶畻鏈烘瀯ID 鏈烘瀯ID,count(distinct 璁板綍ID) 缁撶畻鎬讳汉鏁,
241 sum(js.閲戦) 缁撶畻閲戦,
242 sum(case when ybjs.闄╃绫诲瀷='310' then js.閲戦 else null end) 鑱屽伐閲戦,
243 sum(case when ybjs.闄╃绫诲瀷='390' then js.閲戦 else null end) 灞呮皯閲戦,
244 sum(case when ybjs.缁撶畻ID is null then js.閲戦 else null end) 鑷垂閲戦,
245 sum(js.鍖婚櫌鎵挎媴) 鍖婚櫌鎵挎媴
246 into #zyjs
247 from ihm_璁板綍_缁撶畻 js
248 left join yb_灏辫瘖缁撶畻璁板綍 ybjs on js.缁撶畻ID=ybjs.缁撶畻ID AND js.缁撶畻鏈烘瀯ID=${缁熻鏈烘瀯}
249 where js.缁撶畻鏃堕棿 between ${鏃堕棿_START} and ${鏃堕棿_END}
250 group by js.缁撶畻鏈烘瀯ID
251
252 select
253 yj.鐧昏鏈烘瀯ID 鏈烘瀯ID,
254 sum(yj.閲戦) 棰勪氦鏀跺叆
255 into #zyyj
256 from ihm_璁板綍_棰勪氦 yj
257 where yj.鏀惰垂鏃堕棿 between ${鏃堕棿_START} and ${鏃堕棿_END} and yj.鐧昏鏈烘瀯ID=${缁熻鏈烘瀯}
258 group by yj.鐧昏鏈烘瀯ID
259
260 select js.缁撶畻鏈烘瀯ID 鏈烘瀯ID,
261 sum(case when xm.绫诲埆ID in ('5','6','7','8') then case when js.鐘舵='浣滃簾' then -mx.閲戦 else mx.閲戦 end else null end) 鑽搧鏀跺叆,
262 sum(case when xm.绫诲埆ID not in ('5','6','7','8') then case when js.鐘舵='浣滃簾' then -mx.閲戦 else mx.閲戦 end else null end) 璇婄枟鏀跺叆
263 into #zycf
264 from ihm_璁板綍_缁撶畻 js
265 inner join ihm_璁板綍_缁撶畻_鏄庣粏 jsmx on js.缁撶畻ID=jsmx.缁撶畻ID
266 inner join ihm_璁板綍_鏄庣粏 mx on jsmx.鏄庣粏ID=mx.鏄庣粏ID
267 inner join bas_鏀惰垂椤圭洰 xm on mx.椤圭洰ID=xm.椤圭洰ID
268 where js.缁撶畻鏃堕棿 between ${鏃堕棿_START} and ${鏃堕棿_END} and js.缁撶畻鏈烘瀯ID=${缁熻鏈烘瀯}
269 group by js.缁撶畻鏈烘瀯ID
270
271
272 select
273 sum(case when xm.绫诲埆ID in ('5','6','7','8') then mx.閲戦 else null end) 鑽搧閲戦,
274 sum(case when xm.绫诲埆ID not in ('5','6','7','8') then mx.閲戦 else null end) 璇婄枟閲戦,
275 sum(mx.閲戦) 鎬婚噾棰 into #mx
276 from opc_璁板綍_鏄庣粏 mx
277 inner join bas_鏀惰垂椤圭洰 xm on mx.椤圭洰ID=xm.椤圭洰ID
278 where mx.鐧昏鏃堕棿 between ${鏃堕棿_START} and ${鏃堕棿_END} and mx.鐧昏鏈烘瀯ID=${缁熻鏈烘瀯}
279 union all
280 select
281 sum(case when xm.绫诲埆ID in ('5','6','7','8') then mx.閲戦 else null end) 鑽搧閲戦,
282 sum(case when xm.绫诲埆ID not in ('5','6','7','8') then mx.閲戦 else null end) 璇婄枟閲戦,
283 sum(mx.閲戦) 鎬婚噾棰
284 from ihm_璁板綍_鏄庣粏 mx
285 inner join bas_鏀惰垂椤圭洰 xm on mx.椤圭洰ID=xm.椤圭洰ID
286 where mx.鐧昏鏃堕棿 between ${鏃堕棿_START} and ${鏃堕棿_END} and mx.鐧昏鏈烘瀯ID=${缁熻鏈烘瀯}
287
288 select
289 sum(t.鎬婚噾棰) 鎬婚噾棰,
290 sum(t.鑽搧閲戦) 鑽搧閲戦,
291 sum(t.璇婄枟閲戦) 璇婄枟閲戦
292 into #gzl
293 from #mx t
294
295
296 select
297 js.缁撶畻鏈烘瀯ID,
298 xm.鏀跺叆椤圭洰,
299 sum(mx.閲戦) 閲戦 into #srxmmx
300 from opc_璁板綍_缁撶畻 js
301 inner join opc_璁板綍_鏄庣粏 mx on js.缁撶畻ID=mx.缁撶畻ID
302 inner join bas_鏀惰垂椤圭洰 xm on mx.椤圭洰ID=xm.椤圭洰ID
303 where js.缁撶畻鏃堕棿 between ${鏃堕棿_START} and ${鏃堕棿_END} and js.缁撶畻鏈烘瀯ID=${缁熻鏈烘瀯}
304 group by js.缁撶畻鏈烘瀯ID,xm.鏀跺叆椤圭洰
305 union all
306 select
307 js.缁撶畻鏈烘瀯ID,
308 xm.鏀跺叆椤圭洰,
309 sum(case when js.鐘舵='浣滃簾' then -mx.閲戦 else mx.閲戦 end) 閲戦
310 from ihm_璁板綍_缁撶畻 js
311 inner join ihm_璁板綍_缁撶畻_鏄庣粏 jsmx on js.缁撶畻ID=jsmx.缁撶畻ID
312 inner join ihm_璁板綍_鏄庣粏 mx on jsmx.鏄庣粏ID=mx.鏄庣粏ID
313 inner join bas_鏀惰垂椤圭洰 xm on mx.椤圭洰ID=xm.椤圭洰ID
314 where js.缁撶畻鏃堕棿 between ${鏃堕棿_START} and ${鏃堕棿_END} and js.缁撶畻鏈烘瀯ID=${缁熻鏈烘瀯}
315 group by js.缁撶畻鏈烘瀯ID,xm.鏀跺叆椤圭洰
316
317
318
319 select
320 t.缁撶畻鏈烘瀯ID,t.鏀跺叆椤圭洰,sum(t.閲戦) 閲戦,
321 ROW_NUMBER()over(order by t.鏀跺叆椤圭洰) px into #srxm
322 from #srxmmx t
323 group by t.缁撶畻鏈烘瀯ID,t.鏀跺叆椤圭洰
324
325 select 鏀跺叆椤圭洰,閲戦,px into #a from #srxm t where t.px%4=1
326 select 鏀跺叆椤圭洰,閲戦,px into #b from #srxm t where t.px%4=2
327 select 鏀跺叆椤圭洰,閲戦,px into #c from #srxm t where t.px%4=3
328 select 鏀跺叆椤圭洰,閲戦,px into #d from #srxm t where t.px%4=0
329
330
331 select jg.鏈烘瀯ID into #jg
332 from bas_鏈烘瀯 jg
333 where jg.鏈烘瀯ID=${缁熻鏈烘瀯}
334
335 ]]>
336 </with>
337
338
339 <where>
340 <![CDATA[
341
342 ]]>
343 </where>
344
345 <groups>
346 <group>
347 <group-col id="鍒嗙被" field-id="鍒嗙被" width="120" span="true" span-dep-col-id="鍒嗙被"/>
348 <group-col id="鍒1" field-id="鍒1" width="120" />
349 <group-col id="鍒1鍊" field-id="鍒1鍊" width="80" />
350 <group-col id="鍒2" field-id="鍒2" width="170"/>
351 <group-col id="鍒2鍊" field-id="鍒2鍊" width="125"/>
352 <group-col id="鍒3" field-id="鍒3" width="120"/>
353 <group-col id="鍒3鍊" field-id="鍒3鍊" width="80"/>
354 <group-col id="鍒4" field-id="鍒4" width="120"/>
355 <group-col id="鍒4鍊" field-id="鍒4鍊" width="80" />
356 </group>
357 </groups>
358
359 </report>
澶囨鍙:鑻廔CP澶2024087954鍙-2 | 娓濆叕缃戝畨澶50010402001513