diff --git a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java index a0e726bd4..029f50e78 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java @@ -14,6 +14,7 @@ public class RuoYiApplication { public static void main(String[] args) { + /*mahailong yyds dwbbawidbaicA;fihwbekCNFIHWQFGKJHASPFUIAHRPGLIEA*/ // System.setProperty("spring.devtools.restart.enabled", "false"); SpringApplication.run(RuoYiApplication.class, args); System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙ \n" + diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/JdStudentController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/JdStudentController.java new file mode 100644 index 000000000..479d07775 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/JdStudentController.java @@ -0,0 +1,127 @@ +package com.ruoyi.system.controller; + +import java.util.List; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.system.domain.JdStudent; +import com.ruoyi.system.service.IJdStudentService; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 交大学生数据Controller + * + * @author ruoyi + * @date 2023-07-07 + */ +@Controller +@RequestMapping("/system/student") +public class JdStudentController extends BaseController +{ + private String prefix = "system/student"; + + @Autowired + private IJdStudentService jdStudentService; + + @RequiresPermissions("system:student:view") + @GetMapping() + public String student() + { + return prefix + "/student"; + } + + /** + * 查询交大学生数据列表 + */ + @RequiresPermissions("system:student:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(JdStudent jdStudent) + { + startPage(); + List list = jdStudentService.selectJdStudentList(jdStudent); + return getDataTable(list); + } + + /** + * 导出交大学生数据列表 + */ + @RequiresPermissions("system:student:export") + @Log(title = "交大学生数据", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(JdStudent jdStudent) + { + List list = jdStudentService.selectJdStudentList(jdStudent); + ExcelUtil util = new ExcelUtil(JdStudent.class); + return util.exportExcel(list, "交大学生数据数据"); + } + + /** + * 新增交大学生数据 + */ + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } + + /** + * 新增保存交大学生数据 + */ + @RequiresPermissions("system:student:add") + @Log(title = "交大学生数据", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(JdStudent jdStudent) + { + return toAjax(jdStudentService.insertJdStudent(jdStudent)); + } + + /** + * 修改交大学生数据 + */ + @RequiresPermissions("system:student:edit") + @GetMapping("/edit/{id}") + public String edit(@PathVariable("id") Long id, ModelMap mmap) + { + JdStudent jdStudent = jdStudentService.selectJdStudentById(id); + mmap.put("jdStudent", jdStudent); + return prefix + "/edit"; + } + + /** + * 修改保存交大学生数据 + */ + @RequiresPermissions("system:student:edit") + @Log(title = "交大学生数据", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(JdStudent jdStudent) + { + return toAjax(jdStudentService.updateJdStudent(jdStudent)); + } + + /** + * 删除交大学生数据 + */ + @RequiresPermissions("system:student:remove") + @Log(title = "交大学生数据", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(jdStudentService.deleteJdStudentByIds(ids)); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/JdStudent.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/JdStudent.java new file mode 100644 index 000000000..a8c5cd5fb --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/JdStudent.java @@ -0,0 +1,96 @@ +package com.ruoyi.system.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 交大学生数据对象 jd_student + * + * @author ruoyi + * @date 2023-07-07 + */ +public class JdStudent extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 姓名 */ + @Excel(name = "姓名") + private String name; + + /** 性别 */ + @Excel(name = "性别") + private String sex; + + /** 入学时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "入学时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date startTime; + + /** 描述 */ + @Excel(name = "描述") + private String description; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + public void setSex(String sex) + { + this.sex = sex; + } + + public String getSex() + { + return sex; + } + public void setStartTime(Date startTime) + { + this.startTime = startTime; + } + + public Date getStartTime() + { + return startTime; + } + public void setDescription(String description) + { + this.description = description; + } + + public String getDescription() + { + return description; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("name", getName()) + .append("sex", getSex()) + .append("startTime", getStartTime()) + .append("description", getDescription()) + .toString(); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/JdStudentMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/JdStudentMapper.java new file mode 100644 index 000000000..0127db3be --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/JdStudentMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.JdStudent; + +/** + * 交大学生数据Mapper接口 + * + * @author ruoyi + * @date 2023-07-07 + */ +public interface JdStudentMapper +{ + /** + * 查询交大学生数据 + * + * @param id 交大学生数据主键 + * @return 交大学生数据 + */ + public JdStudent selectJdStudentById(Long id); + + /** + * 查询交大学生数据列表 + * + * @param jdStudent 交大学生数据 + * @return 交大学生数据集合 + */ + public List selectJdStudentList(JdStudent jdStudent); + + /** + * 新增交大学生数据 + * + * @param jdStudent 交大学生数据 + * @return 结果 + */ + public int insertJdStudent(JdStudent jdStudent); + + /** + * 修改交大学生数据 + * + * @param jdStudent 交大学生数据 + * @return 结果 + */ + public int updateJdStudent(JdStudent jdStudent); + + /** + * 删除交大学生数据 + * + * @param id 交大学生数据主键 + * @return 结果 + */ + public int deleteJdStudentById(Long id); + + /** + * 批量删除交大学生数据 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteJdStudentByIds(String[] ids); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/IJdStudentService.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/IJdStudentService.java new file mode 100644 index 000000000..2556374c7 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/IJdStudentService.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.system.domain.JdStudent; + +/** + * 交大学生数据Service接口 + * + * @author ruoyi + * @date 2023-07-07 + */ +public interface IJdStudentService +{ + /** + * 查询交大学生数据 + * + * @param id 交大学生数据主键 + * @return 交大学生数据 + */ + public JdStudent selectJdStudentById(Long id); + + /** + * 查询交大学生数据列表 + * + * @param jdStudent 交大学生数据 + * @return 交大学生数据集合 + */ + public List selectJdStudentList(JdStudent jdStudent); + + /** + * 新增交大学生数据 + * + * @param jdStudent 交大学生数据 + * @return 结果 + */ + public int insertJdStudent(JdStudent jdStudent); + + /** + * 修改交大学生数据 + * + * @param jdStudent 交大学生数据 + * @return 结果 + */ + public int updateJdStudent(JdStudent jdStudent); + + /** + * 批量删除交大学生数据 + * + * @param ids 需要删除的交大学生数据主键集合 + * @return 结果 + */ + public int deleteJdStudentByIds(String ids); + + /** + * 删除交大学生数据信息 + * + * @param id 交大学生数据主键 + * @return 结果 + */ + public int deleteJdStudentById(Long id); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/JdStudentServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/JdStudentServiceImpl.java new file mode 100644 index 000000000..77a28b594 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/JdStudentServiceImpl.java @@ -0,0 +1,94 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.system.mapper.JdStudentMapper; +import com.ruoyi.system.domain.JdStudent; +import com.ruoyi.system.service.IJdStudentService; +import com.ruoyi.common.core.text.Convert; + +/** + * 交大学生数据Service业务层处理 + * + * @author ruoyi + * @date 2023-07-07 + */ +@Service +public class JdStudentServiceImpl implements IJdStudentService +{ + @Autowired + private JdStudentMapper jdStudentMapper; + + /** + * 查询交大学生数据 + * + * @param id 交大学生数据主键 + * @return 交大学生数据 + */ + @Override + public JdStudent selectJdStudentById(Long id) + { + return jdStudentMapper.selectJdStudentById(id); + } + + /** + * 查询交大学生数据列表 + * + * @param jdStudent 交大学生数据 + * @return 交大学生数据 + */ + @Override + public List selectJdStudentList(JdStudent jdStudent) + { + return jdStudentMapper.selectJdStudentList(jdStudent); + } + + /** + * 新增交大学生数据 + * + * @param jdStudent 交大学生数据 + * @return 结果 + */ + @Override + public int insertJdStudent(JdStudent jdStudent) + { + return jdStudentMapper.insertJdStudent(jdStudent); + } + + /** + * 修改交大学生数据 + * + * @param jdStudent 交大学生数据 + * @return 结果 + */ + @Override + public int updateJdStudent(JdStudent jdStudent) + { + return jdStudentMapper.updateJdStudent(jdStudent); + } + + /** + * 批量删除交大学生数据 + * + * @param ids 需要删除的交大学生数据主键 + * @return 结果 + */ + @Override + public int deleteJdStudentByIds(String ids) + { + return jdStudentMapper.deleteJdStudentByIds(Convert.toStrArray(ids)); + } + + /** + * 删除交大学生数据信息 + * + * @param id 交大学生数据主键 + * @return 结果 + */ + @Override + public int deleteJdStudentById(Long id) + { + return jdStudentMapper.deleteJdStudentById(id); + } +} diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml index a69d8feb2..f116196a2 100644 --- a/ruoyi-admin/src/main/resources/application-druid.yml +++ b/ruoyi-admin/src/main/resources/application-druid.yml @@ -8,7 +8,7 @@ spring: master: url: jdbc:mysql://localhost:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 username: root - password: password + password: root # 从库数据源 slave: # 从数据源开关/默认关闭 diff --git a/ruoyi-admin/src/main/resources/mapper/system/JdStudentMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/JdStudentMapper.xml new file mode 100644 index 000000000..75529bc2d --- /dev/null +++ b/ruoyi-admin/src/main/resources/mapper/system/JdStudentMapper.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + select id, name, sex, start_time, description from jd_student + + + + + + + + insert into jd_student + + id, + name, + sex, + start_time, + description, + + + #{id}, + #{name}, + #{sex}, + #{startTime}, + #{description}, + + + + + update jd_student + + name = #{name}, + sex = #{sex}, + start_time = #{startTime}, + description = #{description}, + + where id = #{id} + + + + delete from jd_student where id = #{id} + + + + delete from jd_student where id in + + #{id} + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/student/add.html b/ruoyi-admin/src/main/resources/templates/system/student/add.html new file mode 100644 index 000000000..31676b11c --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/student/add.html @@ -0,0 +1,62 @@ + + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ + +
+
+
+
+ +
+ +
+
+
+
+ + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/student/edit.html b/ruoyi-admin/src/main/resources/templates/system/student/edit.html new file mode 100644 index 000000000..c2314b085 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/student/edit.html @@ -0,0 +1,63 @@ + + + + + + + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ + +
+
+
+
+ +
+ +
+
+
+
+ + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/student/student.html b/ruoyi-admin/src/main/resources/templates/system/student/student.html new file mode 100644 index 000000000..e9fc4ad38 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/student/student.html @@ -0,0 +1,117 @@ + + + + + + +
+
+
+
+
+
    +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file