Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
BudgetManagementSystem
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王利雷
BudgetManagementSystem
Commits
eb1f1ccf
Commit
eb1f1ccf
authored
Jun 02, 2019
by
shj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化导出的费用清单和费用说明
parent
d7d1d941
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
40 additions
and
2 deletions
+40
-2
IPowerDao.java
src/main/java/dao/IPowerDao.java
+4
-0
IPowerDao.xml
src/main/java/dao/IPowerDao.xml
+7
-0
ITravelDao.xml
src/main/java/dao/ITravelDao.xml
+3
-2
BudgetHandler.java
src/main/java/handlers/BudgetHandler.java
+0
-0
DatabaseQueryHandler.java
src/main/java/handlers/DatabaseQueryHandler.java
+26
-0
BudgetExportUtil.java
src/main/java/util/BudgetExportUtil.java
+0
-0
budgetDetail.jsp
src/main/webapp/budgetDetail.jsp
+0
-0
No files found.
src/main/java/dao/IPowerDao.java
View file @
eb1f1ccf
...
...
@@ -6,4 +6,8 @@ import java.util.List;
public
interface
IPowerDao
{
List
<
Power
>
selectAll
();
void
insertPower
(
Power
power
);
void
deletePower
(
Power
power
);
}
src/main/java/dao/IPowerDao.xml
View file @
eb1f1ccf
...
...
@@ -5,4 +5,10 @@
<select
id=
"selectAll"
resultType=
"beans.Power"
>
select * from power
</select>
<insert
id=
"insertPower"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into power(name,price) values (#{name},#{price})
</insert>
<delete
id=
"deletePower"
>
delete from power where id=#{id}
</delete>
</mapper>
\ No newline at end of file
src/main/java/dao/ITravelDao.xml
View file @
eb1f1ccf
...
...
@@ -10,14 +10,14 @@
</select>
<insert
id=
"insertTravel"
>
insert into budgetmanagementsystem.travel(name, price, food, traffic, accommodation)
values (#{
dest
},#{price},#{food},#{traffic},#{accommodation})
values (#{
name
},#{price},#{food},#{traffic},#{accommodation})
</insert>
<delete
id=
"deleteTravel"
>
delete from budgetmanagementsystem.travel where id=#{id}
</delete>
<update
id=
"updateTravel"
>
update budgetmanagementsystem.travel
set name=#{
dest
},price=#{price},food=#{food},traffic=#{traffic},accommodation=#{accommodation}
set name=#{
name
},price=#{price},food=#{food},traffic=#{traffic},accommodation=#{accommodation}
where id=#{id}
</update>
</mapper>
\ No newline at end of file
src/main/java/handlers/BudgetHandler.java
View file @
eb1f1ccf
This diff is collapsed.
Click to expand it.
src/main/java/handlers/DatabaseQueryHandler.java
View file @
eb1f1ccf
...
...
@@ -103,6 +103,32 @@ public class DatabaseQueryHandler {
}
@Autowired
private
IPowerDao
powerDao
;
@RequestMapping
(
"/Power"
)
public
void
queryPower
(
HttpServletRequest
request
,
HttpServletResponse
response
){
try
{
response
.
setCharacterEncoding
(
"utf-8"
);
response
.
setContentType
(
"text/html;charset=utf-8"
);
PrintWriter
writer
=
response
.
getWriter
();
JSONObject
object
=
new
JSONObject
();
List
<
Power
>
powers
=
powerDao
.
selectAll
();
List
<
JSONObject
>
list
=
new
LinkedList
<>();
for
(
Power
item
:
powers
)
{
JSONObject
obj
=
new
JSONObject
();
obj
.
put
(
"id"
,
item
.
getId
());
obj
.
put
(
"name"
,
item
.
getName
());
obj
.
put
(
"price"
,
item
.
getPrice
());
obj
.
put
(
"nums"
,
0
);
list
.
add
(
obj
);
}
object
.
put
(
"data"
,
list
);
writer
.
write
(
JSON
.
toJSONString
(
object
));
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
@Autowired
private
ILabourDao
labourDao
;
@RequestMapping
(
"/Labour"
)
public
void
queryLabour
(
HttpServletRequest
request
,
HttpServletResponse
response
){
...
...
src/main/java/util/BudgetExportUtil.java
View file @
eb1f1ccf
This diff is collapsed.
Click to expand it.
src/main/webapp/budgetDetail.jsp
View file @
eb1f1ccf
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment