diff --git a/code/server/src/main/java/com/keafmd/dao/IDataDao.java b/code/server/src/main/java/com/keafmd/dao/IDataDao.java index c40d3ad..9ef4705 100644 --- a/code/server/src/main/java/com/keafmd/dao/IDataDao.java +++ b/code/server/src/main/java/com/keafmd/dao/IDataDao.java @@ -1,11 +1,22 @@ package com.keafmd.dao; -import com.keafmd.domain.Drugs; -import com.keafmd.domain.User; +import com.keafmd.domain.*; + import java.util.List; public interface IDataDao { List find_User(); List find_drugs(); + List insert_drugs(); + + List find_Norms(); + + List find_Vendor(); + + List find_Department(); + + List find_request(); + List find_sum_commits(); + List insert_requests(); } diff --git a/code/server/src/main/java/com/keafmd/domain/Department.java b/code/server/src/main/java/com/keafmd/domain/Department.java new file mode 100644 index 0000000..603c507 --- /dev/null +++ b/code/server/src/main/java/com/keafmd/domain/Department.java @@ -0,0 +1,40 @@ +package com.keafmd.domain; + +public class Department { + private Integer ID; + private String name; + private Integer member; + private String floor; + + public void setID(Integer ID) { + this.ID = ID; + } + public Integer getID() { + return ID; + } + + public void setName(String name) { + this.name = name; + } + public String getName() { + return name; + } + + public void setMember(Integer member) { + this.member = member; + } + public Integer getMember() { + return member; + } + + public void setFloor(String floor) { + this.floor = floor; + } + public String getFloor() { + return floor; + } + + public String toString() { + return "ID: {" + ID + ", Name: " + name + ", Member: " + member + ", Floor: " + floor + "}"; + } +} diff --git a/code/server/src/main/java/com/keafmd/domain/Drugs.java b/code/server/src/main/java/com/keafmd/domain/Drugs.java index a6cc333..fd50669 100644 --- a/code/server/src/main/java/com/keafmd/domain/Drugs.java +++ b/code/server/src/main/java/com/keafmd/domain/Drugs.java @@ -4,6 +4,9 @@ public class Drugs { private Integer ID; private String name; private Integer num; + private String type; + private String productor; + private String address; public Integer getID() { return ID; @@ -26,8 +29,29 @@ public class Drugs { this.num = num; } + public String getType() { + return type; + } + public void setType(String type) { + this.type = type; + } + + public String getProductor() { + return productor; + } + public void setProductor(String productor) { + this.productor = productor; + } + + public String getAddress() { + return address; + } + public void setAddress(String address) { + this.address = address; + } + @Override public String toString() { - return "Drugs:{ID=" + ID + ", name=" + name + ", num=" + num + "}"; + return "Drugs:{" + ID + ", " + name + ", " + num + ", " + type + ", " + productor + ", " + address + "}"; } } diff --git a/code/server/src/main/java/com/keafmd/domain/Norms.java b/code/server/src/main/java/com/keafmd/domain/Norms.java new file mode 100644 index 0000000..840bfe2 --- /dev/null +++ b/code/server/src/main/java/com/keafmd/domain/Norms.java @@ -0,0 +1,25 @@ +package com.keafmd.domain; + +public class Norms { + private Integer ID; + private String feather; + + public Integer getID() { + return ID; + } + public void setID(Integer ID) { + this.ID = ID; + } + + public String getFeather() { + return feather; + } + public void setFeather(String feather) { + this.feather = feather; + } + + @Override + public String toString() { + return "Norms:{ID=" + ID + ", feather=" + feather + "}"; + } +} diff --git a/code/server/src/main/java/com/keafmd/domain/Request.java b/code/server/src/main/java/com/keafmd/domain/Request.java new file mode 100644 index 0000000..ae5e8f8 --- /dev/null +++ b/code/server/src/main/java/com/keafmd/domain/Request.java @@ -0,0 +1,74 @@ +package com.keafmd.domain; + +public class Request { + private Integer ID; + private Integer drug_ID; + private String drug_name; + private String feather; + private Integer num; + private String user_name; + private String department_name; + private String date; + + public Integer getID() { + return ID; + } + public void setID(Integer ID) { + this.ID = ID; + } + + public Integer getDrug_ID() { + return drug_ID; + } + public void setDrug_ID(Integer drug_ID){ + this.drug_ID = drug_ID; + } + + public String getDrug_name(){ + return drug_name; + } + public void setDrug_name(String drug_name) { + this.drug_name = drug_name; + } + + public String getFeather() { + return feather; + } + public void setFeather(String feather) { + this.feather = feather; + } + + public Integer getNum() { + return num; + } + public void setNum(Integer num) { + this.num = num; + } + + public String getUser_name() { + return user_name; + } + public void setUser_name(String user_name) { + this.user_name = user_name; + } + + public String getDepartment_name() { + return department_name; + } + public void setDepartment_name(String department_name) { + this.department_name = department_name; + } + + public String getDate() { + return date; + } + public void setDate(String date) { + this.date = date; + } + + @Override + public String toString(){ + return "Request:{ID:" + ID + ",drug_ID:" + drug_ID + ",drug_name:" + drug_name + + ",feather:" + feather + ",num:" + num + ",user_name:" + user_name + "}"; + } +} diff --git a/code/server/src/main/java/com/keafmd/domain/User.java b/code/server/src/main/java/com/keafmd/domain/User.java index 9d2c95c..0a6b934 100644 --- a/code/server/src/main/java/com/keafmd/domain/User.java +++ b/code/server/src/main/java/com/keafmd/domain/User.java @@ -1,7 +1,5 @@ package com.keafmd.domain; -import java.util.Date; - public class User { private Integer user_id; private String user_name; @@ -10,6 +8,7 @@ public class User { private Integer age; private String phonenumber; private String role; + private String department; public Integer getUser_id() { return user_id; @@ -60,6 +59,13 @@ public class User { this.role = role; } + public String getDepartment() { + return department; + } + public void setDepartment(String department) { + this.department = department; + } + @Override public String toString() { return "User:{" + @@ -70,6 +76,7 @@ public class User { ",age=" + age + '\'' + ",phonenumber=" + phonenumber + '\'' + ",role=" + role + '\'' + + ",department=" + department + '\'' + "}"; } } diff --git a/code/server/src/main/java/com/keafmd/domain/Vendor.java b/code/server/src/main/java/com/keafmd/domain/Vendor.java new file mode 100644 index 0000000..e378eb9 --- /dev/null +++ b/code/server/src/main/java/com/keafmd/domain/Vendor.java @@ -0,0 +1,58 @@ +package com.keafmd.domain; + +public class Vendor { + private Integer ID; + private String name; + private String address; + private String phonenumber; + private String monitor; + private String zipcode; + + public Integer getID() { + return ID; + } + public void setID(Integer ID) { + this.ID = ID; + } + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + public String getAddress() { + return address; + } + public void setAddress(String address) { + this.address = address; + } + + public String getPhonenumber() { + return phonenumber; + } + public void setPhonenumber(String phonenumber) { + this.phonenumber = phonenumber; + } + + public String getMonitor() { + return monitor; + } + public void setMonitor(String monitor) { + this.monitor = monitor; + } + + public String getZipcode() { + return zipcode; + } + public void setZipcode(String zipcode) { + this.zipcode = zipcode; + } + + @Override + public String toString() { + return "Vendor:{ID=" + ID + ", name=" + name + ", address=" + address + ", phonenumber=" + phonenumber + + ", monitor=" + monitor + ", zipcode=" + zipcode + "}"; + } +} diff --git a/code/server/src/main/resources/com/keafmd/dao/IDataDao.xml b/code/server/src/main/resources/com/keafmd/dao/IDataDao.xml index 792b7f4..3933471 100644 --- a/code/server/src/main/resources/com/keafmd/dao/IDataDao.xml +++ b/code/server/src/main/resources/com/keafmd/dao/IDataDao.xml @@ -5,7 +5,7 @@ + + + + + + + + + + + insert into T_Drugs values (ID,name,num) + insert into T_Type values (ID,t_id,price,producer) + insert into T_Norm values (t_id,feather) + insert into T_Vendor values (producer,p_name,address,phonenumber,monitor,zipcode) + + + + insert into T_Request values (ID,num,date) + insert into T_Require values (d_id,ID) + insert into T_Commit values (ID,u_id) + diff --git a/code/server/src/test/java/com/keafmd/test/MybatisTest.java b/code/server/src/test/java/com/keafmd/test/MybatisTest.java index f84edb6..b19e294 100644 --- a/code/server/src/test/java/com/keafmd/test/MybatisTest.java +++ b/code/server/src/test/java/com/keafmd/test/MybatisTest.java @@ -1,7 +1,7 @@ package com.keafmd.test; import com.keafmd.dao.IDataDao; -import com.keafmd.domain.Drugs; +import com.keafmd.domain.*; import org.apache.ibatis.io.Resources; import org.apache.ibatis.session.SqlSession; import org.apache.ibatis.session.SqlSessionFactory;