diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/mapper/DatasetDao.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/mapper/DatasetDao.java index f08112a3..9deb0e0c 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/mapper/DatasetDao.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/mapper/DatasetDao.java @@ -80,6 +80,6 @@ public interface DatasetDao { */ int deleteById(Integer id); - Dataset findByName(String name); + Dataset findByName(@Param("name") String name); } diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/DatasetServiceImpl.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/DatasetServiceImpl.java index 40bcfe0b..79c049ec 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/DatasetServiceImpl.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/DatasetServiceImpl.java @@ -358,7 +358,7 @@ public class DatasetServiceImpl implements DatasetService { for (Field field : fields) { if (field.isAnnotationPresent(CheckDuplicate.class)) { CheckDuplicate annotation = field.getAnnotation(CheckDuplicate.class); - throw new Exception(annotation.value() + "不能重复"); + throw new Exception(field.getName()+ "不能重复"); } } } diff --git a/ruoyi-modules/management-platform/src/main/resources/mapper/managementPlatform/DatasetDaoMapper.xml b/ruoyi-modules/management-platform/src/main/resources/mapper/managementPlatform/DatasetDaoMapper.xml index c7380588..836361cc 100644 --- a/ruoyi-modules/management-platform/src/main/resources/mapper/managementPlatform/DatasetDaoMapper.xml +++ b/ruoyi-modules/management-platform/src/main/resources/mapper/managementPlatform/DatasetDaoMapper.xml @@ -29,7 +29,7 @@ select id,name,description,available_range,data_type,data_tag,create_by,create_time,update_by,update_time,state from dataset - where name = #{name} and state = 1 + where name = #{name} and state = 1 limit 1