feat(pocket): 新增模块
- 创建当前状态实体类Klptcm1ProPlantStateCurrent- 创建当前状态业务对象Klptcm1ProPlantStateCurrentBo - 创建当前状态值对象Klptcm1ProPlantStateCurrentVo - 实现当前状态Service接口及实现类 - 实现当前状态Controller接口- 实现当前状态Mapper接口及XML映射文件 - 提供当前状态的增删改查及分页查询功能 - 支持当前状态数据导出Excel功能- 添加字段校验和重复提交注解 - 配置MyBatis Plus自动映射99个VALUE字段
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
package com.klp.pocket.service;
|
||||
|
||||
import com.klp.pocket.domain.Klptcm1ProPlantStateCurrent;
|
||||
import com.klp.pocket.domain.vo.Klptcm1ProPlantStateCurrentVo;
|
||||
import com.klp.pocket.domain.bo.Klptcm1ProPlantStateCurrentBo;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 当前Service接口
|
||||
*
|
||||
* @author klp
|
||||
* @date 2025-10-27
|
||||
*/
|
||||
public interface IKlptcm1ProPlantStateCurrentService {
|
||||
|
||||
/**
|
||||
* 查询当前
|
||||
*/
|
||||
Klptcm1ProPlantStateCurrentVo queryById(Date INSDATE);
|
||||
|
||||
/**
|
||||
* 查询当前列表
|
||||
*/
|
||||
TableDataInfo<Klptcm1ProPlantStateCurrentVo> queryPageList(Klptcm1ProPlantStateCurrentBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询当前列表
|
||||
*/
|
||||
List<Klptcm1ProPlantStateCurrentVo> queryList(Klptcm1ProPlantStateCurrentBo bo);
|
||||
|
||||
/**
|
||||
* 新增当前
|
||||
*/
|
||||
Boolean insertByBo(Klptcm1ProPlantStateCurrentBo bo);
|
||||
|
||||
/**
|
||||
* 修改当前
|
||||
*/
|
||||
Boolean updateByBo(Klptcm1ProPlantStateCurrentBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除当前信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Date> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,213 @@
|
||||
package com.klp.pocket.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.klp.pocket.domain.bo.Klptcm1ProPlantStateCurrentBo;
|
||||
import com.klp.pocket.domain.vo.Klptcm1ProPlantStateCurrentVo;
|
||||
import com.klp.pocket.domain.Klptcm1ProPlantStateCurrent;
|
||||
import com.klp.pocket.mapper.Klptcm1ProPlantStateCurrentMapper;
|
||||
import com.klp.pocket.service.IKlptcm1ProPlantStateCurrentService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 当前Service业务层处理
|
||||
*
|
||||
* @author klp
|
||||
* @date 2025-10-27
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class Klptcm1ProPlantStateCurrentServiceImpl implements IKlptcm1ProPlantStateCurrentService {
|
||||
|
||||
private final Klptcm1ProPlantStateCurrentMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询当前
|
||||
*/
|
||||
@Override
|
||||
public Klptcm1ProPlantStateCurrentVo queryById(Date INSDATE){
|
||||
return baseMapper.selectVoById(INSDATE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当前列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<Klptcm1ProPlantStateCurrentVo> queryPageList(Klptcm1ProPlantStateCurrentBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<Klptcm1ProPlantStateCurrent> lqw = buildQueryWrapper(bo);
|
||||
Page<Klptcm1ProPlantStateCurrentVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当前列表
|
||||
*/
|
||||
@Override
|
||||
public List<Klptcm1ProPlantStateCurrentVo> queryList(Klptcm1ProPlantStateCurrentBo bo) {
|
||||
LambdaQueryWrapper<Klptcm1ProPlantStateCurrent> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<Klptcm1ProPlantStateCurrent> buildQueryWrapper(Klptcm1ProPlantStateCurrentBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<Klptcm1ProPlantStateCurrent> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getINSDATE() != null, Klptcm1ProPlantStateCurrent::getINSDATE, bo.getINSDATE());
|
||||
lqw.eq(bo.getYEAR() != null, Klptcm1ProPlantStateCurrent::getYEAR, bo.getYEAR());
|
||||
lqw.eq(bo.getMONTH() != null, Klptcm1ProPlantStateCurrent::getMONTH, bo.getMONTH());
|
||||
lqw.eq(bo.getDAY() != null, Klptcm1ProPlantStateCurrent::getDAY, bo.getDAY());
|
||||
lqw.eq(bo.getHOUR() != null, Klptcm1ProPlantStateCurrent::getHOUR, bo.getHOUR());
|
||||
lqw.eq(bo.getMINUTE() != null, Klptcm1ProPlantStateCurrent::getMINUTE, bo.getMINUTE());
|
||||
lqw.eq(bo.getTYPE() != null, Klptcm1ProPlantStateCurrent::getTYPE, bo.getTYPE());
|
||||
lqw.eq(bo.getVALUE1() != null, Klptcm1ProPlantStateCurrent::getVALUE1, bo.getVALUE1());
|
||||
lqw.eq(bo.getVALUE2() != null, Klptcm1ProPlantStateCurrent::getVALUE2, bo.getVALUE2());
|
||||
lqw.eq(bo.getVALUE3() != null, Klptcm1ProPlantStateCurrent::getVALUE3, bo.getVALUE3());
|
||||
lqw.eq(bo.getVALUE4() != null, Klptcm1ProPlantStateCurrent::getVALUE4, bo.getVALUE4());
|
||||
lqw.eq(bo.getVALUE5() != null, Klptcm1ProPlantStateCurrent::getVALUE5, bo.getVALUE5());
|
||||
lqw.eq(bo.getVALUE6() != null, Klptcm1ProPlantStateCurrent::getVALUE6, bo.getVALUE6());
|
||||
lqw.eq(bo.getVALUE7() != null, Klptcm1ProPlantStateCurrent::getVALUE7, bo.getVALUE7());
|
||||
lqw.eq(bo.getVALUE8() != null, Klptcm1ProPlantStateCurrent::getVALUE8, bo.getVALUE8());
|
||||
lqw.eq(bo.getVALUE9() != null, Klptcm1ProPlantStateCurrent::getVALUE9, bo.getVALUE9());
|
||||
lqw.eq(bo.getVALUE10() != null, Klptcm1ProPlantStateCurrent::getVALUE10, bo.getVALUE10());
|
||||
lqw.eq(bo.getVALUE11() != null, Klptcm1ProPlantStateCurrent::getVALUE11, bo.getVALUE11());
|
||||
lqw.eq(bo.getVALUE12() != null, Klptcm1ProPlantStateCurrent::getVALUE12, bo.getVALUE12());
|
||||
lqw.eq(bo.getVALUE13() != null, Klptcm1ProPlantStateCurrent::getVALUE13, bo.getVALUE13());
|
||||
lqw.eq(bo.getVALUE14() != null, Klptcm1ProPlantStateCurrent::getVALUE14, bo.getVALUE14());
|
||||
lqw.eq(bo.getVALUE15() != null, Klptcm1ProPlantStateCurrent::getVALUE15, bo.getVALUE15());
|
||||
lqw.eq(bo.getVALUE16() != null, Klptcm1ProPlantStateCurrent::getVALUE16, bo.getVALUE16());
|
||||
lqw.eq(bo.getVALUE17() != null, Klptcm1ProPlantStateCurrent::getVALUE17, bo.getVALUE17());
|
||||
lqw.eq(bo.getVALUE18() != null, Klptcm1ProPlantStateCurrent::getVALUE18, bo.getVALUE18());
|
||||
lqw.eq(bo.getVALUE19() != null, Klptcm1ProPlantStateCurrent::getVALUE19, bo.getVALUE19());
|
||||
lqw.eq(bo.getVALUE20() != null, Klptcm1ProPlantStateCurrent::getVALUE20, bo.getVALUE20());
|
||||
lqw.eq(bo.getVALUE21() != null, Klptcm1ProPlantStateCurrent::getVALUE21, bo.getVALUE21());
|
||||
lqw.eq(bo.getVALUE22() != null, Klptcm1ProPlantStateCurrent::getVALUE22, bo.getVALUE22());
|
||||
lqw.eq(bo.getVALUE23() != null, Klptcm1ProPlantStateCurrent::getVALUE23, bo.getVALUE23());
|
||||
lqw.eq(bo.getVALUE24() != null, Klptcm1ProPlantStateCurrent::getVALUE24, bo.getVALUE24());
|
||||
lqw.eq(bo.getVALUE25() != null, Klptcm1ProPlantStateCurrent::getVALUE25, bo.getVALUE25());
|
||||
lqw.eq(bo.getVALUE26() != null, Klptcm1ProPlantStateCurrent::getVALUE26, bo.getVALUE26());
|
||||
lqw.eq(bo.getVALUE27() != null, Klptcm1ProPlantStateCurrent::getVALUE27, bo.getVALUE27());
|
||||
lqw.eq(bo.getVALUE28() != null, Klptcm1ProPlantStateCurrent::getVALUE28, bo.getVALUE28());
|
||||
lqw.eq(bo.getVALUE29() != null, Klptcm1ProPlantStateCurrent::getVALUE29, bo.getVALUE29());
|
||||
lqw.eq(bo.getVALUE30() != null, Klptcm1ProPlantStateCurrent::getVALUE30, bo.getVALUE30());
|
||||
lqw.eq(bo.getVALUE31() != null, Klptcm1ProPlantStateCurrent::getVALUE31, bo.getVALUE31());
|
||||
lqw.eq(bo.getVALUE32() != null, Klptcm1ProPlantStateCurrent::getVALUE32, bo.getVALUE32());
|
||||
lqw.eq(bo.getVALUE33() != null, Klptcm1ProPlantStateCurrent::getVALUE33, bo.getVALUE33());
|
||||
lqw.eq(bo.getVALUE34() != null, Klptcm1ProPlantStateCurrent::getVALUE34, bo.getVALUE34());
|
||||
lqw.eq(bo.getVALUE35() != null, Klptcm1ProPlantStateCurrent::getVALUE35, bo.getVALUE35());
|
||||
lqw.eq(bo.getVALUE36() != null, Klptcm1ProPlantStateCurrent::getVALUE36, bo.getVALUE36());
|
||||
lqw.eq(bo.getVALUE37() != null, Klptcm1ProPlantStateCurrent::getVALUE37, bo.getVALUE37());
|
||||
lqw.eq(bo.getVALUE38() != null, Klptcm1ProPlantStateCurrent::getVALUE38, bo.getVALUE38());
|
||||
lqw.eq(bo.getVALUE39() != null, Klptcm1ProPlantStateCurrent::getVALUE39, bo.getVALUE39());
|
||||
lqw.eq(bo.getVALUE40() != null, Klptcm1ProPlantStateCurrent::getVALUE40, bo.getVALUE40());
|
||||
lqw.eq(bo.getVALUE41() != null, Klptcm1ProPlantStateCurrent::getVALUE41, bo.getVALUE41());
|
||||
lqw.eq(bo.getVALUE42() != null, Klptcm1ProPlantStateCurrent::getVALUE42, bo.getVALUE42());
|
||||
lqw.eq(bo.getVALUE43() != null, Klptcm1ProPlantStateCurrent::getVALUE43, bo.getVALUE43());
|
||||
lqw.eq(bo.getVALUE44() != null, Klptcm1ProPlantStateCurrent::getVALUE44, bo.getVALUE44());
|
||||
lqw.eq(bo.getVALUE45() != null, Klptcm1ProPlantStateCurrent::getVALUE45, bo.getVALUE45());
|
||||
lqw.eq(bo.getVALUE46() != null, Klptcm1ProPlantStateCurrent::getVALUE46, bo.getVALUE46());
|
||||
lqw.eq(bo.getVALUE47() != null, Klptcm1ProPlantStateCurrent::getVALUE47, bo.getVALUE47());
|
||||
lqw.eq(bo.getVALUE48() != null, Klptcm1ProPlantStateCurrent::getVALUE48, bo.getVALUE48());
|
||||
lqw.eq(bo.getVALUE49() != null, Klptcm1ProPlantStateCurrent::getVALUE49, bo.getVALUE49());
|
||||
lqw.eq(bo.getVALUE50() != null, Klptcm1ProPlantStateCurrent::getVALUE50, bo.getVALUE50());
|
||||
lqw.eq(bo.getVALUE51() != null, Klptcm1ProPlantStateCurrent::getVALUE51, bo.getVALUE51());
|
||||
lqw.eq(bo.getVALUE52() != null, Klptcm1ProPlantStateCurrent::getVALUE52, bo.getVALUE52());
|
||||
lqw.eq(bo.getVALUE53() != null, Klptcm1ProPlantStateCurrent::getVALUE53, bo.getVALUE53());
|
||||
lqw.eq(bo.getVALUE54() != null, Klptcm1ProPlantStateCurrent::getVALUE54, bo.getVALUE54());
|
||||
lqw.eq(bo.getVALUE55() != null, Klptcm1ProPlantStateCurrent::getVALUE55, bo.getVALUE55());
|
||||
lqw.eq(bo.getVALUE56() != null, Klptcm1ProPlantStateCurrent::getVALUE56, bo.getVALUE56());
|
||||
lqw.eq(bo.getVALUE57() != null, Klptcm1ProPlantStateCurrent::getVALUE57, bo.getVALUE57());
|
||||
lqw.eq(bo.getVALUE58() != null, Klptcm1ProPlantStateCurrent::getVALUE58, bo.getVALUE58());
|
||||
lqw.eq(bo.getVALUE59() != null, Klptcm1ProPlantStateCurrent::getVALUE59, bo.getVALUE59());
|
||||
lqw.eq(bo.getVALUE60() != null, Klptcm1ProPlantStateCurrent::getVALUE60, bo.getVALUE60());
|
||||
lqw.eq(bo.getVALUE61() != null, Klptcm1ProPlantStateCurrent::getVALUE61, bo.getVALUE61());
|
||||
lqw.eq(bo.getVALUE62() != null, Klptcm1ProPlantStateCurrent::getVALUE62, bo.getVALUE62());
|
||||
lqw.eq(bo.getVALUE63() != null, Klptcm1ProPlantStateCurrent::getVALUE63, bo.getVALUE63());
|
||||
lqw.eq(bo.getVALUE64() != null, Klptcm1ProPlantStateCurrent::getVALUE64, bo.getVALUE64());
|
||||
lqw.eq(bo.getVALUE65() != null, Klptcm1ProPlantStateCurrent::getVALUE65, bo.getVALUE65());
|
||||
lqw.eq(bo.getVALUE66() != null, Klptcm1ProPlantStateCurrent::getVALUE66, bo.getVALUE66());
|
||||
lqw.eq(bo.getVALUE67() != null, Klptcm1ProPlantStateCurrent::getVALUE67, bo.getVALUE67());
|
||||
lqw.eq(bo.getVALUE68() != null, Klptcm1ProPlantStateCurrent::getVALUE68, bo.getVALUE68());
|
||||
lqw.eq(bo.getVALUE69() != null, Klptcm1ProPlantStateCurrent::getVALUE69, bo.getVALUE69());
|
||||
lqw.eq(bo.getVALUE70() != null, Klptcm1ProPlantStateCurrent::getVALUE70, bo.getVALUE70());
|
||||
lqw.eq(bo.getVALUE71() != null, Klptcm1ProPlantStateCurrent::getVALUE71, bo.getVALUE71());
|
||||
lqw.eq(bo.getVALUE72() != null, Klptcm1ProPlantStateCurrent::getVALUE72, bo.getVALUE72());
|
||||
lqw.eq(bo.getVALUE73() != null, Klptcm1ProPlantStateCurrent::getVALUE73, bo.getVALUE73());
|
||||
lqw.eq(bo.getVALUE74() != null, Klptcm1ProPlantStateCurrent::getVALUE74, bo.getVALUE74());
|
||||
lqw.eq(bo.getVALUE75() != null, Klptcm1ProPlantStateCurrent::getVALUE75, bo.getVALUE75());
|
||||
lqw.eq(bo.getVALUE76() != null, Klptcm1ProPlantStateCurrent::getVALUE76, bo.getVALUE76());
|
||||
lqw.eq(bo.getVALUE77() != null, Klptcm1ProPlantStateCurrent::getVALUE77, bo.getVALUE77());
|
||||
lqw.eq(bo.getVALUE78() != null, Klptcm1ProPlantStateCurrent::getVALUE78, bo.getVALUE78());
|
||||
lqw.eq(bo.getVALUE79() != null, Klptcm1ProPlantStateCurrent::getVALUE79, bo.getVALUE79());
|
||||
lqw.eq(bo.getVALUE80() != null, Klptcm1ProPlantStateCurrent::getVALUE80, bo.getVALUE80());
|
||||
lqw.eq(bo.getVALUE81() != null, Klptcm1ProPlantStateCurrent::getVALUE81, bo.getVALUE81());
|
||||
lqw.eq(bo.getVALUE82() != null, Klptcm1ProPlantStateCurrent::getVALUE82, bo.getVALUE82());
|
||||
lqw.eq(bo.getVALUE83() != null, Klptcm1ProPlantStateCurrent::getVALUE83, bo.getVALUE83());
|
||||
lqw.eq(bo.getVALUE84() != null, Klptcm1ProPlantStateCurrent::getVALUE84, bo.getVALUE84());
|
||||
lqw.eq(bo.getVALUE85() != null, Klptcm1ProPlantStateCurrent::getVALUE85, bo.getVALUE85());
|
||||
lqw.eq(bo.getVALUE86() != null, Klptcm1ProPlantStateCurrent::getVALUE86, bo.getVALUE86());
|
||||
lqw.eq(bo.getVALUE87() != null, Klptcm1ProPlantStateCurrent::getVALUE87, bo.getVALUE87());
|
||||
lqw.eq(bo.getVALUE88() != null, Klptcm1ProPlantStateCurrent::getVALUE88, bo.getVALUE88());
|
||||
lqw.eq(bo.getVALUE89() != null, Klptcm1ProPlantStateCurrent::getVALUE89, bo.getVALUE89());
|
||||
lqw.eq(bo.getVALUE90() != null, Klptcm1ProPlantStateCurrent::getVALUE90, bo.getVALUE90());
|
||||
lqw.eq(bo.getVALUE91() != null, Klptcm1ProPlantStateCurrent::getVALUE91, bo.getVALUE91());
|
||||
lqw.eq(bo.getVALUE92() != null, Klptcm1ProPlantStateCurrent::getVALUE92, bo.getVALUE92());
|
||||
lqw.eq(bo.getVALUE93() != null, Klptcm1ProPlantStateCurrent::getVALUE93, bo.getVALUE93());
|
||||
lqw.eq(bo.getVALUE94() != null, Klptcm1ProPlantStateCurrent::getVALUE94, bo.getVALUE94());
|
||||
lqw.eq(bo.getVALUE95() != null, Klptcm1ProPlantStateCurrent::getVALUE95, bo.getVALUE95());
|
||||
lqw.eq(bo.getVALUE96() != null, Klptcm1ProPlantStateCurrent::getVALUE96, bo.getVALUE96());
|
||||
lqw.eq(bo.getVALUE97() != null, Klptcm1ProPlantStateCurrent::getVALUE97, bo.getVALUE97());
|
||||
lqw.eq(bo.getVALUE98() != null, Klptcm1ProPlantStateCurrent::getVALUE98, bo.getVALUE98());
|
||||
lqw.eq(bo.getVALUE99() != null, Klptcm1ProPlantStateCurrent::getVALUE99, bo.getVALUE99());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增当前
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(Klptcm1ProPlantStateCurrentBo bo) {
|
||||
Klptcm1ProPlantStateCurrent add = BeanUtil.toBean(bo, Klptcm1ProPlantStateCurrent.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setINSDATE(add.getINSDATE());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改当前
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(Klptcm1ProPlantStateCurrentBo bo) {
|
||||
Klptcm1ProPlantStateCurrent update = BeanUtil.toBean(bo, Klptcm1ProPlantStateCurrent.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(Klptcm1ProPlantStateCurrent entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除当前
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Date> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user