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

@@ -4,9 +4,18 @@ import com.klp.common.core.domain.PageQuery;
import com.klp.common.core.page.TableDataInfo;
import com.klp.pocket.domain.Klptcm1ProPlantStateCurrent;
import java.util.List;
import java.util.Date;
import java.math.BigDecimal;
public interface IKlptcm1ProPlantStateCurrentService {
TableDataInfo<Klptcm1ProPlantStateCurrent> selectAll(PageQuery pageQuery);
Klptcm1ProPlantStateCurrent selectOne(Date insdate, BigDecimal type);
int insert(Klptcm1ProPlantStateCurrent entity);
int updateByKey(Klptcm1ProPlantStateCurrent entity);
int deleteByKey(Date insdate, BigDecimal type);
}

View File

@@ -3,7 +3,7 @@ package com.klp.pocket.service;
import com.klp.common.core.domain.PageQuery;
import com.klp.common.core.page.TableDataInfo;
import com.klp.pocket.domain.Klptcm1ProPlantStateDefine;
import com.klp.pocket.domain.vo.PlantStateWithValueVo;
import java.math.BigDecimal;
@@ -23,5 +23,13 @@ public interface IKlptcm1ProPlantStateDefineService {
*/
TableDataInfo<Klptcm1ProPlantStateDefine> getDefinePage(PageQuery pageQuery);
List<PlantStateWithValueVo> selectByValue(String name);
Klptcm1ProPlantStateDefine selectById(BigDecimal id);
int insert(Klptcm1ProPlantStateDefine entity);
int updateById(Klptcm1ProPlantStateDefine entity);
int deleteByIds(List<BigDecimal> ids);
}

View File

@@ -10,6 +10,8 @@ import com.klp.pocket.service.IKlptcm1ProPlantStateCurrentService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Date;
import java.math.BigDecimal;
@DS("slave")
@Service
@@ -18,11 +20,30 @@ public class Klptcm1ProPlantStateCurrentServiceImpl implements IKlptcm1ProPlantS
@Resource
private Klptcm1ProPlantStateCurrentMapper klptcm1ProPlantStateCurrentMapper;
@Override
public TableDataInfo<Klptcm1ProPlantStateCurrent> selectAll(PageQuery pageQuery) {
Page<Klptcm1ProPlantStateCurrent> result = klptcm1ProPlantStateCurrentMapper.selectAll(pageQuery.build());
return TableDataInfo.build(result);
}
@Override
public Klptcm1ProPlantStateCurrent selectOne(Date insdate, BigDecimal type) {
return klptcm1ProPlantStateCurrentMapper.selectOne(insdate, type);
}
@Override
public int insert(Klptcm1ProPlantStateCurrent entity) {
return klptcm1ProPlantStateCurrentMapper.insert(entity);
}
@Override
public int updateByKey(Klptcm1ProPlantStateCurrent entity) {
return klptcm1ProPlantStateCurrentMapper.updateByKey(entity);
}
@Override
public int deleteByKey(Date insdate, BigDecimal type) {
return klptcm1ProPlantStateCurrentMapper.deleteByKey(insdate, type);
}
}

View File

@@ -1,9 +1,11 @@
package com.klp.pocket.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.klp.common.core.domain.PageQuery;
import com.klp.common.core.page.TableDataInfo;
import com.klp.pocket.domain.Klptcm1ProPlantStateCurrent;
import com.klp.pocket.domain.Klptcm1ProPlantStateDefine;
import com.klp.pocket.domain.vo.PlantStateWithValueVo;
import com.klp.pocket.mapper.Klptcm1ProPlantStateDefineMapper;
import com.klp.pocket.service.IKlptcm1ProPlantStateDefineService;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -11,12 +13,14 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.Collections;
import java.util.List;
/**
* 工厂状态定义表Service实现类
* 具体业务逻辑实现依赖Mapper操作数据库
*/
@DS("slave")
@Service
public class Klptcm1ProPlantStateDefineServiceImpl implements IKlptcm1ProPlantStateDefineService {
@@ -33,4 +37,30 @@ public class Klptcm1ProPlantStateDefineServiceImpl implements IKlptcm1ProPlantSt
}
@Override
public List<PlantStateWithValueVo> selectByValue(String name) {
return defineMapper.selectByValue(name);
}
@Override
public Klptcm1ProPlantStateDefine selectById(BigDecimal id) {
return defineMapper.selectById(id);
}
@Override
public int insert(Klptcm1ProPlantStateDefine entity) {
return defineMapper.insert(entity);
}
@Override
public int updateById(Klptcm1ProPlantStateDefine entity) {
return defineMapper.updateById(entity);
}
@Override
public int deleteByIds(List<BigDecimal> ids) {
return defineMapper.deleteByIds(ids);
}
}