1. 指标子集映射
This commit is contained in:
parent
ef50951bb3
commit
516a03e46a
|
@ -0,0 +1,50 @@
|
|||
package com.hshh.evaluation.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author liDongYu
|
||||
* @since 2025-08-24
|
||||
*/
|
||||
@TableName("m_data_evaluation_indicator_result")
|
||||
@Data
|
||||
public class EvaluationIndicatorResult implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
|
||||
private Integer indicatorId;
|
||||
|
||||
|
||||
private Integer indicatorParentId;
|
||||
|
||||
|
||||
private Integer indicatorTopId;
|
||||
|
||||
|
||||
private String randomKey;
|
||||
|
||||
|
||||
private String memberShipScore;
|
||||
|
||||
|
||||
private String finalScore;
|
||||
|
||||
private Integer rootId;
|
||||
|
||||
|
||||
private String indicatorName;
|
||||
private Integer level;
|
||||
private Double weight;
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
package com.hshh.evaluation.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.hshh.system.common.bean.BaseBean;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 评估结果表
|
||||
* </p>
|
||||
*
|
||||
* @author liDongYu
|
||||
* @since 2025-08-24
|
||||
*/
|
||||
@TableName("m_data_evaluation_root_result")
|
||||
@Data
|
||||
public class EvaluationRootResult extends BaseBean {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
|
||||
private Integer projectId;
|
||||
|
||||
|
||||
private String identifier;
|
||||
|
||||
|
||||
private LocalDateTime createTime;
|
||||
@TableField(exist = false)
|
||||
private String createTimeStr;
|
||||
|
||||
private String randomKey;
|
||||
|
||||
|
||||
private String finalScore;
|
||||
|
||||
|
||||
private String membershipScore;
|
||||
|
||||
|
||||
private String indicatorName;
|
||||
private Integer indicatorTopId;
|
||||
private Integer originalId;
|
||||
private String datasourceType;
|
||||
//评价集区间名称
|
||||
@TableField(exist = false)
|
||||
private String levelName;
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.hshh.evaluation.mapper;
|
||||
|
||||
import com.hshh.evaluation.entity.EvaluationIndicatorResult;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author liDongYu
|
||||
* @since 2025-08-24
|
||||
*/
|
||||
public interface EvaluationIndicatorResultMapper extends BaseMapper<EvaluationIndicatorResult> {
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.hshh.evaluation.mapper;
|
||||
|
||||
import com.hshh.evaluation.entity.EvaluationRootResult;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 评估结果表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author liDongYu
|
||||
* @since 2025-08-24
|
||||
*/
|
||||
public interface EvaluationRootResultMapper extends BaseMapper<EvaluationRootResult> {
|
||||
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
package com.hshh.evaluation.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.hshh.evaluation.entity.EvaluationIndicatorResult;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author liDongYu
|
||||
* @since 2025-08-24
|
||||
*/
|
||||
public interface EvaluationIndicatorResultService extends IService<EvaluationIndicatorResult> {
|
||||
|
||||
/**
|
||||
* 保存指标详情.
|
||||
*
|
||||
* @param list 数据
|
||||
* @param rootId 根记录ID
|
||||
*/
|
||||
void saveWhole(List<EvaluationIndicatorResult> list, Integer rootId);
|
||||
|
||||
/**
|
||||
* 根据根指标查询每个指标的评估数据.
|
||||
*
|
||||
* @param rootId 对应的索引值 根指标记录ID
|
||||
* @return 评估数据列表
|
||||
*/
|
||||
List<EvaluationIndicatorResult> selectByRootId(Integer rootId);
|
||||
|
||||
/**
|
||||
* 根据父ID和评估标识key获取数据.
|
||||
*
|
||||
* @param parentId 父ID
|
||||
* @param randomKey 评估本次的
|
||||
* @return
|
||||
*/
|
||||
List<EvaluationIndicatorResult> queryListByParentIdAndRandomKey(Integer parentId,
|
||||
String randomKey, Integer rootId);
|
||||
|
||||
/**
|
||||
* 根据关联的rootID删除相关记录.
|
||||
*
|
||||
* @param rootId 根记录ID
|
||||
*/
|
||||
void removeByRootId(Integer rootId);
|
||||
|
||||
void deleteByRandomKey(String randomKey);
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package com.hshh.evaluation.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.hshh.evaluation.entity.EvaluationRootResult;
|
||||
import com.hshh.system.algorithm.fuzzy.IndicatorNode;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 评估结果表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author liDongYu
|
||||
* @since 2025-08-24
|
||||
*/
|
||||
public interface EvaluationRootResultService extends IService<EvaluationRootResult> {
|
||||
|
||||
/**
|
||||
* 保存评估数据.
|
||||
*
|
||||
* @param indicatorNode 评估结果数据
|
||||
*/
|
||||
void saveWhole(IndicatorNode indicatorNode);
|
||||
|
||||
/**
|
||||
* 根据评估时临时生成的批次key查询根指标的评估结果.
|
||||
*
|
||||
* @param randomKey 生成批次临时key
|
||||
* @return 根指标评估结果
|
||||
*/
|
||||
List<EvaluationRootResult> queryListByRandomKey(String randomKey);
|
||||
|
||||
/**
|
||||
* 删除指标根评估记录.
|
||||
*
|
||||
* @param id 评估根指标记录ID
|
||||
*/
|
||||
void deleteRootRecord(Integer id);
|
||||
void deleteByRandomKey(String randomKey);
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
package com.hshh.evaluation.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.hshh.evaluation.entity.EvaluationIndicatorResult;
|
||||
import com.hshh.evaluation.mapper.EvaluationIndicatorResultMapper;
|
||||
import com.hshh.evaluation.service.EvaluationIndicatorResultService;
|
||||
import java.util.List;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author liDongYu
|
||||
* @since 2025-08-24
|
||||
*/
|
||||
@Service
|
||||
public class EvaluationIndicatorResultServiceImpl extends
|
||||
ServiceImpl<EvaluationIndicatorResultMapper, EvaluationIndicatorResult> implements
|
||||
EvaluationIndicatorResultService {
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void saveWhole(List<EvaluationIndicatorResult> list, Integer rootId) {
|
||||
list.forEach(item -> {
|
||||
item.setRootId(rootId);
|
||||
save(item);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EvaluationIndicatorResult> selectByRootId(Integer rootId
|
||||
) {
|
||||
QueryWrapper<EvaluationIndicatorResult> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("root_id", rootId);
|
||||
|
||||
wrapper.orderByAsc("level", "id");
|
||||
return this.list(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EvaluationIndicatorResult> queryListByParentIdAndRandomKey(Integer parentId,
|
||||
String randomKey, Integer rootId) {
|
||||
QueryWrapper<EvaluationIndicatorResult> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("indicator_parent_id", parentId);
|
||||
wrapper.eq("random_key", randomKey);
|
||||
wrapper.eq("root_id", rootId);
|
||||
return this.list(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeByRootId(Integer rootId) {
|
||||
QueryWrapper<EvaluationIndicatorResult> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("root_id", rootId);
|
||||
remove(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteByRandomKey(String randomKey) {
|
||||
QueryWrapper<EvaluationIndicatorResult> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("random_key", randomKey);
|
||||
remove(wrapper);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,128 @@
|
|||
package com.hshh.evaluation.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.hshh.evaluation.entity.EvaluationIndicatorResult;
|
||||
import com.hshh.evaluation.entity.EvaluationRootResult;
|
||||
import com.hshh.evaluation.mapper.EvaluationRootResultMapper;
|
||||
import com.hshh.evaluation.service.EvaluationIndicatorResultService;
|
||||
import com.hshh.evaluation.service.EvaluationRootResultService;
|
||||
import com.hshh.system.algorithm.fuzzy.IndicatorNode;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 评估结果表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author liDongYu
|
||||
* @since 2025-08-24
|
||||
*/
|
||||
@Service
|
||||
public class EvaluationRootResultServiceImpl extends
|
||||
ServiceImpl<EvaluationRootResultMapper, EvaluationRootResult> implements
|
||||
EvaluationRootResultService {
|
||||
|
||||
private static final String doubleFormat = "%.2f";
|
||||
@Resource
|
||||
private EvaluationIndicatorResultService evaluationIndicatorResultService;
|
||||
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void saveWhole(IndicatorNode indicatorNode) {
|
||||
EvaluationRootResult rootResult = new EvaluationRootResult();
|
||||
|
||||
//设置创建时间
|
||||
rootResult.setCreateTime(LocalDateTime.now());
|
||||
//设置根指标ID
|
||||
rootResult.setIndicatorTopId(Integer.parseInt(indicatorNode.getId()));
|
||||
//原始记录ID
|
||||
rootResult.setOriginalId(indicatorNode.getOriginalId());
|
||||
//数据来源
|
||||
rootResult.setDatasourceType(indicatorNode.getType());
|
||||
//最终分
|
||||
if (indicatorNode.getScore() == null) {
|
||||
indicatorNode.setScore(0d);
|
||||
}
|
||||
rootResult.setFinalScore(
|
||||
new BigDecimal(indicatorNode.getScore()).setScale(1, RoundingMode.UP).toPlainString());
|
||||
StringBuilder membershipBuilder = new StringBuilder();
|
||||
indicatorNode.getMembershipDegrees().forEach((k, v) -> {
|
||||
membershipBuilder.append(k).append(":").append(String.format(doubleFormat, v)).append(";");
|
||||
});
|
||||
//设置隶属度
|
||||
rootResult.setMembershipScore(membershipBuilder.toString());
|
||||
//设置工程ID
|
||||
rootResult.setProjectId(indicatorNode.getProjectId());
|
||||
//设置本次评估随机标识
|
||||
rootResult.setRandomKey(indicatorNode.getRandomKey());
|
||||
//设置标识名称
|
||||
rootResult.setIdentifier(indicatorNode.getLogicName());
|
||||
//设置指标名称
|
||||
rootResult.setIndicatorName(indicatorNode.getName());
|
||||
save(rootResult);
|
||||
|
||||
List<EvaluationIndicatorResult> indicatorResultList = new ArrayList<>();
|
||||
fillIndicatorResult(indicatorResultList, indicatorNode, null,
|
||||
Integer.parseInt(indicatorNode.getId()));
|
||||
//开始保存详情
|
||||
evaluationIndicatorResultService.saveWhole(indicatorResultList, rootResult.getId());
|
||||
}
|
||||
|
||||
private void fillIndicatorResult(List<EvaluationIndicatorResult> indicatorResultList,
|
||||
IndicatorNode indicatorNode, Integer pid, Integer topId) {
|
||||
EvaluationIndicatorResult result = new EvaluationIndicatorResult();
|
||||
result.setIndicatorId(indicatorNode.getOriginalId());
|
||||
result.setWeight(indicatorNode.getWeight());
|
||||
result.setLevel(indicatorNode.getLevel());
|
||||
result.setRandomKey(indicatorNode.getRandomKey());
|
||||
result.setIndicatorTopId(topId);
|
||||
result.setIndicatorParentId(pid);
|
||||
result.setIndicatorName(indicatorNode.getName());
|
||||
result.setFinalScore(
|
||||
indicatorNode.getScore() == null ? ""
|
||||
: String.format(doubleFormat, indicatorNode.getScore()));
|
||||
StringBuilder membershipBuilder = new StringBuilder();
|
||||
indicatorNode.getMembershipDegrees().forEach((k, v) -> {
|
||||
membershipBuilder.append(k).append(":").append(String.format(doubleFormat, v)).append(";");
|
||||
});
|
||||
result.setMemberShipScore(membershipBuilder.toString());
|
||||
indicatorResultList.add(result);
|
||||
if (indicatorNode.getChildren() != null && !indicatorNode.getChildren().isEmpty()) {
|
||||
indicatorNode.getChildren().forEach(child -> {
|
||||
fillIndicatorResult(indicatorResultList, child, indicatorNode.getOriginalId(), topId);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EvaluationRootResult> queryListByRandomKey(String randomKey) {
|
||||
QueryWrapper<EvaluationRootResult> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("random_key", randomKey);
|
||||
wrapper.orderByAsc("id");
|
||||
return this.list(wrapper);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void deleteRootRecord(Integer id) {
|
||||
evaluationIndicatorResultService.removeByRootId(id);
|
||||
removeById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteByRandomKey(String randomKey) {
|
||||
evaluationIndicatorResultService.deleteByRandomKey(randomKey);
|
||||
QueryWrapper<EvaluationRootResult> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("random_key", randomKey);
|
||||
remove(wrapper);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
package com.hshh.indicator.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author liDongYu
|
||||
* @since 2025-08-23
|
||||
*/
|
||||
@TableName("m_data_indicator_top_level")
|
||||
@Data
|
||||
public class IndicatorTopLevel implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
|
||||
|
||||
|
||||
private String levelName;
|
||||
|
||||
|
||||
private String grade;
|
||||
|
||||
|
||||
private Integer levelOrder;
|
||||
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
private double actualValue;
|
||||
private String equalValue;
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
package com.hshh.indicator.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author liDongYu
|
||||
* @since 2025-08-23
|
||||
*/
|
||||
@TableName("m_data_indicator_top_set")
|
||||
@Data
|
||||
public class IndicatorTopSet implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
|
||||
private String membershipFunc;
|
||||
|
||||
|
||||
private String softEdgeS;
|
||||
|
||||
|
||||
private String gaussianEpsilon;
|
||||
|
||||
|
||||
private String triangleOverlapRatio;
|
||||
|
||||
|
||||
private String trianglePeakRatio;
|
||||
private String method;
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.hshh.indicator.mapper;
|
||||
|
||||
import com.hshh.indicator.entity.IndicatorTopLevel;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author liDongYu
|
||||
* @since 2025-08-23
|
||||
*/
|
||||
public interface IndicatorTopLevelMapper extends BaseMapper<IndicatorTopLevel> {
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.hshh.indicator.mapper;
|
||||
|
||||
import com.hshh.indicator.entity.IndicatorTopSet;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author liDongYu
|
||||
* @since 2025-08-23
|
||||
*/
|
||||
public interface IndicatorTopSetMapper extends BaseMapper<IndicatorTopSet> {
|
||||
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package com.hshh.indicator.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.hshh.indicator.bean.IndicatorEvalBean;
|
||||
import com.hshh.indicator.bean.IndicatorSetBean;
|
||||
import com.hshh.indicator.entity.IndicatorTopLevel;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 指标全局评价名称对应的分集合服务类.
|
||||
*
|
||||
* @author liDongYu
|
||||
* @since 2025-08-23
|
||||
*/
|
||||
public interface IndicatorTopLevelService extends IService<IndicatorTopLevel> {
|
||||
|
||||
/**
|
||||
* 查询指标的全局评级分分类集合.
|
||||
*
|
||||
|
||||
* @return 全局评级分分类集合
|
||||
*/
|
||||
List<IndicatorTopLevel> getTopLevel();
|
||||
|
||||
/**
|
||||
* 保存全局评价枚举和分值.
|
||||
*
|
||||
* @param data 前端数据
|
||||
*/
|
||||
void saveWhole(IndicatorSetBean data);
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package com.hshh.indicator.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.hshh.indicator.bean.IndicatorEvalBean;
|
||||
import com.hshh.indicator.bean.IndicatorSetBean;
|
||||
import com.hshh.indicator.entity.IndicatorTopSet;
|
||||
|
||||
/**
|
||||
* 顶级指标全局隶属函数配置服务类.
|
||||
*
|
||||
* @author liDongYu
|
||||
* @since 2025-08-23
|
||||
*/
|
||||
public interface IndicatorTopSetService extends IService<IndicatorTopSet> {
|
||||
|
||||
/**
|
||||
* 根据顶级指标ID查询隶属函数配置.
|
||||
*
|
||||
|
||||
* @return 配置
|
||||
*/
|
||||
IndicatorTopSet getIndicatorTopSet();
|
||||
|
||||
/**
|
||||
* 保存全局隶属度函数设置.
|
||||
*
|
||||
* @param data 前端数据
|
||||
*/
|
||||
void saveWhole(IndicatorSetBean data);
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
package com.hshh.indicator.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.hshh.indicator.bean.IndicatorSetBean;
|
||||
import com.hshh.indicator.entity.IndicatorTopLevel;
|
||||
import com.hshh.indicator.mapper.IndicatorTopLevelMapper;
|
||||
import com.hshh.indicator.service.IndicatorTopLevelService;
|
||||
import com.hshh.indicator.service.IndicatorTopSetService;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author liDongYu
|
||||
* @since 2025-08-23
|
||||
*/
|
||||
@Service
|
||||
public class IndicatorTopLevelServiceImpl extends
|
||||
ServiceImpl<IndicatorTopLevelMapper, IndicatorTopLevel> implements
|
||||
IndicatorTopLevelService {
|
||||
|
||||
@Resource
|
||||
private IndicatorTopSetService indicatorTopSetService;
|
||||
|
||||
@Override
|
||||
public List<IndicatorTopLevel> getTopLevel() {
|
||||
QueryWrapper<IndicatorTopLevel> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
queryWrapper.orderByAsc("id");
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void saveWhole(IndicatorSetBean data) {
|
||||
QueryWrapper<IndicatorTopLevel> queryWrapper = new QueryWrapper<>();
|
||||
//先删除表中所有记录
|
||||
remove(queryWrapper);
|
||||
for (int i = 0; i < data.getLevels().size(); i++) {
|
||||
IndicatorTopLevel topLevel = data.getLevels().get(i);
|
||||
topLevel.setLevelOrder(i + 1);
|
||||
save(topLevel);
|
||||
}
|
||||
indicatorTopSetService.saveWhole(data);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
package com.hshh.indicator.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.hshh.indicator.bean.IndicatorSetBean;
|
||||
import com.hshh.indicator.entity.IndicatorTopSet;
|
||||
import com.hshh.indicator.mapper.IndicatorTopSetMapper;
|
||||
import com.hshh.indicator.service.IndicatorTopSetService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author liDongYu
|
||||
* @since 2025-08-23
|
||||
*/
|
||||
@Service
|
||||
public class IndicatorTopSetServiceImpl extends
|
||||
ServiceImpl<IndicatorTopSetMapper, IndicatorTopSet> implements
|
||||
IndicatorTopSetService {
|
||||
|
||||
@Override
|
||||
public IndicatorTopSet getIndicatorTopSet() {
|
||||
QueryWrapper<IndicatorTopSet> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
return baseMapper.selectOne(queryWrapper);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void saveWhole(IndicatorSetBean data) {
|
||||
|
||||
QueryWrapper<IndicatorTopSet> queryWrapper = new QueryWrapper<>();
|
||||
remove(queryWrapper);
|
||||
save(data.getTopSet());
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.hshh.evaluation.mapper.EvaluationIndicatorResultMapper">
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.hshh.evaluation.mapper.EvaluationRootResultMapper">
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.hshh.indicator.mapper.IndicatorTopLevelMapper">
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.hshh.indicator.mapper.IndicatorTopSetMapper">
|
||||
|
||||
</mapper>
|
168
manager-system/d.puml
Normal file
168
manager-system/d.puml
Normal file
|
@ -0,0 +1,168 @@
|
|||
@startuml
|
||||
skinparam rectangle {
|
||||
BackgroundColor<<ControllerLayer>> #E3F2FD
|
||||
BorderColor<<ControllerLayer>> #90CAF9
|
||||
BackgroundColor<<ServiceInterfaceLayer>> #F3E5F5
|
||||
BorderColor<<ServiceInterfaceLayer>> #B39DDB
|
||||
BackgroundColor<<ServiceImplLayer>> #E8F5E9
|
||||
BorderColor<<ServiceImplLayer>> #A5D6A7
|
||||
BackgroundColor<<MapperLayer>> #FFF3E0
|
||||
BorderColor<<MapperLayer>> #FFB74D
|
||||
BackgroundColor<<EntityLayer>> #FFEBEE
|
||||
BorderColor<<EntityLayer>> #EF9A9A
|
||||
}
|
||||
|
||||
title 基础权限管理分层架构依赖关系
|
||||
|
||||
' --------- Controller 层 ----------
|
||||
package "Controller Layer" <<ControllerLayer>> {
|
||||
class ConfigSetController <<C>>
|
||||
class DictItemController <<C>>
|
||||
class DictTypeController <<C>>
|
||||
class LogsController <<C>>
|
||||
class MenuController <<C>>
|
||||
class PermissionController <<C>>
|
||||
class RoleController <<C>>
|
||||
class UserController <<C>>
|
||||
}
|
||||
|
||||
' --------- Service 接口层 ----------
|
||||
package "Service Interface Layer" <<ServiceInterfaceLayer>> {
|
||||
interface ConfigSetService <<I>>
|
||||
interface DictItemService <<I>>
|
||||
interface DictTypeService <<I>>
|
||||
interface LogsService <<I>>
|
||||
interface MenusService <<I>>
|
||||
interface PermissionMenuService <<I>>
|
||||
interface PermissionsService <<I>>
|
||||
interface RolePermissionService <<I>>
|
||||
interface RolesService <<I>>
|
||||
interface TableRelationsService <<I>>
|
||||
interface UserRoleService <<I>>
|
||||
interface UsersService <<I>>
|
||||
}
|
||||
|
||||
' --------- Service 实现层 ----------
|
||||
package "Service Implementation Layer" <<ServiceImplLayer>> {
|
||||
class ConfigSetServiceImpl <<C>>
|
||||
class DictItemServiceImpl <<C>>
|
||||
class DictTypeServiceImpl <<C>>
|
||||
class LogsServiceImpl <<C>>
|
||||
class MenusServiceImpl <<C>>
|
||||
class PermissionMenuServiceImpl <<C>>
|
||||
class PermissionsServiceImpl <<C>>
|
||||
class RolePermissionServiceImpl <<C>>
|
||||
class RolesServiceImpl <<C>>
|
||||
class TableRelationsServiceImpl <<C>>
|
||||
class UserRoleServiceImpl <<C>>
|
||||
class UsersServiceImpl <<C>>
|
||||
}
|
||||
|
||||
' --------- Mapper 层 ----------
|
||||
package "Mapper Layer" <<MapperLayer>> {
|
||||
interface ConfigSetMapper <<I>>
|
||||
interface DictItemMapper <<I>>
|
||||
interface DictTypeMapper <<I>>
|
||||
interface LogsMapper <<I>>
|
||||
interface MenusMapper <<I>>
|
||||
interface PermissionMenuMapper <<I>>
|
||||
interface PermissionsMapper <<I>>
|
||||
interface RolePermissionMapper <<I>>
|
||||
interface RolesMapper <<I>>
|
||||
interface TableRelationsMapper <<I>>
|
||||
interface UserRoleMapper <<I>>
|
||||
interface UsersMapper <<I>>
|
||||
}
|
||||
|
||||
' --------- Entity 层 ----------
|
||||
package "Entity Layer" <<EntityLayer>> {
|
||||
class ConfigSet
|
||||
class CreateUser
|
||||
class DictItem
|
||||
class DictType
|
||||
class Logs
|
||||
class Menus
|
||||
class PermissionMenu
|
||||
class Permissions
|
||||
class RolePermission
|
||||
class Roles
|
||||
class TableRelations
|
||||
class UpdateUser
|
||||
class UserRole
|
||||
class Users
|
||||
}
|
||||
|
||||
' ======== 依赖关系,每组典型主线依赖 =========
|
||||
' ConfigSet
|
||||
ConfigSetController --> ConfigSetService
|
||||
ConfigSetService <|.. ConfigSetServiceImpl
|
||||
ConfigSetServiceImpl --> ConfigSetMapper
|
||||
ConfigSetMapper --> ConfigSet
|
||||
|
||||
' DictItem
|
||||
DictItemController --> DictItemService
|
||||
DictItemService <|.. DictItemServiceImpl
|
||||
DictItemServiceImpl --> DictItemMapper
|
||||
DictItemMapper --> DictItem
|
||||
|
||||
' DictType
|
||||
DictTypeController --> DictTypeService
|
||||
DictTypeService <|.. DictTypeServiceImpl
|
||||
DictTypeServiceImpl --> DictTypeMapper
|
||||
DictTypeMapper --> DictType
|
||||
|
||||
' Logs
|
||||
LogsController --> LogsService
|
||||
LogsService <|.. LogsServiceImpl
|
||||
LogsServiceImpl --> LogsMapper
|
||||
LogsMapper --> Logs
|
||||
|
||||
' Menu
|
||||
MenuController --> MenusService
|
||||
MenusService <|.. MenusServiceImpl
|
||||
MenusServiceImpl --> MenusMapper
|
||||
MenusMapper --> Menus
|
||||
|
||||
' PermissionMenu
|
||||
PermissionController --> PermissionMenuService
|
||||
PermissionMenuService <|.. PermissionMenuServiceImpl
|
||||
PermissionMenuServiceImpl --> PermissionMenuMapper
|
||||
PermissionMenuMapper --> PermissionMenu
|
||||
|
||||
' Permissions
|
||||
PermissionController --> PermissionsService
|
||||
PermissionsService <|.. PermissionsServiceImpl
|
||||
PermissionsServiceImpl --> PermissionsMapper
|
||||
PermissionsMapper --> Permissions
|
||||
|
||||
' RolePermission
|
||||
RoleController --> RolePermissionService
|
||||
RolePermissionService <|.. RolePermissionServiceImpl
|
||||
RolePermissionServiceImpl --> RolePermissionMapper
|
||||
RolePermissionMapper --> RolePermission
|
||||
|
||||
' Roles
|
||||
RoleController --> RolesService
|
||||
RolesService <|.. RolesServiceImpl
|
||||
RolesServiceImpl --> RolesMapper
|
||||
RolesMapper --> Roles
|
||||
|
||||
' TableRelations
|
||||
TableRelationsService <|.. TableRelationsServiceImpl
|
||||
TableRelationsServiceImpl --> TableRelationsMapper
|
||||
TableRelationsMapper --> TableRelations
|
||||
|
||||
' UserRole
|
||||
UserController --> UserRoleService
|
||||
UserRoleService <|.. UserRoleServiceImpl
|
||||
UserRoleServiceImpl --> UserRoleMapper
|
||||
UserRoleMapper --> UserRole
|
||||
|
||||
' Users
|
||||
UserController --> UsersService
|
||||
UsersService <|.. UsersServiceImpl
|
||||
UsersServiceImpl --> UsersMapper
|
||||
UsersMapper --> Users
|
||||
|
||||
' CreateUser/UpdateUser (通常为DTO/VO,可与Users并列)
|
||||
@enduml
|
132
manager-system/src/main/base.puml
Normal file
132
manager-system/src/main/base.puml
Normal file
|
@ -0,0 +1,132 @@
|
|||
@startuml
|
||||
!define CONTROLLER_COLOR #E1F5FE
|
||||
!define SERVICE_COLOR #F3E5F5
|
||||
!define SERVICEIMPL_COLOR #E8F5E8
|
||||
!define MAPPER_COLOR #FFF3E0
|
||||
!define ENTITY_COLOR #FFEBEE
|
||||
!define BEAN_COLOR #FFF8DC
|
||||
|
||||
title 能力评估管理
|
||||
|
||||
package "Bean Layer" BEAN_COLOR {
|
||||
class BarData
|
||||
class CsvUploadBean
|
||||
class EvalItemToFieldInfo
|
||||
class PageDatasourceRequest
|
||||
class pageDynamicTable
|
||||
class PageEvaluationRequest
|
||||
class PageIndicatorWeight
|
||||
class PageMetricComputeRequest
|
||||
class PageMetricComputerResponse
|
||||
class PageMetricMapperWeightBean
|
||||
class PageMetricTableHeaderBean
|
||||
class PieData
|
||||
class ReportBean
|
||||
class ReportIndicatorNodeData
|
||||
class SingleEvaluationData
|
||||
}
|
||||
|
||||
package "Controller Layer" CONTROLLER_COLOR {
|
||||
class AssistantEvaluationProjectController
|
||||
class AssistantTemplateController
|
||||
class EvaluationIndicatorResultController
|
||||
class EvaluationProjectController
|
||||
class EvaluationRootResultController
|
||||
class EvaluationTemplateController
|
||||
}
|
||||
|
||||
package "Entity Layer" ENTITY_COLOR {
|
||||
class EvaluationCsvData
|
||||
class EvaluationHistory
|
||||
class EvaluationIndicatorResult
|
||||
class EvaluationProject
|
||||
class EvaluationRootResult
|
||||
class EvaluationTemplate
|
||||
class EvaluationTemplateIndicatorWeight
|
||||
class EvaluationTemplateWeight
|
||||
}
|
||||
|
||||
package "Mapper Layer" MAPPER_COLOR {
|
||||
interface EvaluationCsvDataMapper
|
||||
interface EvaluationHistoryMapper
|
||||
interface EvaluationIndicatorResultMapper
|
||||
interface EvaluationProjectMapper
|
||||
interface EvaluationRootResultMapper
|
||||
interface EvaluationTemplateIndicatorWeightMapper
|
||||
interface EvaluationTemplateMapper
|
||||
interface EvaluationTemplateWeightMapper
|
||||
}
|
||||
|
||||
package "Service Interface Layer" SERVICE_COLOR {
|
||||
interface CoreEvaluationService
|
||||
interface EvaluationCsvDataService
|
||||
interface EvaluationHistoryService
|
||||
interface EvaluationIndicatorResultService
|
||||
interface EvaluationProjectService
|
||||
interface EvaluationRootResultService
|
||||
interface EvaluationTemplateIndicatorWeightService
|
||||
interface EvaluationTemplateService
|
||||
interface EvaluationTemplateWeightService
|
||||
}
|
||||
|
||||
package "Service Implementation Layer" SERVICEIMPL_COLOR {
|
||||
class CoreEvaluationServiceImpl
|
||||
class EvaluationCsvDataServiceImpl
|
||||
class EvaluationHistoryServiceImpl
|
||||
class EvaluationIndicatorResultServiceImpl
|
||||
class EvaluationProjectServiceImpl
|
||||
class EvaluationRootResultServiceImpl
|
||||
class EvaluationTemplateIndicatorWeightServiceImpl
|
||||
class EvaluationTemplateServiceImpl
|
||||
class EvaluationTemplateWeightServiceImpl
|
||||
}
|
||||
|
||||
' ========== 典型依赖关系举例 ==========
|
||||
|
||||
' Controller --> Service
|
||||
AssistantEvaluationProjectController --> EvaluationProjectService
|
||||
AssistantTemplateController --> EvaluationTemplateService
|
||||
EvaluationIndicatorResultController --> EvaluationIndicatorResultService
|
||||
EvaluationProjectController --> EvaluationProjectService
|
||||
EvaluationRootResultController --> EvaluationRootResultService
|
||||
EvaluationTemplateController --> EvaluationTemplateService
|
||||
|
||||
' Service接口到实现
|
||||
CoreEvaluationService <|.. CoreEvaluationServiceImpl
|
||||
EvaluationCsvDataService <|.. EvaluationCsvDataServiceImpl
|
||||
EvaluationHistoryService <|.. EvaluationHistoryServiceImpl
|
||||
EvaluationIndicatorResultService <|.. EvaluationIndicatorResultServiceImpl
|
||||
EvaluationProjectService <|.. EvaluationProjectServiceImpl
|
||||
EvaluationRootResultService <|.. EvaluationRootResultServiceImpl
|
||||
EvaluationTemplateIndicatorWeightService <|.. EvaluationTemplateIndicatorWeightServiceImpl
|
||||
EvaluationTemplateService <|.. EvaluationTemplateServiceImpl
|
||||
EvaluationTemplateWeightService <|.. EvaluationTemplateWeightServiceImpl
|
||||
|
||||
' ServiceImpl --> Mapper
|
||||
EvaluationCsvDataServiceImpl --> EvaluationCsvDataMapper
|
||||
EvaluationHistoryServiceImpl --> EvaluationHistoryMapper
|
||||
EvaluationIndicatorResultServiceImpl --> EvaluationIndicatorResultMapper
|
||||
EvaluationProjectServiceImpl --> EvaluationProjectMapper
|
||||
EvaluationRootResultServiceImpl --> EvaluationRootResultMapper
|
||||
EvaluationTemplateIndicatorWeightServiceImpl --> EvaluationTemplateIndicatorWeightMapper
|
||||
EvaluationTemplateServiceImpl --> EvaluationTemplateMapper
|
||||
EvaluationTemplateWeightServiceImpl --> EvaluationTemplateWeightMapper
|
||||
|
||||
' Mapper --> Entity
|
||||
EvaluationCsvDataMapper --> EvaluationCsvData
|
||||
EvaluationHistoryMapper --> EvaluationHistory
|
||||
EvaluationIndicatorResultMapper --> EvaluationIndicatorResult
|
||||
EvaluationProjectMapper --> EvaluationProject
|
||||
EvaluationRootResultMapper --> EvaluationRootResult
|
||||
EvaluationTemplateIndicatorWeightMapper --> EvaluationTemplateIndicatorWeight
|
||||
EvaluationTemplateMapper --> EvaluationTemplate
|
||||
EvaluationTemplateWeightMapper --> EvaluationTemplateWeight
|
||||
|
||||
note right of "Bean Layer" : VO/DTO/BO 层\n用于前后端数据传输和页面展示
|
||||
note right of "Controller Layer" : 控制层\n处理 HTTP 请求
|
||||
note right of "Service Interface Layer" : 业务接口层\n定义业务契约
|
||||
note right of "Service Implementation Layer" : 业务实现层\n具体业务逻辑
|
||||
note right of "Mapper Layer" : 数据访问层\n数据库操作
|
||||
note right of "Entity Layer" : 实体层\n数据模型
|
||||
|
||||
@enduml
|
|
@ -0,0 +1,63 @@
|
|||
package com.hshh.system.base.controller;
|
||||
|
||||
import com.hshh.system.base.entity.Logs;
|
||||
import com.hshh.system.base.service.LogsService;
|
||||
import com.hshh.system.common.bean.BaseController;
|
||||
import com.hshh.system.common.bean.PaginationBean;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author liDongYu
|
||||
* @since 2025-08-22
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/base/logs")
|
||||
public class LogsController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private LogsService logsService;
|
||||
|
||||
/**
|
||||
* 日志查询页面.
|
||||
*
|
||||
* @param request 查询请求
|
||||
* @param model session容器
|
||||
* @return /log/log.html
|
||||
*/
|
||||
@GetMapping("/")
|
||||
public String list(PaginationBean request, Model model) {
|
||||
setNavigateTitle(model, "/base/logs/");
|
||||
List<Logs> list = logsService.list(request);
|
||||
for (Logs logs : list) {
|
||||
if ("LOGIN".equals(logs.getType())) {
|
||||
logs.setTypeName("登录");
|
||||
}
|
||||
if ("BIZ".equals(logs.getType())) {
|
||||
logs.setTypeName("业务");
|
||||
}
|
||||
if ("ERROR".equals(logs.getType())) {
|
||||
logs.setTypeName("错误");
|
||||
}
|
||||
}
|
||||
Long total = logsService.count(request);
|
||||
//设置分页信息
|
||||
setPaginationInfo(request, list, total, model);
|
||||
return "system/log/list";
|
||||
}
|
||||
|
||||
@GetMapping("/{id}")
|
||||
public String view(@PathVariable("id") Integer id, Model model) {
|
||||
model.addAttribute("logData", logsService.getById(id));
|
||||
return "system/log/general_detail";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
package com.hshh.system.base.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.hshh.system.common.bean.BaseBean;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 日志.
|
||||
*
|
||||
* @author liDongYu
|
||||
* @since 2025-08-22
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("s_logs")
|
||||
@Data
|
||||
public class Logs extends BaseBean {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
|
||||
private String type;
|
||||
|
||||
private String operator;
|
||||
|
||||
private String ip;
|
||||
|
||||
private String msg;
|
||||
|
||||
private LocalDateTime createTime;
|
||||
@TableField(exist = false)
|
||||
private String typeName = "";
|
||||
private String url;
|
||||
private String params;
|
||||
private String errors;
|
||||
private String httpMethod;
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package com.hshh.system.base.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.hshh.system.base.entity.Logs;
|
||||
import com.hshh.system.common.bean.PaginationBean;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 日志查询.
|
||||
*
|
||||
* @author liDongYu
|
||||
* @since 2025-08-22
|
||||
*/
|
||||
public interface LogsMapper extends BaseMapper<Logs> {
|
||||
|
||||
/**
|
||||
* 查询列表.
|
||||
*
|
||||
* @param bean 查询请求
|
||||
* @return 结果列表
|
||||
*/
|
||||
List<Logs> list(PaginationBean bean);
|
||||
|
||||
/**
|
||||
* 总条数.
|
||||
*
|
||||
* @param bean 查询请求
|
||||
* @return 总数
|
||||
*/
|
||||
Long count(PaginationBean bean);
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package com.hshh.system.base.service;
|
||||
|
||||
import com.hshh.system.base.entity.Logs;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.hshh.system.common.bean.PaginationBean;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author liDongYu
|
||||
* @since 2025-08-22
|
||||
*/
|
||||
public interface LogsService extends IService<Logs> {
|
||||
/**
|
||||
* 查询列表.
|
||||
*
|
||||
* @param bean 查询请求
|
||||
* @return 结果列表
|
||||
*/
|
||||
List<Logs> list(PaginationBean bean);
|
||||
|
||||
/**
|
||||
* 总条数.
|
||||
*
|
||||
* @param bean 查询请求
|
||||
* @return 总数
|
||||
*/
|
||||
Long count(PaginationBean bean);
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package com.hshh.system.base.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.hshh.system.base.entity.Logs;
|
||||
import com.hshh.system.base.mapper.LogsMapper;
|
||||
import com.hshh.system.base.service.LogsService;
|
||||
import com.hshh.system.common.bean.PaginationBean;
|
||||
import java.util.List;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 服务实现类.
|
||||
*
|
||||
* @author liDongYu
|
||||
* @since 2025-08-22
|
||||
*/
|
||||
@Service
|
||||
public class LogsServiceImpl extends ServiceImpl<LogsMapper, Logs> implements LogsService {
|
||||
|
||||
@Override
|
||||
public List<Logs> list(PaginationBean bean) {
|
||||
return this.baseMapper.list(bean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long count(PaginationBean bean) {
|
||||
return this.baseMapper.count(bean);
|
||||
}
|
||||
}
|
64
manager-system/src/main/resources/mapper/LogsMapper.xml
Normal file
64
manager-system/src/main/resources/mapper/LogsMapper.xml
Normal file
|
@ -0,0 +1,64 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.hshh.system.base.mapper.LogsMapper">
|
||||
<select id="list" resultType="com.hshh.system.base.entity.Logs"
|
||||
parameterType="com.hshh.system.common.bean.PaginationBean" databaseId="mysql">
|
||||
SELECT
|
||||
@rownum := @rownum + 1 AS seq,
|
||||
t.*
|
||||
FROM (
|
||||
SELECT * FROM s_logs
|
||||
<where>
|
||||
<if test="businessKeyStr!=null and businessKeyStr!=''">
|
||||
and type = #{businessKeyStr}
|
||||
</if>
|
||||
<if test="search != null and search !='' ">
|
||||
and (msg LIKE CONCAT('%',#{search},'%') or operator LIKE CONCAT('%',#{search},'%'))
|
||||
</if>
|
||||
</where>
|
||||
order by id desc ) t, ( SELECT @rownum := #{start} ) r limit
|
||||
#{start},#{pageSize}
|
||||
</select>
|
||||
<select id="list" resultType="com.hshh.system.base.entity.Logs"
|
||||
parameterType="com.hshh.system.common.bean.PaginationBean" databaseId="dm">SELECT
|
||||
t.seq,
|
||||
t.*
|
||||
FROM (
|
||||
SELECT
|
||||
ROW_NUMBER() OVER (ORDER BY id desc) AS seq,
|
||||
a.*
|
||||
FROM s_logs a
|
||||
<where>
|
||||
<if test="businessKeyStr!=null and businessKeyStr!='' " >
|
||||
and type = #{businessKeyStr}
|
||||
</if>
|
||||
<if test="search != null and search !='' ">
|
||||
and ( msg LIKE '%'||#{search}||'%' or operator LIKE '%'||#{search}||'%')
|
||||
</if>
|
||||
</where>
|
||||
) t
|
||||
WHERE t.seq > #{start} AND t.seq <= (#{start} + #{pageSize})
|
||||
</select>
|
||||
<select id="count" resultType="java.lang.Long" databaseId="dm">
|
||||
select count(id) from s_logs
|
||||
<where>
|
||||
<if test="businessKeyStr!=null and businessKeyStr!='' ">
|
||||
and type = #{businessKeyStr}
|
||||
</if>
|
||||
<if test="search != null and search !=''">
|
||||
and ( msg LIKE '%'||#{search}||'%' or operator LIKE '%'||#{search}||'%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="count" resultType="java.lang.Long" databaseId="mysql">
|
||||
select count(id) from s_logs
|
||||
<where>
|
||||
<if test="businessKeyStr!=null and businessKeyStr!='' ">
|
||||
and type = #{businessKeyStr}
|
||||
</if>
|
||||
<if test="search != null and search !=''">
|
||||
and (msg LIKE CONCAT('%',#{search},'%') or operator LIKE CONCAT('%',#{search},'%'))
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user