diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/controller/TestController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/controller/TestController.java new file mode 100644 index 0000000..c1676d6 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/controller/TestController.java @@ -0,0 +1,104 @@ +package com.ruoyi.system.controller.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.system.domain.Test; +import com.ruoyi.system.service.ITestService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * kController + * + * @author ruoyi + * @date 2024-12-02 + */ +@RestController +@RequestMapping("/system/test") +public class TestController extends BaseController +{ + @Autowired + private ITestService testService; + + /** + * 查询k列表 + */ + @PreAuthorize("@ss.hasPermi('system:test:list')") + @GetMapping("/list") + public TableDataInfo list(Test test) + { + startPage(); + List list = testService.selectTestList(test); + return getDataTable(list); + } + + /** + * 导出k列表 + */ + @PreAuthorize("@ss.hasPermi('system:test:export')") + @Log(title = "k", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, Test test) + { + List list = testService.selectTestList(test); + ExcelUtil util = new ExcelUtil(Test.class); + util.exportExcel(response, list, "k数据"); + } + + /** + * 获取k详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:test:query')") + @GetMapping(value = "/{fy}") + public AjaxResult getInfo(@PathVariable("fy") String fy) + { + return success(testService.selectTestByFy(fy)); + } + + /** + * 新增k + */ + @PreAuthorize("@ss.hasPermi('system:test:add')") + @Log(title = "k", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody Test test) + { + return toAjax(testService.insertTest(test)); + } + + /** + * 修改k + */ + @PreAuthorize("@ss.hasPermi('system:test:edit')") + @Log(title = "k", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody Test test) + { + return toAjax(testService.updateTest(test)); + } + + /** + * 删除k + */ + @PreAuthorize("@ss.hasPermi('system:test:remove')") + @Log(title = "k", businessType = BusinessType.DELETE) + @DeleteMapping("/{fys}") + public AjaxResult remove(@PathVariable String[] fys) + { + return toAjax(testService.deleteTestByFys(fys)); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/Test.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/Test.java new file mode 100644 index 0000000..be5a973 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/Test.java @@ -0,0 +1,66 @@ +package com.ruoyi.system.domain; + +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; + +/** + * k对象 test + * + * @author ruoyi + * @date 2024-12-02 + */ +public class Test extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String fy; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String ll; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String gg; + + public void setFy(String fy) + { + this.fy = fy; + } + + public String getFy() + { + return fy; + } + public void setLl(String ll) + { + this.ll = ll; + } + + public String getLl() + { + return ll; + } + public void setGg(String gg) + { + this.gg = gg; + } + + public String getGg() + { + return gg; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("fy", getFy()) + .append("ll", getLl()) + .append("gg", getGg()) + .toString(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TestMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TestMapper.java new file mode 100644 index 0000000..3a47ae7 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/TestMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.Test; + +/** + * kMapper接口 + * + * @author ruoyi + * @date 2024-12-02 + */ +public interface TestMapper +{ + /** + * 查询k + * + * @param fy k主键 + * @return k + */ + public Test selectTestByFy(String fy); + + /** + * 查询k列表 + * + * @param test k + * @return k集合 + */ + public List selectTestList(Test test); + + /** + * 新增k + * + * @param test k + * @return 结果 + */ + public int insertTest(Test test); + + /** + * 修改k + * + * @param test k + * @return 结果 + */ + public int updateTest(Test test); + + /** + * 删除k + * + * @param fy k主键 + * @return 结果 + */ + public int deleteTestByFy(String fy); + + /** + * 批量删除k + * + * @param fys 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteTestByFys(String[] fys); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ITestService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITestService.java new file mode 100644 index 0000000..0bea809 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ITestService.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.system.domain.Test; + +/** + * kService接口 + * + * @author ruoyi + * @date 2024-12-02 + */ +public interface ITestService +{ + /** + * 查询k + * + * @param fy k主键 + * @return k + */ + public Test selectTestByFy(String fy); + + /** + * 查询k列表 + * + * @param test k + * @return k集合 + */ + public List selectTestList(Test test); + + /** + * 新增k + * + * @param test k + * @return 结果 + */ + public int insertTest(Test test); + + /** + * 修改k + * + * @param test k + * @return 结果 + */ + public int updateTest(Test test); + + /** + * 批量删除k + * + * @param fys 需要删除的k主键集合 + * @return 结果 + */ + public int deleteTestByFys(String[] fys); + + /** + * 删除k信息 + * + * @param fy k主键 + * @return 结果 + */ + public int deleteTestByFy(String fy); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TestServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TestServiceImpl.java new file mode 100644 index 0000000..4aedb6c --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TestServiceImpl.java @@ -0,0 +1,93 @@ +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.TestMapper; +import com.ruoyi.system.domain.Test; +import com.ruoyi.system.service.ITestService; + +/** + * kService业务层处理 + * + * @author ruoyi + * @date 2024-12-02 + */ +@Service +public class TestServiceImpl implements ITestService +{ + @Autowired + private TestMapper testMapper; + + /** + * 查询k + * + * @param fy k主键 + * @return k + */ + @Override + public Test selectTestByFy(String fy) + { + return testMapper.selectTestByFy(fy); + } + + /** + * 查询k列表 + * + * @param test k + * @return k + */ + @Override + public List selectTestList(Test test) + { + return testMapper.selectTestList(test); + } + + /** + * 新增k + * + * @param test k + * @return 结果 + */ + @Override + public int insertTest(Test test) + { + return testMapper.insertTest(test); + } + + /** + * 修改k + * + * @param test k + * @return 结果 + */ + @Override + public int updateTest(Test test) + { + return testMapper.updateTest(test); + } + + /** + * 批量删除k + * + * @param fys 需要删除的k主键 + * @return 结果 + */ + @Override + public int deleteTestByFys(String[] fys) + { + return testMapper.deleteTestByFys(fys); + } + + /** + * 删除k信息 + * + * @param fy k主键 + * @return 结果 + */ + @Override + public int deleteTestByFy(String fy) + { + return testMapper.deleteTestByFy(fy); + } +} diff --git a/ruoyi-system/src/main/resources/mapper/system/TestMapper.xml b/ruoyi-system/src/main/resources/mapper/system/TestMapper.xml new file mode 100644 index 0000000..006856e --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/TestMapper.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + select fy, ll, gg from test + + + + + + + + insert into test + + fy, + ll, + gg, + + + #{fy}, + #{ll}, + #{gg}, + + + + + update test + + ll = #{ll}, + gg = #{gg}, + + where fy = #{fy} + + + + delete from test where fy = #{fy} + + + + delete from test where fy in + + #{fy} + + + \ No newline at end of file