feat(pocket): 新增工厂状态数据的CURD功能

- 为Klptcm1ProPlantStateCurrent实体增加完整的增删改查接口
- 实现按复合键(INSDATE+TYPE)查询、插入、更新和删除逻辑
- 在Mapper层添加对应的XML SQL映射支持
- 为Klptcm1ProPlantStateDefine增加ID查询、批量删除等功能
- 添加PlantStateWithValueVo视图对象及相关联查逻辑
- 提供根据名称获取带值的状态定义列表方法
- 控制器层新增RESTful API endpoints支持完整操作- 完善服务层实现并暴露统一的服务接口供调用
This commit is contained in:
2025-10-29 11:53:42 +08:00
parent 22895d3513
commit d9580f4c5b
11 changed files with 728 additions and 2 deletions

View File

@@ -9,6 +9,9 @@ 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")
@@ -26,4 +29,40 @@ public class Klptcm1ProPlantStateCurrentController extends BaseController {
}
/**
* 查询单条(按 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));
}
}