fangq 4 jaren geleden
bovenliggende
commit
7f74ef6d03
28 gewijzigde bestanden met toevoegingen van 1267 en 14 verwijderingen
  1. 112 0
      src/main/java/org/springblade/modules/system/excel/CableExcel.java
  2. 42 0
      src/main/java/org/springblade/modules/system/excel/CableImporter.java
  3. 67 0
      src/main/java/org/springblade/ship/cable/controller/CableController.java
  4. 12 0
      src/main/java/org/springblade/ship/cable/entity/Cable.java
  5. 5 0
      src/main/java/org/springblade/ship/cable/mapper/CableMapper.java
  6. 6 0
      src/main/java/org/springblade/ship/cable/mapper/CableMapper.xml
  7. 10 0
      src/main/java/org/springblade/ship/cable/service/ICableService.java
  8. 108 0
      src/main/java/org/springblade/ship/cable/service/impl/CableServiceImpl.java
  9. 8 8
      src/main/java/org/springblade/ship/device/controller/DeviceController.java
  10. 8 6
      src/main/java/org/springblade/ship/device/wrapper/DeviceWrapper.java
  11. 129 0
      src/main/java/org/springblade/ship/ship/controller/ShipController.java
  12. 34 0
      src/main/java/org/springblade/ship/ship/dto/ShipDTO.java
  13. 58 0
      src/main/java/org/springblade/ship/ship/entity/Ship.java
  14. 42 0
      src/main/java/org/springblade/ship/ship/mapper/ShipMapper.java
  15. 18 0
      src/main/java/org/springblade/ship/ship/mapper/ShipMapper.xml
  16. 41 0
      src/main/java/org/springblade/ship/ship/service/IShipService.java
  17. 41 0
      src/main/java/org/springblade/ship/ship/service/impl/ShipServiceImpl.java
  18. 36 0
      src/main/java/org/springblade/ship/ship/vo/ShipVO.java
  19. 49 0
      src/main/java/org/springblade/ship/ship/wrapper/ShipWrapper.java
  20. 129 0
      src/main/java/org/springblade/ship/shipyard/controller/ShipyardController.java
  21. 34 0
      src/main/java/org/springblade/ship/shipyard/dto/ShipyardDTO.java
  22. 52 0
      src/main/java/org/springblade/ship/shipyard/entity/Shipyard.java
  23. 42 0
      src/main/java/org/springblade/ship/shipyard/mapper/ShipyardMapper.java
  24. 17 0
      src/main/java/org/springblade/ship/shipyard/mapper/ShipyardMapper.xml
  25. 41 0
      src/main/java/org/springblade/ship/shipyard/service/IShipyardService.java
  26. 41 0
      src/main/java/org/springblade/ship/shipyard/service/impl/ShipyardServiceImpl.java
  27. 36 0
      src/main/java/org/springblade/ship/shipyard/vo/ShipyardVO.java
  28. 49 0
      src/main/java/org/springblade/ship/shipyard/wrapper/ShipyardWrapper.java

+ 112 - 0
src/main/java/org/springblade/modules/system/excel/CableExcel.java

@@ -0,0 +1,112 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.system.excel;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentRowHeight;
+import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * CableExcel
+ *
+ * @author Andy
+ */
+@Data
+@ColumnWidth(16)
+@HeadRowHeight(20)
+@ContentRowHeight(18)
+public class CableExcel implements Serializable {
+	private static final long serialVersionUID = 1L;
+
+	@ExcelProperty("船号")
+	private String shipNo;
+
+	@ExcelProperty("图号")
+	private String pictureNo;
+
+	@ExcelProperty("电缆代号")
+	private String alias;
+
+	@ExcelProperty(value = "类别")
+	private String category;
+
+	@ExcelProperty(value = "型号")
+	private String model;
+
+	@ExcelProperty(value = "规格")
+	private String specs;
+
+	@ExcelProperty(value = "直径")
+	private String diameter;
+
+	@ExcelProperty(value = "起点舱室")
+	private String beginCabin;
+
+	@ExcelProperty(value = "起点设备名称")
+	private String beginName;
+
+	@ExcelProperty(value = "起点甲板")
+	private String beginDeck;
+
+	@ExcelProperty(value = "起点船舷")
+	private String beginShipSide;
+
+	@ExcelProperty(value = "起点肋位")
+	private String beginRibPosition;
+
+	@ExcelProperty(value = "经过节点")
+	private String passNode;
+
+	@ExcelProperty(value = "终点舱室")
+	private String endCabin;
+
+	@ExcelProperty(value = "终点设备名称")
+	private String endName;
+
+	@ExcelProperty(value = "终点甲板")
+	private String endDeck;
+
+	@ExcelProperty(value = "终点船舷")
+	private String endShipSide;
+
+	@ExcelProperty(value = "终点肋位")
+	private String endRibPosition;
+
+	@ExcelProperty(value = "停止点")
+	private String stopPoint;
+
+	@ExcelProperty(value = "前长度")
+	private String frontLen;
+
+	@ExcelProperty(value = "总长")
+	private String len;
+
+	@ExcelProperty(value = "系统图号")
+	private String drawingNo;
+
+	@ExcelProperty(value = "备注")
+	private String remark;
+/*
+	@ExcelProperty(value = "标签")
+	private String label;*/
+
+}

+ 42 - 0
src/main/java/org/springblade/modules/system/excel/CableImporter.java

@@ -0,0 +1,42 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.system.excel;
+
+import lombok.RequiredArgsConstructor;
+import org.springblade.core.excel.support.ExcelImporter;
+import org.springblade.modules.system.service.IRegionService;
+import org.springblade.ship.cable.entity.Cable;
+import org.springblade.ship.cable.service.ICableService;
+
+import java.util.List;
+
+/**
+ * 行政区划数据导入类
+ *
+ * @author Chill
+ */
+@RequiredArgsConstructor
+public class CableImporter implements ExcelImporter<CableExcel> {
+
+	private final ICableService cableService;
+	private final Boolean isCovered;
+
+	@Override
+	public void save(List<CableExcel> data) {
+		cableService.importCable(data, isCovered);
+	}
+}

+ 67 - 0
src/main/java/org/springblade/ship/cable/controller/CableController.java

@@ -22,12 +22,25 @@ import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import lombok.AllArgsConstructor;
+
+import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
 
+import org.springblade.core.excel.util.ExcelUtil;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
+import org.springblade.core.secure.BladeUser;
+import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.constant.BladeConstant;
+import org.springblade.core.tool.utils.DateUtil;
 import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.system.entity.User;
+import org.springblade.modules.system.excel.CableExcel;
+import org.springblade.modules.system.excel.CableImporter;
+import org.springblade.modules.system.excel.UserExcel;
+import org.springblade.modules.system.excel.UserImporter;
+import org.springframework.util.Assert;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.RequestParam;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -36,7 +49,11 @@ import org.springblade.ship.cable.vo.CableVO;
 import org.springblade.ship.cable.wrapper.CableWrapper;
 import org.springblade.ship.cable.service.ICableService;
 import org.springblade.core.boot.ctrl.BladeController;
+import org.springframework.web.multipart.MultipartFile;
+import springfox.documentation.annotations.ApiIgnore;
 
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -98,6 +115,8 @@ public class CableController extends BladeController {
 	@ApiOperationSupport(order = 4)
 	@ApiOperation(value = "新增", notes = "传入cable")
 	public R save(@Valid @RequestBody Cable cable) {
+		Cable one = cableService.getByAlias(cable.getAlias());
+		Assert.isNull(one, "代号为(" + cable.getAlias() + ")的记录已存在!");
 		return R.status(cableService.save(cable));
 	}
 
@@ -132,5 +151,53 @@ public class CableController extends BladeController {
 		return R.status(cableService.deleteLogic(Func.toLongList(ids)));
 	}
 
+	/**
+	 * 导入用户
+	 */
+	@PostMapping("/import-cable")
+	@ApiOperationSupport(order = 12)
+	@ApiOperation(value = "导入用户", notes = "传入excel")
+	public R importCable(MultipartFile file, Integer isCovered) {
+		CableImporter cableImporter = new CableImporter(cableService, new Integer(1).equals(isCovered));
+		ExcelUtil.save(file, cableImporter, CableExcel.class);
+		return R.success("操作成功");
+	}
+
+	/**
+	 * 导出用户
+	 */
+	@GetMapping("export-cable")
+	@ApiOperationSupport(order = 13)
+	@ApiOperation(value = "导出用户", notes = "传入user")
+	public void exportCable(CableVO cable, BladeUser bladeUser, HttpServletResponse response) {
+		QueryWrapper<Cable> queryWrapper = Condition.getQueryWrapper(cable);
+		if (cable.getCreateTimeBegin() != null && cable.getCreateTimeEnd() != null){
+			queryWrapper.lambda().between(Cable::getCreateTime, cable.getCreateTimeBegin(), cable.getCreateTimeEnd());
+		}
+		List<CableExcel> list = cableService.exportCable(queryWrapper);
+		ExcelUtil.export(response, "电缆数据" + DateUtil.time(), "电缆数据表", list, CableExcel.class);
+	}
+
+	/**
+	 * 导出模板
+	 */
+	@GetMapping("export-template")
+	@ApiOperationSupport(order = 14)
+	@ApiOperation(value = "导出模板")
+	public void exportUser(HttpServletResponse response) {
+		List<CableExcel> list = new ArrayList<>();
+		ExcelUtil.export(response, "电缆数据模板", "电缆数据表", list, CableExcel.class);
+	}
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/getCableList")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入cable")
+	public R getList() {
+		List<Cable> list = cableService.list();
+		return R.data(list);
+	}
 
 }

+ 12 - 0
src/main/java/org/springblade/ship/cable/entity/Cable.java

@@ -37,6 +37,18 @@ public class Cable extends BaseEntity {
 
 	private static final long serialVersionUID = 1L;
 
+
+
+	/**
+	* 船号
+	*/
+		@ApiModelProperty(value = "船号")
+		private String shipNo;
+	/**
+	* 图号
+	*/
+		@ApiModelProperty(value = "图号")
+		private String pictureNo;
 	/**
 	* 电缆代号
 	*/

+ 5 - 0
src/main/java/org/springblade/ship/cable/mapper/CableMapper.java

@@ -16,6 +16,10 @@
  */
 package org.springblade.ship.cable.mapper;
 
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.modules.system.excel.CableExcel;
 import org.springblade.ship.cable.entity.Cable;
 import org.springblade.ship.cable.vo.CableVO;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -39,4 +43,5 @@ public interface CableMapper extends BaseMapper<Cable> {
 	 */
 	List<CableVO> selectCablePage(IPage page, CableVO cable);
 
+    List<CableExcel> exportCable(@Param("ew") Wrapper<Cable> queryWrapper);
 }

+ 6 - 0
src/main/java/org/springblade/ship/cable/mapper/CableMapper.xml

@@ -5,6 +5,8 @@
     <!-- 通用查询映射结果 -->
     <resultMap id="cableResultMap" type="org.springblade.ship.cable.entity.Cable">
         <result column="id" property="id"/>
+        <result column="ship_no" property="shipNo"/>
+        <result column="picture_no" property="pictureNo"/>
         <result column="alias" property="alias"/>
         <result column="category" property="category"/>
         <result column="model" property="model"/>
@@ -34,4 +36,8 @@
         select * from sc_cable where is_deleted = 0
     </select>
 
+    <select id="exportUser" resultType="org.springblade.modules.system.excel.CableExcel">
+        SELECT * FROM sc_cable ${ew.customSqlSegment}
+    </select>
+
 </mapper>

+ 10 - 0
src/main/java/org/springblade/ship/cable/service/ICableService.java

@@ -16,11 +16,16 @@
  */
 package org.springblade.ship.cable.service;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import org.springblade.modules.system.entity.User;
+import org.springblade.modules.system.excel.CableExcel;
 import org.springblade.ship.cable.entity.Cable;
 import org.springblade.ship.cable.vo.CableVO;
 import org.springblade.core.mp.base.BaseService;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 
+import java.util.List;
+
 /**
  *  服务类
  *
@@ -38,4 +43,9 @@ public interface ICableService extends BaseService<Cable> {
 	 */
 	IPage<CableVO> selectCablePage(IPage<CableVO> page, CableVO cable);
 
+    void importCable(List<CableExcel> data, Boolean isCovered);
+
+	Cable getByAlias(String alias);
+
+	List<CableExcel> exportCable(QueryWrapper<Cable> queryWrapper);
 }

+ 108 - 0
src/main/java/org/springblade/ship/cable/service/impl/CableServiceImpl.java

@@ -16,6 +16,17 @@
  */
 package org.springblade.ship.cable.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import org.springblade.common.cache.DictCache;
+import org.springblade.common.cache.SysCache;
+import org.springblade.common.cache.UserCache;
+import org.springblade.common.enums.DictEnum;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.core.tool.utils.StringUtil;
+import org.springblade.modules.system.entity.Region;
+import org.springblade.modules.system.entity.User;
+import org.springblade.modules.system.excel.CableExcel;
+import org.springblade.modules.system.excel.UserExcel;
 import org.springblade.ship.cable.entity.Cable;
 import org.springblade.ship.cable.vo.CableVO;
 import org.springblade.ship.cable.mapper.CableMapper;
