diff --git a/src/main/java/com/sixteam/irs/IrsApplication.java b/src/main/java/com/sixteam/irs/IrsApplication.java index 6ed4ad334cdfb1e04fa632d1ce9e01cf6d1550d6..127e7322ab1498dc6d26435410abcca447e0dd7a 100644 --- a/src/main/java/com/sixteam/irs/IrsApplication.java +++ b/src/main/java/com/sixteam/irs/IrsApplication.java @@ -8,7 +8,8 @@ public class IrsApplication { public static void main(String[] args) { SpringApplication.run(IrsApplication.class, args); - System.out.println("12311111qrr3r321"); +<<<<<<< hcd + System.out.println("运行ing"); } } diff --git a/src/main/java/com/sixteam/irs/controller/EnterpriseController.java b/src/main/java/com/sixteam/irs/controller/EnterpriseController.java new file mode 100644 index 0000000000000000000000000000000000000000..144496b010f544eac5be53ae94fe3d982ecae788 --- /dev/null +++ b/src/main/java/com/sixteam/irs/controller/EnterpriseController.java @@ -0,0 +1,38 @@ +package com.sixteam.irs.controller; + +import com.sixteam.irs.entity.Enterprise; +import com.sixteam.irs.service.EnterpriseService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; + +@RestController +@RequestMapping("/enterprise") +public class EnterpriseController { + + @Autowired + private EnterpriseService enterpriseService; + + //查询所有企业 + @RequestMapping("/getAllEnterprise") + public List getAllEnterprise(HttpServletRequest request){ + List getAllEnterprise = enterpriseService.getAllEnterprise(); + request.setAttribute("getAllEnterprise",getAllEnterprise); + System.out.println(getAllEnterprise); + return getAllEnterprise; + } + + @GetMapping("/addEnterprise") + public void addEnterprise(Enterprise enterprise,HttpServletRequest request){ + int res=enterpriseService.addEnterprise(enterprise); + if (res>0) { + System.out.println("添加企业成功"); + }else { + System.out.println("添加企业失败"); + } + } +} diff --git a/src/main/java/com/sixteam/irs/controller/StationController.java b/src/main/java/com/sixteam/irs/controller/StationController.java new file mode 100644 index 0000000000000000000000000000000000000000..43d212d0171bd2e0ab127874ce73f6ecc94793fd --- /dev/null +++ b/src/main/java/com/sixteam/irs/controller/StationController.java @@ -0,0 +1,53 @@ +package com.sixteam.irs.controller; + +import com.sixteam.irs.entity.Station; +import com.sixteam.irs.service.StationService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; + +@RestController +@RequestMapping("/station") +public class StationController { + @Autowired + private StationService stationService; + + //查询所有岗位 + @RequestMapping("/getAllStation") + public List getAllStation(HttpServletRequest request){ + List getAllStation = stationService.getAllStation(); + request.setAttribute("getAllStation",getAllStation); + System.out.println(getAllStation); + return getAllStation; + } + + @GetMapping("/addStation") + public void addStation(Station station,HttpServletRequest request){ + int res=stationService.addStation(station); + if (res>0) { + System.out.println("添加企业成功"); + }else { + System.out.println("添加企业失败"); + } + } + //修改 + @GetMapping("/updateStation") + public void updateStation(Station station,HttpServletRequest request) { + int i = stationService.updateStation(station); + if(i>0){ + System.out.println("修改企业成功"); + }else { + System.out.println("修改企业失败"); + } + } + //按名称查询 + @GetMapping("/stationName") + public String findStationByName(String stationName,HttpServletRequest request) { + return null; + // TODO: 2022/8/16 + } +} diff --git a/src/main/java/com/sixteam/irs/entity/Enterprise.java b/src/main/java/com/sixteam/irs/entity/Enterprise.java new file mode 100644 index 0000000000000000000000000000000000000000..9c67dbc0f0cc86e8d8216dcf61ffc85e62c38038 --- /dev/null +++ b/src/main/java/com/sixteam/irs/entity/Enterprise.java @@ -0,0 +1,89 @@ +package com.sixteam.irs.entity; + +import java.util.List; + +public class Enterprise { + private String eId;//企业id + private String eName;//企业名称 + private String eIntroduce;//企业介绍 + private String eStart;//企业成立时间 + private String eType;//企业类型,定位 + private String eFounder;//企业创始人 + + +// List departmentList;//嵌套查询角色,用户 + List stationList; + + + public Enterprise() { + } + + public Enterprise(String eId, String eName, String eIntroduce, String eStart, String eType, String eFounder) { + this.eId = eId; + this.eName = eName; + this.eIntroduce = eIntroduce; + this.eStart = eStart; + this.eType = eType; + this.eFounder = eFounder; + } + + public String geteId() { + return eId; + } + + public void seteId(String eId) { + this.eId = eId; + } + + public String geteName() { + return eName; + } + + public void seteName(String eName) { + this.eName = eName; + } + + public String geteIntroduce() { + return eIntroduce; + } + + public void seteIntroduce(String eIntroduce) { + this.eIntroduce = eIntroduce; + } + + public String geteStart() { + return eStart; + } + + public void seteStart(String eStart) { + this.eStart = eStart; + } + + public String geteType() { + return eType; + } + + public void seteType(String eType) { + this.eType = eType; + } + + public String geteFounder() { + return eFounder; + } + + public void seteFounder(String eFounder) { + this.eFounder = eFounder; + } + + @Override + public String toString() { + return "Enterprise{" + + "eId='" + eId + '\'' + + ", eName='" + eName + '\'' + + ", eIntroduce='" + eIntroduce + '\'' + + ", eStart='" + eStart + '\'' + + ", eType='" + eType + '\'' + + ", eFounder='" + eFounder + '\'' + + '}'; + } +} diff --git a/src/main/java/com/sixteam/irs/entity/Station.java b/src/main/java/com/sixteam/irs/entity/Station.java new file mode 100644 index 0000000000000000000000000000000000000000..109da83a9e62783948dfae1d9b27a3e4a29d646f --- /dev/null +++ b/src/main/java/com/sixteam/irs/entity/Station.java @@ -0,0 +1,127 @@ +package com.sixteam.irs.entity; + +public class Station { + + private String sId; + private String sName;//岗位名 + private String sWages;//岗位工资 + private String sWork;//岗位工作 + private String sDepartment;//部门名 + private String sNumber;//岗位所需人数 + private String sEducation;//学历要求 + private String sWorkdays;//工作天数 + private String sSubsidy;//生活补助 + private String sGold;//五险一金 + + public Station() { + } + + public Station(String sId, String sName, String sWages, String sWork, String sDepartment, String sNumber, String sEducation, String sWorkdays, String sSubsidy, String sGold) { + this.sId = sId; + this.sName = sName; + this.sWages = sWages; + this.sWork = sWork; + this.sDepartment = sDepartment; + this.sNumber = sNumber; + this.sEducation = sEducation; + this.sWorkdays = sWorkdays; + this.sSubsidy = sSubsidy; + this.sGold = sGold; + } + + public String getsId() { + return sId; + } + + public void setsId(String sId) { + this.sId = sId; + } + + public String getsName() { + return sName; + } + + public void setsName(String sName) { + this.sName = sName; + } + + public String getsWages() { + return sWages; + } + + public void setsWages(String sWages) { + this.sWages = sWages; + } + + public String getsWork() { + return sWork; + } + + public void setsWork(String sWork) { + this.sWork = sWork; + } + + public String getsDepartment() { + return sDepartment; + } + + public void setsDepartment(String sDepartment) { + this.sDepartment = sDepartment; + } + + public String getsNumber() { + return sNumber; + } + + public void setsNumber(String sNumber) { + this.sNumber = sNumber; + } + + public String getsEducation() { + return sEducation; + } + + public void setsEducation(String sEducation) { + this.sEducation = sEducation; + } + + public String getsWorkdays() { + return sWorkdays; + } + + public void setsWorkdays(String sWorkdays) { + this.sWorkdays = sWorkdays; + } + + public String getsSubsidy() { + return sSubsidy; + } + + public void setsSubsidy(String sSubsidy) { + this.sSubsidy = sSubsidy; + } + + public String getsGold() { + return sGold; + } + + public void setsGold(String sGold) { + this.sGold = sGold; + } + + @Override + public String toString() { + return "Station{" + + "sId='" + sId + '\'' + + ", sName='" + sName + '\'' + + ", sWages='" + sWages + '\'' + + ", sWork='" + sWork + '\'' + + ", sDepartment='" + sDepartment + '\'' + + ", sNumber='" + sNumber + '\'' + + ", sEducation='" + sEducation + '\'' + + ", sWorkdays='" + sWorkdays + '\'' + + ", sSubsidy='" + sSubsidy + '\'' + + ", sGold='" + sGold + '\'' + + '}'; + } +} diff --git a/src/main/java/com/sixteam/irs/mapper/EnterpriseMapper.java b/src/main/java/com/sixteam/irs/mapper/EnterpriseMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..1224d1e018944be98a5985e6b6f9fbfaf033f1de --- /dev/null +++ b/src/main/java/com/sixteam/irs/mapper/EnterpriseMapper.java @@ -0,0 +1,15 @@ +package com.sixteam.irs.mapper; + +import com.sixteam.irs.entity.Enterprise; +import org.apache.ibatis.annotations.*; + +import java.util.List; +@Mapper +public interface EnterpriseMapper { + @Select("select * from irs_enterprise") + List getAllEnterprise(); + @Insert("INSERT INTO irs_enterprise(e_id,e_name,e_introduce,e_start,e_type,e_founder)"+ + "VALUES('4','碧蓝航线','上海宽娱数码科技有限公司','2017年6月2日','战舰游戏','勇仕')") + int addEnterprise(Enterprise enterprise); +} + diff --git a/src/main/java/com/sixteam/irs/mapper/StationMapper.java b/src/main/java/com/sixteam/irs/mapper/StationMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..52d5bcad3539dd7119088874174c7497660358e8 --- /dev/null +++ b/src/main/java/com/sixteam/irs/mapper/StationMapper.java @@ -0,0 +1,16 @@ +package com.sixteam.irs.mapper; + +import com.sixteam.irs.entity.Station; +import org.apache.ibatis.annotations.*; + +import java.util.List; +@Mapper +public interface StationMapper { + @Select("select * from irs_station") + List getAllStation(); + @Insert("INSERT INTO irs_station(s_id,s_name,s_wages,s_work,s_department,s_number,s_education,s_workdays,s_subsidy,s_gold)" + + " VALUES ('2','软件测试','6000-10000元/月','测试代码运维','测试部门','5','硕士','5天/周','有生活补助','有五险一金')") + int addStation(Station station); + @Update("update irs_station set s_name=#{sName},s_wages=#{sWages},s_work=#{sWork},s_department=#{sDepartment},s_number=#{sNumber},s_education=#{sEducation},s_workdays=#{sWorkdays},s_subsidy=#{sSubsidy},s_gold=#{sGold} where s_id = 1") + int updateStation(Station station); +} diff --git a/src/main/java/com/sixteam/irs/service/EnterpriseService.java b/src/main/java/com/sixteam/irs/service/EnterpriseService.java new file mode 100644 index 0000000000000000000000000000000000000000..d07aa15ea338741c4ed2339ba69ce0002391dbb3 --- /dev/null +++ b/src/main/java/com/sixteam/irs/service/EnterpriseService.java @@ -0,0 +1,13 @@ +package com.sixteam.irs.service; + +import com.sixteam.irs.entity.Enterprise; + +import java.util.List; + +public interface EnterpriseService { + + List getAllEnterprise();//查询所有企业 + + + int addEnterprise(Enterprise enterprise);//添加企业 +} diff --git a/src/main/java/com/sixteam/irs/service/StationService.java b/src/main/java/com/sixteam/irs/service/StationService.java new file mode 100644 index 0000000000000000000000000000000000000000..1e6adbcc76f48dd208da6893f5ce7dee1c15745d --- /dev/null +++ b/src/main/java/com/sixteam/irs/service/StationService.java @@ -0,0 +1,13 @@ +package com.sixteam.irs.service; + +import com.sixteam.irs.entity.Station; + +import java.util.List; + +public interface StationService { + List getAllStation(); + + int addStation(Station station); + + int updateStation(Station station); +} diff --git a/src/main/java/com/sixteam/irs/service/impl/EnterpriseServiceImpl.java b/src/main/java/com/sixteam/irs/service/impl/EnterpriseServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..2d8326020c2d6d63dc4d052c356d748b06233019 --- /dev/null +++ b/src/main/java/com/sixteam/irs/service/impl/EnterpriseServiceImpl.java @@ -0,0 +1,25 @@ +package com.sixteam.irs.service.impl; + +import com.sixteam.irs.entity.Enterprise; +import com.sixteam.irs.mapper.EnterpriseMapper; +import com.sixteam.irs.service.EnterpriseService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class EnterpriseServiceImpl implements EnterpriseService { + @Autowired + private EnterpriseMapper enterpriseMapper; + + @Override + public List getAllEnterprise() { + return enterpriseMapper.getAllEnterprise(); + } + + @Override + public int addEnterprise(Enterprise enterprise) { + return enterpriseMapper.addEnterprise(enterprise); + } +} diff --git a/src/main/java/com/sixteam/irs/service/impl/StationServiceImpl.java b/src/main/java/com/sixteam/irs/service/impl/StationServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..5ba852f16c80d0160a9a67be9a8a622283aadbb8 --- /dev/null +++ b/src/main/java/com/sixteam/irs/service/impl/StationServiceImpl.java @@ -0,0 +1,31 @@ +package com.sixteam.irs.service.impl; + +import com.sixteam.irs.entity.Station; +import com.sixteam.irs.mapper.StationMapper; +import com.sixteam.irs.service.StationService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class StationServiceImpl implements StationService { + + @Autowired + private StationMapper stationMapper; + + @Override + public List getAllStation() { + return stationMapper.getAllStation(); + } + + @Override + public int addStation(Station station) { + return stationMapper.addStation(station); + } + + @Override + public int updateStation(Station station) { + return stationMapper.updateStation(station); + } +} diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index d6e6325c817bfbe881931da2f177065394ca532f..399b3df9db04ccd43a4c7a10970f1b3e3bb0e058 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -3,7 +3,7 @@ server: spring: datasource: driver-class-name: com.mysql.jdbc.Driver - url: jdbc:mysql:/49.232.158.16;3306/irs?serverTimezone=UTC + url: jdbc:mysql://49.232.158.16:3306/irs?serverTimezone=UTC username: irsadmin password: 666 @@ -16,6 +16,6 @@ spring: mybatis: configuration: map-underscore-to-camel-case: true - #շʽ + #�����շ�ʽ mapper-locations: classpath:mapper/*.xml type-aliases-package: com.sixteam.irs.entity diff --git a/src/main/resources/com/sixteam/irs/mapper/EnterpriseMapper.xml b/src/main/resources/com/sixteam/irs/mapper/EnterpriseMapper.xml new file mode 100644 index 0000000000000000000000000000000000000000..c27fc392600dd24b9e8183c6a66f9c66c6c54552 --- /dev/null +++ b/src/main/resources/com/sixteam/irs/mapper/EnterpriseMapper.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/com/sixteam/irs/mapper/StationMapper.xml b/src/main/resources/com/sixteam/irs/mapper/StationMapper.xml new file mode 100644 index 0000000000000000000000000000000000000000..5d48c0e0a890de1855a1d0d927590bf099b161b0 --- /dev/null +++ b/src/main/resources/com/sixteam/irs/mapper/StationMapper.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + +