重新生成代码

This commit is contained in:
cuizhibin 2025-04-24 14:00:36 +08:00
parent bb952bd01f
commit d03afd190e
16 changed files with 402 additions and 432 deletions

View File

@ -1,13 +1,16 @@
package com.dite.znpt.domain;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
/**
@ -21,27 +24,30 @@ import java.util.List;
public class AuditableEntity implements Serializable {
private static final long serialVersionUID = 141481953116476081L;
// @ApiParam(hidden = true)
// private String createBy;
//
// @ApiParam(hidden = true)
// private String updateBy;
//
// @ApiModelProperty(value = "创建时间", example = "2022-01-22", notes = "创建时间", hidden = true)
// private Date createTime;
//
// @ApiModelProperty(hidden = true)
// private Date updateTime;
@ApiParam(hidden = true)
private String createBy;
@ApiParam(hidden = true)
private String updateBy;
@ApiModelProperty(value = "创建时间", example = "2022-01-22", notes = "创建时间", hidden = true)
private LocalDateTime createTime;
@ApiModelProperty(hidden = true)
private LocalDateTime updateTime;
@ExcelIgnore
@ApiModelProperty(value = "id集合", example = "[]", notes = "id集合")
@TableField(exist = false)
private List<String> idList;
@ExcelIgnore
@ApiModelProperty(value = "当前页", example = "1", notes = "0")
@TableField(exist = false)
int page = 1;
@ExcelIgnore
@ApiModelProperty(value = "页大小", example = "10", notes = "10")
@TableField(exist = false)
int pageSize = 10;
}

View File

@ -1,56 +0,0 @@
package com.dite.znpt.domain.entity;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.*;
import com.dite.znpt.domain.AuditableEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.alibaba.excel.annotation.ExcelProperty;
/**
* @author huise23
* @date 2025/04/11 23:17
* @Description: 机组信息表实体类
*/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("crew")
@ApiModel(value="CrewEntity对象", description="机组信息表")
public class CrewEntity extends AuditableEntity implements Serializable {
private static final long serialVersionUID = -18989296759149249L;
@ExcelProperty("机组id")
@ApiModelProperty("机组id")
@TableId(value = "crew_id", type = IdType.ASSIGN_ID)
private String crewId;
@ExcelProperty("项目id")
@ApiModelProperty("项目id")
@TableField("project_id")
private String projectId;
@ExcelProperty("机组名称")
@ApiModelProperty("机组名称")
@TableField("crew_name")
private String crewName;
@ExcelProperty("机组描述")
@ApiModelProperty("机组描述")
@TableField("crew_desc")
private String crewDesc;
@ExcelProperty("机组厂商")
@ApiModelProperty("机组厂商")
@TableField("manufacturer")
private String manufacturer;
@ExcelProperty("机组型号")
@ApiModelProperty("机组型号")
@TableField("model")
private String model;
}

View File

@ -0,0 +1,77 @@
package com.dite.znpt.domain.entity;
import java.time.LocalDateTime;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.*;
import com.dite.znpt.domain.AuditableEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.alibaba.excel.annotation.ExcelProperty;
/**
* @author huise23
* @date 2025/04/24 13:44
* @Description: 图像信息表实体类
*/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("image")
@ApiModel(value="ImageEntity对象", description="图像信息表")
public class ImageEntity extends AuditableEntity implements Serializable {
private static final long serialVersionUID = -60463872766900490L;
@ExcelProperty("图像id")
@ApiModelProperty("图像id")
@TableId(value = "image_id", type = IdType.ASSIGN_ID)
private Long imageId;
@ExcelProperty("部件id")
@ApiModelProperty("部件id")
@TableField("part_id")
private Long partId;
@ExcelProperty("机组id")
@ApiModelProperty("机组id")
@TableField("turbine_id")
private Long turbineId;
@ExcelProperty("项目id")
@ApiModelProperty("项目id")
@TableField("project")
private Long project;
@ExcelProperty("图像名称")
@ApiModelProperty("图像名称")
@TableField("image_name")
private String imageName;
@ExcelProperty("图像尺寸")
@ApiModelProperty("图像尺寸")
@TableField("image_size")
private String imageSize;
@ExcelProperty("焦距")
@ApiModelProperty("焦距")
@TableField("focal_distance")
private String focalDistance;
@ExcelProperty("拍摄时间")
@ApiModelProperty("拍摄时间")
@TableField("shooting_time")
private LocalDateTime shootingTime;
@ExcelProperty("相机制造商")
@ApiModelProperty("相机制造商")
@TableField("camera_manufacturer")
private String cameraManufacturer;
@ExcelProperty("相机型号")
@ApiModelProperty("相机型号")
@TableField("camera_model")
private String cameraModel;
}

