Shanks 7 年之前
父节点
当前提交
2a7590beb4
共有 28 个文件被更改,包括 1235 次插入265 次删除
  1. 1 5
      src/main/java/com/ygj/yuemum/ServletInitializer.java
  2. 2 2
      src/main/java/com/ygj/yuemum/UserCrudApplication.java
  3. 0 45
      src/main/java/com/ygj/yuemum/controller/UserController.java
  4. 37 0
      src/main/java/com/ygj/yuemum/controller/admin/CertificateController.java
  5. 40 0
      src/main/java/com/ygj/yuemum/controller/admin/JlAdminUserController.java
  6. 37 0
      src/main/java/com/ygj/yuemum/controller/admin/ResumeController.java
  7. 37 0
      src/main/java/com/ygj/yuemum/controller/admin/TrainController.java
  8. 44 0
      src/main/java/com/ygj/yuemum/dao/admin/CertificateDao.java
  9. 45 0
      src/main/java/com/ygj/yuemum/dao/admin/JlAdminUserDao.java
  10. 44 0
      src/main/java/com/ygj/yuemum/dao/admin/ResumeDao.java
  11. 9 9
      src/main/java/com/ygj/yuemum/dao/UserDao.java
  12. 45 0
      src/main/java/com/ygj/yuemum/domain/admin/Certificate.java
  13. 197 0
      src/main/java/com/ygj/yuemum/domain/admin/JlAdminUser.java
  14. 55 0
      src/main/java/com/ygj/yuemum/domain/admin/Resume.java
  15. 45 0
      src/main/java/com/ygj/yuemum/domain/admin/Train.java
  16. 0 64
      src/main/java/com/ygj/yuemum/pojo/UserPO.java
  17. 0 41
      src/main/java/com/ygj/yuemum/service/UserService.java
  18. 37 0
      src/main/java/com/ygj/yuemum/service/admin/CertificateService.java
  19. 37 0
      src/main/java/com/ygj/yuemum/service/admin/JlAdminUserService.java
  20. 37 0
      src/main/java/com/ygj/yuemum/service/admin/ResumeService.java
  21. 37 0
      src/main/java/com/ygj/yuemum/service/admin/TrainService.java
  22. 2 2
      src/main/resources/application.yml
  23. 0 97
      src/main/resources/mybatis/mapper/UserMapper.xml
  24. 70 0
      src/main/resources/mybatis/mapper/admin/CertificateMapper.xml
  25. 226 0
      src/main/resources/mybatis/mapper/admin/JlAdminUserMapper.xml
  26. 80 0
      src/main/resources/mybatis/mapper/admin/ResumeMapper.xml
  27. 70 0
      src/main/resources/mybatis/mapper/admin/TrainMapper.xml
  28. 1 0
      src/main/resources/mybatis/mybatis-config.xml

+ 1 - 5
src/main/java/com/ygj/yuemum/ServletInitializer.java

@@ -3,14 +3,10 @@ package com.ygj.yuemum;
 import org.springframework.boot.builder.SpringApplicationBuilder;
 import org.springframework.boot.web.support.SpringBootServletInitializer;
 
-/**
- * @Author: yf
- * @Date: 2017/11/27.
- */
 public class ServletInitializer extends SpringBootServletInitializer {
 
     @Override
     protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
-        return builder.sources(UserCrudApplication.class);
+        return builder.sources(YueMumApplication.class);
     }
 }

+ 2 - 2
src/main/java/com/ygj/yuemum/UserCrudApplication.java

@@ -6,9 +6,9 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
 
 @SpringBootApplication
 @MapperScan("com.ygj.yuemum.dao")
