├── design
├── 数据库PJER图.png
└── 数据库pj数据库设计.png
├── .idea
├── copyright
│ └── profiles_settings.xml
├── vcs.xml
├── modules.xml
├── database_project.iml
├── compiler.xml
└── misc.xml
├── propertyManagement
├── 用户手册
├── 用户手册.pdf
├── .idea
│ ├── dictionaries
│ │ └── .xml
│ ├── copyright
│ │ └── profiles_settings.xml
│ ├── libraries
│ │ ├── commons_dbutils_1_7.xml
│ │ ├── commons_dbutils_1_7__2_.xml
│ │ ├── mysql_connector_java_8_0_11.xml
│ │ └── mysql_connector_java_8_0_11__2_.xml
│ ├── modules.xml
│ ├── misc.xml
│ ├── propertyManagement.iml
│ ├── compiler.xml
│ └── uiDesigner.xml
├── web
│ ├── lib
│ │ ├── mail.jar
│ │ ├── activation.jar
│ │ ├── commons-io-2.6.jar
│ │ ├── commons-dbutils-1.7.jar
│ │ ├── commons-fileupload-1.3.3.jar
│ │ └── mysql-connector-java-8.0.11.jar
│ ├── WEB-INF
│ │ ├── web.xml
│ │ ├── equipmentCheck.jsp
│ │ ├── equipmentRepair.jsp
│ │ ├── parkingmanage.jsp
│ │ └── parkingview.jsp
│ └── index.jsp
├── src
│ ├── dao
│ │ ├── database.properties
│ │ ├── daoInterface
│ │ │ ├── DAO.java
│ │ │ └── JdbcDaoImpl.java
│ │ ├── JDBCUtil.java
│ │ └── classDao
│ │ │ ├── relationDao
│ │ │ ├── equipmentDao
│ │ │ │ ├── InEquipCheckDao.java
│ │ │ │ ├── OutEquipCheckDao.java
│ │ │ │ ├── OutEquipRepairDao.java
│ │ │ │ ├── InEquipRepairDao.java
│ │ │ │ └── EquipmentIssueDao.java
│ │ │ ├── PropertyRecordDao.java
│ │ │ ├── buildingDao
│ │ │ │ ├── HousePurchaseRecordDao.java
│ │ │ │ └── ComplaintDao.java
│ │ │ ├── ProperMonthRecordDao.java
│ │ │ ├── parkingDao
│ │ │ │ ├── LeasedParkingRecordDao.java
│ │ │ │ ├── OwnedParkingRecordDao.java
│ │ │ │ └── TemporaryParkingRecordDao.java
│ │ │ └── residentDao
│ │ │ │ └── ResidentCostDao.java
│ │ │ └── entityDao
│ │ │ ├── houseDao
│ │ │ ├── HouseDao.java
│ │ │ ├── CommunityDao.java
│ │ │ └── BuildingDao.java
│ │ │ ├── ResidentDao.java
│ │ │ ├── parkingspaceDao
│ │ │ ├── OwnedParkingSpaceDao.java
│ │ │ ├── TemporaryParkingSpaceDao.java
│ │ │ └── LeasedParkingSpaceDao.java
│ │ │ └── equipmentDao
│ │ │ ├── OutdoorEquipmentDao.java
│ │ │ └── IndoorEquipmentDao.java
│ ├── model
│ │ ├── entity
│ │ │ ├── house
│ │ │ │ ├── Building.java
│ │ │ │ ├── House.java
│ │ │ │ └── Community.java
│ │ │ ├── parkingspace
│ │ │ │ ├── OwnedParkingSpace.java
│ │ │ │ ├── LeasedParkingSpace.java
│ │ │ │ └── TemporaryParkingSpace.java
│ │ │ ├── Resident.java
│ │ │ └── equipment
│ │ │ │ ├── IndoorEquipment.java
│ │ │ │ └── OutdoorEquipment.java
│ │ └── relation
│ │ │ ├── ProperMonthRecord.java
│ │ │ ├── equipment
│ │ │ ├── IndoorEquipCheck.java
│ │ │ ├── OutdoorEquipCheck.java
│ │ │ ├── IndoorEquipRepair.java
│ │ │ ├── OutdoorEquipRepair.java
│ │ │ └── EquipmentIssue.java
│ │ │ ├── PropertyRecord.java
│ │ │ ├── building
│ │ │ ├── HousePurchaseRecord.java
│ │ │ └── Complaint.java
│ │ │ ├── parking
│ │ │ ├── OwnedParkingRecord.java
│ │ │ ├── LeasedParkingRecord.java
│ │ │ └── TemporaryParkingRecord.java
│ │ │ └── resident
│ │ │ └── ResidentCost.java
│ ├── service
│ │ ├── ResidentService.java
│ │ ├── HouseService.java
│ │ ├── FeedbackService.java
│ │ ├── EquipmentService.java
│ │ ├── ParkingService.java
│ │ └── PaymentService.java
│ ├── addData.java
│ └── UI.java
├── .gitignore
└── propertyManagement.iml
└── README.md
/design/数据库PJER图.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yaopenglalala/database_project/HEAD/design/数据库PJER图.png
--------------------------------------------------------------------------------
/design/数据库pj数据库设计.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yaopenglalala/database_project/HEAD/design/数据库pj数据库设计.png
--------------------------------------------------------------------------------
/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/propertyManagement/用户手册:
--------------------------------------------------------------------------------
1 | Temporary_parking_space:
2 | 临时车位里 停车状态为 0没车停,1有车停。
3 |
4 | Outdoor_equipment:
5 | 设备完好 0 ,设备出错 1.
--------------------------------------------------------------------------------
/propertyManagement/用户手册.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yaopenglalala/database_project/HEAD/propertyManagement/用户手册.pdf
--------------------------------------------------------------------------------
/propertyManagement/.idea/dictionaries/.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/propertyManagement/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/propertyManagement/web/lib/mail.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yaopenglalala/database_project/HEAD/propertyManagement/web/lib/mail.jar
--------------------------------------------------------------------------------
/propertyManagement/web/lib/activation.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yaopenglalala/database_project/HEAD/propertyManagement/web/lib/activation.jar
--------------------------------------------------------------------------------
/propertyManagement/web/lib/commons-io-2.6.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yaopenglalala/database_project/HEAD/propertyManagement/web/lib/commons-io-2.6.jar
--------------------------------------------------------------------------------
/propertyManagement/web/lib/commons-dbutils-1.7.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yaopenglalala/database_project/HEAD/propertyManagement/web/lib/commons-dbutils-1.7.jar
--------------------------------------------------------------------------------
/propertyManagement/web/lib/commons-fileupload-1.3.3.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yaopenglalala/database_project/HEAD/propertyManagement/web/lib/commons-fileupload-1.3.3.jar
--------------------------------------------------------------------------------
/propertyManagement/web/lib/mysql-connector-java-8.0.11.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yaopenglalala/database_project/HEAD/propertyManagement/web/lib/mysql-connector-java-8.0.11.jar
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/propertyManagement/src/dao/database.properties:
--------------------------------------------------------------------------------
1 | jdbcdriver=com.mysql.jdbc.Driver
2 | dburl=jdbc:mysql://localhost:3306/communitysystem?serverTimezone=GMT&useUnicode=true&characterEncoding=utf-8
3 | user=root
4 | password=123456
--------------------------------------------------------------------------------
/propertyManagement/.gitignore:
--------------------------------------------------------------------------------
1 | # comment
2 | /out/
3 | /.idea/workspace.xml
4 | /.idea/artifacts/propertyManagement_war_exploded.xml
5 | /json/test.json
6 | /web/res/
7 | /web/classes
8 |
9 | # mac bin
10 | .DS_Store
11 |
--------------------------------------------------------------------------------
/propertyManagement/.idea/libraries/commons_dbutils_1_7.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/propertyManagement/.idea/libraries/commons_dbutils_1_7__2_.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/propertyManagement/.idea/libraries/mysql_connector_java_8_0_11.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/propertyManagement/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/propertyManagement/.idea/libraries/mysql_connector_java_8_0_11__2_.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/propertyManagement/web/WEB-INF/web.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
--------------------------------------------------------------------------------
/propertyManagement/web/WEB-INF/equipmentCheck.jsp:
--------------------------------------------------------------------------------
1 | <%--
2 | Created by IntelliJ IDEA.
3 | User: 妖风
4 | Date: 2019/1/4
5 | Time: 12:52
6 | To change this template use File | Settings | File Templates.
7 | --%>
8 | <%@ page contentType="text/html;charset=UTF-8" language="java" %>
9 |
10 |
11 | Title
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/propertyManagement/web/WEB-INF/equipmentRepair.jsp:
--------------------------------------------------------------------------------
1 | <%--
2 | Created by IntelliJ IDEA.
3 | User: 妖风
4 | Date: 2019/1/4
5 | Time: 12:52
6 | To change this template use File | Settings | File Templates.
7 | --%>
8 | <%@ page contentType="text/html;charset=UTF-8" language="java" %>
9 |
10 |
11 | Title
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/propertyManagement/web/WEB-INF/parkingmanage.jsp:
--------------------------------------------------------------------------------
1 | <%--
2 | Created by IntelliJ IDEA.
3 | User: 妖风
4 | Date: 2019/1/4
5 | Time: 12:56
6 | To change this template use File | Settings | File Templates.
7 | --%>
8 | <%@ page contentType="text/html;charset=UTF-8" language="java" %>
9 |
10 |
11 | Title
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/propertyManagement/web/index.jsp:
--------------------------------------------------------------------------------
1 | <%--
2 | Created by IntelliJ IDEA.
3 | User: 妖风
4 | Date: 2018/12/28
5 | Time: 14:55
6 | To change this template use File | Settings | File Templates.
7 | --%>
8 | <%@ page contentType="text/html;charset=UTF-8" language="java" %>
9 |
10 |
11 | $Title$
12 |
13 |
14 | $END$
15 |
16 |
17 |
--------------------------------------------------------------------------------
/propertyManagement/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/propertyManagement/web/WEB-INF/parkingview.jsp:
--------------------------------------------------------------------------------
1 | <%--
2 | Created by IntelliJ IDEA.
3 | User: 妖风
4 | Date: 2019/1/4
5 | Time: 12:47
6 | To change this template use File | Settings | File Templates.
7 | 此页面用于:
8 | 1.记录临时停车信息
9 | 2.车位租借
10 | 3.车位购买
11 | 用户可以选择小区,展示车位情况,选中车位后进入车位管理界面
12 | --%>
13 | <%@ page contentType="text/html;charset=UTF-8" language="java" %>
14 |
15 |
16 | Title
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/.idea/database_project.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/propertyManagement/src/dao/daoInterface/DAO.java:
--------------------------------------------------------------------------------
1 | package dao.daoInterface;
2 |
3 | import java.sql.Connection;
4 | import java.sql.SQLException;
5 | import java.util.List;
6 |
7 | public interface DAO {
8 | int update(Connection connection, String sql, Object... args) throws Exception;
9 |
10 | T get(Connection connection, String sql, Object... args) throws Exception;
11 |
12 | List getList(Connection connection, String sql, Object... args) throws Exception;
13 |
14 | E getValue(Connection connection, String sql, Object... args) throws SQLException, Exception;
15 | }
16 |
--------------------------------------------------------------------------------
/propertyManagement/.idea/propertyManagement.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/propertyManagement/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/propertyManagement/src/model/entity/house/Building.java:
--------------------------------------------------------------------------------
1 | package model.entity.house;
2 |
3 | /**
4 | * Created by your dad on 2019/1/3.
5 | */
6 | public class Building {
7 | private Integer building_id;
8 | private Integer community_id;
9 | private String name;
10 |
11 | public Integer getBuilding_id() {
12 | return building_id;
13 | }
14 |
15 | public void setBuilding_id(Integer building_id) {
16 | this.building_id = building_id;
17 | }
18 |
19 | public Integer getCommunity_id() {
20 | return community_id;
21 | }
22 |
23 | public void setCommunity_id(Integer community_id) {
24 | this.community_id = community_id;
25 | }
26 |
27 | public String getName() {
28 | return name;
29 | }
30 |
31 | public void setName(String name) {
32 | this.name = name;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/propertyManagement/src/model/entity/parkingspace/OwnedParkingSpace.java:
--------------------------------------------------------------------------------
1 | package model.entity.parkingspace;
2 |
3 | /**
4 | * Created by your dad on 2019/1/3.
5 | */
6 | public class OwnedParkingSpace {
7 | private Integer parking_space_id;
8 | private Integer community_id;
9 | private String description;
10 |
11 | public Integer getParking_space_id() {
12 | return parking_space_id;
13 | }
14 |
15 | public void setParking_space_id(Integer parking_space_id) {
16 | this.parking_space_id = parking_space_id;
17 | }
18 |
19 | public Integer getCommunity_id() {
20 | return community_id;
21 | }
22 |
23 | public void setCommunity_id(Integer community_id) {
24 | this.community_id = community_id;
25 | }
26 |
27 | public String getDescription() {
28 | return description;
29 | }
30 |
31 | public void setDescription(String description) {
32 | this.description = description;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/propertyManagement/src/model/relation/ProperMonthRecord.java:
--------------------------------------------------------------------------------
1 | package model.relation;
2 |
3 | /**
4 | * Created by your dad on 2019/1/3.
5 | */
6 | public class ProperMonthRecord {
7 | private Integer year;
8 | private Integer month;
9 | private Integer type;
10 | private Float amount;
11 |
12 | public Integer getYear() {
13 | return year;
14 | }
15 |
16 | public void setYear(Integer year) {
17 | this.year = year;
18 | }
19 |
20 | public Integer getMonth() {
21 | return month;
22 | }
23 |
24 | public void setMonth(Integer month) {
25 | this.month = month;
26 | }
27 |
28 | public Integer getType() {
29 | return type;
30 | }
31 |
32 | public void setType(Integer type) {
33 | this.type = type;
34 | }
35 |
36 | public Float getAmount() {
37 | return amount;
38 | }
39 |
40 | public void setAmount(Float amount) {
41 | this.amount = amount;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/propertyManagement/src/model/entity/house/House.java:
--------------------------------------------------------------------------------
1 | package model.entity.house;
2 |
3 | /**
4 | * Created by your dad on 2019/1/3.
5 | */
6 | public class House {
7 | private Integer house_id;
8 | private Integer building_id;
9 | private String name;
10 | private Integer size;
11 |
12 | public Integer getHouse_id() {
13 | return house_id;
14 | }
15 |
16 | public void setHouse_id(Integer house_id) {
17 | this.house_id = house_id;
18 | }
19 |
20 | public Integer getBuilding_id() {
21 | return building_id;
22 | }
23 |
24 | public void setBuilding_id(Integer building_id) {
25 | this.building_id = building_id;
26 | }
27 |
28 | public String getName() {
29 | return name;
30 | }
31 |
32 | public void setName(String name) {
33 | this.name = name;
34 | }
35 |
36 | public Integer getSize() {
37 | return size;
38 | }
39 |
40 | public void setSize(Integer size) {
41 | this.size = size;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/propertyManagement/src/model/entity/Resident.java:
--------------------------------------------------------------------------------
1 | package model.entity;
2 |
3 | /**
4 | * Created by your dad on 2019/1/3.
5 | */
6 | public class Resident {
7 | private Integer resident_id ;
8 | private String identity_card;
9 | private String name;
10 | private long tel;
11 | public Integer getResident_id() {
12 | return resident_id;
13 | }
14 |
15 | public void setResident_id(Integer resident_id) {
16 | this.resident_id = resident_id;
17 | }
18 |
19 | public String getIdentity_card() {
20 | return identity_card;
21 | }
22 |
23 | public void setIdentity_card(String identity_card) {
24 | this.identity_card = identity_card;
25 | }
26 |
27 | public String getName() {
28 | return name;
29 | }
30 |
31 | public void setName(String name) {
32 | this.name = name;
33 | }
34 |
35 | public long getTel() {
36 | return tel;
37 | }
38 |
39 | public void setTel(long tel) {
40 | this.tel = tel;
41 | }
42 |
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/propertyManagement/src/model/entity/house/Community.java:
--------------------------------------------------------------------------------
1 | package model.entity.house;
2 |
3 | /**
4 | * Created by your dad on 2019/1/3.
5 | */
6 | public class Community {
7 | private Integer communityId;
8 | private String name;
9 | private float longitude;
10 | private float latitude;
11 |
12 | public Integer getCommunityId() {
13 | return communityId;
14 | }
15 |
16 | public void setCommunityId(Integer community_id) {
17 | this.communityId = community_id;
18 | }
19 |
20 | public String getName() {
21 | return name;
22 | }
23 |
24 | public void setName(String name) {
25 | this.name = name;
26 | }
27 |
28 | public float getLongitude() {
29 | return longitude;
30 | }
31 |
32 | public void setLongitude(float longitude) {
33 | this.longitude = longitude;
34 | }
35 |
36 | public float getLatitude() {
37 | return latitude;
38 | }
39 |
40 | public void setLatitude(float latitude) {
41 | this.latitude = latitude;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/propertyManagement/src/model/relation/equipment/IndoorEquipCheck.java:
--------------------------------------------------------------------------------
1 | package model.relation.equipment;
2 |
3 | import java.util.Date;
4 |
5 | /**
6 | * Created by your dad on 2019/1/3.
7 | */
8 | public class IndoorEquipCheck {
9 | private int check_id;
10 | private int equipment_id;
11 | private int state;
12 | private Date time;
13 |
14 | public int getCheck_id() {
15 | return check_id;
16 | }
17 |
18 | public void setCheck_id(int check_id) {
19 | this.check_id = check_id;
20 | }
21 |
22 | public int getEquipment_id() {
23 | return equipment_id;
24 | }
25 |
26 | public void setEquipment_id(int equipment_id) {
27 | this.equipment_id = equipment_id;
28 | }
29 |
30 | public int getState() {
31 | return state;
32 | }
33 |
34 | public void setState(int state) {
35 | this.state = state;
36 | }
37 |
38 | public Date getTime() {
39 | return time;
40 | }
41 |
42 | public void setTime(Date time) {
43 | this.time = time;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/propertyManagement/src/model/relation/equipment/OutdoorEquipCheck.java:
--------------------------------------------------------------------------------
1 | package model.relation.equipment;
2 |
3 | import java.util.Date;
4 |
5 | /**
6 | * Created by your dad on 2019/1/3.
7 | */
8 | public class OutdoorEquipCheck {
9 | private int check_id;
10 | private int equipment_id;
11 | private int state;
12 | private Date time;
13 |
14 | public int getCheck_id() {
15 | return check_id;
16 | }
17 |
18 | public void setCheck_id(int check_id) {
19 | this.check_id = check_id;
20 | }
21 |
22 | public int getEquipment_id() {
23 | return equipment_id;
24 | }
25 |
26 | public void setEquipment_id(int equipment_id) {
27 | this.equipment_id = equipment_id;
28 | }
29 |
30 | public int getState() {
31 | return state;
32 | }
33 |
34 | public void setState(int state) {
35 | this.state = state;
36 | }
37 |
38 | public Date getTime() {
39 | return time;
40 | }
41 |
42 | public void setTime(Date time) {
43 | this.time = time;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/propertyManagement/propertyManagement.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/propertyManagement/src/dao/JDBCUtil.java:
--------------------------------------------------------------------------------
1 | package dao;
2 |
3 | import java.io.FileInputStream;
4 | import java.sql.Connection;
5 | import java.sql.DriverManager;
6 | import java.util.Properties;
7 |
8 | public class JDBCUtil {
9 | private static Connection connection;
10 | private static final String FILEPATH = JDBCUtil.class.getClassLoader().getResource("./dao/database.properties").getPath();
11 |
12 | public static Connection getConnection(){
13 | if (connection != null) return connection;
14 |
15 | try{
16 | Properties properties = new Properties();
17 | properties.load(new FileInputStream(FILEPATH));
18 | String JDBC_DRIVER = properties.getProperty("jdbcdriver");
19 | String DB_URL = properties.getProperty("dburl");
20 | String USER = properties.getProperty("user");
21 | String PASSWORD = properties.getProperty("password");
22 |
23 | Class.forName(JDBC_DRIVER);
24 | connection = DriverManager.getConnection(DB_URL, USER, PASSWORD);
25 | return connection;
26 | } catch (Exception e){
27 | e.printStackTrace();
28 | }
29 |
30 | return null;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/propertyManagement/src/model/entity/parkingspace/LeasedParkingSpace.java:
--------------------------------------------------------------------------------
1 | package model.entity.parkingspace;
2 |
3 | /**
4 | * Created by MoonBird on 2019/1/3.
5 | */
6 | public class LeasedParkingSpace {
7 | private Integer parking_space_id;
8 | private Integer community_id;
9 | private String description;
10 | private Integer parking_state;
11 |
12 | public Integer getParking_space_id() {
13 | return parking_space_id;
14 | }
15 |
16 | public void setParking_space_id(Integer parking_space_id) {
17 | this.parking_space_id = parking_space_id;
18 | }
19 |
20 | public Integer getCommunity_id() {
21 | return community_id;
22 | }
23 |
24 | public void setCommunity_id(Integer community_id) {
25 | this.community_id = community_id;
26 | }
27 |
28 | public String getDescription() {
29 | return description;
30 | }
31 |
32 | public void setDescription(String description) {
33 | this.description = description;
34 | }
35 |
36 | public Integer getParking_state() {
37 | return parking_state;
38 | }
39 |
40 | public void setParking_state(Integer parking_state) {
41 | this.parking_state = parking_state;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/propertyManagement/src/model/entity/parkingspace/TemporaryParkingSpace.java:
--------------------------------------------------------------------------------
1 | package model.entity.parkingspace;
2 |
3 | /**
4 | * Created by your dad on 2019/1/3.
5 | */
6 | public class TemporaryParkingSpace {
7 | private Integer parking_space_id;
8 | private Integer community_id;
9 | private String description;
10 | private Integer parking_state;
11 |
12 | public Integer getParking_space_id() {
13 | return parking_space_id;
14 | }
15 |
16 | public void setParking_space_id(Integer parking_space_id) {
17 | this.parking_space_id = parking_space_id;
18 | }
19 |
20 | public Integer getCommunity_id() {
21 | return community_id;
22 | }
23 |
24 | public void setCommunity_id(Integer community_id) {
25 | this.community_id = community_id;
26 | }
27 |
28 | public String getDescription() {
29 | return description;
30 | }
31 |
32 | public void setDescription(String description) {
33 | this.description = description;
34 | }
35 |
36 | public Integer getParking_state() {
37 | return parking_state;
38 | }
39 |
40 | public void setParking_state(Integer parking_state) {
41 | this.parking_state = parking_state;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/propertyManagement/src/model/relation/PropertyRecord.java:
--------------------------------------------------------------------------------
1 | package model.relation;
2 |
3 | import java.util.Date;
4 |
5 | /**
6 | * Created by your dad on 2019/1/3.
7 | */
8 | public class PropertyRecord {
9 | private int order_id;
10 | private int type;
11 | private float amount;
12 | private String description;
13 | private Date time;
14 |
15 | public int getOrder_id() {
16 | return order_id;
17 | }
18 |
19 | public void setOrder_id(int order_id) {
20 | this.order_id = order_id;
21 | }
22 |
23 | public int getType() {
24 | return type;
25 | }
26 |
27 | public void setType(int type) {
28 | this.type = type;
29 | }
30 |
31 | public float getAmount() {
32 | return amount;
33 | }
34 |
35 | public void setAmount(float amount) {
36 | this.amount = amount;
37 | }
38 |
39 | public String getDescription() {
40 | return description;
41 | }
42 |
43 | public void setDescription(String description) {
44 | this.description = description;
45 | }
46 |
47 | public Date getTime() {
48 | return time;
49 | }
50 |
51 | public void setTime(Date time) {
52 | this.time = time;
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/propertyManagement/src/model/relation/equipment/IndoorEquipRepair.java:
--------------------------------------------------------------------------------
1 | package model.relation.equipment;
2 |
3 | import java.util.Date;
4 |
5 | /**
6 | * Created by your dad on 2019/1/3.
7 | */
8 | public class IndoorEquipRepair {
9 | private int repair_id;
10 | private int equipment_id;
11 | private int state;
12 | private float cost;
13 | private Date time;
14 |
15 | public int getRepair_id() {
16 | return repair_id;
17 | }
18 |
19 | public void setRepair_id(int repair_id) {
20 | this.repair_id = repair_id;
21 | }
22 |
23 | public int getEquipment_id() {
24 | return equipment_id;
25 | }
26 |
27 | public void setEquipment_id(int equipment_id) {
28 | this.equipment_id = equipment_id;
29 | }
30 |
31 | public int getState() {
32 | return state;
33 | }
34 |
35 | public void setState(int state) {
36 | this.state = state;
37 | }
38 |
39 | public float getCost() {
40 | return cost;
41 | }
42 |
43 | public void setCost(float cost) {
44 | this.cost = cost;
45 | }
46 |
47 | public Date getTime() {
48 | return time;
49 | }
50 |
51 | public void setTime(Date time) {
52 | this.time = time;
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/propertyManagement/src/model/relation/equipment/OutdoorEquipRepair.java:
--------------------------------------------------------------------------------
1 | package model.relation.equipment;
2 |
3 | import java.util.Date;
4 |
5 | /**
6 | * Created by your dad on 2019/1/3.
7 | */
8 | public class OutdoorEquipRepair {
9 | private int repair_id;
10 | private int equipment_id;
11 | private int state;
12 | private float cost;
13 | private Date time;
14 |
15 | public int getRepair_id() {
16 | return repair_id;
17 | }
18 |
19 | public void setRepair_id(int repair_id) {
20 | this.repair_id = repair_id;
21 | }
22 |
23 | public int getEquipment_id() {
24 | return equipment_id;
25 | }
26 |
27 | public void setEquipment_id(int equipment_id) {
28 | this.equipment_id = equipment_id;
29 | }
30 |
31 | public int getState() {
32 | return state;
33 | }
34 |
35 | public void setState(int state) {
36 | this.state = state;
37 | }
38 |
39 | public float getCost() {
40 | return cost;
41 | }
42 |
43 | public void setCost(float cost) {
44 | this.cost = cost;
45 | }
46 |
47 | public Date getTime() {
48 | return time;
49 | }
50 |
51 | public void setTime(Date time) {
52 | this.time = time;
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/propertyManagement/src/model/relation/building/HousePurchaseRecord.java:
--------------------------------------------------------------------------------
1 | package model.relation.building;
2 |
3 | import java.util.Date;
4 |
5 | /**
6 | * Created by your dad on 2019/1/3.
7 | */
8 | public class HousePurchaseRecord {
9 | private int order_id;
10 | private int house_id;
11 | private int resident_id;
12 | private float cost;
13 | private Date time;
14 |
15 | public int getOrder_id() {
16 | return order_id;
17 | }
18 |
19 | public void setOrder_id(int order_id) {
20 | this.order_id = order_id;
21 | }
22 |
23 | public int getHouse_id() {
24 | return house_id;
25 | }
26 |
27 | public void setHouse_id(int house_id) {
28 | this.house_id = house_id;
29 | }
30 |
31 | public int getResident_id() {
32 | return resident_id;
33 | }
34 |
35 | public void setResident_id(int resident_id) {
36 | this.resident_id = resident_id;
37 | }
38 |
39 | public float getCost() {
40 | return cost;
41 | }
42 |
43 | public void setCost(float cost) {
44 | this.cost = cost;
45 | }
46 |
47 | public Date getTime() {
48 | return time;
49 | }
50 |
51 | public void setTime(Date time) {
52 | this.time = time;
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/propertyManagement/src/model/entity/equipment/IndoorEquipment.java:
--------------------------------------------------------------------------------
1 | package model.entity.equipment;
2 |
3 | /**
4 | * Created by your dad on 2019/1/3.
5 | */
6 | public class IndoorEquipment {
7 | private Integer equipment_id;
8 | private Integer building_id;
9 | private String type;
10 | private String description;
11 | private Integer state;
12 |
13 | public Integer getEquipment_id() {
14 | return equipment_id;
15 | }
16 |
17 | public void setEquipment_id(Integer equipment_id) {
18 | this.equipment_id = equipment_id;
19 | }
20 |
21 | public Integer getBuilding_id() {
22 | return building_id;
23 | }
24 |
25 | public void setBuilding_id(Integer building_id) {
26 | this.building_id = building_id;
27 | }
28 |
29 | public String getType() {
30 | return type;
31 | }
32 |
33 | public void setType(String type) {
34 | this.type = type;
35 | }
36 |
37 | public String getDescription() {
38 | return description;
39 | }
40 |
41 | public void setDescription(String description) {
42 | this.description = description;
43 | }
44 |
45 | public Integer getState() {
46 | return state;
47 | }
48 |
49 | public void setState(Integer state) {
50 | this.state = state;
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/propertyManagement/src/model/relation/parking/OwnedParkingRecord.java:
--------------------------------------------------------------------------------
1 | package model.relation.parking;
2 |
3 | import java.util.Date;
4 |
5 | /**
6 | * Created by your dad on 2019/1/3.
7 | */
8 | public class OwnedParkingRecord {
9 | private int record_id;
10 | private int parking_space_id;
11 | private int resident_id;
12 | private Date date;
13 | private float cost;
14 |
15 | public int getRecord_id() {
16 | return record_id;
17 | }
18 |
19 | public void setRecord_id(int record_id) {
20 | this.record_id = record_id;
21 | }
22 |
23 | public int getParking_space_id() {
24 | return parking_space_id;
25 | }
26 |
27 | public void setParking_space_id(int parking_space_id) {
28 | this.parking_space_id = parking_space_id;
29 | }
30 |
31 | public int getResident_id() {
32 | return resident_id;
33 | }
34 |
35 | public void setResident_id(int resident_id) {
36 | this.resident_id = resident_id;
37 | }
38 |
39 | public Date getDate() {
40 | return date;
41 | }
42 |
43 | public void setDate(Date date) {
44 | this.date = date;
45 | }
46 |
47 | public float getCost() {
48 | return cost;
49 | }
50 |
51 | public void setCost(float cost) {
52 | this.cost = cost;
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/propertyManagement/src/model/entity/equipment/OutdoorEquipment.java:
--------------------------------------------------------------------------------
1 | package model.entity.equipment;
2 |
3 | /**
4 | * Created by your dad on 2019/1/3.
5 | */
6 | public class OutdoorEquipment {
7 | private Integer equipment_id;
8 | private Integer community_id;
9 | private String type;
10 | private String description;
11 | private Integer state;
12 |
13 | public Integer getEquipment_id() {
14 | return equipment_id;
15 | }
16 |
17 | public void setEquipment_id(Integer equipment_id) {
18 | this.equipment_id = equipment_id;
19 | }
20 |
21 | public Integer getCommunity_id() {
22 | return community_id;
23 | }
24 |
25 | public void setCommunity_id(Integer community_id) {
26 | this.community_id = community_id;
27 | }
28 |
29 | public String getType() {
30 | return type;
31 | }
32 |
33 | public void setType(String type) {
34 | this.type = type;
35 | }
36 |
37 | public String getDescription() {
38 | return description;
39 | }
40 |
41 | public void setDescription(String description) {
42 | this.description = description;
43 | }
44 |
45 | public Integer getState() {
46 | return state;
47 | }
48 |
49 | public void setState(Integer state) {
50 | this.state = state;
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/propertyManagement/src/dao/classDao/relationDao/equipmentDao/InEquipCheckDao.java:
--------------------------------------------------------------------------------
1 | package dao.classDao.relationDao.equipmentDao;
2 |
3 | import dao.JDBCUtil;
4 | import dao.daoInterface.JdbcDaoImpl;
5 | import model.relation.equipment.IndoorEquipCheck;
6 |
7 | import java.sql.Connection;
8 | import java.util.List;
9 |
10 | /**
11 | * Created by MoonBird on 2019/1/4.
12 | */
13 | public class InEquipCheckDao extends JdbcDaoImpl {
14 | private static Connection connection = JDBCUtil.getConnection();
15 |
16 | public InEquipCheckDao(){
17 | init();
18 | }
19 |
20 | public boolean addCheck(IndoorEquipCheck check){
21 | String sql = "INSERT INTO in_equip_check (equipment_id, state, time)" +
22 | "value (?,?,?)";
23 | return update(connection, sql, check.getEquipment_id(), check.getState(), check.getTime()) != 0;
24 | }
25 |
26 | public List getChecksByEquipId(int equipId){
27 | String sql = "SELECT * FROM in_equip_check where equipment_id = ?";
28 | return getList(connection, sql, equipId);
29 | }
30 |
31 | public IndoorEquipCheck getCheckByCheckId(int checkId){
32 | String sql = "SELECT * FROM in_equip_check where check_id = ?";
33 | return get(connection, sql, checkId);
34 | }
35 |
36 | private static void init(){
37 |
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/propertyManagement/src/dao/classDao/relationDao/equipmentDao/OutEquipCheckDao.java:
--------------------------------------------------------------------------------
1 | package dao.classDao.relationDao.equipmentDao;
2 |
3 | import dao.JDBCUtil;
4 | import dao.daoInterface.JdbcDaoImpl;
5 | import model.relation.equipment.OutdoorEquipCheck;
6 |
7 | import java.sql.Connection;
8 | import java.util.List;
9 |
10 | /**
11 | * Created by MoonBird on 2019/1/4.
12 | */
13 | public class OutEquipCheckDao extends JdbcDaoImpl {
14 | private static Connection connection = JDBCUtil.getConnection();
15 |
16 | public OutEquipCheckDao(){
17 | init();
18 | }
19 |
20 | public boolean addCheck(OutdoorEquipCheck check){
21 | String sql = "INSERT INTO out_equip_check (equipment_id, state, time)" +
22 | "value (?,?,?)";
23 | return update(connection, sql, check.getEquipment_id(), check.getState(), check.getTime()) != 0;
24 | }
25 |
26 | public List getChecksByEquipId(int equipId){
27 | String sql = "SELECT * FROM out_equip_check where equipment_id = ?";
28 | return getList(connection, sql, equipId);
29 | }
30 |
31 | public OutdoorEquipCheck getCheckByCheckId(int checkId){
32 | String sql = "SELECT * FROM out_equip_check where check_id = ?";
33 | return get(connection, sql, checkId);
34 | }
35 |
36 | private static void init(){
37 |
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/propertyManagement/src/dao/classDao/relationDao/PropertyRecordDao.java:
--------------------------------------------------------------------------------
1 | package dao.classDao.relationDao;
2 |
3 | import dao.JDBCUtil;
4 | import dao.daoInterface.JdbcDaoImpl;
5 | import model.relation.PropertyRecord;
6 |
7 | import java.sql.Connection;
8 | import java.util.Date;
9 | import java.util.List;
10 |
11 | /**
12 | * Created by MoonBird on 2019/1/4.
13 | */
14 | public class PropertyRecordDao extends JdbcDaoImpl {
15 | private static Connection connection = JDBCUtil.getConnection();
16 |
17 | public PropertyRecordDao(){
18 | init();
19 | }
20 |
21 | public boolean addPropertyRecord(PropertyRecord record){
22 | String sql = "INSERT INTO property_record (type, amount, description, time)" +
23 | " value (?, ?, ?, ?)";
24 | return update(connection, sql, record.getType(), record.getAmount(), record.getDescription(), record.getTime()) != 0;
25 | }
26 |
27 | public List getRecordsByTime(Date startTime, Date endTime){
28 | String sql = "SELECT * FROM property_record where time > ? and time < ?";
29 | return getList(connection, sql, startTime, endTime);
30 | }
31 | public List getAllRecords(){
32 | String sql = "SELECT * FROM property_record ";
33 | return getList(connection, sql);
34 | }
35 | private static void init(){
36 |
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/propertyManagement/src/model/relation/parking/LeasedParkingRecord.java:
--------------------------------------------------------------------------------
1 | package model.relation.parking;
2 |
3 | import java.util.Date;
4 |
5 | /**
6 | * Created by your dad on 2019/1/3.
7 | */
8 | public class LeasedParkingRecord {
9 | private int record_id;
10 | private int parking_space_id;
11 | private int resident_id;
12 | private Date start_time;
13 | private Date end_time;
14 |
15 | public int getRecord_id() {
16 | return record_id;
17 | }
18 |
19 | public void setRecord_id(int record_id) {
20 | this.record_id = record_id;
21 | }
22 |
23 | public int getParking_space_id() {
24 | return parking_space_id;
25 | }
26 |
27 | public void setParking_space_id(int parking_space_id) {
28 | this.parking_space_id = parking_space_id;
29 | }
30 |
31 | public int getResident_id() {
32 | return resident_id;
33 | }
34 |
35 | public void setResident_id(int resident_id) {
36 | this.resident_id = resident_id;
37 | }
38 |
39 | public Date getStart_time() {
40 | return start_time;
41 | }
42 |
43 | public void setStart_time(Date start_time) {
44 | this.start_time = start_time;
45 | }
46 |
47 | public Date getEnd_time() {
48 | return end_time;
49 | }
50 |
51 | public void setEnd_time(Date end_time) {
52 | this.end_time = end_time;
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/propertyManagement/src/dao/classDao/entityDao/houseDao/HouseDao.java:
--------------------------------------------------------------------------------
1 | package dao.classDao.entityDao.houseDao;
2 |
3 | import dao.JDBCUtil;
4 | import dao.daoInterface.JdbcDaoImpl;
5 | import model.entity.house.House;
6 |
7 | import java.sql.Connection;
8 | import java.util.List;
9 |
10 | /**
11 | * Created by your dad on 2019/1/4.
12 | */
13 | public class HouseDao extends JdbcDaoImpl {
14 | private static Connection connection = JDBCUtil.getConnection();
15 | public HouseDao(){
16 | init();
17 | }
18 | private static void init() {
19 |
20 | }
21 |
22 | public boolean addHouse(House house) {
23 | String sql = "INSERT INTO house (building_id, name, size) " +
24 | "values (?,?,?)";
25 | update(connection,sql,house.getBuilding_id(), house.getName(),house.getSize());
26 | return true;
27 | }
28 |
29 | public List getHousesByBuildingId(int building_id){
30 | String sql = "SELECT * FROM house where building_id = ?";
31 | return getList(connection, sql, building_id);
32 | }
33 |
34 | public List getAllHouse(){
35 | String sql = "SELECT * " +
36 | "FROM house ORDER BY house_id DESC";
37 | return getList(connection, sql);
38 | }
39 |
40 | public House getHouseByHouseId(int houseId){
41 | String sql = "SELECT * FROM house where house_id = ?";
42 | return get(connection, sql, houseId);
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/propertyManagement/src/model/relation/resident/ResidentCost.java:
--------------------------------------------------------------------------------
1 | package model.relation.resident;
2 |
3 | import java.util.Date;
4 |
5 | /**
6 | * Created by your dad on 2019/1/3.
7 | */
8 | public class ResidentCost {
9 | private int cost_id;
10 | private int resident_id;
11 | private String description;
12 | private float cost;
13 | private Date time;
14 | private int state;//0已缴费,1未缴费
15 |
16 | public int getCost_id() {
17 | return cost_id;
18 | }
19 |
20 | public void setCost_id(int cost_id) {
21 | this.cost_id = cost_id;
22 | }
23 |
24 | public int getResident_id() {
25 | return resident_id;
26 | }
27 |
28 | public void setResident_id(int resident_id) {
29 | this.resident_id = resident_id;
30 | }
31 |
32 | public String getDescription() {
33 | return description;
34 | }
35 |
36 | public void setDescription(String description) {
37 | this.description = description;
38 | }
39 |
40 | public Date getTime() {
41 | return time;
42 | }
43 |
44 | public void setTime(Date time) {
45 | this.time = time;
46 | }
47 |
48 | public float getCost() {
49 | return cost;
50 | }
51 |
52 | public void setCost(float cost) {
53 | this.cost = cost;
54 | }
55 |
56 | public int getState() {
57 | return state;
58 | }
59 |
60 | public void setState(int state) {
61 | this.state = state;
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/propertyManagement/src/dao/classDao/entityDao/ResidentDao.java:
--------------------------------------------------------------------------------
1 | package dao.classDao.entityDao;
2 |
3 | import dao.JDBCUtil;
4 | import dao.daoInterface.JdbcDaoImpl;
5 | import model.entity.Resident;
6 |
7 | import java.sql.Connection;
8 | import java.util.List;
9 |
10 | /**
11 | * Created by your dad on 2019/1/4.
12 | */
13 | public class ResidentDao extends JdbcDaoImpl {
14 | private static Connection connection = JDBCUtil.getConnection();
15 |
16 | public ResidentDao(){
17 | init();
18 | }
19 | private static void init(){}
20 |
21 | public boolean addResident(Resident resident) {
22 | String sql = "INSERT INTO resident (identity_card, name,tel) " +
23 | "values (?,?,?)";
24 | update(connection,sql,resident.getIdentity_card(), resident.getName(),resident.getTel());
25 | return true;
26 | }
27 |
28 | public Resident getResidentByResidentId(int residentId){
29 | String sql = "SELECT * FROM resident where resident_id = ?";
30 | return get(connection, sql, residentId);
31 | }
32 |
33 | public Resident getResidentByIdentity(String identity){
34 | String sql = "SELECT * FROM resident where identity_card = ?";
35 | return get(connection, sql, identity);
36 | }
37 |
38 | public List getAllResident(){
39 | String sql = "SELECT * " +
40 | "FROM resident ORDER BY resident_id DESC";
41 | return getList(connection, sql);
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/propertyManagement/src/model/relation/building/Complaint.java:
--------------------------------------------------------------------------------
1 | package model.relation.building;
2 |
3 | import java.util.Date;
4 |
5 | /**
6 | * Created by your dad on 2019/1/3.
7 | */
8 | public class Complaint {
9 | private Integer feedback_id;
10 | private Integer house_id;
11 | private Integer type;
12 | private String description;
13 | private String process;
14 | private Date date;
15 |
16 | public Integer getFeedback_id() {
17 | return feedback_id;
18 | }
19 |
20 | public void setFeedback_id(Integer feedback_id) {
21 | this.feedback_id = feedback_id;
22 | }
23 |
24 | public Integer getHouse_id() {
25 | return house_id;
26 | }
27 |
28 | public void setHouse_id(Integer house_id) {
29 | this.house_id = house_id;
30 | }
31 |
32 | public Integer getType() {
33 | return type;
34 | }
35 |
36 | public void setType(Integer type) {
37 | this.type = type;
38 | }
39 |
40 | public String getDescription() {
41 | return description;
42 | }
43 |
44 | public void setDescription(String description) {
45 | this.description = description;
46 | }
47 |
48 | public String getProcess() {
49 | return process;
50 | }
51 |
52 | public void setProcess(String process) {
53 | this.process = process;
54 | }
55 |
56 | public Date getDate() {
57 | return date;
58 | }
59 |
60 | public void setDate(Date date) {
61 | this.date = date;
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 | 1.8
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/propertyManagement/src/model/relation/parking/TemporaryParkingRecord.java:
--------------------------------------------------------------------------------
1 | package model.relation.parking;
2 |
3 | import java.util.Date;
4 |
5 | /**
6 | * Created by your dad on 2019/1/3.
7 | */
8 | public class TemporaryParkingRecord {
9 | private int record_id;
10 | private int parking_space_id;
11 | private String car_id;
12 | private Date start_time;
13 | private Date end_time;
14 | private float cost;
15 |
16 | public int getRecord_id() {
17 | return record_id;
18 | }
19 |
20 | public void setRecord_id(int record_id) {
21 | this.record_id = record_id;
22 | }
23 |
24 | public int getParking_space_id() {
25 | return parking_space_id;
26 | }
27 |
28 | public void setParking_space_id(int parking_space_id) {
29 | this.parking_space_id = parking_space_id;
30 | }
31 |
32 | public String getCar_id() {
33 | return car_id;
34 | }
35 |
36 | public void setCar_id(String car_id) {
37 | this.car_id = car_id;
38 | }
39 |
40 | public Date getStart_time() {
41 | return start_time;
42 | }
43 |
44 | public void setStart_time(Date start_time) {
45 | this.start_time = start_time;
46 | }
47 |
48 | public Date getEnd_time() {
49 | return end_time;
50 | }
51 |
52 | public void setEnd_time(Date end_time) {
53 | this.end_time = end_time;
54 | }
55 |
56 | public float getCost() {
57 | return cost;
58 | }
59 |
60 | public void setCost(float cost) {
61 | this.cost = cost;
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/propertyManagement/src/dao/classDao/relationDao/buildingDao/HousePurchaseRecordDao.java:
--------------------------------------------------------------------------------
1 | package dao.classDao.relationDao.buildingDao;
2 |
3 | import dao.JDBCUtil;
4 | import dao.daoInterface.JdbcDaoImpl;
5 | import model.relation.building.HousePurchaseRecord;
6 |
7 | import java.sql.Connection;
8 | import java.util.List;
9 |
10 | /**
11 | * Created by moonBird on 2019/1/4.
12 | */
13 | public class HousePurchaseRecordDao extends JdbcDaoImpl {
14 | private static Connection connection = JDBCUtil.getConnection();
15 |
16 | public HousePurchaseRecordDao(){
17 | init();
18 | }
19 |
20 | public boolean addRecord(HousePurchaseRecord housePurchaseRecord){
21 | if (getRecordByHouseId(housePurchaseRecord.getHouse_id()) != null) return false;//房屋已经被购买
22 | String sql = "INSERT INTO house_purchase_record (house_id, resident_id, cost, time) " +
23 | " value (?,?,?,?)";
24 | update(connection, sql, housePurchaseRecord.getHouse_id(), housePurchaseRecord.getResident_id(), housePurchaseRecord.getCost(), housePurchaseRecord.getTime());
25 | return true;
26 | }
27 |
28 | public HousePurchaseRecord getRecordByHouseId(int houseId){
29 | String sql = "SELECT * FROM house_purchase_record where house_id = ?";
30 | return get(connection, sql, houseId);
31 | }
32 |
33 | public List getAll(){
34 | String sql = "SELECT * FROM house_purchase_record";
35 | return getList(connection, sql);
36 | }
37 |
38 | private static void init(){
39 |
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/propertyManagement/src/dao/classDao/relationDao/ProperMonthRecordDao.java:
--------------------------------------------------------------------------------
1 | package dao.classDao.relationDao;
2 |
3 | import dao.JDBCUtil;
4 | import dao.daoInterface.JdbcDaoImpl;
5 | import model.relation.ProperMonthRecord;
6 | import model.relation.resident.ResidentCost;
7 |
8 | import java.sql.Connection;
9 | import java.util.List;
10 |
11 | /**
12 | * Created by MoonBird on 2019/1/4.
13 | */
14 | public class ProperMonthRecordDao extends JdbcDaoImpl {
15 | private static Connection connection = JDBCUtil.getConnection();
16 |
17 | public ProperMonthRecordDao(){
18 | init();
19 | }
20 |
21 | public boolean addProperMonthRecord(ProperMonthRecord record){
22 | String sql = "INSERT INTO proper_month_record (year, month, type, amount)" +
23 | " value (?, ?, ?, ?)";
24 | return update(connection, sql, record.getYear(),record.getMonth(), record.getType(), record.getAmount()) != 0;
25 | }
26 |
27 | public List getRecordsByYear(int year){
28 | String sql = "SELECT * FROM proper_month_record where year = ?";
29 | return getList(connection, sql, year);
30 | }
31 |
32 | public List getRecordsByMonth(int month){
33 | String sql = "SELECT * FROM proper_month_record where month = ?";
34 | return getList(connection, sql, month);
35 | }
36 |
37 | public ProperMonthRecord getRecordByYearAndMonth(int year, int month){
38 | String sql = "SELECT * FROM proper_month_record where year = ? and month = ?";
39 | return get(connection, sql, year, month);
40 | }
41 |
42 | private static void init(){
43 |
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/propertyManagement/src/dao/classDao/relationDao/parkingDao/LeasedParkingRecordDao.java:
--------------------------------------------------------------------------------
1 | package dao.classDao.relationDao.parkingDao;
2 |
3 | import dao.JDBCUtil;
4 | import dao.daoInterface.JdbcDaoImpl;
5 | import model.relation.parking.LeasedParkingRecord;
6 |
7 | import java.sql.Connection;
8 | import java.util.Date;
9 | import java.util.List;
10 |
11 | /**
12 | * Created by MoonBird on 2019/1/4.
13 | */
14 | public class LeasedParkingRecordDao extends JdbcDaoImpl {
15 | private static Connection connection = JDBCUtil.getConnection();
16 |
17 | public LeasedParkingRecordDao(){
18 | init();
19 | }
20 |
21 | public boolean addRecord(LeasedParkingRecord record){
22 | String sql = "INSERT INTO leased_parking_record (parking_space_id, resident_id, start_time, end_time)" +
23 | " value (?, ?, ?, ?)";
24 | return update(connection, sql, record.getParking_space_id(),record.getResident_id(), record.getStart_time(), record.getEnd_time()) != 0;
25 | }
26 |
27 | public List getRecordsBySpaceId(int parkingSpaceId){
28 | String sql = "SELECT * FROM leased_parking_record where parking_space_id = ?";
29 | return getList(connection, sql, parkingSpaceId);
30 | }
31 |
32 | public List getRecordsByResidentId(int residentId){
33 | String sql = "SELECT * FROM leased_parking_record where resident_id = ?";
34 | return getList(connection, sql, residentId);
35 | }
36 |
37 | public List getRecordsValid(Date date){
38 | String sql = "SELECT * FROM leased_parking_record where end_time > ?";
39 | return getList(connection, sql, date);
40 | }
41 |
42 | private static void init(){
43 |
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/propertyManagement/src/dao/classDao/relationDao/parkingDao/OwnedParkingRecordDao.java:
--------------------------------------------------------------------------------
1 | package dao.classDao.relationDao.parkingDao;
2 |
3 | import dao.JDBCUtil;
4 | import dao.daoInterface.JdbcDaoImpl;
5 | import model.relation.parking.LeasedParkingRecord;
6 | import model.relation.parking.OwnedParkingRecord;
7 |
8 | import java.sql.Connection;
9 | import java.util.List;
10 |
11 | /**
12 | * Created by MoonBird on 2019/1/4.
13 | */
14 | public class OwnedParkingRecordDao extends JdbcDaoImpl {
15 | private static Connection connection = JDBCUtil.getConnection();
16 |
17 | public OwnedParkingRecordDao(){
18 | init();
19 | }
20 |
21 | public boolean addRecord(OwnedParkingRecord record){
22 | if (getRecordBySpaceId(record.getParking_space_id()) != null) return false;
23 | String sql = "INSERT INTO owned_parking_record (parking_space_id, resident_id, date, cost)" +
24 | " value (?, ?, ?, ?)";
25 | return update(connection, sql, record.getParking_space_id(),record.getResident_id(), record.getDate(), record.getCost()) != 0;
26 | }
27 |
28 | public OwnedParkingRecord getRecordBySpaceId(int parkingSpaceId){
29 | String sql = "SELECT * FROM owned_parking_record where parking_space_id = ?";
30 | return get(connection, sql, parkingSpaceId);
31 | }
32 |
33 | public List getRecordByResidentId(int residentId){
34 | String sql = "SELECT * FROM owned_parking_record where resident_id = ?";
35 | return getList(connection, sql, residentId);
36 | }
37 |
38 | public List getAll(){
39 | String sql = "SELECT * FROM owned_parking_record ";
40 | return getList(connection, sql);
41 | }
42 |
43 | private static void init(){
44 |
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/propertyManagement/src/model/relation/equipment/EquipmentIssue.java:
--------------------------------------------------------------------------------
1 | package model.relation.equipment;
2 |
3 | import java.util.Date;
4 |
5 | /**
6 | * Created by your dad on 2019/1/3.
7 | */
8 | public class EquipmentIssue {
9 | private Integer feedback_id;
10 | private Integer house_id;
11 | private Integer equipment_id;
12 | private Integer repair_id;
13 | private Integer type;
14 | private String description;
15 | private Date time;
16 |
17 | public Integer getFeedback_id() {
18 | return feedback_id;
19 | }
20 |
21 | public void setFeedback_id(Integer feedback_id) {
22 | this.feedback_id = feedback_id;
23 | }
24 |
25 | public Integer getHouse_id() {
26 | return house_id;
27 | }
28 |
29 | public void setHouse_id(Integer house_id) {
30 | this.house_id = house_id;
31 | }
32 |
33 | public Integer getEquipment_id() {
34 | return equipment_id;
35 | }
36 |
37 | public void setEquipment_id(Integer equipment_id) {
38 | this.equipment_id = equipment_id;
39 | }
40 |
41 | public Integer getRepair_id() {
42 | return repair_id;
43 | }
44 |
45 | public void setRepair_id(Integer repair_id) {
46 | this.repair_id = repair_id;
47 | }
48 |
49 | public Integer getType() {
50 | return type;
51 | }
52 |
53 | public void setType(Integer type) {
54 | this.type = type;
55 | }
56 |
57 | public String getDescription() {
58 | return description;
59 | }
60 |
61 | public void setDescription(String description) {
62 | this.description = description;
63 | }
64 |
65 | public Date getTime() {
66 | return time;
67 | }
68 |
69 | public void setTime(Date time) {
70 | this.time = time;
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/propertyManagement/src/dao/classDao/relationDao/equipmentDao/OutEquipRepairDao.java:
--------------------------------------------------------------------------------
1 | package dao.classDao.relationDao.equipmentDao;
2 |
3 | import dao.JDBCUtil;
4 | import dao.daoInterface.JdbcDaoImpl;
5 | import model.relation.equipment.OutdoorEquipRepair;
6 |
7 | import java.sql.Connection;
8 | import java.util.Date;
9 | import java.util.List;
10 |
11 | /**
12 | * Created by MoonBird on 2019/1/4.
13 | */
14 | public class OutEquipRepairDao extends JdbcDaoImpl {
15 | private static Connection connection = JDBCUtil.getConnection();
16 |
17 | public boolean addRepair(OutdoorEquipRepair repair) {
18 | String sql = "INSERT INTO out_equip_repair (equipment_id, state, cost, time) " +
19 | "value (?,?,?,?)";
20 | return update(connection, sql, repair.getEquipment_id(), repair.getState(), repair.getCost(), repair.getTime()) != 0;
21 | }
22 |
23 | public boolean modifyRepairState(int repairId, int state) {
24 | String sql = "UPDATE out_equip_repair SET state = ? where repair_id = ?";
25 | return update(connection, sql, state, repairId) != 0;
26 | }
27 |
28 | public List getRepairsByEquimentId(int equipmentId) {
29 | String sql = "SELECT * FROM out_equip_repair where equipment_id = ?";
30 | return getList(connection, sql, equipmentId);
31 | }
32 |
33 | public List getAllRepairs() {
34 | String sql = "SELECT * FROM out_equip_repair where cost > 0";
35 | return getList(connection, sql);
36 | }
37 |
38 | public List getRepairsByTime(Date start, Date end) {
39 | String sql = "SELECT * FROM out_equip_repair where time > ? and time < ?";
40 | return getList(connection, sql,start,end);
41 | }
42 |
43 | private static void init() {
44 |
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/propertyManagement/src/dao/classDao/relationDao/residentDao/ResidentCostDao.java:
--------------------------------------------------------------------------------
1 | package dao.classDao.relationDao.residentDao;
2 |
3 | import dao.JDBCUtil;
4 | import dao.daoInterface.JdbcDaoImpl;
5 | import model.relation.resident.ResidentCost;
6 |
7 | import java.sql.Connection;
8 | import java.util.Date;
9 | import java.util.List;
10 |
11 | /**
12 | * Created by MoonBird on 2019/1/4.
13 | */
14 | public class ResidentCostDao extends JdbcDaoImpl {
15 | private static Connection connection = JDBCUtil.getConnection();
16 |
17 | public ResidentCostDao(){
18 | init();
19 | }
20 |
21 | public boolean addCost(ResidentCost cost){
22 | String sql = "INSERT INTO resident_cost (resident_id, description, cost, time, state)" +
23 | " value (?, ?, ?, ?, ?)";
24 | return update(connection, sql, cost.getResident_id(), cost.getDescription(),
25 | cost.getCost(), cost.getTime(), cost.getState()) != 0;
26 | }
27 |
28 | public boolean modifyState(int costId, int state){
29 | String sql = "UPDATE resident_cost SET state = ? where cost_id = ?";
30 | return update(connection, sql, state, costId) != 0;
31 | }
32 |
33 | public List getCostsByResidentId(int residentId){
34 | String sql = "SELECT * FROM resident_cost where resident_id = ?";
35 | return getList(connection, sql, residentId);
36 | }
37 | public List getAllCosts(){
38 | String sql = "SELECT * FROM resident_cost ";
39 | return getList(connection, sql);
40 | }
41 |
42 | public List getCostsByTime(Date start, Date end){
43 | String sql = "SELECT * FROM resident_cost where time > ? and time < ?";
44 | return getList(connection, sql, start, end);
45 | }
46 |
47 | private static void init(){
48 |
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/propertyManagement/src/dao/classDao/relationDao/equipmentDao/InEquipRepairDao.java:
--------------------------------------------------------------------------------
1 | package dao.classDao.relationDao.equipmentDao;
2 |
3 | import dao.JDBCUtil;
4 | import dao.daoInterface.JdbcDaoImpl;
5 | import model.relation.equipment.IndoorEquipRepair;
6 |
7 | import java.sql.Connection;
8 | import java.util.Date;
9 | import java.util.List;
10 |
11 | /**
12 | * Created by MoonBird on 2019/1/4.
13 | */
14 | public class InEquipRepairDao extends JdbcDaoImpl {
15 | private static Connection connection = JDBCUtil.getConnection();
16 |
17 | public boolean addRepair(IndoorEquipRepair repair){
18 | String sql = "INSERT INTO in_equip_repair (equipment_id, state, cost, time) " +
19 | "value (?,?,?,?)";
20 | return update(connection, sql, repair.getEquipment_id(), repair.getState(), repair.getCost(), repair.getTime()) != 0;
21 | }
22 |
23 | public boolean modifyRepairState(int repairId, int state){
24 | String sql = "UPDATE in_equip_repair SET state = ? where repair_id = ?";
25 | return update(connection, sql, state, repairId) != 0;
26 | }
27 |
28 | public List getRepairsByEquipmentId(int equipmentId){
29 | String sql = "SELECT * FROM in_equip_repair where equipment_id = ?";
30 | return getList(connection, sql, equipmentId);
31 | }
32 |
33 | public IndoorEquipRepair getRepairByRepairId(int repairId){
34 | String sql = "SELECT * FROM in_equip_repair where repair_id = ?";
35 | return get(connection, sql, repairId);
36 | }
37 |
38 | public List getAllRepairs(){
39 | String sql = "SELECT * FROM in_equip_repair where cost >0";
40 | return getList(connection, sql);
41 | }
42 |
43 | public List getRepairsByTime(Date start, Date end){
44 | String sql = "SELECT * FROM in_equip_repair where time > ? and time < ?";
45 | return getList(connection, sql, start, end);
46 | }
47 |
48 | private static void init(){
49 |
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/propertyManagement/src/dao/classDao/entityDao/parkingspaceDao/OwnedParkingSpaceDao.java:
--------------------------------------------------------------------------------
1 | package dao.classDao.entityDao.parkingspaceDao;
2 |
3 | import dao.JDBCUtil;
4 | import dao.daoInterface.JdbcDaoImpl;
5 | import model.entity.house.Community;
6 | import model.entity.parkingspace.OwnedParkingSpace;
7 |
8 | import java.sql.Connection;
9 | import java.util.List;
10 |
11 | /**
12 | * Created by your dad on 2019/1/4.
13 | */
14 | public class OwnedParkingSpaceDao extends JdbcDaoImpl {
15 | private static Connection connection = JDBCUtil.getConnection();
16 |
17 | public OwnedParkingSpaceDao() {
18 | init();
19 | }
20 |
21 | private static void init() {
22 | }
23 |
24 | public boolean addOwnedParkingSpace(OwnedParkingSpace ownedParkingSpace) {
25 | String sql = "INSERT INTO owned_parking_space (community_id, description) " +
26 | "values (?,?)";
27 | update(connection, sql, ownedParkingSpace.getCommunity_id(), ownedParkingSpace.getDescription());
28 | return true;
29 | }
30 | /* public OwnedParkingSpace getOwnedParkingSpace(int temporaryParkingSpaceId){
31 | String sql = "SELECT * " +
32 | "FROM temporary_parking_space where answer_id = ? ";
33 | return get(connection, sql, temporaryParkingSpaceId);
34 | }*/
35 |
36 | public List getOwnedParkingSpacesByCommunity(Community community) {
37 | String sql = "SELECT * FROM owned_parking_space where community_id = ?";
38 | return getList(connection, sql, community.getCommunityId());
39 | }
40 |
41 | public List getAllOwnedParkingSpace() {
42 | String sql = "SELECT * " +
43 | "FROM owned_parking_space ORDER BY parking_space_id DESC";
44 | return getList(connection, sql);
45 | }
46 |
47 | public OwnedParkingSpace getOwnedParkingSpaceBySpaceId(int spaceId){
48 | String sql = "SELECT * FROM owned_parking_space where parking_space_id = ?";
49 | return get(connection, sql, spaceId);
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/propertyManagement/src/dao/classDao/relationDao/parkingDao/TemporaryParkingRecordDao.java:
--------------------------------------------------------------------------------
1 | package dao.classDao.relationDao.parkingDao;
2 |
3 | import dao.JDBCUtil;
4 | import dao.daoInterface.JdbcDaoImpl;
5 | import model.relation.parking.TemporaryParkingRecord;
6 |
7 | import java.sql.Connection;
8 | import java.util.List;
9 |
10 | /**
11 | * Created by MoonBird on 2019/1/4.
12 | */
13 | public class TemporaryParkingRecordDao extends JdbcDaoImpl {
14 | private static Connection connection = JDBCUtil.getConnection();
15 |
16 | public TemporaryParkingRecordDao(){
17 | init();
18 | }
19 |
20 | public boolean addRecord(TemporaryParkingRecord record){
21 | String sql = "INSERT INTO temporary_parking_record (parking_space_id, car_id, start_time, end_time, cost)" +
22 | " value (?, ?, ?, ?, ?)";
23 | return update(connection, sql, record.getParking_space_id(),record.getCar_id(), record.getStart_time(), record.getEnd_time(), record.getCost()) != 0;
24 | }
25 |
26 | public boolean updateRecord(TemporaryParkingRecord record){
27 | String sql = "UPDATE temporary_parking_record SET end_time = ?, cost = ? where record_id = ?" ;
28 | return update(connection, sql, record.getEnd_time(), record.getCost() ,record.getRecord_id()) != 0;
29 | }
30 |
31 | public List getRecordsBySpaceId(int parkingSpaceId){
32 | String sql = "SELECT * FROM temporary_parking_record where parking_space_id = ?";
33 | return getList(connection, sql, parkingSpaceId);
34 | }
35 |
36 | public List getRecordsByCostNoNull(){
37 | String sql = "SELECT * FROM temporary_parking_record where cost > 1";
38 | return getList(connection, sql);
39 | }
40 |
41 |
42 | public TemporaryParkingRecord getRecordLatest(int spaceId){
43 | String sql = "SELECT * FROM temporary_parking_record where parking_space_id = ? ORDER BY record_id DESC LIMIT 1";
44 | return get(connection, sql, spaceId);
45 | }
46 |
47 |
48 |
49 | private static void init(){
50 |
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/propertyManagement/src/dao/classDao/entityDao/houseDao/CommunityDao.java:
--------------------------------------------------------------------------------
1 | package dao.classDao.entityDao.houseDao;
2 |
3 | import dao.JDBCUtil;
4 | import dao.daoInterface.JdbcDaoImpl;
5 | import model.entity.house.Community;
6 |
7 | import java.sql.Connection;
8 | import java.sql.Statement;
9 | import java.util.List;
10 |
11 | /**
12 | * Created by your dad on 2019/1/4.
13 | */
14 | public class CommunityDao extends JdbcDaoImpl {
15 | private static Connection connection = JDBCUtil.getConnection();
16 | public CommunityDao(){
17 | init();
18 | }
19 | private static void init() {
20 | try {
21 | Statement statement = connection.createStatement();
22 | statement.executeUpdate(
23 | "CREATE TABLE IF not exists community\n" +
24 | "(\n" +
25 | " community_id INT(32) PRIMARY KEY NOT NULL,\n" +
26 | " name VARCHAR(255),\n" +
27 | " longitude FLOAT(255,1),\n" +
28 | " latitude FLOAT(255,1)\n" +
29 | ");"
30 | );
31 | statement.close();
32 | } catch (Exception e) {
33 | e.printStackTrace();
34 | }
35 | }
36 |
37 | public boolean addCommunity(Community community) {
38 | String sql = "INSERT INTO community (name, longitude, latitude) " +
39 | "values (?,?,?)";
40 | update(connection,sql,community.getName(), community.getLongitude(),community.getLatitude());
41 | return true;
42 | }
43 |
44 | public List getAllCommunity(){
45 | String sql = "SELECT community_id as communityId, name, longitude, latitude " +
46 | "FROM community ";
47 | /* List