维护清单内容变更--代码生成

This commit is contained in:
zhn
2022-04-11 17:37:11 +08:00
parent 46b223f1f8
commit 36d0fac0a2
6 changed files with 431 additions and 0 deletions
@@ -0,0 +1,170 @@
package com.jero.modules.dummy.controller;
import java.util.Arrays;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.jero.common.api.vo.Result;
import com.jero.common.system.query.QueryGenerator;
import com.jero.modules.dummy.entity.DummyContentChangeEO;
import com.jero.modules.dummy.service.IDummyContentChangeEOService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import com.jero.common.system.base.controller.JeroController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import com.jero.common.aspect.annotation.AutoLog;
/**
* @Description: 维护清单内容变更表
* @Author: jero-boot
* @Date: 2022-04-11
* @Version: V1.0
*/
@Api(tags="维护清单内容变更表")
@RestController
@RequestMapping("/dummy/dummyContentChangeEO")
@Slf4j
public class DummyContentChangeEOController extends JeroController<DummyContentChangeEO, IDummyContentChangeEOService> {
@Autowired
private IDummyContentChangeEOService dummyContentChangeEOService;
/**
* 分页列表查询
*
* @param dummyContentChangeEO
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "维护清单内容变更表-分页列表查询")
@ApiOperation(value="维护清单内容变更表-分页列表查询", notes="维护清单内容变更表-分页列表查询")
@GetMapping(value = "/page")
public Result<?> queryPageList(DummyContentChangeEO dummyContentChangeEO,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<DummyContentChangeEO> queryWrapper = QueryGenerator.initQueryWrapper(dummyContentChangeEO, req.getParameterMap());
Page<DummyContentChangeEO> page = new Page<DummyContentChangeEO>(pageNo, pageSize);
IPage<DummyContentChangeEO> pageList = dummyContentChangeEOService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 列表查询
*
* @return
*/
@AutoLog(value = "维护清单内容变更表-列表查询")
@ApiOperation(value="维护清单内容变更表-列表查询", notes="维护清单内容变更表-列表查询")
@GetMapping(value = "/list")
public Result<List<DummyContentChangeEO>> queryList() {
List<DummyContentChangeEO> list = dummyContentChangeEOService.queryList();
return Result.OK(list);
}
/**
* 添加
*
* @param dummyContentChangeEO
* @return
*/
@AutoLog(value = "维护清单内容变更表-添加")
@ApiOperation(value="维护清单内容变更表-添加", notes="维护清单内容变更表-添加")
@PostMapping(value = "/add")
public Result<?> add(@Validated @RequestBody DummyContentChangeEO dummyContentChangeEO) {
dummyContentChangeEOService.add(dummyContentChangeEO);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param dummyContentChangeEO
* @return
*/
@AutoLog(value = "维护清单内容变更表-编辑")
@ApiOperation(value="维护清单内容变更表-编辑", notes="维护清单内容变更表-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@Validated @RequestBody DummyContentChangeEO dummyContentChangeEO) {
dummyContentChangeEOService.editById(dummyContentChangeEO);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "维护清单内容变更表-通过id删除")
@ApiOperation(value="维护清单内容变更表-通过id删除", notes="维护清单内容变更表-通过id删除")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
dummyContentChangeEOService.deleteById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "维护清单内容变更表-批量删除")
@ApiOperation(value="维护清单内容变更表-批量删除", notes="维护清单内容变更表-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.dummyContentChangeEOService.deleteByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
@AutoLog(value = "维护清单内容变更表-通过id查询")
@ApiOperation(value="维护清单内容变更表-通过id查询", notes="维护清单内容变更表-通过id查询")
@GetMapping(value = "/queryById")
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
DummyContentChangeEO dummyContentChangeEO = dummyContentChangeEOService.queryById(id);
if(dummyContentChangeEO==null) {
return Result.error("未找到对应数据");
}
return Result.OK(dummyContentChangeEO);
}
/**
* 导出excel
*
* @param request
* @param dummyContentChangeEO
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, DummyContentChangeEO dummyContentChangeEO) {
return super.exportXls(request, dummyContentChangeEO, DummyContentChangeEO.class, "维护清单内容变更表");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, DummyContentChangeEO.class);
}
}
@@ -0,0 +1,79 @@
package com.jero.modules.dummy.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import com.jero.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
/**
* @Description: 维护清单内容变更表
* @Author: jero-boot
* @Date: 2022-04-11
* @Version: V1.0
*/
@Data
@TableName("dummy_content_change")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="dummy_content_change对象", description="维护清单内容变更表")
public class DummyContentChangeEO implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private java.lang.String id;
/**创建人*/
@ApiModelProperty(value = "创建人")
private java.lang.String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private java.util.Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private java.lang.String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期")
private java.util.Date updateTime;
/**所属部门*/
@ApiModelProperty(value = "所属部门")
private java.lang.String sysOrgCode;
/**法规清单基础表id或法规清单详情表id*/
@Excel(name = "法规清单基础表id或法规清单详情表id", width = 15)
@ApiModelProperty(value = "法规清单基础表id或法规清单详情表id")
private java.lang.String connectId;
/**父id*/
@Excel(name = "父id", width = 15)
@ApiModelProperty(value = "父id")
private java.lang.String parentId;
/**内容*/
@Excel(name = "内容", width = 15)
@ApiModelProperty(value = "内容")
private java.lang.String contentJson;
}
@@ -0,0 +1,17 @@
package com.jero.modules.dummy.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.jero.modules.dummy.entity.DummyContentChangeEO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 维护清单内容变更表
* @Author: jero-boot
* @Date: 2022-04-11
* @Version: V1.0
*/
public interface DummyContentChangeEOMapper extends BaseMapper<DummyContentChangeEO> {
}
@@ -0,0 +1,15 @@
<?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.jero.modules.dummy.mapper.DummyContentChangeEOMapper">
<resultMap id="DummyContentChangeEOResultMap" type="com.jero.modules.dummy.entity.DummyContentChangeEO">
<id column="id" property="id" />
<result column="create_by" property="createBy" />
<result column="create_time" property="createTime" />
<result column="update_by" property="updateBy" />
<result column="update_time" property="updateTime" />
<result column="sys_org_code" property="sysOrgCode" />
<result column="connect_id" property="connectId" />
<result column="parent_id" property="parentId" />
<result column="content_json" property="contentJson" />
</resultMap>
</mapper>
@@ -0,0 +1,61 @@
package com.jero.modules.dummy.service;
import com.jero.modules.dummy.entity.DummyContentChangeEO;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* @Description: 维护清单内容变更表
* @Author: jero-boot
* @Date: 2022-04-11
* @Version: V1.0
*/
public interface IDummyContentChangeEOService extends IService<DummyContentChangeEO> {
/**
* 保存
*
* @param dummyContentChangeEO
* @return
*/
void add(DummyContentChangeEO dummyContentChangeEO);
/**
* 更新
*
* @param dummyContentChangeEO
* @return
*/
void editById(DummyContentChangeEO dummyContentChangeEO);
/**
* 通过id删除
*
* @param id
* @return
*/
void deleteById(String id);
/**
* 批量删除
*
* @param ids
* @return
*/
void deleteByIds(List<String> ids);
/**
* 通过id查询
*
* @param id
* @return
*/
DummyContentChangeEO queryById(String id);
/**
* 列表查询
*
* @return
*/
List<DummyContentChangeEO> queryList();
}
@@ -0,0 +1,89 @@
package com.jero.modules.dummy.service.impl;
import com.jero.modules.dummy.entity.DummyContentChangeEO;
import com.jero.modules.dummy.mapper.DummyContentChangeEOMapper;
import com.jero.modules.dummy.service.IDummyContentChangeEOService;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Date;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 维护清单内容变更表
* @Author: jero-boot
* @Date: 2022-04-11
* @Version: V1.0
*/
@Service
public class DummyContentChangeEOServiceImpl extends ServiceImpl<DummyContentChangeEOMapper, DummyContentChangeEO> implements IDummyContentChangeEOService {
/**
* 保存
*
* @param dummyContentChangeEO
* @return
*/
@Override
public void add(DummyContentChangeEO dummyContentChangeEO) {
Date now = new Date();
dummyContentChangeEO.setCreateTime(now);
dummyContentChangeEO.setUpdateTime(now);
save(dummyContentChangeEO);
}
/**
* 更新
*
* @param dummyContentChangeEO
* @return
*/
@Override
public void editById(DummyContentChangeEO dummyContentChangeEO) {
Date now = new Date();
dummyContentChangeEO.setUpdateTime(now);
saveOrUpdate(dummyContentChangeEO);
}
/**
* 通过id删除
*
* @param id
* @return
*/
@Override
public void deleteById(String id) {
removeById(id);
}
/**
* 批量删除
*
* @param ids
* @return
*/
@Override
public void deleteByIds(List<String> ids) {
removeByIds(ids);
}
/**
* 通过id查询
*
* @param id
* @return
*/
@Override
public DummyContentChangeEO queryById(String id) {
return getById(id);
}
/**
* 列表查询
*
* @return
*/
@Override
public List<DummyContentChangeEO> queryList() {
return list();
}
}