@@ -24,6 +35,9 @@ import org.springblade.core.mp.base.BaseServiceImpl;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  *  服务实现类
  *
@@ -38,4 +52,98 @@ public class CableServiceImpl extends BaseServiceImpl<CableMapper, Cable> implem
 		return page.setRecords(baseMapper.selectCablePage(page, cable));
 	}
 
+	@Override
+	public void importCable(List<CableExcel> data, Boolean isCovered) {
+		List<Cable> listAdd = new ArrayList<>();
+		List<Cable> listUpdate = new ArrayList<>();
+		data.forEach(cableExcel -> {
+			Cable cable = BeanUtil.copy(cableExcel, Cable.class);
+
+			String cable_category = DictCache.getKey("cable_category", cableExcel.getCategory());
+			String cable_model = DictCache.getKey("cable_model", cableExcel.getModel());
+			String ship_cabin = DictCache.getKey("ship_cabin", cableExcel.getBeginCabin());
+			String ship_side = DictCache.getKey("ship_side", cableExcel.getBeginShipSide());
+			String ship_cabin1 = DictCache.getKey("ship_cabin", cableExcel.getEndCabin());
+			String ship_side1 = DictCache.getKey("ship_side", cableExcel.getEndShipSide());
+
+			if (cable_category != null){
+				cable.setCategory(cable_category);
+			}
+			if (cable_model != null){
+				cable.setModel(cable_model);
+			}
+			if (ship_cabin != null){
+				cable.setBeginCabin(ship_cabin);
+			}
+			if (ship_side != null){
+				cable.setBeginShipSide(ship_side);
+			}
+			if (ship_cabin1 != null){
+				cable.setEndCabin(ship_cabin1);
+			}
+			if (ship_side1 != null){
+				cable.setEndShipSide(ship_side1);
+			}
+
+			// 覆盖数据
+			if (isCovered) {
+				// 查询数据是否存在
+				Cable old = this.getByAlias(cableExcel.getAlias());
+				if (old != null && old.getId() != null) {
+					cable.setId(old.getId());
+				}
+			}
+			if (cable.getId() == null){
+				listAdd.add(cable);
+			}else {
+				listUpdate.add(cable);
+			}
+		});
+		this.saveBatch(listAdd);
+		this.saveOrUpdateBatch(listUpdate);
+	}
+
+	@Override
+	public Cable getByAlias(String alias) {
+		return baseMapper.selectOne(new QueryWrapper<>(new Cable()).lambda().eq(Cable::getAlias, alias));
+	}
+
+	@Override
+	public List<CableExcel> exportCable(QueryWrapper<Cable> queryWrapper) {
+		List<CableExcel> list = new ArrayList<>();
+		List<Cable> cableList = baseMapper.selectList(queryWrapper);
+		cableList.forEach(cable -> {
+			CableExcel cableExcel = new CableExcel();
+			BeanUtil.copy(cable, cableExcel);
+
+			String cable_category = DictCache.getValue("cable_category", cableExcel.getCategory());
+			String cable_model = DictCache.getValue("cable_model", cableExcel.getModel());
+			String ship_cabin = DictCache.getValue("ship_cabin", cableExcel.getBeginCabin());
+			String ship_side = DictCache.getValue("ship_side", cableExcel.getBeginShipSide());
+			String ship_cabin1 = DictCache.getValue("ship_cabin", cableExcel.getEndCabin());
+			String ship_side1 = DictCache.getValue("ship_side", cableExcel.getEndShipSide());
+
+			if (cable_category != null){
+				cableExcel.setCategory(cable_category);
+			}
+			if (cable_model != null){
+				cableExcel.setModel(cable_model);
+			}
+			if (ship_cabin != null){
+				cableExcel.setBeginCabin(ship_cabin);
+			}
+			if (ship_side != null){
+				cableExcel.setBeginShipSide(ship_side);
+			}
+			if (ship_cabin1 != null){
+				cableExcel.setEndCabin(ship_cabin1);
+			}
+			if (ship_side1 != null){
+				cableExcel.setEndShipSide(ship_side1);
+			}
+
+			list.add(cableExcel);
+		});
+		return list;
+	}
 }

+ 8 - 8
src/main/java/org/springblade/ship/device/controller/DeviceController.java

@@ -62,7 +62,7 @@ public class DeviceController extends BladeController {
 	}
 
 	/**
-	 * 分页 
+	 * 分页
 	 */
 	@GetMapping("/list")
 	@ApiOperationSupport(order = 2)
