Files
klp-oa/klp-pocket/src/main/java/com/klp/pocket/controller/Klptcm1ProPlantStateCurrentController.java
Joshi d9580f4c5b feat(pocket): 新增工厂状态数据的CURD功能
- 为Klptcm1ProPlantStateCurrent实体增加完整的增删改查接口
- 实现按复合键(INSDATE+TYPE)查询、插入、更新和删除逻辑
- 在Mapper层添加对应的XML SQL映射支持
- 为Klptcm1ProPlantStateDefine增加ID查询、批量删除等功能
- 添加PlantStateWithValueVo视图对象及相关联查逻辑
- 提供根据名称获取带值的状态定义列表方法
- 控制器层新增RESTful API endpoints支持完整操作- 完善服务层实现并暴露统一的服务接口供调用
2025-10-29 11:53:42 +08:00

69 lines
2.2 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.klp.pocket.controller;
import com.klp.common.core.controller.BaseController;
import com.klp.common.core.domain.PageQuery;
import com.klp.common.core.domain.R;
import com.klp.common.core.page.TableDataInfo;
import com.klp.pocket.domain.Klptcm1ProPlantStateCurrent;
import com.klp.pocket.service.IKlptcm1ProPlantStateCurrentService;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
import java.util.Date;
import java.math.BigDecimal;
import org.springframework.format.annotation.DateTimeFormat;
@RestController
@RequestMapping("/pocket/proPlantStateCurrent")
public class Klptcm1ProPlantStateCurrentController extends BaseController {
@Resource
private IKlptcm1ProPlantStateCurrentService klptcm1ProPlantStateCurrentService;
/**
* 查询所有数据
*/
@GetMapping("/selectAll")
public TableDataInfo<Klptcm1ProPlantStateCurrent> selectAll(PageQuery pageQuery) {
return klptcm1ProPlantStateCurrentService.selectAll(pageQuery);
}
/**
* 查询单条(按 INSDATE + TYPE
*/
@GetMapping("/one")
public R<Klptcm1ProPlantStateCurrent> getOne(
@RequestParam("type") BigDecimal type,
@RequestParam("insdate") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date insdate) {
return R.ok(klptcm1ProPlantStateCurrentService.selectOne(insdate, type));
}
/**
* 新增一条 current 记录
*/
@PostMapping
public R<Void> add(@RequestBody Klptcm1ProPlantStateCurrent entity) {
return toAjax(klptcm1ProPlantStateCurrentService.insert(entity));
}
/**
* 修改一条 current 记录(依据 INSDATE + TYPE
*/
@PutMapping
public R<Void> edit(@RequestBody Klptcm1ProPlantStateCurrent entity) {
return toAjax(klptcm1ProPlantStateCurrentService.updateByKey(entity));
}
/**
* 删除一条 current 记录(按 INSDATE + TYPE
*/
@DeleteMapping
public R<Void> remove(
@RequestParam("type") BigDecimal type,
@RequestParam("insdate") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date insdate) {
return toAjax(klptcm1ProPlantStateCurrentService.deleteByKey(insdate, type));
}
}