Browse Source

fix: 培训模块数据权限逻辑修改

zhongwei
liwen 7 months ago
parent
commit
8b0b6e244f
  1. 2
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.xml
  2. 11
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestMapper.java
  3. 12
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestMapper.xml
  4. 4
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestScoreMapper.java
  5. 4
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainPlanMapper.java
  6. 11
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.java
  7. 12
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.xml
  8. 5
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestServiceImpl.java
  9. 5
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java

2
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
</select>
</mapper>

11
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<TestEntity> {
public interface TestMapper extends UserDataScopeBaseMapper<TestEntity> {
/**
* 查询考试记录名称列表
@ -35,4 +35,11 @@ public interface TestMapper extends BaseMapper<TestEntity> {
*/
@UserDataAuth
IPage<TestEntity> testPage(IPage<TestEntity> page, Map<String, Object> param);
/**
* 查询当月考试记录
* @param month 当月
* @return 当月考试记录
*/
List<TestEntity> selectTestByMonth(String month);
}

12
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TestMapper.xml

@ -38,4 +38,16 @@
ORDER BY
create_time DESC
</select>
<select id="selectTestByMonth" resultType="com.hnac.hzims.safeproduct.entity.TestEntity">
SELECT
*
FROM
hzims_test
WHERE
is_deleted = 0
AND create_time like concat(#{month}, '%')
ORDER BY
code DESC
</select>
</mapper>

4
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<TestScoreEntity> {
public interface TestScoreMapper extends UserDataScopeBaseMapper<TestScoreEntity> {
/**
* 查询考试成绩列表

4
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<TrainPlanEntity> {
public interface TrainPlanMapper extends UserDataScopeBaseMapper<TrainPlanEntity> {
/**
* 查询当月各单位的培训计划总数

11
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<TrainRecordEntity> {
public interface TrainRecordMapper extends UserDataScopeBaseMapper<TrainRecordEntity> {
/**
* 查询培训记录名称列表
@ -44,4 +44,11 @@ public interface TrainRecordMapper extends BaseMapper<TrainRecordEntity> {
*/
@UserDataAuth
IPage<TrainRecordVO> trainRecordPage(IPage<TrainRecordVO> page, Map<String, Object> param);
/**
* 查询当月培训记录
* @param month 当月
* @return 当月培训记录
*/
List<TrainRecordEntity> selectTrainByMonth(String month);
}

12
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.xml

@ -53,4 +53,16 @@
ORDER BY
t1.create_time DESC
</select>
<select id="selectTrainByMonth" resultType="com.hnac.hzims.safeproduct.entity.TrainRecordEntity">
SELECT
*
FROM
hzims_train_record
WHERE
is_deleted = 0
AND create_time like concat(#{month}, '%')
ORDER BY
code DESC
</select>
</mapper>

5
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestServiceImpl.java

@ -246,9 +246,6 @@ public class TestServiceImpl extends ServiceImpl<TestMapper, TestEntity> impleme
* @return 当月考试记录
*/
public List<TestEntity> getTestByMonth(String month) {
QueryWrapper<TestEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().like(TestEntity::getCreateTime, month)
.orderByDesc(TestEntity::getCode);
return this.list(queryWrapper);
return baseMapper.selectTestByMonth(month);
}
}

5
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java

@ -219,9 +219,6 @@ public class TrainRecordServiceImpl extends ServiceImpl<TrainRecordMapper, Train
* @return 当月培训记录
*/
public List<TrainRecordEntity> getTrainByMonth(String month) {
QueryWrapper<TrainRecordEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().like(TrainRecordEntity::getCreateTime, month)
.orderByDesc(TrainRecordEntity::getCode);
return this.list(queryWrapper);
return baseMapper.selectTrainByMonth(month);
}
}

Loading…
Cancel
Save