-public class UserCrudApplication {
+public class YueMumApplication {
 
     public static void main(String[] args) {
-        SpringApplication.run(UserCrudApplication.class, args);
+        SpringApplication.run(YueMumApplication.class, args);
     }
 }

+ 0 - 45
src/main/java/com/ygj/yuemum/controller/UserController.java

@@ -1,45 +0,0 @@
-package com.ygj.yuemum.controller;
-
-
-import com.ygj.yuemum.pojo.UserPO;
-import com.ygj.yuemum.service.UserService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
-
-/**
- * @Author: yf
- * @Date: 2017/11/27.
- */
-@RestController
-public class UserController {
-
-    @Autowired
-    private UserService userService;
-
-    @GetMapping("/getUsers")
-    public List<UserPO> getUsers() {
-        return userService.getUsers();
-    }
-
-    @PostMapping("/add")
-    public int add(@ModelAttribute UserPO user) {
-        return userService.addUser(user);
-    }
-
-    @GetMapping("/delete/{id}")
-    public int delete(@PathVariable("id") Integer id) {
-        return userService.deleteUser(id);
-    }
-
-    @PostMapping("/update")
-    public int update(@ModelAttribute UserPO user) {
-        return userService.updateUser(user);
-    }
-
-    @GetMapping("/get/{id}")
-    public UserPO getOne(@PathVariable("id") Integer id) {
-        return  userService.getUser(id);
-    }
-}

+ 37 - 0
src/main/java/com/ygj/yuemum/controller/admin/CertificateController.java

@@ -0,0 +1,37 @@
+package com.ygj.yuemum.controller.admin;
+
+
+import com.ygj.yuemum.service.admin.CertificateService;
+import com.ygj.yuemum.domain.admin.Certificate;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@RestController
+public class CertificateController {
+
+    @Autowired
+    private CertificateService certificateService;
+
+    @GetMapping("/getCertificates")
+    public List<Certificate> getTrains() {
+        return certificateService.getCertificates();
+    }
+
+    @PostMapping("/addCertificate")
+    public int add(@ModelAttribute Certificate certificate) {
+        return certificateService.addCertificate(certificate);
+    }
+
+    @GetMapping("/deleteCertificate/{id}")
+    public int delete(@PathVariable("id") Integer id) {
+        return certificateService.deleteCertificate(id);
+    }
+
+    @PostMapping("/updateCertificate")
+    public int update(@ModelAttribute Certificate certificate) { return certificateService.updateCertificate(certificate);}
+
+    @GetMapping("/getCertificate/{id}")
+    public Certificate getOne(@PathVariable("id") Integer id) {return  certificateService.getCertificate(id);}
+}

+ 40 - 0
src/main/java/com/ygj/yuemum/controller/admin/JlAdminUserController.java

@@ -0,0 +1,40 @@
+package com.ygj.yuemum.controller.admin;
+
+import com.ygj.yuemum.domain.admin.JlAdminUser;
+import com.ygj.yuemum.service.admin.JlAdminUserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@RestController
+public class JlAdminUserController {
+
+    @Autowired
+    private JlAdminUserService jladminuserService;
+
+    @GetMapping("/getJlAdminUsers")
+    public List<JlAdminUser> getUsers() {
+        return jladminuserService.getUsers();
+    }
+
+    @PostMapping("/JlAdminadd")
+    public int add(@ModelAttribute JlAdminUser jladminuser) {
+        return jladminuserService.addUser(jladminuser);
+    }
+
+    @GetMapping("/JlAdmindelete/{id}")
+    public int delete(@PathVariable("id") Integer id) {
+        return jladminuserService.deleteUser(id);
+    }
+
+    @PostMapping("/JlAdminupdate")
+    public int update(@ModelAttribute JlAdminUser jladminuser) {
+        return jladminuserService.updateUser(jladminuser);
+    }
+
+    @GetMapping("/JlAdminget/{id}")
+    public JlAdminUser getOne(@PathVariable("id") Integer id) {
+        return jladminuserService.getUser(id);
+    }
+}

+ 37 - 0
src/main/java/com/ygj/yuemum/controller/admin/ResumeController.java

@@ -0,0 +1,37 @@
+package com.ygj.yuemum.controller.admin;
+
+
+import com.ygj.yuemum.domain.admin.Resume;
+import com.ygj.yuemum.service.admin.ResumeService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@RestController
+public class ResumeController {
+
+    @Autowired
+    private ResumeService resumeService;
+
+    @GetMapping("/getResumes")
+    public List<Resume> getResumes() {
+        return resumeService.getResums();
+    }
+
+    @PostMapping("/addResume")
+    public int add(@ModelAttribute Resume resume) {
+        return resumeService.addResume(resume);
+    }
+
+    @GetMapping("/deleteResume/{id}")
+    public int delete(@PathVariable("id") Integer id) {
+        return resumeService.deleteResume(id);
+    }
+
+    @PostMapping("/updateResume")
+    public int update(@ModelAttribute Resume resume) { return resumeService.updateResume(resume);}
+
+    @GetMapping("/getResume/{id}")
+    public Resume getOne(@PathVariable("id") Integer id) {return  resumeService.getResume(id);}
+}

+ 37 - 0
src/main/java/com/ygj/yuemum/controller/admin/TrainController.java

@@ -0,0 +1,37 @@
+package com.ygj.yuemum.controller.admin;
+
+
+import com.ygj.yuemum.domain.admin.Train;
+import com.ygj.yuemum.service.admin.TrainService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@RestController
+public class TrainController {
+
+    @Autowired
+    private TrainService trainService;
+
+    @GetMapping("/getTrains")
+    public List<Train> getTrains() {
+        return trainService.getTrains();
+    }
+
+    @PostMapping("/addTrain")
+    public int add(@ModelAttribute Train train) {
+        return trainService.addTrain(train);
+    }
+
+    @GetMapping("/deleteTrain/{id}")
+    public int delete(@PathVariable("id") Integer id) {
+        return trainService.deleteTrain(id);
+    }
+
+    @PostMapping("/updateTrain")
+    public int update(@ModelAttribute Train train) { return trainService.updateTrain(train);}
+
+    @GetMapping("/getTrain/{id}")
+    public Train getOne(@PathVariable("id") Integer id) {return  trainService.getTrain(id);}
+}

+ 44 - 0
src/main/java/com/ygj/yuemum/dao/admin/CertificateDao.java

@@ -0,0 +1,44 @@
+package com.ygj.yuemum.dao.admin;
+
+import com.ygj.yuemum.domain.admin.Certificate;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public interface CertificateDao {
+
+    /**
+     * 得到所有的用户信息
+     * @return List<Train>
+     */
+    List<Certificate> getAll();
+
+    /**
+     * 根据id删除某个用户信息
+     * @param id
+     * @return
+     */
+    int deleteByPrimaryKey(Integer id);
+
+    /**
+     * 插入一条用户信息
+     * @param record
+     * @return
+     */
+    int insertSelective(Certificate record);
+
+    /**
+     * 根据id查找某个用户信息
+     * @param id
+     * @return User
+     */
+    Certificate selectByPrimaryKey(Integer id);
+
+    /**
+     * 根据id更新一条用户信息
+     * @param record
+     * @return
+     */
+    int updateByPrimaryKeySelective(Certificate record);
+}

+ 45 - 0
src/main/java/com/ygj/yuemum/dao/admin/JlAdminUserDao.java

@@ -0,0 +1,45 @@
+package com.ygj.yuemum.dao.admin;
+
+import com.ygj.yuemum.domain.admin.JlAdminUser;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+
+@Repository
+public interface JlAdminUserDao {
+
+    /**
+     * 得到所有的用户信息
+     * @return List<User>
+     */
+    List<JlAdminUser> getAll();
+
+    /**
+     * 根据id删除某个用户信息
+     * @param id
+     * @return
+     */
+    int deleteByPrimaryKey(Integer id);
+
+    /**
+     * 插入一条用户信息
+     * @param record
+     * @return
+     */
+    int insertSelective(JlAdminUser record);
+
+    /**
+     * 根据id查找某个用户信息
+     * @param id
+     * @return User
+     */
+    JlAdminUser selectByPrimaryKey(Integer id);
+
+    /**
+     * 根据id更新一条用户信息
+     * @param record
+     * @return
+     */
+    int updateByPrimaryKeySelective(JlAdminUser record);
+}

+ 44 - 0
src/main/java/com/ygj/yuemum/dao/admin/ResumeDao.java

@@ -0,0 +1,44 @@
+package com.ygj.yuemum.dao.admin;
+
+import com.ygj.yuemum.domain.admin.Resume;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public interface ResumeDao {
+
+    /**
+     * 得到所有的简历信息
+     * @return List<Train>
+     */
+    List<Resume> getAll();
+
+    /**
+     * 根据id删除某个简历信息
+     * @param id
+     * @return
+     */
+    int deleteByPrimaryKey(Integer id);
+
+    /**
+     * 插入一条简历信息
+     * @param record
+     * @return
+     */
+    int insertSelective(Resume record);
+
+    /**
+     * 根据id查找某个简历信息
+     * @param id
+     * @return User
+     */
+    Resume selectByPrimaryKey(Integer id);
+
+    /**
+     * 根据id更新一条简历信息
+     * @param record
+     * @return
+     */
+    int updateByPrimaryKeySelective(Resume record);
+}

+ 9 - 9
src/main/java/com/ygj/yuemum/dao/UserDao.java

@@ -1,18 +1,18 @@
-package com.ygj.yuemum.dao;
+package com.ygj.yuemum.dao.admin;
 
-import com.ygj.yuemum.pojo.UserPO;
+import com.ygj.yuemum.domain.admin.Train;
 import org.springframework.stereotype.Repository;
 
 import java.util.List;
 
 @Repository
-public interface UserDao {
+public interface TrainDao {
 
     /**
      * 得到所有的用户信息
-     * @return List<UserPO>
+     * @return List<Train>
      */
-    List<UserPO> getAll();
+    List<Train> getAll();
 
     /**
      * 根据id删除某个用户信息
@@ -26,19 +26,19 @@ public interface UserDao {
      * @param record
      * @return
      */
-    int insertSelective(UserPO record);
+    int insertSelective(Train record);
 
     /**
      * 根据id查找某个用户信息
      * @param id
-     * @return UserPO
+     * @return User
      */
-    UserPO selectByPrimaryKey(Integer id);
+    Train selectByPrimaryKey(Integer id);
 
     /**
      * 根据id更新一条用户信息
      * @param record
      * @return
      */
-    int updateByPrimaryKeySelective(UserPO record);
+    int updateByPrimaryKeySelective(Train record);
 }

+ 45 - 0
src/main/java/com/ygj/yuemum/domain/admin/Certificate.java

@@ -0,0 +1,45 @@
+package com.ygj.yuemum.domain.admin;
+
+public class Certificate {
+
+    private Integer id;
+    private Integer certificate_code; // 证书编号
+    private String certificate_name; // 证书名称
+
+    public Certificate() {
+        super();
+    }
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getCertificate_code() {
+        return certificate_code;
+    }
+
+    public void setCertificate_code(Integer certificate_code) {
+        this.certificate_code = certificate_code;
+    }
+
+    public String getCertificate_name() {
+        return certificate_name;
+    }
+
+    public void setCertificate_name(String certificate_name) {
+        this.certificate_name = certificate_name;
+    }
+
+    @Override
+    public String toString() {
+        return "Train{" +
+                "id=" + id +
+                ", certificate_code='" + certificate_code + '\'' +
+                ", certificate_name='" + certificate_name + '\'' +
+                '}';
+    }
+}

+ 197 - 0
src/main/java/com/ygj/yuemum/domain/admin/JlAdminUser.java

@@ -0,0 +1,197 @@
+package com.ygj.yuemum.domain.admin;
+
+import java.util.Date;
+
+public class JlAdminUser {
+    private Integer id;
+    private String username;
+    private String email;
+    private String password;
+    private Date create_time;
+    private Date last_login_time;
+    private String last_login_ip;
+    private Integer role;
+    private Integer status;
+    private Integer org;
+    private String last_login_location;
+    private String remark;
+    private String phone;
+    private String province;
+    private String city;
+    private String district;
+    private Integer enabled;
+    private Date update_time;
+
+    public JlAdminUser() {
+        super();
+    }
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public String getEmail() {
+        return email;
+    }
+
+    public void setEmail(String email) {
+        this.email = email;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public Date getCreate_time() {
+        return create_time;
+    }
+
+    public void setCreate_time(Date create_time) {
+        this.create_time = create_time;
+    }
+
+    public Date getLast_login_time() {
+        return last_login_time;
+    }
+
+    public void setLast_login_time(Date last_login_time) {
+        this.last_login_time = last_login_time;
+    }
+
+    public String getLast_login_ip() {
+        return last_login_ip;
+    }
+
+    public void setLast_login_ip(String last_login_ip) {
+        this.last_login_ip = last_login_ip;
+    }
+
+    public Integer getRole() {
+        return role;
+    }
+
+    public void setRole(Integer role) {
+        this.role = role;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Integer getOrg() {
+        return org;
+    }
+
+    public void setOrg(Integer org) {
+        this.org = org;
+    }
+
+    public String getLast_login_location() {
+        return last_login_location;
+    }
+
+    public void setLast_login_location(String last_login_location) {
+        this.last_login_location = last_login_location;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public String getPhone() {
+        return phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+
+    public String getProvince() {
+        return province;
+    }
+
+    public void setProvince(String province) {
+        this.province = province;
+    }
+
+    public String getCity() {
+        return city;
+    }
+
+    public void setCity(String city) {
+        this.city = city;
+    }
+
+    public String getDistrict() {
+        return district;
+    }
+
+    public void setDistrict(String district) {
+        this.district = district;
+    }
+
+    public Integer getEnabled() {
+        return enabled;
+    }
+
+    public void setEnabled(Integer enabled) {
+        this.enabled = enabled;
+    }
+
+    public Date getUpdate_time() {
+        return update_time;
+    }
+
+    public void setUpdate_time(Date update_time) {
+        this.update_time = update_time;
+    }
+
+
+    @Override
+    public String toString() {
+        return "JlAdminUser{" +
+                "id=" + id +
+                ", username='" + username + '\'' +
+                ", email='" + email + '\'' +
+                ", password=" + password +
+                ", create_time='" + create_time + '\'' +
+                ", last_login_time='" + last_login_time + '\'' +
+                ", last_login_ip='" + last_login_ip + '\'' +
+                ", role=" + role +
+                ", status='" + status + '\'' +
+                ", org='" + org + '\'' +
+                ", last_login_location='" + last_login_location + '\'' +
+                ", remark=" + remark +
+                ", phone='" + phone + '\'' +
+                ", province='" + province + '\'' +
+                ", city='" + city + '\'' +
+                ", district=" + district +
+                ", enabled='" + enabled + '\'' +
+                ", update_time='" + update_time + '\'' +
+                '}';
+    }
+}

+ 55 - 0
src/main/java/com/ygj/yuemum/domain/admin/Resume.java

@@ -0,0 +1,55 @@
+package com.ygj.yuemum.domain.admin;
+
+public class Resume {
+
+    private Integer id;
+    private Integer resume_code; // 简历编号
+    private String resume_name; // 简历名称
+    private String resume_path;// 简历路径
+
+    public Resume() {
+        super();
+    }
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getResume_code() {
+        return resume_code;
+    }
+
+    public void setResume_code(Integer resume_code) {
+        this.resume_code = resume_code;
+    }
+
+    public String getResume_name() {
+        return resume_name;
+    }
+
+    public void setResume_name(String resume_name) {
+        this.resume_name = resume_name;
+    }
+
+    public String getResume_path() {
+        return resume_path;
+    }
+
+    public void setResume_path(String resume_path) {
+        this.resume_path = resume_path;
+    }
+
+    @Override
+    public String toString() {
+        return "Resume{" +
+                "id=" + id +
+                ", resume_code='" + resume_code + '\'' +
+                ", resume_name='" + resume_name + '\'' +
+                ", resume_path='" + resume_path + '\'' +
+                '}';
+    }
+}

+ 45 - 0
src/main/java/com/ygj/yuemum/domain/admin/Train.java

@@ -0,0 +1,45 @@
+package com.ygj.yuemum.domain.admin;
+
+public class Train {
+
+    private Integer id;
+    private Integer train_code; // 培训编号
+    private String train_name; // 培训名称
+
+    public Train() {
+        super();
+    }
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getTrain_code() {
+        return train_code;
+    }
+
+    public void setTrain_code(Integer train_code) {
+        this.train_code = train_code;
+    }
+
+    public String getTrain_name() {
+        return train_name;
+    }
+
+    public void setTrain_name(String train_name) {
+        this.train_name = train_name;
+    }
+
+    @Override
+    public String toString() {
+        return "Train{" +
+                "id=" + id +
+                ", train_code='" + train_code + '\'' +
+                ", train_name='" + train_name + '\'' +
+                '}';
+    }
+}

+ 0 - 64
src/main/java/com/ygj/yuemum/pojo/UserPO.java

@@ -1,64 +0,0 @@
-package com.ygj.yuemum.pojo;
-
-public class UserPO {
-    private Integer id;
-    private String name; // 用户名
-    private String password; // 密码
-    private Integer age; // 年龄
-    private String phone; // 电话号码
-
-    public UserPO() {
-        super();
-    }
-
-    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 == null ? null : name.trim();
-    }
-
-    public String getPassword() {
-        return password;
-    }
-
-    public void setPassword(String password) {
-        this.password = password == null ? null : password.trim();
-    }
-
-    public Integer getAge() {
-        return age;
-    }
-
-    public void setAge(Integer age) {
-        this.age = age;
-    }
-
-    public String getPhone() {
-        return phone;
-    }
-
-    public void setPhone(String phone) {
-        this.phone = phone == null ? null : phone.trim();
-    }
-
-    @Override
-    public String toString() {
-        return "UserPO{" +
-                "id=" + id +
-                ", name='" + name + '\'' +
-                ", password='" + password + '\'' +
-                ", age=" + age +
-                ", phone='" + phone + '\'' +
-                '}';
-    }
-}

+ 0 - 41
src/main/java/com/ygj/yuemum/service/UserService.java

@@ -1,41 +0,0 @@
-package com.ygj.yuemum.service;
-
-import com.ygj.yuemum.dao.UserDao;
-import com.ygj.yuemum.pojo.UserPO;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-/**
- * @Author: yf
- * @Date: 2017/11/27.
- */
-@Service
-public class UserService {
-
-    @Autowired
-    private UserDao userDao;
-
-    public List<UserPO> getUsers() {
-        List<UserPO> users = userDao.getAll();
-        return users;
-    }
-
-    public int addUser(UserPO user) {
-        return userDao.insertSelective(user);
-    }
-
-    public int deleteUser(Integer id) {
-        return userDao.deleteByPrimaryKey(id);
-    }
-
-    public int updateUser(UserPO user) {
-        return userDao.updateByPrimaryKeySelective(user);
-    }
-
-    public UserPO getUser(Integer id) {
-        return userDao.selectByPrimaryKey(id);
-    }
-}

+ 37 - 0
src/main/java/com/ygj/yuemum/service/admin/CertificateService.java

@@ -0,0 +1,37 @@
+package com.ygj.yuemum.service.admin;
+
+import com.ygj.yuemum.dao.admin.CertificateDao;
+import com.ygj.yuemum.domain.admin.Certificate;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class CertificateService {
+
+    @Autowired
+
+    private CertificateDao certificateDao;
+
+    public List<Certificate> getCertificates() {
+        List<Certificate> certificates = certificateDao.getAll();
+        return certificates;
+    }
+
+    public int addCertificate(Certificate certificate) {
+        return certificateDao.insertSelective(certificate);
+    }
+
+    public int deleteCertificate(Integer id) {
+        return certificateDao.deleteByPrimaryKey(id);
+    }
+
+    public int updateCertificate(Certificate certificate) {
+        return certificateDao.updateByPrimaryKeySelective(certificate);
+    }
+
+    public Certificate getCertificate(Integer id) {
+        return certificateDao.selectByPrimaryKey(id);
+    }
+}

+ 37 - 0
src/main/java/com/ygj/yuemum/service/admin/JlAdminUserService.java

@@ -0,0 +1,37 @@
+package com.ygj.yuemum.service.admin;
+
+import com.ygj.yuemum.dao.admin.JlAdminUserDao;
+import com.ygj.yuemum.domain.admin.JlAdminUser;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+
+@Service
+public class JlAdminUserService {
+
+    @Autowired
+    private JlAdminUserDao jladminuserdao;
+
+    public List<JlAdminUser> getUsers() {
+        List<JlAdminUser> jladminusers = jladminuserdao.getAll();
+        return jladminusers;
+    }
+
+    public int addUser(JlAdminUser jladminusers) {
+        return jladminuserdao.insertSelective(jladminusers);
+    }
+
+    public int deleteUser(Integer id) {
+        return jladminuserdao.deleteByPrimaryKey(id);
+    }
+
+    public int updateUser(JlAdminUser jladminusers) {
+        return jladminuserdao.updateByPrimaryKeySelective(jladminusers);
+    }
+
+    public JlAdminUser getUser(Integer id) {
+        return jladminuserdao.selectByPrimaryKey(id);
+    }
+}

+ 37 - 0
src/main/java/com/ygj/yuemum/service/admin/ResumeService.java

@@ -0,0 +1,37 @@
+package com.ygj.yuemum.service.admin;
+
+import com.ygj.yuemum.dao.admin.ResumeDao;
+import com.ygj.yuemum.domain.admin.Resume;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class ResumeService {
+
+    @Autowired
+
+    private ResumeDao resumeDao;
+
+    public List<Resume> getResums() {
+        List<Resume> resumes = resumeDao.getAll();
+        return resumes;
+    }
+
+    public int addResume(Resume resume) {
+        return resumeDao.insertSelective(resume);
+    }
+
+    public int deleteResume(Integer id) {
+        return resumeDao.deleteByPrimaryKey(id);
+    }
+
+    public int updateResume(Resume resume) {
+        return resumeDao.updateByPrimaryKeySelective(resume);
+    }
+
+    public Resume getResume(Integer id) {
+        return resumeDao.selectByPrimaryKey(id);
+    }
+}

+ 37 - 0
src/main/java/com/ygj/yuemum/service/admin/TrainService.java

@@ -0,0 +1,37 @@
+package com.ygj.yuemum.service.admin;
+
+import com.ygj.yuemum.dao.admin.TrainDao;
+import com.ygj.yuemum.domain.admin.Train;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class TrainService {
+
+    @Autowired
+
+    private TrainDao trainDao;
+
+    public List<Train> getTrains() {
+        List<Train> trains = trainDao.getAll();
+        return trains;
+    }
+
+    public int addTrain(Train train) {
+        return trainDao.insertSelective(train);
+    }
+
+    public int deleteTrain(Integer id) {
+        return trainDao.deleteByPrimaryKey(id);
+    }
+
+    public int updateTrain(Train train) {
+        return trainDao.updateByPrimaryKeySelective(train);
+    }
+
+    public Train getTrain(Integer id) {
+        return trainDao.selectByPrimaryKey(id);
+    }
+}

+ 2 - 2
src/main/resources/application.yml

@@ -2,8 +2,8 @@ server:
   port: 8080
 mybatis:
   config-location: classpath:mybatis/mybatis-config.xml
-  mapper-locations: classpath:mybatis/mapper/*.xml
-  mybatis.type-aliases-package: com.ygj.yuemum.pojo
+  mapper-locations: mybatis/mapper/admin/*.xml
+  mybatis.type-aliases-package: com.ygj.yuemum.domain/admin
 spring:
   datasource:
     driverClassName: com.mysql.jdbc.Driver

+ 0 - 97
src/main/resources/mybatis/mapper/UserMapper.xml

@@ -1,97 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
-<mapper namespace="com.ygj.yuemum.dao.UserDao" >
-
-    <resultMap id="BaseResultMap" type="com.ygj.yuemum.pojo.UserPO" >
-        <id column="id" property="id" jdbcType="INTEGER" />
-        <result column="name" property="name" jdbcType="VARCHAR" />
-        <result column="password" property="password" jdbcType="VARCHAR" />
-        <result column="age" property="age" jdbcType="INTEGER" />
-        <result column="phone" property="phone" jdbcType="VARCHAR" />
-    </resultMap>
-
-    <sql id="Base_Column_List" >
-        id, name, password, age, phone
-    </sql>
-
-    <!-- 得到所有的用户信息 -->
-    <select id="getAll" resultMap="BaseResultMap" >
-        select
-        <include refid="Base_Column_List" />
-        from user
-    </select>
-
-    <!-- 根据id查找某个用户信息 -->
-    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
-        select
-        <include refid="Base_Column_List" />
-        from user
-        where id = #{id,jdbcType=INTEGER}
-    </select>
-
-    <!-- 根据id删除某个用户信息 -->
-    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
-        delete from user
-        where id = #{id,jdbcType=INTEGER}
-    </delete>
-
-    <!-- 插入一条用户信息 -->
-    <insert id="insertSelective" parameterType="com.ygj.yuemum.pojo.UserPO" >
-        insert into user
-        <trim prefix="(" suffix=")" suffixOverrides="," >
-            <if test="id != null" >
-                id,
-            </if>
-            <if test="name != null" >
-                name,
-            </if>
-            <if test="password != null" >
-                password,
-            </if>
-            <if test="age != null" >
-                age,
-            </if>
-            <if test="phone != null" >
-                phone,
-            </if>
-        </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides="," >
-            <if test="id != null" >
-                #{id,jdbcType=INTEGER},
-            </if>
-            <if test="name != null" >
-                #{name,jdbcType=VARCHAR},
-            </if>
-            <if test="password != null" >
-                #{password,jdbcType=VARCHAR},
-            </if>
-            <if test="age != null" >
-                #{age,jdbcType=INTEGER},
-            </if>
-            <if test="phone != null" >
-                #{phone,jdbcType=VARCHAR},
-            </if>
-        </trim>
-    </insert>
-
-    <!-- 根据id更新一条用户信息 -->
-    <update id="updateByPrimaryKeySelective" parameterType="com.ygj.yuemum.pojo.UserPO" >
-        update user
-        <set >
-            <if test="name != null" >
-                name = #{name,jdbcType=VARCHAR},
-            </if>
-            <if test="password != null" >
-                password = #{password,jdbcType=VARCHAR},
-            </if>
-            <if test="age != null" >
-                age = #{age,jdbcType=INTEGER},
-            </if>
-            <if test="phone != null" >
-                phone = #{phone,jdbcType=VARCHAR},
-            </if>
-        </set>
-        where id = #{id,jdbcType=INTEGER}
-    </update>
-
-</mapper>

+ 70 - 0
src/main/resources/mybatis/mapper/admin/CertificateMapper.xml

@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.ygj.yuemum.dao.admin.CertificateDao" >
+
+    <resultMap id="BaseResultMap" type="com.ygj.yuemum.domain.admin.Certificate" >
+        <id column="id" property="id" jdbcType="INTEGER" />
+        <result column="certificate_code" property="certificate_code" jdbcType="INTEGER" />
+        <result column="certificate_name" property="certificate_name" jdbcType="VARCHAR" />
+    </resultMap>
+
+    <sql id="Base_Column_List" >
+        id, certificate_code, certificate_name
+    </sql>
+
+    <!-- 得到所有的证书信息 -->
+    <select id="getAll" resultMap="BaseResultMap" >
+        select
+        <include refid="Base_Column_List" />
+        from certificate
+    </select>
+
+    <!-- 根据id查找某个证书信息 -->
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+        select
+        <include refid="Base_Column_List" />
+        from certificate
+        where id = #{id,jdbcType=INTEGER}
+    </select>
+    <!-- 根据id删除某个证书信息 -->
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+        delete from certificate
+        where id = #{id,jdbcType=INTEGER}
+    </delete>
+
+    <!-- 插入一条证书信息 -->
+    <insert id="insertSelective" parameterType="com.ygj.yuemum.domain.admin.Certificate" >
+        insert into certificate
+        <trim prefix="(" suffix=")" suffixOverrides="," >
+            <if test="certificate_code != null" >
+                certificate_code,
+            </if>
+            <if test="certificate_name != null" >
+                certificate_name,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides="," >
+            <if test="certificate_code != null" >
+                #{certificate_code,jdbcType=INTEGER},
+            </if>
+            <if test="certificate_name != null" >
+                #{certificate_name,jdbcType=VARCHAR},
+            </if>
+        </trim>
+    </insert>
+
+    <!-- 根据id更新一条证书信息 -->
+    <update id="updateByPrimaryKeySelective" parameterType="com.ygj.yuemum.domain.admin.Certificate" >
+        update certificate
+        <set >
+            <if test="certificate_code != null" >
+                certificate_code = #{certificate_code,jdbcType=INTEGER},
+            </if>
+            <if test="certificate_name != null" >
+                certificate_name = #{certificate_name,jdbcType=VARCHAR},
+            </if>
+        </set>
+        where id = #{id,jdbcType=INTEGER}
+    </update>
+
+</mapper>

+ 226 - 0
src/main/resources/mybatis/mapper/admin/JlAdminUserMapper.xml

@@ -0,0 +1,226 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.ygj.yuemum.dao.admin.JlAdminUserDao" >
+
+    <resultMap id="BaseResultMap" type="com.ygj.yuemum.domain.admin.JlAdminUser" >
+        <id column="id" property="id" jdbcType="INTEGER" />
+        <result column="username" property="username" jdbcType="VARCHAR" />
+        <result column="email" property="email" jdbcType="VARCHAR" />
+        <result column="password" property="password" jdbcType="VARCHAR" />
+        <result column="create_time" property="create_time" jdbcType="DATE" />
+        <result column="last_login_time" property="last_login_time" jdbcType="DATE" />
+        <result column="last_login_ip" property="last_login_ip" jdbcType="VARCHAR" />
+        <result column="role" property="role" jdbcType="INTEGER" />
+        <result column="status" property="status" jdbcType="INTEGER" />
+        <result column="org" property="org" jdbcType="INTEGER" />
+        <result column="last_login_location" property="last_login_location" jdbcType="VARCHAR" />
+        <result column="remark" property="remark" jdbcType="VARCHAR" />
+        <result column="phone" property="phone" jdbcType="VARCHAR" />
+        <result column="province" property="province" jdbcType="VARCHAR" />
+        <result column="city" property="city" jdbcType="VARCHAR" />
+        <result column="district" property="district" jdbcType="VARCHAR" />
+        <result column="province" property="province" jdbcType="VARCHAR" />
+        <result column="enabled" property="enabled" jdbcType="INTEGER" />
+        <result column="update_time" property="update_time" jdbcType="DATE" />
+    </resultMap>
+
+    <sql id="Base_Column_List" >
+        id,username,email,password,create_time,last_login_time,last_login_ip,role,status,org,last_login_location,remark,phone,province,city,district,enabled,update_time
+    </sql>
+
+    <!-- 得到所有的用户信息 -->
+    <select id="getAll" resultMap="BaseResultMap" >
+        select
+        <include refid="Base_Column_List" />
+        from jl_admin_user
+    </select>
+
+    <!-- 根据id查找某个用户信息 -->
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+        select
+        <include refid="Base_Column_List" />
+        from jl_admin_user
+        where id = #{id,jdbcType=INTEGER}
+    </select>
+
+    <!-- 根据id删除某个用户信息 -->
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+        delete from jl_admin_user
+        where id = #{id,jdbcType=INTEGER}
+    </delete>
+
+    <!-- 插入一条用户信息 -->
+    <insert id="insertSelective" parameterType="com.ygj.yuemum.domain.admin.JlAdminUser" >
+        insert into jl_admin_user
+        <trim prefix="(" suffix=")" suffixOverrides="," >
+            <if test="username != null" >
+                username,
+            </if>
+            <if test="email != null" >
+                email,
+            </if>
+            <if test="password != null" >
+                password,
+            </if>
+            <if test="create_time != null" >
+                create_time,
+            </if>
+            <if test="last_login_time != null" >
+                last_login_time,
+            </if>
+            <if test="last_login_ip != null" >
+                last_login_ip,
+            </if>
+            <if test="role != null" >
+                role,
+            </if>
+            <if test="status != null" >
+                status,
+            </if>
+            <if test="org != null" >
+                org,
+            </if>
+            <if test="last_login_location != null" >
+                last_login_location,
+            </if>
+            <if test="remark != null" >
+                remark,
+            </if>
+            <if test="phone != null" >
+                phone,
+            </if>
+            <if test="province != null" >
+                province,
+            </if>
+            <if test="city != null" >
+                city,
+            </if>
+
+            <if test="district != null" >
+                district,
+            </if>
+            <if test="enabled != null" >
+                enabled,
+            </if>
+            <if test="update_time != null" >
+                update_time,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides="," >
+            <if test="username != null" >
+                #{username,jdbcType=VARCHAR},
+            </if>
+            <if test="email != null" >
+                #{email,jdbcType=VARCHAR},
+            </if>
+            <if test="password != null" >
+                #{password,jdbcType=VARCHAR},
+            </if>
+            <if test="create_time != null" >
+                #{create_time,jdbcType=DATETIME},
+            </if>
+            <if test="last_login_time != null" >
+                #{last_login_time,jdbcType=DATETIME},
+            </if>
+            <if test="last_login_ip != null" >
+                #{last_login_ip,jdbcType=VARCHAR},
+            </if>
+            <if test="role != null" >
+                #{role,jdbcType=INTEGER},
+            </if>
+            <if test="status != null" >
+                #{status,jdbcType=INTEGER},
+            </if>
+            <if test="org != null" >
+                #{org,jdbcType=INTEGER},
+            </if>
+            <if test="last_login_location != null" >
+                #{last_login_location,jdbcType=VARCHAR},
+            </if>
+            <if test="remark != null" >
+                #{remark,jdbcType=VARCHAR},
+            </if>
+            <if test="phone != null" >
+                #{phone,jdbcType=VARCHAR},
+            </if>
+            <if test="province != null" >
+                #{province,jdbcType=VARCHAR},
+            </if>
+            <if test="city != null" >
+                #{city,jdbcType=VARCHAR},
+            </if>
+            <if test="district != null" >
+                #{district,jdbcType=VARCHAR},
+            </if>
+            <if test="password != null" >
+                #{password,jdbcType=VARCHAR},
+            </if>
+            <if test="enabled != null" >
+                #{enabled,jdbcType=INTEGER},
+            </if>
+            <if test="update_time != null" >
+                #{update_time,jdbcType=DATE},
+            </if>
+        </trim>
+    </insert>
+
+    <!-- 根据id更新一条用户信息 -->
+    <update id="updateByPrimaryKeySelective" parameterType="com.ygj.yuemum.domain.admin.JlAdminUser" >
+        update jl_admin_user
+        <set >
+            <if test="username != null" >
+                username = #{username,jdbcType=VARCHAR},
+            </if>
+            <if test="email != null" >
+                email = #{email,jdbcType=VARCHAR},
+            </if>
+            <if test="password != null" >
+                password = #{password,jdbcType=VARCHAR},
+            </if>
+            <if test="create_time != null" >
+                create_time = #{create_time,jdbcType=DATE},
+            </if>
+            <if test="last_login_time != null" >
+                password = #{last_login_time,jdbcType=DATE},
+            </if>
+            <if test="last_login_ip != null" >
+                last_login_ip = #{last_login_ip,jdbcType=VARCHAR},
+            </if>
+            <if test="role != null" >
+                role = #{role,jdbcType=INTEGER},
+            </if>
+            <if test="status != null" >
+                status = #{status,jdbcType=INTEGER},
+            </if>
+            <if test="org != null" >
+                org = #{org,jdbcType=INTEGER},
+            </if>
+            <if test="last_login_location != null" >
+                last_login_location = #{last_login_location,jdbcType=VARCHAR},
+            </if>
+            <if test="remark != null" >
+                remark = #{remark,jdbcType=VARCHAR},
+            </if>
+            <if test="phone != null" >
+                phone = #{phone,jdbcType=VARCHAR},
+            </if>
+            <if test="province != null" >
+                province = #{province,jdbcType=VARCHAR},
+            </if>
+            <if test="city != null" >
+                city = #{city,jdbcType=VARCHAR},
+            </if>
+            <if test="district != null" >
+                district = #{district,jdbcType=VARCHAR},
+            </if>
+            <if test="enabled != null" >
+                enabled = #{enabled,jdbcType=INTEGER},
+            </if>
+            <if test="update_time != null" >
+                update_time = #{update_time,jdbcType=DATE},
+            </if>
+        </set>
+        where id = #{id,jdbcType=INTEGER}
+    </update>
+
+</mapper>

+ 80 - 0
src/main/resources/mybatis/mapper/admin/ResumeMapper.xml

@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.ygj.yuemum.dao.admin.ResumeDao" >
+
+    <resultMap id="BaseResultMap" type="com.ygj.yuemum.domain.admin.Resume" >
+        <id column="id" property="id" jdbcType="INTEGER" />
+        <result column="resume_code" property="resume_code" jdbcType="INTEGER" />
+        <result column="resume_name" property="resume_name" jdbcType="VARCHAR" />
+        <result column="resume_path" property="resume_path" jdbcType="VARCHAR" />
+    </resultMap>
+
+    <sql id="Base_Column_List" >
+        id,resume_code,resume_name,resume_path
+    </sql>
+
+    <!-- 得到所有的简历信息 -->
+    <select id="getAll" resultMap="BaseResultMap" >
+        select
+        <include refid="Base_Column_List" />
+        from resume
+    </select>
+
+    <!-- 根据id查找某个简历信息 -->
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+        select
+        <include refid="Base_Column_List" />
+        from resume
+        where id = #{id,jdbcType=INTEGER}
+    </select>
+    <!-- 根据id删除某个简历信息 -->
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+        delete from resume
+        where id = #{id,jdbcType=INTEGER}
+    </delete>
+
+    <!-- 插入一条简历信息 -->
+    <insert id="insertSelective" parameterType="com.ygj.yuemum.domain.admin.Resume" >
+        insert into resume
+        <trim prefix="(" suffix=")" suffixOverrides="," >
+            <if test="resume_code != null" >
+                resume_code,
+            </if>
+            <if test="resume_name != null" >
+                resume_name,
+            </if>
+            <if test="resume_path != null" >
+                resume_path,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides="," >
+            <if test="resume_code != null" >
+                #{resume_code,jdbcType=INTEGER},
+            </if>
+            <if test="resume_name != null" >
+                #{resume_name,jdbcType=VARCHAR},
+            </if>
+            <if test="resume_path != null" >
+                #{resume_path,jdbcType=VARCHAR},
+            </if>
+        </trim>
+    </insert>
+
+    <!-- 根据id更新一条简历信息 -->
+    <update id="updateByPrimaryKeySelective" parameterType="com.ygj.yuemum.domain.admin.Resume" >
+        update resume
+        <set >
+            <if test="resume_code != null" >
+                resume_code = #{resume_code,jdbcType=INTEGER},
+            </if>
+            <if test="resume_name != null" >
+                resume_name = #{resume_name,jdbcType=VARCHAR},
+            </if>
+            <if test="resume_path != null" >
+                resume_path = #{resume_path,jdbcType=VARCHAR},
+            </if>
+        </set>
+        where id = #{id,jdbcType=INTEGER}
+    </update>
+
+</mapper>

+ 70 - 0
src/main/resources/mybatis/mapper/admin/TrainMapper.xml

@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.ygj.yuemum.dao.admin.TrainDao" >
+
+    <resultMap id="BaseResultMap" type="com.ygj.yuemum.domain.admin.Train" >
+        <id column="id" property="id" jdbcType="INTEGER" />
+        <result column="train_code" property="train_code" jdbcType="INTEGER" />
+        <result column="train_name" property="train_name" jdbcType="VARCHAR" />
+    </resultMap>
+
+    <sql id="Base_Column_List" >
+        id, train_code, train_name
+    </sql>
+
+    <!-- 得到所有的培训信息 -->
+    <select id="getAll" resultMap="BaseResultMap" >
+        select
+        <include refid="Base_Column_List" />
+        from train
+    </select>
+
+    <!-- 根据id查找某个培训信息 -->
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+        select
+        <include refid="Base_Column_List" />
+        from train
+        where id = #{id,jdbcType=INTEGER}
+    </select>
+    <!-- 根据id删除某个培训信息 -->
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+        delete from train
+        where id = #{id,jdbcType=INTEGER}
+    </delete>
+
+    <!-- 插入一条培训信息 -->
+    <insert id="insertSelective" parameterType="com.ygj.yuemum.domain.admin.Train" >
+        insert into train
+        <trim prefix="(" suffix=")" suffixOverrides="," >
+            <if test="train_code != null" >
+                train_code,
+            </if>
+            <if test="train_name != null" >
+                train_name,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides="," >
+            <if test="train_code != null" >
+                #{train_code,jdbcType=INTEGER},
+            </if>
+            <if test="train_name != null" >
+                #{train_name,jdbcType=VARCHAR},
+            </if>
+        </trim>
+    </insert>
+
+    <!-- 根据id更新一条培训信息 -->
+    <update id="updateByPrimaryKeySelective" parameterType="com.ygj.yuemum.domain.admin.Train" >
+        update train
+        <set >
+            <if test="train_code != null" >
+                train_code = #{train_code,jdbcType=INTEGER},
+            </if>
+            <if test="train_name != null" >
+                train_name = #{train_name,jdbcType=VARCHAR},
+            </if>
+        </set>
+        where id = #{id,jdbcType=INTEGER}
+    </update>
+
+</mapper>

+ 1 - 0
src/main/resources/mybatis/mybatis-config.xml

@@ -8,5 +8,6 @@
         <typeAlias alias="LinkedHashMap" type="java.util.LinkedHashMap" />
         <typeAlias alias="ArrayList" type="java.util.ArrayList" />
         <typeAlias alias="LinkedList" type="java.util.LinkedList" />
+        <typeAlias alias="Date" type="java.util.Date" />
     </typeAliases>
 </configuration>