@@ -74,7 +74,7 @@ public class DeviceController extends BladeController {
 
 
 	/**
-	 * 自定义分页 
+	 * 自定义分页
 	 */
 	@GetMapping("/page")
 	@ApiOperationSupport(order = 3)
@@ -85,7 +85,7 @@ public class DeviceController extends BladeController {
 	}
 
 	/**
-	 * 新增 
+	 * 新增
 	 */
 	@PostMapping("/save")
 	@ApiOperationSupport(order = 4)
@@ -95,7 +95,7 @@ public class DeviceController extends BladeController {
 	}
 
 	/**
-	 * 修改 
+	 * 修改
 	 */
 	@PostMapping("/update")
 	@ApiOperationSupport(order = 5)
@@ -105,7 +105,7 @@ public class DeviceController extends BladeController {
 	}
 
 	/**
-	 * 新增或修改 
+	 * 新增或修改
 	 */
 	@PostMapping("/submit")
 	@ApiOperationSupport(order = 6)
@@ -114,9 +114,9 @@ public class DeviceController extends BladeController {
 		return R.status(deviceService.saveOrUpdate(device));
 	}
 
-	
+
 	/**
-	 * 删除 
+	 * 删除
 	 */
 	@PostMapping("/remove")
 	@ApiOperationSupport(order = 7)
@@ -125,5 +125,5 @@ public class DeviceController extends BladeController {
 		return R.status(deviceService.deleteLogic(Func.toLongList(ids)));
 	}
 
-	
+
 }

+ 8 - 6
src/main/java/org/springblade/ship/device/wrapper/DeviceWrapper.java

@@ -46,13 +46,15 @@ public class DeviceWrapper extends BaseEntityWrapper<Device, DeviceVO>  {
 
 		if (device.getPersonIds() != null){
 			List<String> nameList = new ArrayList<>();
-			String[] split = device.getPersonIds().split(",");
-			for (int i = 0; i < split.length; i++) {
-				String userId = split[i];
-				User user = UserCache.getUser(Long.valueOf(userId));
-				nameList.add(user.getName());
+			if (StringUtil.isNotBlank(device.getPersonIds())){
+				String[] split = device.getPersonIds().split(",");
+				for (int i = 0; i < split.length; i++) {
+					String userId = split[i];
+					User user = UserCache.getUser(Long.valueOf(userId));
+					nameList.add(user.getName());
+				}
+				deviceVO.setPersonNames(StringUtil.join(nameList));
 			}
-			deviceVO.setPersonNames(StringUtil.join(nameList));
 		}
 
 		//User updateUser = UserCache.getUser(device.getUpdateUser());

+ 129 - 0
src/main/java/org/springblade/ship/ship/controller/ShipController.java

@@ -0,0 +1,129 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.ship.ship.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.RequestParam;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.ship.ship.entity.Ship;
+import org.springblade.ship.ship.vo.ShipVO;
+import org.springblade.ship.ship.wrapper.ShipWrapper;
+import org.springblade.ship.ship.service.IShipService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ *  控制器
+ *
+ * @author BladeX
+ * @since 2021-11-17
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("ship/ship")
+@Api(value = "", tags = "接口")
+public class ShipController extends BladeController {
+
+	private final IShipService shipService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入ship")
+	public R<ShipVO> detail(Ship ship) {
+		Ship detail = shipService.getOne(Condition.getQueryWrapper(ship));
+		return R.data(ShipWrapper.build().entityVO(detail));
+	}
+
+	/**
+	 * 分页 
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入ship")
+	public R<IPage<ShipVO>> list(Ship ship, Query query) {
+		IPage<Ship> pages = shipService.page(Condition.getPage(query), Condition.getQueryWrapper(ship));
+		return R.data(ShipWrapper.build().pageVO(pages));
+	}
+
+
+	/**
+	 * 自定义分页 
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入ship")
+	public R<IPage<ShipVO>> page(ShipVO ship, Query query) {
+		IPage<ShipVO> pages = shipService.selectShipPage(Condition.getPage(query), ship);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入ship")
+	public R save(@Valid @RequestBody Ship ship) {
+		return R.status(shipService.save(ship));
+	}
+
+	/**
+	 * 修改 
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入ship")
+	public R update(@Valid @RequestBody Ship ship) {
+		return R.status(shipService.updateById(ship));
+	}
+
+	/**
+	 * 新增或修改 
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入ship")
+	public R submit(@Valid @RequestBody Ship ship) {
+		return R.status(shipService.saveOrUpdate(ship));
+	}
+
+	
+	/**
+	 * 删除 
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 7)
+	@ApiOperation(value = "逻辑删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(shipService.deleteLogic(Func.toLongList(ids)));
+	}
+
+	
+}

+ 34 - 0
src/main/java/org/springblade/ship/ship/dto/ShipDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.ship.ship.dto;
+
+import org.springblade.ship.ship.entity.Ship;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2021-11-17
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ShipDTO extends Ship {
+	private static final long serialVersionUID = 1L;
+
+}

+ 58 - 0
src/main/java/org/springblade/ship/ship/entity/Ship.java

@@ -0,0 +1,58 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.ship.ship.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import org.springblade.core.mp.base.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 实体类
+ *
+ * @author BladeX
+ * @since 2021-11-17
+ */
+@Data
+@TableName("sc_ship")
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "Ship对象", description = "Ship对象")
+public class Ship extends BaseEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	* 编号
+	*/
+		@ApiModelProperty(value = "编号")
+		private String code;
+	/**
+	* 名称
+	*/
+		@ApiModelProperty(value = "名称")
+		private String name;
+
+	/**
+	* 船厂ID
+	*/
+		@ApiModelProperty(value = "船厂ID")
+		private Long yardId;
+
+
+}

+ 42 - 0
src/main/java/org/springblade/ship/ship/mapper/ShipMapper.java

@@ -0,0 +1,42 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.ship.ship.mapper;
+
+import org.springblade.ship.ship.entity.Ship;
+import org.springblade.ship.ship.vo.ShipVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ *  Mapper 接口
+ *
+ * @author BladeX
+ * @since 2021-11-17
+ */
+public interface ShipMapper extends BaseMapper<Ship> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param ship
+	 * @return
+	 */
+	List<ShipVO> selectShipPage(IPage page, ShipVO ship);
+
+}