View File

@ -1,42 +0,0 @@
package com.dite.znpt.domain.vo;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author huise23
* @date 2025/04/11 23:17
* @Description: 机组信息请求实体
*/
@Data
@ApiModel("机组信息列表请求实体")
public class CrewListReq implements Serializable {
private static final long serialVersionUID = 322835125942914057L;
@ApiModelProperty("查询关键字")
private String keyword;
@ApiModelProperty("机组信息Id")
private String crewId;
@ApiModelProperty("项目id")
private String projectId;
@ApiModelProperty("机组名称")
private String crewName;
@ApiModelProperty("机组描述")
private String crewDesc;
@ApiModelProperty("机组厂商")
private String manufacturer;
@ApiModelProperty("机组型号")
private String model;
}

View File

@ -1,18 +0,0 @@
package com.dite.znpt.domain.vo;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.dite.znpt.domain.entity.CrewEntity;
/**
* @author huise23
* @date 2025/04/11 23:17
* @Description: 机组信息响应实体
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel("机组信息响应实体")
public class CrewResp extends CrewEntity {
}

View File

@ -0,0 +1,55 @@
package com.dite.znpt.domain.vo;
import java.time.LocalDateTime;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author huise23
* @date 2025/04/24 13:44
* @Description: 图像信息请求实体
*/
@Data
@ApiModel("图像信息列表请求实体")
public class ImageListReq implements Serializable {
private static final long serialVersionUID = 734848078850759056L;
@ApiModelProperty("查询关键字")
private String keyword;
@ApiModelProperty("图像信息Id")
private Long imageId;
@ApiModelProperty("部件id")
private Long partId;
@ApiModelProperty("机组id")
private Long turbineId;
@ApiModelProperty("项目id")
private Long project;
@ApiModelProperty("图像名称")
private String imageName;
@ApiModelProperty("图像尺寸")
private String imageSize;
@ApiModelProperty("焦距")
private String focalDistance;
@ApiModelProperty("拍摄时间")
private LocalDateTime shootingTime;
@ApiModelProperty("相机制造商")
private String cameraManufacturer;
@ApiModelProperty("相机型号")
private String cameraModel;
}

View File

@ -0,0 +1,19 @@
package com.dite.znpt.domain.vo;
import java.time.LocalDateTime;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.dite.znpt.domain.entity.ImageEntity;
/**
* @author huise23
* @date 2025/04/24 13:44
* @Description: 图像信息响应实体
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel("图像信息响应实体")
public class ImageResp extends ImageEntity {
}

View File

@ -1,19 +0,0 @@
package com.dite.znpt.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dite.znpt.domain.entity.CrewEntity;
import com.dite.znpt.domain.vo.CrewListReq;
import com.dite.znpt.domain.vo.CrewResp;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author huise23
* @date 2025/04/11 23:17
* @Description: 机组信息表数据库访问层
*/
public interface CrewMapper extends BaseMapper<CrewEntity> {
List<CrewResp> queryBySelective(CrewListReq crewReq);
}

View File

@ -0,0 +1,19 @@
package com.dite.znpt.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dite.znpt.domain.entity.ImageEntity;
import com.dite.znpt.domain.vo.ImageListReq;
import com.dite.znpt.domain.vo.ImageResp;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author huise23
* @date 2025/04/24 13:44
* @Description: 图像信息表数据库访问层
*/
public interface ImageMapper extends BaseMapper<ImageEntity> {
List<ImageResp> queryBySelective(ImageListReq imageReq);
}

View File

