From 8b0b6e244f4df834abe86a7c4b3a1248240a147d Mon Sep 17 00:00:00 2001 From: liwen Date: Tue, 23 Apr 2024 16:41:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=9F=B9=E8=AE=AD=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9D=83=E9=99=90=E9=80=BB=E8=BE=91=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.xml | 2 +- .../java/com/hnac/hzims/safeproduct/mapper/TestMapper.java | 11 +++++++++-- .../java/com/hnac/hzims/safeproduct/mapper/TestMapper.xml | 12 ++++++++++++ .../com/hnac/hzims/safeproduct/mapper/TestScoreMapper.java | 4 ++-- .../com/hnac/hzims/safeproduct/mapper/TrainPlanMapper.java | 4 ++-- .../com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.java | 11 +++++++++-- .../com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.xml | 12 ++++++++++++ .../hnac/hzims/safeproduct/service/impl/TestServiceImpl.java | 5 +---- .../safeproduct/service/impl/TrainRecordServiceImpl.java | 5 +---- 9 files changed, 49 insertions(+), 17 deletions(-) diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.xml index 2130923..c1d3077 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.xml +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.xml @@ -49,6 +49,6 @@ is_deleted = 0 AND create_time like concat(#{month}, '%') ORDER BY - create_time DESC + code DESC \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestMapper.java index 906f6b2..0817af7 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestMapper.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestMapper.java @@ -1,11 +1,11 @@ package com.hnac.hzims.safeproduct.mapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.hnac.hzims.safeproduct.dto.TestDTO; import com.hnac.hzims.safeproduct.entity.TestEntity; import org.apache.ibatis.annotations.Mapper; import org.springblade.core.datascope.annotation.UserDataAuth; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; import java.util.List; import java.util.Map; @@ -17,7 +17,7 @@ import java.util.Map; * @date 2023-12-25 */ @Mapper -public interface TestMapper extends BaseMapper { +public interface TestMapper extends UserDataScopeBaseMapper { /** * 查询考试记录名称列表 @@ -35,4 +35,11 @@ public interface TestMapper extends BaseMapper { */ @UserDataAuth IPage testPage(IPage page, Map param); + + /** + * 查询当月考试记录 + * @param month 当月 + * @return 当月考试记录 + */ + List selectTestByMonth(String month); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestMapper.xml index 626bbad..18d8ea1 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestMapper.xml +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestMapper.xml @@ -38,4 +38,16 @@ ORDER BY create_time DESC + + \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestScoreMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestScoreMapper.java index 23290b8..061d4a5 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestScoreMapper.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestScoreMapper.java @@ -1,9 +1,9 @@ package com.hnac.hzims.safeproduct.mapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.hnac.hzims.safeproduct.entity.TestScoreEntity; import com.hnac.hzims.safeproduct.vo.TestScoreVO; import org.apache.ibatis.annotations.Mapper; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; import java.util.List; @@ -14,7 +14,7 @@ import java.util.List; * @date 2023-12-25 */ @Mapper -public interface TestScoreMapper extends BaseMapper { +public interface TestScoreMapper extends UserDataScopeBaseMapper { /** * 查询考试成绩列表 diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainPlanMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainPlanMapper.java index 4a63a61..bbb1960 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainPlanMapper.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainPlanMapper.java @@ -1,6 +1,5 @@ package com.hnac.hzims.safeproduct.mapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.hnac.hzims.safeproduct.dto.AnalysisYearDTO; import com.hnac.hzims.safeproduct.entity.TrainPlanEntity; @@ -8,6 +7,7 @@ import com.hnac.hzims.safeproduct.vo.TrainMonthVO; import com.hnac.hzims.safeproduct.vo.TrainYearVO; import org.apache.ibatis.annotations.Mapper; import org.springblade.core.datascope.annotation.UserDataAuth; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; import java.util.List; import java.util.Map; @@ -19,7 +19,7 @@ import java.util.Map; * @date 2023-12-25 */ @Mapper -public interface TrainPlanMapper extends BaseMapper { +public interface TrainPlanMapper extends UserDataScopeBaseMapper { /** * 查询当月各单位的培训计划总数 diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.java index a4dd083..a7265c8 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.java @@ -1,6 +1,5 @@ package com.hnac.hzims.safeproduct.mapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.hnac.hzims.safeproduct.dto.TrainRecordDTO; import com.hnac.hzims.safeproduct.entity.TrainRecordEntity; @@ -8,6 +7,7 @@ import com.hnac.hzims.safeproduct.vo.TrainRecordDetailVO; import com.hnac.hzims.safeproduct.vo.TrainRecordVO; import org.apache.ibatis.annotations.Mapper; import org.springblade.core.datascope.annotation.UserDataAuth; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; import java.util.List; import java.util.Map; @@ -19,7 +19,7 @@ import java.util.Map; * @date 2023-12-25 */ @Mapper -public interface TrainRecordMapper extends BaseMapper { +public interface TrainRecordMapper extends UserDataScopeBaseMapper { /** * 查询培训记录名称列表 @@ -44,4 +44,11 @@ public interface TrainRecordMapper extends BaseMapper { */ @UserDataAuth IPage trainRecordPage(IPage page, Map param); + + /** + * 查询当月培训记录 + * @param month 当月 + * @return 当月培训记录 + */ + List selectTrainByMonth(String month); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.xml index a719263..cf36041 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.xml +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.xml @@ -53,4 +53,16 @@ ORDER BY t1.create_time DESC + + \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestServiceImpl.java index 2645f06..8e75d9c 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestServiceImpl.java @@ -246,9 +246,6 @@ public class TestServiceImpl extends ServiceImpl impleme * @return 当月考试记录 */ public List getTestByMonth(String month) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().like(TestEntity::getCreateTime, month) - .orderByDesc(TestEntity::getCode); - return this.list(queryWrapper); + return baseMapper.selectTestByMonth(month); } } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java index 9a79a53..9a04c57 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java @@ -219,9 +219,6 @@ public class TrainRecordServiceImpl extends ServiceImpl getTrainByMonth(String month) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().like(TrainRecordEntity::getCreateTime, month) - .orderByDesc(TrainRecordEntity::getCode); - return this.list(queryWrapper); + return baseMapper.selectTrainByMonth(month); } }