parent
8bbf1128b4
commit
f1c938f579
8 changed files with 311 additions and 0 deletions
@ -0,0 +1,126 @@ |
||||
/** |
||||
* Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). |
||||
* <p> |
||||
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0; |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* <p> |
||||
* http://www.gnu.org/licenses/lgpl.html
|
||||
* <p> |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
package org.energy.modules.leger.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 com.dayu.daf.core.mp.support.Condition; |
||||
import com.dayu.daf.core.mp.support.Query; |
||||
import com.dayu.daf.core.tool.api.R; |
||||
import com.dayu.daf.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.energy.modules.leger.entity.InspectionStandards; |
||||
import org.energy.modules.leger.vo.InspectionStandardsVO; |
||||
import org.energy.modules.leger.service.IInspectionStandardsService; |
||||
import com.dayu.daf.core.boot.ctrl.DafController; |
||||
|
||||
/** |
||||
* 检验标准一览 控制器 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-09 |
||||
*/ |
||||
@RestController |
||||
@AllArgsConstructor |
||||
@RequestMapping("/inspectionstandards") |
||||
@Api(value = "检验标准一览", tags = "检验标准一览接口") |
||||
public class InspectionStandardsController extends DafController { |
||||
|
||||
private IInspectionStandardsService inspectionStandardsService; |
||||
|
||||
/** |
||||
* 详情 |
||||
*/ |
||||
@GetMapping("/detail") |
||||
@ApiOperationSupport(order = 1) |
||||
@ApiOperation(value = "详情", notes = "传入inspectionStandards") |
||||
public R<InspectionStandards> detail(InspectionStandards inspectionStandards) { |
||||
InspectionStandards detail = inspectionStandardsService.getOne(Condition.getQueryWrapper(inspectionStandards)); |
||||
return R.data(detail); |
||||
} |
||||
|
||||
/** |
||||
* 分页 检验标准一览 |
||||
*/ |
||||
@GetMapping("/list") |
||||
@ApiOperationSupport(order = 2) |
||||
@ApiOperation(value = "分页", notes = "传入inspectionStandards") |
||||
public R<IPage<InspectionStandards>> list(InspectionStandards inspectionStandards, Query query) { |
||||
IPage<InspectionStandards> pages = inspectionStandardsService.page(Condition.getPage(query), Condition.getQueryWrapper(inspectionStandards)); |
||||
return R.data(pages); |
||||
} |
||||
|
||||
/** |
||||
* 自定义分页 检验标准一览 |
||||
*/ |
||||
@GetMapping("/page") |
||||
@ApiOperationSupport(order = 3) |
||||
@ApiOperation(value = "分页", notes = "传入inspectionStandards") |
||||
public R<IPage<InspectionStandardsVO>> page(InspectionStandardsVO inspectionStandards, Query query) { |
||||
IPage<InspectionStandardsVO> pages = inspectionStandardsService.selectInspectionStandardsPage(Condition.getPage(query), inspectionStandards); |
||||
return R.data(pages); |
||||
} |
||||
|
||||
/** |
||||
* 新增 检验标准一览 |
||||
*/ |
||||
@PostMapping("/save") |
||||
@ApiOperationSupport(order = 4) |
||||
@ApiOperation(value = "新增", notes = "传入inspectionStandards") |
||||
public R save(@Valid @RequestBody InspectionStandards inspectionStandards) { |
||||
return R.status(inspectionStandardsService.save(inspectionStandards)); |
||||
} |
||||
|
||||
/** |
||||
* 修改 检验标准一览 |
||||
*/ |
||||
@PostMapping("/update") |
||||
@ApiOperationSupport(order = 5) |
||||
@ApiOperation(value = "修改", notes = "传入inspectionStandards") |
||||
public R update(@Valid @RequestBody InspectionStandards inspectionStandards) { |
||||
return R.status(inspectionStandardsService.updateById(inspectionStandards)); |
||||
} |
||||
|
||||
/** |
||||
* 新增或修改 检验标准一览 |
||||
*/ |
||||
@PostMapping("/submit") |
||||
@ApiOperationSupport(order = 6) |
||||
@ApiOperation(value = "新增或修改", notes = "传入inspectionStandards") |
||||
public R submit(@Valid @RequestBody InspectionStandards inspectionStandards) { |
||||
return R.status(inspectionStandardsService.saveOrUpdate(inspectionStandards)); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 删除 检验标准一览 |
||||
*/ |
||||
@PostMapping("/remove") |
||||
@ApiOperationSupport(order = 7) |
||||
@ApiOperation(value = "逻辑删除", notes = "传入ids") |
||||
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
||||
return R.status(inspectionStandardsService.deleteLogic(Func.toLongList(ids))); |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,18 @@ |
||||
package org.energy.modules.leger.dto; |
||||
|
||||
import org.energy.modules.leger.entity.InspectionStandards; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
|
||||
/** |
||||
* 检验标准一览数据传输对象实体类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-09 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
public class InspectionStandardsDTO extends InspectionStandards { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
} |
@ -0,0 +1,47 @@ |
||||
package org.energy.modules.leger.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.dayu.daf.core.mp.base.BaseEntity; |
||||
import java.io.Serializable; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
|
||||
/** |
||||
* 检验标准一览实体类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-09 |
||||
*/ |
||||
@Data |
||||
@TableName("l_inspection_standards") |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "InspectionStandards对象", description = "检验标准一览") |
||||
public class InspectionStandards extends BaseEntity { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 主键 |
||||
*/ |
||||
@ApiModelProperty(value = "主键") |
||||
private Long id; |
||||
/** |
||||
* 工器具编码 |
||||
*/ |
||||
@ApiModelProperty(value = "工器具编码") |
||||
private Long toolsCodeId; |
||||
/** |
||||
* 检验内容 |
||||
*/ |
||||
@ApiModelProperty(value = "检验内容") |
||||
private String inspectionContent; |
||||
/** |
||||
* 检验标准 |
||||
*/ |
||||
@ApiModelProperty(value = "检验标准") |
||||
private String inspectionStandards; |
||||
|
||||
|
||||
} |
@ -0,0 +1,26 @@ |
||||
package org.energy.modules.leger.mapper; |
||||
|
||||
import org.energy.modules.leger.entity.InspectionStandards; |
||||
import org.energy.modules.leger.vo.InspectionStandardsVO; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 检验标准一览 Mapper 接口 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-09 |
||||
*/ |
||||
public interface InspectionStandardsMapper extends BaseMapper<InspectionStandards> { |
||||
|
||||
/** |
||||
* 自定义分页 |
||||
* |
||||
* @param page |
||||
* @param inspectionStandards |
||||
* @return |
||||
*/ |
||||
List<InspectionStandardsVO> selectInspectionStandardsPage(IPage page, InspectionStandardsVO inspectionStandards); |
||||
|
||||
} |
@ -0,0 +1,24 @@ |
||||
<?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.energy.modules.leger.mapper.InspectionStandardsMapper"> |
||||
|
||||
<!-- 通用查询映射结果 --> |
||||
<resultMap id="inspectionStandardsResultMap" type="org.energy.modules.leger.entity.InspectionStandards"> |
||||
<id column="id" property="id"/> |
||||
<result column="status" property="status"/> |
||||
<result column="create_time" property="createTime"/> |
||||
<result column="create_user" property="createUser"/> |
||||
<result column="update_time" property="updateTime"/> |
||||
<result column="update_user" property="updateUser"/> |
||||
<result column="is_deleted" property="isDeleted"/> |
||||
<result column="tools_code_id" property="toolsCodeId"/> |
||||
<result column="inspection_content" property="inspectionContent"/> |
||||
<result column="inspection_standards" property="inspectionStandards"/> |
||||
</resultMap> |
||||
|
||||
|
||||
<select id="selectInspectionStandardsPage" resultMap="inspectionStandardsResultMap"> |
||||
select * from l_inspection_standards where is_deleted = 0 |
||||
</select> |
||||
|
||||
</mapper> |
@ -0,0 +1,25 @@ |
||||
package org.energy.modules.leger.service; |
||||
|
||||
import org.energy.modules.leger.entity.InspectionStandards; |
||||
import org.energy.modules.leger.vo.InspectionStandardsVO; |
||||
import com.dayu.daf.core.mp.base.BaseService; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
||||
/** |
||||
* 检验标准一览 服务类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-09 |
||||
*/ |
||||
public interface IInspectionStandardsService extends BaseService<InspectionStandards> { |
||||
|
||||
/** |
||||
* 自定义分页 |
||||
* |
||||
* @param page |
||||
* @param inspectionStandards |
||||
* @return |
||||
*/ |
||||
IPage<InspectionStandardsVO> selectInspectionStandardsPage(IPage<InspectionStandardsVO> page, InspectionStandardsVO inspectionStandards); |
||||
|
||||
} |
@ -0,0 +1,25 @@ |
||||
package org.energy.modules.leger.service.impl; |
||||
|
||||
import org.energy.modules.leger.entity.InspectionStandards; |
||||
import org.energy.modules.leger.vo.InspectionStandardsVO; |
||||
import org.energy.modules.leger.mapper.InspectionStandardsMapper; |
||||
import org.energy.modules.leger.service.IInspectionStandardsService; |
||||
import com.dayu.daf.core.mp.base.BaseServiceImpl; |
||||
import org.springframework.stereotype.Service; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
||||
/** |
||||
* 检验标准一览 服务实现类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-09 |
||||
*/ |
||||
@Service |
||||
public class InspectionStandardsServiceImpl extends BaseServiceImpl<InspectionStandardsMapper, InspectionStandards> implements IInspectionStandardsService { |
||||
|
||||
@Override |
||||
public IPage<InspectionStandardsVO> selectInspectionStandardsPage(IPage<InspectionStandardsVO> page, InspectionStandardsVO inspectionStandards) { |
||||
return page.setRecords(baseMapper.selectInspectionStandardsPage(page, inspectionStandards)); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,20 @@ |
||||
package org.energy.modules.leger.vo; |
||||
|
||||
import org.energy.modules.leger.entity.InspectionStandards; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import io.swagger.annotations.ApiModel; |
||||
|
||||
/** |
||||
* 检验标准一览视图实体类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-09 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "InspectionStandardsVO对象", description = "检验标准一览") |
||||
public class InspectionStandardsVO extends InspectionStandards { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
} |
Loading…
Reference in new issue