@ -1,64 +0,0 @@
package com.dite.znpt.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dite.znpt.domain.entity.CrewEntity;
import com.dite.znpt.domain.vo.CrewListReq;
import com.dite.znpt.domain.vo.CrewResp;
import java.util.List;
/**
* @author huise23
* @date 2025/04/11 23:17
* @Description: 机组信息表服务接口
*/
public interface CrewService extends IService<CrewEntity> {
/**
* 功能描述查询机组信息列表
*
* @param crewReq 机组信息
* @return {@link List }<{@link CrewEntity }>
* @author huise23
* @date 2025/04/11 23:17
**/
List<CrewResp> selectList(CrewListReq crewReq);
/**
* 功能描述查询单条机组信息
*
* @param crewId 机组信息Id
* @return {@link CrewResp }
* @author huise23
* @date 2025/04/11 23:17
**/
CrewResp selectById(String crewId);
/**
* 功能描述新增机组信息
*
* @param crew 机组信息
* @author huise23
* @date 2025/04/11 23:17
**/
void saveData(CrewEntity crew);
/**
* 功能描述更新机组信息
*
* @param crew 机组信息
* @author huise23
* @date 2025/04/11 23:17
**/
void updateData(CrewEntity crew);
/**
* 功能描述删除机组信息
*
* @param crewId 机组信息Id
* @author huise23
* @date 2025/04/11 23:17
**/
void deleteById(String crewId);
}

View File

@ -0,0 +1,64 @@
package com.dite.znpt.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dite.znpt.domain.entity.ImageEntity;
import com.dite.znpt.domain.vo.ImageListReq;
import com.dite.znpt.domain.vo.ImageResp;
import java.util.List;
/**
* @author huise23
* @date 2025/04/24 13:44
* @Description: 图像信息表服务接口
*/
public interface ImageService extends IService<ImageEntity> {
/**
* 功能描述查询图像信息列表
*
* @param imageReq 图像信息
* @return {@link List }<{@link ImageEntity }>
* @author huise23
* @date 2025/04/24 13:44
**/
List<ImageResp> selectList(ImageListReq imageReq);
/**
* 功能描述查询单条图像信息
*
* @param imageId 图像信息Id
* @return {@link ImageResp }
* @author huise23
* @date 2025/04/24 13:44
**/
ImageResp selectById(Long imageId);
/**
* 功能描述新增图像信息
*
* @param image 图像信息
* @author huise23
* @date 2025/04/24 13:44
**/
void saveData(ImageEntity image);
/**
* 功能描述更新图像信息
*
* @param image 图像信息
* @author huise23
* @date 2025/04/24 13:44
**/
void updateData(ImageEntity image);
/**
* 功能描述删除图像信息
*
* @param imageId 图像信息Id
* @author huise23
* @date 2025/04/24 13:44
**/
void deleteById(Long imageId);
}

View File

@ -1,99 +0,0 @@
package com.dite.znpt.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dite.znpt.domain.entity.CrewEntity;
import com.dite.znpt.domain.vo.CrewListReq;
import com.dite.znpt.domain.vo.CrewResp;
import com.dite.znpt.service.CrewService;
import com.dite.znpt.mapper.CrewMapper;
import org.springframework.stereotype.Service;
import cn.hutool.core.collection.CollUtil;
import lombok.RequiredArgsConstructor;
import com.dite.znpt.util.PageUtil;
import java.util.List;
/**
* @author huise23
* @date 2025/04/11 23:17
* @Description: 机组信息表服务实现类
*/
@Service
@RequiredArgsConstructor
public class CrewServiceImpl extends ServiceImpl<CrewMapper, CrewEntity> implements CrewService {
/**
* 功能描述查询机组信息列表
*
* @param crewReq 机组信息信息
* @return {@link List }<{@link CrewResp }>
* @author huise23
* @date 2025/04/11 23:17
**/
@Override
public List<CrewResp> selectList(CrewListReq crewReq) {
PageUtil.startPage();
List<CrewResp> crewList= this.baseMapper.queryBySelective(crewReq);
crewList.forEach(resp -> {
});
return crewList;
}
/**
* 功能描述查询单条机组信息
*
* @param crewId 机组信息Id
* @return {@link CrewResp }
* @author huise23
* @date 2025/04/11 23:17
**/
@Override
public CrewResp selectById(String crewId) {
CrewListReq crewReq = new CrewListReq();
crewReq.setCrewId(crewId);
List<CrewResp> list = selectList(crewReq);
return list.isEmpty() ? CollUtil.getFirst(list) : new CrewResp();
}
/**
* 功能描述新增机组信息
*
* @param crew 机组信息
* @author huise23
* @date 2025/04/11 23:17
**/
@Override
public void saveData(CrewEntity crew) {
// todo 校验
save(crew);
}
/**
* 功能描述更新机组信息
*
* @param crew 机组信息
* @author huise23
* @date 2025/04/11 23:17
**/
@Override
public void updateData(CrewEntity crew) {
// todo 校验
updateById(crew);
}
/**
* 功能描述删除机组信息
*
* @param crewId 机组信息Id
* @author huise23
* @date 2025/04/11 23:17
**/
@Override
public void deleteById(String crewId) {
// todo 校验
removeById(crewId);
}
}

