2025-10-27 15:07:54 +08:00
|
|
|
|
package com.klp.pocket.controller;
|
|
|
|
|
|
|
2025-10-27 18:07:12 +08:00
|
|
|
|
import com.klp.common.core.controller.BaseController;
|
|
|
|
|
|
import com.klp.common.core.domain.PageQuery;
|
2025-10-27 15:07:54 +08:00
|
|
|
|
import com.klp.common.core.domain.R;
|
2025-10-27 18:07:12 +08:00
|
|
|
|
import com.klp.common.core.page.TableDataInfo;
|
2025-10-27 17:23:52 +08:00
|
|
|
|
import com.klp.pocket.domain.Klptcm1ProPlantStateCurrent;
|
2025-10-27 15:07:54 +08:00
|
|
|
|
import com.klp.pocket.service.IKlptcm1ProPlantStateCurrentService;
|
2025-10-27 17:23:52 +08:00
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
import java.util.List;
|
2025-10-29 11:53:42 +08:00
|
|
|
|
import java.util.Date;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
|
import org.springframework.format.annotation.DateTimeFormat;
|
2025-10-27 15:07:54 +08:00
|
|
|
|
|
|
|
|
|
|
@RestController
|
2025-10-27 18:07:12 +08:00
|
|
|
|
@RequestMapping("/pocket/proPlantStateCurrent")
|
|
|
|
|
|
public class Klptcm1ProPlantStateCurrentController extends BaseController {
|
2025-10-27 15:07:54 +08:00
|
|
|
|
|
2025-10-27 17:23:52 +08:00
|
|
|
|
@Resource
|
|
|
|
|
|
private IKlptcm1ProPlantStateCurrentService klptcm1ProPlantStateCurrentService;
|
2025-10-27 15:07:54 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
2025-10-27 17:23:52 +08:00
|
|
|
|
* 查询所有数据
|
2025-10-27 15:07:54 +08:00
|
|
|
|
*/
|
2025-10-27 17:23:52 +08:00
|
|
|
|
@GetMapping("/selectAll")
|
2025-10-27 18:07:12 +08:00
|
|
|
|
public TableDataInfo<Klptcm1ProPlantStateCurrent> selectAll(PageQuery pageQuery) {
|
|
|
|
|
|
return klptcm1ProPlantStateCurrentService.selectAll(pageQuery);
|
|
|
|
|
|
|
2025-10-27 15:07:54 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-10-29 11:53:42 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 查询单条(按 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));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-10-27 15:07:54 +08:00
|
|
|
|
}
|