username@email.com
2023-11-21 a7ae63ad871b986eb1bede54219638edd4e29b63
ÉêË߼Ǽ±í.sql
@@ -25,3 +25,33 @@
   constraint PK_T_SALARY_APPEAL primary key (id)
)
go
INSERT [dbo].[plt_page] ([Id], [system_id], [page_name], [display_seq], [page_path], [page_method], [page_type], [page_superior], [open_type], [rec_status], [creater], [createtime]) VALUES (newid(), N'1', N'工资核对', 10, N'/SalaryCheck/Employee', N'01', N'M', N'6a13cb10-35d9-4176-a231-8887948e059e',  0, N'A', N'e4c93811-b9b1-4998-89f5-c416ebab0c07', getdate())
go
INSERT [dbo].[plt_page] ([Id], [system_id], [page_name], [display_seq], [page_path], [page_method], [page_type], [page_superior],  [open_type], [rec_status], [creater], [createtime]) VALUES (newid(), N'1', N'工资查询', 8, N'/SalaryCheck/SearchIndex', N'01', N'M', N'6a13cb10-35d9-4176-a231-8887948e059e',  0, N'A', N'e4c93811-b9b1-4998-89f5-c416ebab0c07', getdate())
go
INSERT [dbo].[plt_page] ([Id], [system_id], [page_name], [display_seq], [page_path], [page_method], [page_type], [page_superior],  [open_type], [rec_status], [creater], [createtime]) VALUES (newid(), N'1', N'工资核准', 9, N'/SalaryCheck/Index', N'01', N'M', N'6a13cb10-35d9-4176-a231-8887948e059e',  0, N'A', N'e4c93811-b9b1-4998-89f5-c416ebab0c07', getdate())
go
--2021-6-28 ç”µè¯è´¹
SELECT   td.sim_id, td.bill_year, td.Jan, td.Feb, td.Mar, td.Apr, td.May, td.Jun, td.Jul, td.Aug, td.Sept, td.Oct, td.Nov, td.Dece,
                b.goods_name AS sim
FROM      (SELECT   sim_id, bill_year, SUM(CASE [bill_month] WHEN '1' THEN (bill_amount) ELSE 0 END) AS Jan,
                                 SUM(CASE [bill_month] WHEN '2' THEN (bill_amount) ELSE 0 END) AS Feb,
                                 SUM(CASE [bill_month] WHEN '3' THEN (bill_amount) ELSE 0 END) AS Mar,
                                 SUM(CASE [bill_month] WHEN '4' THEN (bill_amount) ELSE 0 END) AS Apr,
                                 SUM(CASE [bill_month] WHEN '5' THEN (bill_amount) ELSE 0 END) AS May,
                                 SUM(CASE [bill_month] WHEN '6' THEN (bill_amount) ELSE 0 END) AS Jun,
                                 SUM(CASE [bill_month] WHEN '7' THEN (bill_amount) ELSE 0 END) AS Jul,
                                 SUM(CASE [bill_month] WHEN '8' THEN (bill_amount) ELSE 0 END) AS Aug,
                                 SUM(CASE [bill_month] WHEN '9' THEN (bill_amount) ELSE 0 END) AS Sept,
                                 SUM(CASE [bill_month] WHEN '10' THEN (bill_amount) ELSE 0 END) AS Oct,
                                 SUM(CASE [bill_month] WHEN '11' THEN (bill_amount) ELSE 0 END) AS Nov,
                                 SUM(CASE [bill_month] WHEN '12' THEN (bill_amount) ELSE 0 END) AS Dece
                 FROM      dbo.t_sim_cost
                 GROUP BY sim_id, bill_year) AS td INNER JOIN
                dbo.adm_goods_manage AS b ON td.sim_id = b.Id