View File

@ -0,0 +1,99 @@
package com.dite.znpt.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dite.znpt.domain.entity.ImageEntity;
import com.dite.znpt.domain.vo.ImageListReq;
import com.dite.znpt.domain.vo.ImageResp;
import com.dite.znpt.service.ImageService;
import com.dite.znpt.mapper.ImageMapper;
import org.springframework.stereotype.Service;
import cn.hutool.core.collection.CollUtil;
import lombok.RequiredArgsConstructor;
import com.dite.znpt.util.PageUtil;
import java.util.List;
/**
* @author huise23
* @date 2025/04/24 13:44
* @Description: 图像信息表服务实现类
*/
@Service
@RequiredArgsConstructor
public class ImageServiceImpl extends ServiceImpl<ImageMapper, ImageEntity> implements ImageService {
/**
* 功能描述查询图像信息列表
*
* @param imageReq 图像信息信息
* @return {@link List }<{@link ImageResp }>
* @author huise23
* @date 2025/04/24 13:44
**/
@Override
public List<ImageResp> selectList(ImageListReq imageReq) {
PageUtil.startPage();
List<ImageResp> imageList= this.baseMapper.queryBySelective(imageReq);
imageList.forEach(resp -> {
});
return imageList;
}
/**
* 功能描述查询单条图像信息
*
* @param imageId 图像信息Id
* @return {@link ImageResp }
* @author huise23
* @date 2025/04/24 13:44
**/
@Override
public ImageResp selectById(Long imageId) {
ImageListReq imageReq = new ImageListReq();
imageReq.setImageId(imageId);
List<ImageResp> list = selectList(imageReq);
return list.isEmpty() ? CollUtil.getFirst(list) : new ImageResp();
}
/**
* 功能描述新增图像信息
*
* @param image 图像信息
* @author huise23
* @date 2025/04/24 13:44
**/
@Override
public void saveData(ImageEntity image) {
// todo 校验
save(image);
}
/**
* 功能描述更新图像信息
*
* @param image 图像信息
* @author huise23
* @date 2025/04/24 13:44
**/
@Override
public void updateData(ImageEntity image) {
// todo 校验
updateById(image);
}
/**
* 功能描述删除图像信息
*
* @param imageId 图像信息Id
* @author huise23
* @date 2025/04/24 13:44
**/
@Override
public void deleteById(Long imageId) {
// todo 校验
removeById(imageId);
}
}

View File

