From dfcd84c2bca30aa1891bda95d8a4dbc4aecd53c2 Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期五, 02 四月 2021 15:44:02 +0800 Subject: [PATCH] fix 数据权限语句null bug --- ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm b/ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm index 52c2db8..3b6f640 100644 --- a/ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm +++ b/ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm @@ -31,7 +31,7 @@ @Override public ${ClassName}Vo queryById(${pkColumn.javaType} ${pkColumn.javaField}){ ${ClassName} db = this.baseMapper.selectById(${pkColumn.javaField}); - return entity2Vo(Collections.singletonList(db)).get(0); + return BeanUtil.toBean(db, ${ClassName}Vo.class) } @Override @@ -53,6 +53,8 @@ #end lqw.$mpMethod($condition, ${ClassName}::get$AttrName, bo.get$AttrName()); #else + Object dataScope = bo.getParams().get("dataScope"); + lqw.apply(dataScope != null, dataScope != null ? dataScope.toString() : null); Map<String, Object> params = bo.getParams(); if (params.get("begin$AttrName") != null && params.get("end$AttrName") != null) { lqw.between(${ClassName}::get$AttrName ,params.get("begin$AttrName"), params.get("end$AttrName")); -- Gitblit v1.9.3