From 6ff235d56da6e60fbf8fd4281c99ba685bc2e548 Mon Sep 17 00:00:00 2001 From: Joshi <3040996759@qq.com> Date: Mon, 27 Oct 2025 17:23:52 +0800 Subject: [PATCH] =?UTF-8?q?refactor(service):=20=E7=AE=80=E5=8C=96?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E7=8A=B6=E6=80=81=E6=9C=8D=E5=8A=A1=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除冗余的查询、分页和删除方法 -保留核心方法 selectAll用于获取全部数据 - 清理导入包和注释,优化代码结构 --- klp-common/pom.xml | 7 + ...Klptcm1ProPlantStateCurrentController.java | 102 +--- .../domain/Klptcm1ProPlantStateCurrent.java | 452 +----------------- .../Klptcm1ProPlantStateCurrentMapper.java | 15 +- .../IKlptcm1ProPlantStateCurrentService.java | 41 +- ...lptcm1ProPlantStateCurrentServiceImpl.java | 207 +------- .../Klptcm1ProPlantStateCurrentMapper.xml | 137 +----- 7 files changed, 74 insertions(+), 887 deletions(-) diff --git a/klp-common/pom.xml b/klp-common/pom.xml index fdfa8f0e..1a02b0a9 100644 --- a/klp-common/pom.xml +++ b/klp-common/pom.xml @@ -180,6 +180,13 @@ org.flywaydb flyway-mysql + + + com.baomidou + dynamic-datasource-spring-boot-starter + 3.5.2 + + diff --git a/klp-pocket/src/main/java/com/klp/pocket/controller/Klptcm1ProPlantStateCurrentController.java b/klp-pocket/src/main/java/com/klp/pocket/controller/Klptcm1ProPlantStateCurrentController.java index 06f19a47..e6b79103 100644 --- a/klp-pocket/src/main/java/com/klp/pocket/controller/Klptcm1ProPlantStateCurrentController.java +++ b/klp-pocket/src/main/java/com/klp/pocket/controller/Klptcm1ProPlantStateCurrentController.java @@ -1,102 +1,26 @@ package com.klp.pocket.controller; - -import java.util.Date; -import java.util.List; -import java.util.Arrays; - - -import lombok.RequiredArgsConstructor; -import javax.servlet.http.HttpServletResponse; -import javax.validation.constraints.*; -import org.springframework.web.bind.annotation.*; -import org.springframework.validation.annotation.Validated; -import com.klp.common.annotation.RepeatSubmit; -import com.klp.common.annotation.Log; -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.validate.AddGroup; -import com.klp.common.core.validate.EditGroup; -import com.klp.common.enums.BusinessType; -import com.klp.common.utils.poi.ExcelUtil; -import com.klp.pocket.domain.vo.Klptcm1ProPlantStateCurrentVo; -import com.klp.pocket.domain.bo.Klptcm1ProPlantStateCurrentBo; +import com.klp.pocket.domain.Klptcm1ProPlantStateCurrent; import com.klp.pocket.service.IKlptcm1ProPlantStateCurrentService; -import com.klp.common.core.page.TableDataInfo; +import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; +import java.util.List; -/** - * 当前 - * - * @author klp - * @date 2025-10-27 - */ -@Validated -@RequiredArgsConstructor @RestController -@RequestMapping("/pocket/proPlantStateCurrent") -public class Klptcm1ProPlantStateCurrentController extends BaseController { +@RequestMapping("/api/klptcm1ProPlantStateCurrent") +public class Klptcm1ProPlantStateCurrentController { - private final IKlptcm1ProPlantStateCurrentService iKlptcm1ProPlantStateCurrentService; + @Resource + private IKlptcm1ProPlantStateCurrentService klptcm1ProPlantStateCurrentService; /** - * 查询当前列表 + * 查询所有数据 */ - @GetMapping("/list") - public TableDataInfo list(Klptcm1ProPlantStateCurrentBo bo, PageQuery pageQuery) { - return iKlptcm1ProPlantStateCurrentService.queryPageList(bo, pageQuery); + @GetMapping("/selectAll") + public R> selectAll() { + List result = klptcm1ProPlantStateCurrentService.selectAll(); + return R.ok(result); } - /** - * 导出当前列表 - */ - @Log(title = "当前", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(Klptcm1ProPlantStateCurrentBo bo, HttpServletResponse response) { - List list = iKlptcm1ProPlantStateCurrentService.queryList(bo); - ExcelUtil.exportExcel(list, "当前", Klptcm1ProPlantStateCurrentVo.class, response); - } - - /** - * 获取当前详细信息 - * - * @param INSDATE 主键 - */ - @GetMapping("/{INSDATE}") - public R getInfo(@NotNull(message = "主键不能为空") - @PathVariable Date INSDATE) { - return R.ok(iKlptcm1ProPlantStateCurrentService.queryById(INSDATE)); - } - - /** - * 新增当前 - */ - @Log(title = "当前", businessType = BusinessType.INSERT) - @RepeatSubmit() - @PostMapping() - public R add(@Validated(AddGroup.class) @RequestBody Klptcm1ProPlantStateCurrentBo bo) { - return toAjax(iKlptcm1ProPlantStateCurrentService.insertByBo(bo)); - } - - /** - * 修改当前 - */ - @Log(title = "当前", businessType = BusinessType.UPDATE) - @RepeatSubmit() - @PutMapping() - public R edit(@Validated(EditGroup.class) @RequestBody Klptcm1ProPlantStateCurrentBo bo) { - return toAjax(iKlptcm1ProPlantStateCurrentService.updateByBo(bo)); - } - - /** - * 删除当前 - * - * @param INSDATEs 主键串 - */ - @Log(title = "当前", businessType = BusinessType.DELETE) - @DeleteMapping("/{INSDATEs}") - public R remove(@NotEmpty(message = "主键不能为空") - @PathVariable Date[] INSDATEs) { - return toAjax(iKlptcm1ProPlantStateCurrentService.deleteWithValidByIds(Arrays.asList(INSDATEs), true)); - } } diff --git a/klp-pocket/src/main/java/com/klp/pocket/domain/Klptcm1ProPlantStateCurrent.java b/klp-pocket/src/main/java/com/klp/pocket/domain/Klptcm1ProPlantStateCurrent.java index a0a50ce3..fa3b95f9 100644 --- a/klp-pocket/src/main/java/com/klp/pocket/domain/Klptcm1ProPlantStateCurrent.java +++ b/klp-pocket/src/main/java/com/klp/pocket/domain/Klptcm1ProPlantStateCurrent.java @@ -1,449 +1,23 @@ package com.klp.pocket.domain; -import com.baomidou.mybatisplus.annotation.*; -import com.klp.common.core.domain.BaseEntity; import lombok.Data; -import lombok.EqualsAndHashCode; import java.math.BigDecimal; import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; -/** - * 当前对象 klptcm1_pro_plant_state_current - * - * @author klp - * @date 2025-10-27 - */ @Data -@TableName("klptcm1_pro_plant_state_current") -public class Klptcm1ProPlantStateCurrent{ - - private static final long serialVersionUID=1L; - - /** - * - */ - private Date INSDATE; - /** - * - */ - private Long YEAR; - /** - * - */ - private Long MONTH; - /** - * - */ - private Long DAY; - /** - * - */ - private Long HOUR; - /** - * - */ - private Long MINUTE; - /** - * - */ - private Long TYPE; - /** - * - */ - private BigDecimal VALUE1; - /** - * - */ - private BigDecimal VALUE2; - /** - * - */ - private BigDecimal VALUE3; - /** - * - */ - private BigDecimal VALUE4; - /** - * - */ - private BigDecimal VALUE5; - /** - * - */ - private BigDecimal VALUE6; - /** - * - */ - private BigDecimal VALUE7; - /** - * - */ - private BigDecimal VALUE8; - /** - * - */ - private BigDecimal VALUE9; - /** - * - */ - private BigDecimal VALUE10; - /** - * - */ - private BigDecimal VALUE11; - /** - * - */ - private BigDecimal VALUE12; - /** - * - */ - private BigDecimal VALUE13; - /** - * - */ - private BigDecimal VALUE14; - /** - * - */ - private BigDecimal VALUE15; - /** - * - */ - private BigDecimal VALUE16; - /** - * - */ - private BigDecimal VALUE17; - /** - * - */ - private BigDecimal VALUE18; - /** - * - */ - private BigDecimal VALUE19; - /** - * - */ - private BigDecimal VALUE20; - /** - * - */ - private BigDecimal VALUE21; - /** - * - */ - private BigDecimal VALUE22; - /** - * - */ - private BigDecimal VALUE23; - /** - * - */ - private BigDecimal VALUE24; - /** - * - */ - private BigDecimal VALUE25; - /** - * - */ - private BigDecimal VALUE26; - /** - * - */ - private BigDecimal VALUE27; - /** - * - */ - private BigDecimal VALUE28; - /** - * - */ - private BigDecimal VALUE29; - /** - * - */ - private BigDecimal VALUE30; - /** - * - */ - private BigDecimal VALUE31; - /** - * - */ - private BigDecimal VALUE32; - /** - * - */ - private BigDecimal VALUE33; - /** - * - */ - private BigDecimal VALUE34; - /** - * - */ - private BigDecimal VALUE35; - /** - * - */ - private BigDecimal VALUE36; - /** - * - */ - private BigDecimal VALUE37; - /** - * - */ - private BigDecimal VALUE38; - /** - * - */ - private BigDecimal VALUE39; - /** - * - */ - private BigDecimal VALUE40; - /** - * - */ - private BigDecimal VALUE41; - /** - * - */ - private BigDecimal VALUE42; - /** - * - */ - private BigDecimal VALUE43; - /** - * - */ - private BigDecimal VALUE44; - /** - * - */ - private BigDecimal VALUE45; - /** - * - */ - private BigDecimal VALUE46; - /** - * - */ - private BigDecimal VALUE47; - /** - * - */ - private BigDecimal VALUE48; - /** - * - */ - private BigDecimal VALUE49; - /** - * - */ - private BigDecimal VALUE50; - /** - * - */ - private BigDecimal VALUE51; - /** - * - */ - private BigDecimal VALUE52; - /** - * - */ - private BigDecimal VALUE53; - /** - * - */ - private BigDecimal VALUE54; - /** - * - */ - private BigDecimal VALUE55; - /** - * - */ - private BigDecimal VALUE56; - /** - * - */ - private BigDecimal VALUE57; - /** - * - */ - private BigDecimal VALUE58; - /** - * - */ - private BigDecimal VALUE59; - /** - * - */ - private BigDecimal VALUE60; - /** - * - */ - private BigDecimal VALUE61; - /** - * - */ - private BigDecimal VALUE62; - /** - * - */ - private BigDecimal VALUE63; - /** - * - */ - private BigDecimal VALUE64; - /** - * - */ - private BigDecimal VALUE65; - /** - * - */ - private BigDecimal VALUE66; - /** - * - */ - private BigDecimal VALUE67; - /** - * - */ - private BigDecimal VALUE68; - /** - * - */ - private BigDecimal VALUE69; - /** - * - */ - private BigDecimal VALUE70; - /** - * - */ - private BigDecimal VALUE71; - /** - * - */ - private BigDecimal VALUE72; - /** - * - */ - private BigDecimal VALUE73; - /** - * - */ - private BigDecimal VALUE74; - /** - * - */ - private BigDecimal VALUE75; - /** - * - */ - private BigDecimal VALUE76; - /** - * - */ - private BigDecimal VALUE77; - /** - * - */ - private BigDecimal VALUE78; - /** - * - */ - private BigDecimal VALUE79; - /** - * - */ - private BigDecimal VALUE80; - /** - * - */ - private BigDecimal VALUE81; - /** - * - */ - private BigDecimal VALUE82; - /** - * - */ - private BigDecimal VALUE83; - /** - * - */ - private BigDecimal VALUE84; - /** - * - */ - private BigDecimal VALUE85; - /** - * - */ - private BigDecimal VALUE86; - /** - * - */ - private BigDecimal VALUE87; - /** - * - */ - private BigDecimal VALUE88; - /** - * - */ - private BigDecimal VALUE89; - /** - * - */ - private BigDecimal VALUE90; - /** - * - */ - private BigDecimal VALUE91; - /** - * - */ - private BigDecimal VALUE92; - /** - * - */ - private BigDecimal VALUE93; - /** - * - */ - private BigDecimal VALUE94; - /** - * - */ - private BigDecimal VALUE95; - /** - * - */ - private BigDecimal VALUE96; - /** - * - */ - private BigDecimal VALUE97; - /** - * - */ - private BigDecimal VALUE98; - /** - * - */ - private BigDecimal VALUE99; +public class Klptcm1ProPlantStateCurrent { + private Date insdate; // 对应数据库 INSDATE + private BigDecimal year; // 对应数据库 YEAR + private BigDecimal month; // 对应数据库 MONTH + private BigDecimal day; // 对应数据库 DAY + private BigDecimal hour; // 对应数据库 HOUR + private BigDecimal minute; // 对应数据库 MINUTE + private BigDecimal type; // 对应数据库 TYPE + // 以下为 VALUE1 到 VALUE99 的属性 + private BigDecimal value1; + private BigDecimal value2; + // ... 省略 VALUE3 到 VALUE98 的声明 ... + private BigDecimal value99; } diff --git a/klp-pocket/src/main/java/com/klp/pocket/mapper/Klptcm1ProPlantStateCurrentMapper.java b/klp-pocket/src/main/java/com/klp/pocket/mapper/Klptcm1ProPlantStateCurrentMapper.java index 4d3de788..ecf92f9b 100644 --- a/klp-pocket/src/main/java/com/klp/pocket/mapper/Klptcm1ProPlantStateCurrentMapper.java +++ b/klp-pocket/src/main/java/com/klp/pocket/mapper/Klptcm1ProPlantStateCurrentMapper.java @@ -1,15 +1,12 @@ package com.klp.pocket.mapper; import com.klp.pocket.domain.Klptcm1ProPlantStateCurrent; -import com.klp.pocket.domain.vo.Klptcm1ProPlantStateCurrentVo; -import com.klp.common.core.mapper.BaseMapperPlus; +import org.apache.ibatis.annotations.Mapper; +import java.util.List; -/** - * 当前Mapper接口 - * - * @author klp - * @date 2025-10-27 - */ -public interface Klptcm1ProPlantStateCurrentMapper extends BaseMapperPlus { +@Mapper +public interface Klptcm1ProPlantStateCurrentMapper { + // 查询所有 + List selectAll(); } diff --git a/klp-pocket/src/main/java/com/klp/pocket/service/IKlptcm1ProPlantStateCurrentService.java b/klp-pocket/src/main/java/com/klp/pocket/service/IKlptcm1ProPlantStateCurrentService.java index 7c9beb9f..0e746d2a 100644 --- a/klp-pocket/src/main/java/com/klp/pocket/service/IKlptcm1ProPlantStateCurrentService.java +++ b/klp-pocket/src/main/java/com/klp/pocket/service/IKlptcm1ProPlantStateCurrentService.java @@ -1,49 +1,10 @@ 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); + List selectAll(); - /** - * 查询当前列表 - */ - TableDataInfo queryPageList(Klptcm1ProPlantStateCurrentBo bo, PageQuery pageQuery); - - /** - * 查询当前列表 - */ - List queryList(Klptcm1ProPlantStateCurrentBo bo); - - /** - * 新增当前 - */ - Boolean insertByBo(Klptcm1ProPlantStateCurrentBo bo); - - /** - * 修改当前 - */ - Boolean updateByBo(Klptcm1ProPlantStateCurrentBo bo); - - /** - * 校验并批量删除当前信息 - */ - Boolean deleteWithValidByIds(Collection ids, Boolean isValid); } diff --git a/klp-pocket/src/main/java/com/klp/pocket/service/impl/Klptcm1ProPlantStateCurrentServiceImpl.java b/klp-pocket/src/main/java/com/klp/pocket/service/impl/Klptcm1ProPlantStateCurrentServiceImpl.java index 17df3259..0d261149 100644 --- a/klp-pocket/src/main/java/com/klp/pocket/service/impl/Klptcm1ProPlantStateCurrentServiceImpl.java +++ b/klp-pocket/src/main/java/com/klp/pocket/service/impl/Klptcm1ProPlantStateCurrentServiceImpl.java @@ -1,213 +1,24 @@ 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.baomidou.dynamic.datasource.annotation.DS; import com.klp.pocket.domain.Klptcm1ProPlantStateCurrent; import com.klp.pocket.mapper.Klptcm1ProPlantStateCurrentMapper; import com.klp.pocket.service.IKlptcm1ProPlantStateCurrentService; - +import org.springframework.stereotype.Service; +import javax.annotation.Resource; import java.util.List; -import java.util.Map; -import java.util.Collection; -/** - * 当前Service业务层处理 - * - * @author klp - * @date 2025-10-27 - */ -@RequiredArgsConstructor +@DS("slave") @Service public class Klptcm1ProPlantStateCurrentServiceImpl implements IKlptcm1ProPlantStateCurrentService { - private final Klptcm1ProPlantStateCurrentMapper baseMapper; + @Resource + private Klptcm1ProPlantStateCurrentMapper klptcm1ProPlantStateCurrentMapper; + - /** - * 查询当前 - */ @Override - public Klptcm1ProPlantStateCurrentVo queryById(Date INSDATE){ - return baseMapper.selectVoById(INSDATE); + public List selectAll() { + return klptcm1ProPlantStateCurrentMapper.selectAll(); } - /** - * 查询当前列表 - */ - @Override - public TableDataInfo queryPageList(Klptcm1ProPlantStateCurrentBo bo, PageQuery pageQuery) { - LambdaQueryWrapper lqw = buildQueryWrapper(bo); - Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); - return TableDataInfo.build(result); - } - - /** - * 查询当前列表 - */ - @Override - public List queryList(Klptcm1ProPlantStateCurrentBo bo) { - LambdaQueryWrapper lqw = buildQueryWrapper(bo); - return baseMapper.selectVoList(lqw); - } - - private LambdaQueryWrapper buildQueryWrapper(Klptcm1ProPlantStateCurrentBo bo) { - Map params = bo.getParams(); - LambdaQueryWrapper 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 ids, Boolean isValid) { - if(isValid){ - //TODO 做一些业务上的校验,判断是否需要校验 - } - return baseMapper.deleteBatchIds(ids) > 0; - } } diff --git a/klp-pocket/src/main/resources/mapper/pocket/Klptcm1ProPlantStateCurrentMapper.xml b/klp-pocket/src/main/resources/mapper/pocket/Klptcm1ProPlantStateCurrentMapper.xml index c64b367c..1dfe0a6a 100644 --- a/klp-pocket/src/main/resources/mapper/pocket/Klptcm1ProPlantStateCurrentMapper.xml +++ b/klp-pocket/src/main/resources/mapper/pocket/Klptcm1ProPlantStateCurrentMapper.xml @@ -1,117 +1,30 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + INSDATE, YEAR, MONTH, DAY, HOUR, MINUTE, TYPE, + VALUE1, VALUE2, VALUE99 + + + +