diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/jxjs/TsbzJdxController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/jxjs/TsbzJdxController.java new file mode 100644 index 000000000..fe0585075 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/jxjs/TsbzJdxController.java @@ -0,0 +1,103 @@ +package com.ruoyi.web.controller.jxjs; + +import java.util.List; +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.jxjs.domain.TsbzJdx; +import com.ruoyi.jxjs.service.ITsbzJdxService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 基地校Controller + * + * @author ruoyi + * @date 2020-08-20 + */ +@RestController +@RequestMapping("/jxjs/jdx") +public class TsbzJdxController extends BaseController +{ + @Autowired + private ITsbzJdxService tsbzJdxService; + + /** + * 查询基地校列表 + */ + @PreAuthorize("@ss.hasPermi('system:jdx:list')") + @GetMapping("/list") + public TableDataInfo list(TsbzJdx tsbzJdx) + { + startPage(); + List list = tsbzJdxService.selectTsbzJdxList(tsbzJdx); + return getDataTable(list); + } + + /** + * 导出基地校列表 + */ + @PreAuthorize("@ss.hasPermi('system:jdx:export')") + @Log(title = "基地校", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public AjaxResult export(TsbzJdx tsbzJdx) + { + List list = tsbzJdxService.selectTsbzJdxList(tsbzJdx); + ExcelUtil util = new ExcelUtil(TsbzJdx.class); + return util.exportExcel(list, "jdx"); + } + + /** + * 获取基地校详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:jdx:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") String id) + { + return AjaxResult.success(tsbzJdxService.selectTsbzJdxById(id)); + } + + /** + * 新增基地校 + */ + @PreAuthorize("@ss.hasPermi('system:jdx:add')") + @Log(title = "基地校", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody TsbzJdx tsbzJdx) + { + return toAjax(tsbzJdxService.insertTsbzJdx(tsbzJdx)); + } + + /** + * 修改基地校 + */ + @PreAuthorize("@ss.hasPermi('system:jdx:edit')") + @Log(title = "基地校", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody TsbzJdx tsbzJdx) + { + return toAjax(tsbzJdxService.updateTsbzJdx(tsbzJdx)); + } + + /** + * 删除基地校 + */ + @PreAuthorize("@ss.hasPermi('system:jdx:remove')") + @Log(title = "基地校", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable String[] ids) + { + return toAjax(tsbzJdxService.deleteTsbzJdxByIds(ids)); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/jxjs/domain/TsbzJdx.java b/ruoyi-system/src/main/java/com/ruoyi/jxjs/domain/TsbzJdx.java new file mode 100644 index 000000000..21a23a26a --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/jxjs/domain/TsbzJdx.java @@ -0,0 +1,122 @@ +package com.ruoyi.jxjs.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; + +/** + * 基地校对象 tsbz_jdx + * + * @author ruoyi + * @date 2020-08-20 + */ +public class TsbzJdx extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 标识 */ + private String id; + + /** 基地校其他系统id */ + @Excel(name = "基地校其他系统id") + private String otherid; + + /** 基地校名称 */ + @Excel(name = "基地校名称") + private String jdxmc; + + /** 学校类别 */ + @Excel(name = "学校类别") + private String xxlb; + + /** 办学类型 */ + @Excel(name = "办学类型") + private String bxlx; + + /** 学校办别 */ + @Excel(name = "学校办别") + private String xxbb; + + /** 基地校年份 */ + @Excel(name = "基地校年份") + private String jdxnf; + + public void setId(String id) + { + this.id = id; + } + + public String getId() + { + return id; + } + public void setOtherid(String otherid) + { + this.otherid = otherid; + } + + public String getOtherid() + { + return otherid; + } + public void setJdxmc(String jdxmc) + { + this.jdxmc = jdxmc; + } + + public String getJdxmc() + { + return jdxmc; + } + public void setXxlb(String xxlb) + { + this.xxlb = xxlb; + } + + public String getXxlb() + { + return xxlb; + } + public void setBxlx(String bxlx) + { + this.bxlx = bxlx; + } + + public String getBxlx() + { + return bxlx; + } + public void setXxbb(String xxbb) + { + this.xxbb = xxbb; + } + + public String getXxbb() + { + return xxbb; + } + public void setJdxnf(String jdxnf) + { + this.jdxnf = jdxnf; + } + + public String getJdxnf() + { + return jdxnf; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("otherid", getOtherid()) + .append("jdxmc", getJdxmc()) + .append("xxlb", getXxlb()) + .append("bxlx", getBxlx()) + .append("xxbb", getXxbb()) + .append("jdxnf", getJdxnf()) + .append("createTime", getCreateTime()) + .toString(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/jxjs/mapper/TsbzJdxMapper.java b/ruoyi-system/src/main/java/com/ruoyi/jxjs/mapper/TsbzJdxMapper.java new file mode 100644 index 000000000..686f0cab0 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/jxjs/mapper/TsbzJdxMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.jxjs.mapper; + +import java.util.List; +import com.ruoyi.jxjs.domain.TsbzJdx; + +/** + * 基地校Mapper接口 + * + * @author ruoyi + * @date 2020-08-20 + */ +public interface TsbzJdxMapper +{ + /** + * 查询基地校 + * + * @param id 基地校ID + * @return 基地校 + */ + public TsbzJdx selectTsbzJdxById(String id); + + /** + * 查询基地校列表 + * + * @param tsbzJdx 基地校 + * @return 基地校集合 + */ + public List selectTsbzJdxList(TsbzJdx tsbzJdx); + + /** + * 新增基地校 + * + * @param tsbzJdx 基地校 + * @return 结果 + */ + public int insertTsbzJdx(TsbzJdx tsbzJdx); + + /** + * 修改基地校 + * + * @param tsbzJdx 基地校 + * @return 结果 + */ + public int updateTsbzJdx(TsbzJdx tsbzJdx); + + /** + * 删除基地校 + * + * @param id 基地校ID + * @return 结果 + */ + public int deleteTsbzJdxById(String id); + + /** + * 批量删除基地校 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteTsbzJdxByIds(String[] ids); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/jxjs/service/ITsbzJdxService.java b/ruoyi-system/src/main/java/com/ruoyi/jxjs/service/ITsbzJdxService.java new file mode 100644 index 000000000..8e18bc842 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/jxjs/service/ITsbzJdxService.java @@ -0,0 +1,61 @@ +package com.ruoyi.jxjs.service; + +import java.util.List; +import com.ruoyi.jxjs.domain.TsbzJdx; + +/** + * 基地校Service接口 + * + * @author ruoyi + * @date 2020-08-20 + */ +public interface ITsbzJdxService +{ + /** + * 查询基地校 + * + * @param id 基地校ID + * @return 基地校 + */ + public TsbzJdx selectTsbzJdxById(String id); + + /** + * 查询基地校列表 + * + * @param tsbzJdx 基地校 + * @return 基地校集合 + */ + public List selectTsbzJdxList(TsbzJdx tsbzJdx); + + /** + * 新增基地校 + * + * @param tsbzJdx 基地校 + * @return 结果 + */ + public int insertTsbzJdx(TsbzJdx tsbzJdx); + + /** + * 修改基地校 + * + * @param tsbzJdx 基地校 + * @return 结果 + */ + public int updateTsbzJdx(TsbzJdx tsbzJdx); + + /** + * 批量删除基地校 + * + * @param ids 需要删除的基地校ID + * @return 结果 + */ + public int deleteTsbzJdxByIds(String[] ids); + + /** + * 删除基地校信息 + * + * @param id 基地校ID + * @return 结果 + */ + public int deleteTsbzJdxById(String id); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/jxjs/service/impl/TsbzJdxServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/jxjs/service/impl/TsbzJdxServiceImpl.java new file mode 100644 index 000000000..127f74e99 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/jxjs/service/impl/TsbzJdxServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.jxjs.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.jxjs.mapper.TsbzJdxMapper; +import com.ruoyi.jxjs.domain.TsbzJdx; +import com.ruoyi.jxjs.service.ITsbzJdxService; + +/** + * 基地校Service业务层处理 + * + * @author ruoyi + * @date 2020-08-20 + */ +@Service +public class TsbzJdxServiceImpl implements ITsbzJdxService +{ + @Autowired + private TsbzJdxMapper tsbzJdxMapper; + + /** + * 查询基地校 + * + * @param id 基地校ID + * @return 基地校 + */ + @Override + public TsbzJdx selectTsbzJdxById(String id) + { + return tsbzJdxMapper.selectTsbzJdxById(id); + } + + /** + * 查询基地校列表 + * + * @param tsbzJdx 基地校 + * @return 基地校 + */ + @Override + public List selectTsbzJdxList(TsbzJdx tsbzJdx) + { + return tsbzJdxMapper.selectTsbzJdxList(tsbzJdx); + } + + /** + * 新增基地校 + * + * @param tsbzJdx 基地校 + * @return 结果 + */ + @Override + public int insertTsbzJdx(TsbzJdx tsbzJdx) + { + tsbzJdx.setCreateTime(DateUtils.getNowDate()); + return tsbzJdxMapper.insertTsbzJdx(tsbzJdx); + } + + /** + * 修改基地校 + * + * @param tsbzJdx 基地校 + * @return 结果 + */ + @Override + public int updateTsbzJdx(TsbzJdx tsbzJdx) + { + return tsbzJdxMapper.updateTsbzJdx(tsbzJdx); + } + + /** + * 批量删除基地校 + * + * @param ids 需要删除的基地校ID + * @return 结果 + */ + @Override + public int deleteTsbzJdxByIds(String[] ids) + { + return tsbzJdxMapper.deleteTsbzJdxByIds(ids); + } + + /** + * 删除基地校信息 + * + * @param id 基地校ID + * @return 结果 + */ + @Override + public int deleteTsbzJdxById(String id) + { + return tsbzJdxMapper.deleteTsbzJdxById(id); + } +} diff --git a/ruoyi-system/src/main/resources/mapper/jxjs/TsbzJdxMapper.xml b/ruoyi-system/src/main/resources/mapper/jxjs/TsbzJdxMapper.xml new file mode 100644 index 000000000..2cfa58c0a --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/jxjs/TsbzJdxMapper.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + select id, otherid, jdxmc, xxlb, bxlx, xxbb, jdxnf, create_time from tsbz_jdx + + + + + + + + insert into tsbz_jdx + + id, + otherid, + jdxmc, + xxlb, + bxlx, + xxbb, + jdxnf, + create_time, + + + #{id}, + #{otherid}, + #{jdxmc}, + #{xxlb}, + #{bxlx}, + #{xxbb}, + #{jdxnf}, + #{createTime}, + + + + + update tsbz_jdx + + otherid = #{otherid}, + jdxmc = #{jdxmc}, + xxlb = #{xxlb}, + bxlx = #{bxlx}, + xxbb = #{xxbb}, + jdxnf = #{jdxnf}, + create_time = #{createTime}, + + where id = #{id} + + + + delete from tsbz_jdx where id = #{id} + + + + delete from tsbz_jdx where id in + + #{id} + + + + \ No newline at end of file