+ 18 - 0
src/main/java/org/springblade/ship/ship/mapper/ShipMapper.xml

@@ -0,0 +1,18 @@
+<?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="org.springblade.ship.ship.mapper.ShipMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="shipResultMap" type="org.springblade.ship.ship.entity.Ship">
+        <result column="id" property="id"/>
+        <result column="code" property="code"/>
+        <result column="name" property="name"/>
+        <result column="yard_id" property="yardId"/>
+    </resultMap>
+
+
+    <select id="selectShipPage" resultMap="shipResultMap">
+        select * from sc_ship where is_deleted = 0
+    </select>
+
+</mapper>

+ 41 - 0
src/main/java/org/springblade/ship/ship/service/IShipService.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.ship.ship.service;
+
+import org.springblade.ship.ship.entity.Ship;
+import org.springblade.ship.ship.vo.ShipVO;
+import org.springblade.core.mp.base.BaseService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ *  服务类
+ *
+ * @author BladeX
+ * @since 2021-11-17
+ */
+public interface IShipService extends BaseService<Ship> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param ship
+	 * @return
+	 */
+	IPage<ShipVO> selectShipPage(IPage<ShipVO> page, ShipVO ship);
+
+}

+ 41 - 0
src/main/java/org/springblade/ship/ship/service/impl/ShipServiceImpl.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.ship.ship.service.impl;
+
+import org.springblade.ship.ship.entity.Ship;
+import org.springblade.ship.ship.vo.ShipVO;
+import org.springblade.ship.ship.mapper.ShipMapper;
+import org.springblade.ship.ship.service.IShipService;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ *  服务实现类
+ *
+ * @author BladeX
+ * @since 2021-11-17
+ */
+@Service
+public class ShipServiceImpl extends BaseServiceImpl<ShipMapper, Ship> implements IShipService {
+
+	@Override
+	public IPage<ShipVO> selectShipPage(IPage<ShipVO> page, ShipVO ship) {
+		return page.setRecords(baseMapper.selectShipPage(page, ship));
+	}
+
+}

+ 36 - 0
src/main/java/org/springblade/ship/ship/vo/ShipVO.java

@@ -0,0 +1,36 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.ship.ship.vo;
+
+import org.springblade.ship.ship.entity.Ship;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 视图实体类
+ *
+ * @author BladeX
+ * @since 2021-11-17
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "ShipVO对象", description = "ShipVO对象")
+public class ShipVO extends Ship {
+	private static final long serialVersionUID = 1L;
+
+}

+ 49 - 0
src/main/java/org/springblade/ship/ship/wrapper/ShipWrapper.java

@@ -0,0 +1,49 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.ship.ship.wrapper;
+
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.ship.ship.entity.Ship;
+import org.springblade.ship.ship.vo.ShipVO;
+import java.util.Objects;
+
+/**
+ * 包装类,返回视图层所需的字段
+ *
+ * @author BladeX
+ * @since 2021-11-17
+ */
+public class ShipWrapper extends BaseEntityWrapper<Ship, ShipVO>  {
+
+	public static ShipWrapper build() {
+		return new ShipWrapper();
+ 	}
+
+	@Override
+	public ShipVO entityVO(Ship ship) {
+		ShipVO shipVO = Objects.requireNonNull(BeanUtil.copy(ship, ShipVO.class));
+
+		//User createUser = UserCache.getUser(ship.getCreateUser());
+		//User updateUser = UserCache.getUser(ship.getUpdateUser());
+		//shipVO.setCreateUserName(createUser.getName());
+		//shipVO.setUpdateUserName(updateUser.getName());
+
+		return shipVO;
+	}
+
+}

+ 129 - 0
src/main/java/org/springblade/ship/shipyard/controller/ShipyardController.java

@@ -0,0 +1,129 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.ship.shipyard.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.RequestParam;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.ship.shipyard.entity.Shipyard;
+import org.springblade.ship.shipyard.vo.ShipyardVO;
+import org.springblade.ship.shipyard.wrapper.ShipyardWrapper;
+import org.springblade.ship.shipyard.service.IShipyardService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ *  控制器
+ *
+ * @author BladeX
+ * @since 2021-11-17
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("ship/shipyard")
+@Api(value = "", tags = "接口")
+public class ShipyardController extends BladeController {
+
+	private final IShipyardService shipyardService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入shipyard")
+	public R<ShipyardVO> detail(Shipyard shipyard) {
+		Shipyard detail = shipyardService.getOne(Condition.getQueryWrapper(shipyard));
+		return R.data(ShipyardWrapper.build().entityVO(detail));
+	}
+
+	/**
+	 * 分页 
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入shipyard")
+	public R<IPage<ShipyardVO>> list(Shipyard shipyard, Query query) {
+		IPage<Shipyard> pages = shipyardService.page(Condition.getPage(query), Condition.getQueryWrapper(shipyard));
+		return R.data(ShipyardWrapper.build().pageVO(pages));
+	}
+
+
+	/**
+	 * 自定义分页 
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入shipyard")
+	public R<IPage<ShipyardVO>> page(ShipyardVO shipyard, Query query) {
+		IPage<ShipyardVO> pages = shipyardService.selectShipyardPage(Condition.getPage(query), shipyard);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入shipyard")
+	public R save(@Valid @RequestBody Shipyard shipyard) {
+		return R.status(shipyardService.save(shipyard));
+	}
+
+	/**
+	 * 修改 
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入shipyard")
+	public R update(@Valid @RequestBody Shipyard shipyard) {
+		return R.status(shipyardService.updateById(shipyard));
+	}
+
+	/**
+	 * 新增或修改 
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入shipyard")
+	public R submit(@Valid @RequestBody Shipyard shipyard) {
+		return R.status(shipyardService.saveOrUpdate(shipyard));
+	}
+
+	
+	/**
+	 * 删除 
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 7)
+	@ApiOperation(value = "逻辑删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(shipyardService.deleteLogic(Func.toLongList(ids)));
+	}
+
+	
+}

+ 34 - 0
src/main/java/org/springblade/ship/shipyard/dto/ShipyardDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.ship.shipyard.dto;
+
+import org.springblade.ship.shipyard.entity.Shipyard;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2021-11-17
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class ShipyardDTO extends Shipyard {
+	private static final long serialVersionUID = 1L;
+
+}

+ 52 - 0
src/main/java/org/springblade/ship/shipyard/entity/Shipyard.java

@@ -0,0 +1,52 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.ship.shipyard.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import org.springblade.core.mp.base.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 实体类
+ *
+ * @author BladeX
+ * @since 2021-11-17
+ */
+@Data
+@TableName("sc_shipyard")
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "Shipyard对象", description = "Shipyard对象")
+public class Shipyard extends BaseEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	* 编号
+	*/
+		@ApiModelProperty(value = "编号")
+		private String code;
+	/**
+	* 名称
+	*/
+		@ApiModelProperty(value = "名称")
+		private String name;
+
+
+}

+ 42 - 0
src/main/java/org/springblade/ship/shipyard/mapper/ShipyardMapper.java

@@ -0,0 +1,42 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.ship.shipyard.mapper;
+
+import org.springblade.ship.shipyard.entity.Shipyard;
+import org.springblade.ship.shipyard.vo.ShipyardVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ *  Mapper 接口
+ *
+ * @author BladeX
+ * @since 2021-11-17
+ */
+public interface ShipyardMapper extends BaseMapper<Shipyard> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param shipyard
+	 * @return
+	 */
+	List<ShipyardVO> selectShipyardPage(IPage page, ShipyardVO shipyard);
+
+}

+ 17 - 0
src/main/java/org/springblade/ship/shipyard/mapper/ShipyardMapper.xml

@@ -0,0 +1,17 @@
+<?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="org.springblade.ship.shipyard.mapper.ShipyardMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="shipyardResultMap" type="org.springblade.ship.shipyard.entity.Shipyard">
+        <result column="id" property="id"/>
+        <result column="code" property="code"/>
+        <result column="name" property="name"/>
+    </resultMap>
+
+
+    <select id="selectShipyardPage" resultMap="shipyardResultMap">
+        select * from sc_shipyard where is_deleted = 0
+    </select>
+
+</mapper>

+ 41 - 0
src/main/java/org/springblade/ship/shipyard/service/IShipyardService.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.ship.shipyard.service;
+
+import org.springblade.ship.shipyard.entity.Shipyard;
+import org.springblade.ship.shipyard.vo.ShipyardVO;
+import org.springblade.core.mp.base.BaseService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ *  服务类
+ *
+ * @author BladeX
+ * @since 2021-11-17
+ */
+public interface IShipyardService extends BaseService<Shipyard> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param shipyard
+	 * @return
+	 */
+	IPage<ShipyardVO> selectShipyardPage(IPage<ShipyardVO> page, ShipyardVO shipyard);
+
+}

+ 41 - 0
src/main/java/org/springblade/ship/shipyard/service/impl/ShipyardServiceImpl.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.ship.shipyard.service.impl;
+
+import org.springblade.ship.shipyard.entity.Shipyard;
+import org.springblade.ship.shipyard.vo.ShipyardVO;
+import org.springblade.ship.shipyard.mapper.ShipyardMapper;
+import org.springblade.ship.shipyard.service.IShipyardService;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ *  服务实现类
+ *
+ * @author BladeX
+ * @since 2021-11-17
+ */
+@Service
+public class ShipyardServiceImpl extends BaseServiceImpl<ShipyardMapper, Shipyard> implements IShipyardService {
+
+	@Override
+	public IPage<ShipyardVO> selectShipyardPage(IPage<ShipyardVO> page, ShipyardVO shipyard) {
+		return page.setRecords(baseMapper.selectShipyardPage(page, shipyard));
+	}
+
+}

+ 36 - 0
src/main/java/org/springblade/ship/shipyard/vo/ShipyardVO.java

@@ -0,0 +1,36 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.ship.shipyard.vo;
+
+import org.springblade.ship.shipyard.entity.Shipyard;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 视图实体类
+ *
+ * @author BladeX
+ * @since 2021-11-17
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "ShipyardVO对象", description = "ShipyardVO对象")
+public class ShipyardVO extends Shipyard {
+	private static final long serialVersionUID = 1L;
+
+}

+ 49 - 0
src/main/java/org/springblade/ship/shipyard/wrapper/ShipyardWrapper.java

@@ -0,0 +1,49 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.ship.shipyard.wrapper;
+
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.ship.shipyard.entity.Shipyard;
+import org.springblade.ship.shipyard.vo.ShipyardVO;
+import java.util.Objects;
+
+/**
+ * 包装类,返回视图层所需的字段
+ *
+ * @author BladeX
+ * @since 2021-11-17
+ */
+public class ShipyardWrapper extends BaseEntityWrapper<Shipyard, ShipyardVO>  {
+
+	public static ShipyardWrapper build() {
+		return new ShipyardWrapper();
+ 	}
+
+	@Override
+	public ShipyardVO entityVO(Shipyard shipyard) {
+		ShipyardVO shipyardVO = Objects.requireNonNull(BeanUtil.copy(shipyard, ShipyardVO.class));
+
+		//User createUser = UserCache.getUser(shipyard.getCreateUser());
+		//User updateUser = UserCache.getUser(shipyard.getUpdateUser());
+		//shipyardVO.setCreateUserName(createUser.getName());
+		//shipyardVO.setUpdateUserName(updateUser.getName());
+
+		return shipyardVO;
+	}
+
+}