@ -1,39 +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.dite.znpt.mapper.CrewMapper">
<sql id="Base_Column_List">
a.crew_id, a.project_id, a.crew_name, a.crew_desc,
a.manufacturer, a.model
</sql>
<select id="queryBySelective" resultType="com.dite.znpt.domain.vo.CrewResp">
select
<include refid="Base_Column_List"/>
from crew a
<where>
<if test="keyword != null and keyword != ''">
# and (a.TODO like concat('%', #{keyword,jdbcType=VARCHAR}, '%') or a.TODO like concat('%', #{keyword,jdbcType=VARCHAR}, '%'))
</if>
<if test="crewId != null and crewId != ''">
and a.crew_id like concat ('%', #{crewId}, '%')
</if>
<if test="projectId != null and projectId != ''">
and a.project_id like concat ('%', #{projectId}, '%')
</if>
<if test="crewName != null and crewName != ''">
and a.crew_name like concat ('%', #{crewName}, '%')
</if>
<if test="crewDesc != null and crewDesc != ''">
and a.crew_desc like concat ('%', #{crewDesc}, '%')
</if>
<if test="manufacturer != null and manufacturer != ''">
and a.manufacturer like concat ('%', #{manufacturer}, '%')
</if>
<if test="model != null and model != ''">
and a.model like concat ('%', #{model}, '%')
</if>
</where>
</select>
</mapper>

View File

@ -0,0 +1,52 @@
<?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.dite.znpt.mapper.ImageMapper">
<sql id="Base_Column_List">
a.image_id, a.part_id, a.turbine_id, a.project,
a.image_name, a.image_size, a.focal_distance, a.shooting_time,
a.camera_manufacturer, a.camera_model
</sql>
<select id="queryBySelective" resultType="com.dite.znpt.domain.vo.ImageResp">
select
<include refid="Base_Column_List"/>
from image a
<where>
<if test="keyword != null and keyword != ''">
# and (a.TODO like concat('%', #{keyword,jdbcType=VARCHAR}, '%') or a.TODO like concat('%', #{keyword,jdbcType=VARCHAR}, '%'))
</if>
<if test="imageId != null">
and a.image_id = #{imageId}
</if>
<if test="partId != null">
and a.part_id = #{partId}
</if>
<if test="turbineId != null">
and a.turbine_id = #{turbineId}
</if>
<if test="project != null">
and a.project = #{project}
</if>
<if test="imageName != null and imageName != ''">
and a.image_name like concat ('%', #{imageName}, '%')
</if>
<if test="imageSize != null and imageSize != ''">
and a.image_size like concat ('%', #{imageSize}, '%')
</if>
<if test="focalDistance != null and focalDistance != ''">
and a.focal_distance like concat ('%', #{focalDistance}, '%')
</if>
<if test="shootingTime != null">
and a.shooting_time = #{shootingTime}
</if>
<if test="cameraManufacturer != null and cameraManufacturer != ''">
and a.camera_manufacturer like concat ('%', #{cameraManufacturer}, '%')
</if>
<if test="cameraModel != null and cameraModel != ''">
and a.camera_model like concat ('%', #{cameraModel}, '%')
</if>
</where>
</select>
</mapper>

View File

@ -1,84 +0,0 @@
package com.dite.znpt.web.controller;
import com.dite.znpt.domain.Constants;
import com.dite.znpt.domain.vo.CrewListReq;
import com.dite.znpt.domain.vo.CrewResp;
import com.dite.znpt.domain.entity.CrewEntity;
import com.dite.znpt.service.CrewService;
import com.dite.znpt.domain.Result;
import com.dite.znpt.domain.PageResult;
import com.pig4cloud.plugin.excel.annotation.RequestExcel;
import com.pig4cloud.plugin.excel.annotation.ResponseExcel;
import com.pig4cloud.plugin.excel.vo.ErrorMessage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* @author huise23
* @date 2025/04/11 23:17
*/
@Api(tags = "机组信息")
@RestController
@RequestMapping("/crew")
public class CrewController {
@Resource
private CrewService crewService;
@ApiOperation(value = "获取机组信息列表", httpMethod = "GET")
@GetMapping("/list")
public PageResult<CrewResp> list(CrewListReq crewReq) {
return PageResult.ok(crewService.selectList(crewReq));
}
@ApiOperation(value = "根据机组信息Id获取详细信息", httpMethod = "GET")
@GetMapping("/{crewId}")
public Result<CrewResp> getInfo(@PathVariable String crewId) {
return Result.ok(crewService.selectById(crewId));
}
@ApiOperation(value = "新增机组信息", httpMethod = "POST")
@PostMapping
public Result<Object> add(@RequestBody CrewEntity crew) {
crewService.saveData(crew);
return Result.ok();
}
@ApiOperation(value = "修改机组信息", httpMethod = "PUT")
@PutMapping
public Result<Object> edit(@RequestBody CrewEntity crew) {
crewService.updateData(crew);
return Result.ok();
}
@ApiOperation(value = "删除机组信息", httpMethod = "DELETE")
@DeleteMapping("/{crewId}")
public Result<Object> remove(@PathVariable String crewId) {
crewService.deleteById(crewId);
return Result.ok();
}
@ApiOperation(value = "导出机组信息", httpMethod = "GET")
@GetMapping("/export")
@ResponseExcel(name = "机组信息")
public List<CrewResp> export(CrewListReq crewReq) {
return crewService.selectList(crewReq);
}
@ApiOperation(value = "导入机组信息", httpMethod = "POST")
@PostMapping("/import")
public Result<Object> importData(@RequestExcel List<CrewEntity> dataList, BindingResult bindingResult) {
// JSR 303 校验通用校验获取失败的数据
List<ErrorMessage> errorMessageList = (List<ErrorMessage>) bindingResult.getTarget();
if (errorMessageList != null && !errorMessageList.isEmpty()) {
return Result.error(Constants.SERVICE_EXCEPTION, "导入失败");
}
return Result.okM("导入"+dataList.size()+"条数据");
}
}