Răsfoiți Sursa

安全指数代码提交

jingyuanchao 2 ani în urmă
părinte
comite
341780a59a

+ 90 - 0
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/safetyindex/vo/SafeIndexRuleCountVo.java

@@ -0,0 +1,90 @@
+package com.xunmei.common.core.domain.safetyindex.vo;
+
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+
+/**
+ * 安全指标配置表(t_safe_index_config)实体类
+ *
+ * @author oygj
+ * @since 2022-06-07 17:25:41
+ * @description 由 Mybatisplus Code Generator 创建
+ */
+@Data
+@NoArgsConstructor
+@Accessors(chain = true)
+public class SafeIndexRuleCountVo {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 指标分类code
+     */
+    private String typeCode;
+    /**
+     * 指标项目code
+     */
+    private String projectCode;
+    /**
+     * 指标要点code
+     */
+    private String pointCode;
+    /**
+     * 扣分方式 1:直接扣分,2最高扣分
+     */
+    private Integer deductionType;
+    /**
+     * 分值
+     */
+    private Integer score;
+    /**
+     * 扣分规则描述
+     */
+    private String formula;
+    /**
+     * 机构类型
+     */
+    private Integer orgType;
+    /**
+     * 是否删除 0否1是
+     */
+    private Integer deleted;
+    /**
+     * 周期,只有在指标分类为安保履职时使用
+     */
+    private Integer cycle;
+
+    private String remark;
+
+    private Long id;
+    /**
+     * 安全指标主键
+     */
+    private Long ruleId;
+    private Long itemId;
+    /**
+     * 细化指数描述
+     */
+    private String indicatorNote;
+    /**
+     * 计算类型 1累计数,2连续数,3 分类 ,4 固化值
+     */
+    private Integer calculateType;
+    /**
+     * 连续数,连续多少天
+     */
+    private Integer indicatorDays;
+    /**
+     * calculate_type为3是用来存具体分类
+     */
+    private Integer itemType;
+    /**
+     * 扣分系数
+     */
+    private Double itemValue;
+    /**
+     * 排序
+     */
+    private Integer orderNum;
+
+}

+ 4 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyindex/mapper/CoreSafetyIndexCalculateRuleMapper.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.xunmei.common.core.domain.safetyindex.domain.CoreSafetyIndexCalculateRule;
 import com.xunmei.common.core.domain.safetyindex.dto.CoreSafetyIndexCalculateRulePageDto;
 import com.xunmei.common.core.domain.safetyindex.vo.CoreSafetyIndexCalculateRulePageVo;
+import com.xunmei.common.core.domain.safetyindex.vo.SafeIndexRuleCountVo;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -65,4 +66,7 @@ public interface CoreSafetyIndexCalculateRuleMapper extends BaseMapper<CoreSafet
     int deleteCoreSafetyIndexCalculateRuleByIds(Long[] ids);
 
     Page<CoreSafetyIndexCalculateRulePageVo> selectPageData(Page<CoreSafetyIndexCalculateRulePageVo> pageRequest, @Param("request") CoreSafetyIndexCalculateRulePageDto request);
+
+    List<SafeIndexRuleCountVo> findSafeIndexRuleVoList();
+
 }

+ 10 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyindex/service/ICoreSafetyExceptionDataService.java

@@ -13,9 +13,18 @@ import java.util.Date;
  */
 public interface ICoreSafetyExceptionDataService extends IService<CoreSafetyExceptionData> {
 
-
+    /**
+     * 统计异常数据
+     * @param date
+     */
     void countExceptionData(String date);
 
+    /**
+     * 计算安全指标
+     * @param date
+     */
+    void calculateSafetyIndex(String date);
+
     void deleteExceptionData(Date date);
 
 }

+ 4 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyindex/service/ICoreSafetyIndexCalculateRuleService.java

@@ -7,6 +7,7 @@ import com.xunmei.common.core.domain.safetyindex.dto.CoreSafetyIndexCalculateRul
 import com.xunmei.common.core.domain.safetyindex.dto.CoreSafetyIndexCalculateRuleUpdateDto;
 import com.xunmei.common.core.domain.safetyindex.vo.CoreSafetyIndexCalculateRuleDetailVo;
 import com.xunmei.common.core.domain.safetyindex.vo.CoreSafetyIndexCalculateRulePageVo;
+import com.xunmei.common.core.domain.safetyindex.vo.SafeIndexRuleCountVo;
 import com.xunmei.common.core.web.page.TableDataInfo;
 
 import java.util.List;
@@ -73,4 +74,7 @@ public interface ICoreSafetyIndexCalculateRuleService extends IService<CoreSafet
      * @return Page
      */
     TableDataInfo<CoreSafetyIndexCalculateRulePageVo> selectPage(CoreSafetyIndexCalculateRulePageDto coreSafetyIndexCalculateRule);
+
+    List<SafeIndexRuleCountVo> findSafeIndexRuleVoList();
+
 }

+ 44 - 2
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyindex/service/impl/CoreSafetyExceptionDataServiceImpl.java

@@ -3,14 +3,17 @@ package com.xunmei.core.safetyindex.service.impl;
 import cn.hutool.core.date.DateField;
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.xunmei.common.core.domain.safetyindex.domain.CoreSafetyExceptionData;
+import com.xunmei.common.core.domain.safetyindex.vo.SafeIndexRuleCountVo;
 import com.xunmei.core.question.service.IQuestionService;
 import com.xunmei.core.resumption.service.ResumptionService;
 import com.xunmei.core.retrieval.service.ICoreMonitoringRetrievalTaskService;
 import com.xunmei.core.safetyindex.mapper.CoreSafetyExceptionDataMapper;
 import com.xunmei.core.safetyindex.service.ICoreSafetyExceptionDataService;
+import com.xunmei.core.safetyindex.service.ICoreSafetyIndexCalculateRuleService;
 import com.xunmei.system.api.RemoteOrgService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -19,6 +22,7 @@ import org.springframework.transaction.annotation.Transactional;
 import java.util.Date;
 import java.util.List;
 import java.util.TimeZone;
+import java.util.stream.Collectors;
 
 /**
  * 安全指标的异常数据Service业务层处理
@@ -28,6 +32,9 @@ import java.util.TimeZone;
  */
 @Service
 public class CoreSafetyExceptionDataServiceImpl extends ServiceImpl<CoreSafetyExceptionDataMapper, CoreSafetyExceptionData> implements ICoreSafetyExceptionDataService {
+    public static final String CORE_RESUMPTION = "core_resumption";
+    public static final String CORE_QUESTION = "core_question";
+    public static final String CORE_MONITORING_RETRIEVAL_TASK = "core_monitoring_retrieval_task";
     @Autowired
     private CoreSafetyExceptionDataMapper coreSafetyExceptionDataMapper;
     @Autowired
@@ -39,6 +46,9 @@ public class CoreSafetyExceptionDataServiceImpl extends ServiceImpl<CoreSafetyEx
     @Autowired
     private ICoreMonitoringRetrievalTaskService monitoringRetrievalTaskService;
 
+    @Autowired
+    private ICoreSafetyIndexCalculateRuleService ruleService;
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public void countExceptionData(String date) {
@@ -55,11 +65,43 @@ public class CoreSafetyExceptionDataServiceImpl extends ServiceImpl<CoreSafetyEx
 
     }
 
+    public static final String RESUMPTION_DICT_CODE = "1004";
+    public static final String QUESTION_DICT_CODE = "1005";
+    public static final String MONITORING_DICT_CODE = "1006";
+
+    @Override
+    public void calculateSafetyIndex(String date) {
+
+        DateTime time = dealTimeParam(date);
+        //获取指标配置
+        List<SafeIndexRuleCountVo> safeIndexConfigVoList = ruleService.findSafeIndexRuleVoList();
+        //履职的指标配置
+        List<SafeIndexRuleCountVo> resumptionIndexList = safeIndexConfigVoList.stream().filter(r -> ObjectUtil.equal(RESUMPTION_DICT_CODE, r.getTypeCode())).collect(Collectors.toList());
+        //问题整改的指标配置
+        List<SafeIndexRuleCountVo> questionIndexList = safeIndexConfigVoList.stream().filter(r -> ObjectUtil.equal(QUESTION_DICT_CODE, r.getTypeCode())).collect(Collectors.toList());
+        //监控调阅的指标配置
+        List<SafeIndexRuleCountVo> monitoringIndexList = safeIndexConfigVoList.stream().filter(r -> ObjectUtil.equal(MONITORING_DICT_CODE, r.getTypeCode())).collect(Collectors.toList());
+        //履职的异常数据
+        List<CoreSafetyExceptionData> resumptionExceptionDataList = queryExceptionDataList(CORE_RESUMPTION, time);
+        //问题整改的异常数据
+        List<CoreSafetyExceptionData> questionExceptionDataList = queryExceptionDataList(CORE_QUESTION, time);
+        //监控调阅的异常数据
+        List<CoreSafetyExceptionData> monitoringExceptionDataList = queryExceptionDataList(CORE_MONITORING_RETRIEVAL_TASK, time);
+
+    }
+
+    private List<CoreSafetyExceptionData> queryExceptionDataList(String dataSource, DateTime time) {
+        return lambdaQuery().eq(CoreSafetyExceptionData::getDataSource, dataSource)
+                .ge(CoreSafetyExceptionData::getDataTime, DateUtil.beginOfDay(time))
+                .le(CoreSafetyExceptionData::getDataTime, DateUtil.endOfDay(time))
+                .list();
+    }
+
     private void doMonitorExceptionData(DateTime time) {
         //获取监控调阅的异常数据 , 扩展字段2=overTime表示逾期数据  扩展字段2=nums表示异常通道数量数据
         //逾期数据 扩展字段1:周期
         //异常通道数量数据 扩展字段1:通道数
-        List<CoreSafetyExceptionData> resumptionExceptionList =  monitoringRetrievalTaskService.selectMonitorExceptionData(time);
+        List<CoreSafetyExceptionData> resumptionExceptionList = monitoringRetrievalTaskService.selectMonitorExceptionData(time);
         this.saveBatch(resumptionExceptionList);
     }
 
@@ -67,7 +109,7 @@ public class CoreSafetyExceptionDataServiceImpl extends ServiceImpl<CoreSafetyEx
         //未确认和已确认但未整改的
         //扩展字段1:来源任务id
         //扩展字段2:任务来源 1:履职,2:安全检查
-        List<CoreSafetyExceptionData> resumptionExceptionList =  questionService.selectQuestionExceptionData(time);
+        List<CoreSafetyExceptionData> resumptionExceptionList = questionService.selectQuestionExceptionData(time);
         this.saveBatch(resumptionExceptionList);
     }
 

+ 6 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyindex/service/impl/CoreSafetyIndexCalculateRuleServiceImpl.java

@@ -13,6 +13,7 @@ import com.xunmei.common.core.domain.safetyindex.dto.*;
 import com.xunmei.common.core.domain.safetyindex.vo.CoreSafetyIndexCalculateRuleDetailVo;
 import com.xunmei.common.core.domain.safetyindex.vo.CoreSafetyIndexCalculateRuleItemVo;
 import com.xunmei.common.core.domain.safetyindex.vo.CoreSafetyIndexCalculateRulePageVo;
+import com.xunmei.common.core.domain.safetyindex.vo.SafeIndexRuleCountVo;
 import com.xunmei.common.core.enums.OrgTypeEnum;
 import com.xunmei.common.core.enums.safetyindex.CalculateTypeEnums;
 import com.xunmei.common.core.exception.SystemException;
@@ -193,4 +194,9 @@ public class CoreSafetyIndexCalculateRuleServiceImpl extends ServiceImpl<CoreSaf
     public int deleteCoreSafetyIndexCalculateRuleById(Long id) {
         return coreSafetyIndexCalculateRuleMapper.deleteById(id);
     }
+
+    @Override
+    public List<SafeIndexRuleCountVo> findSafeIndexRuleVoList() {
+        return coreSafetyIndexCalculateRuleMapper.findSafeIndexRuleVoList();
+    }
 }

+ 185 - 132
soc-modules/soc-modules-core/src/main/resources/mapper/safetyindex/CoreSafetyIndexCalculateRuleMapper.xml

@@ -3,157 +3,203 @@
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.xunmei.core.safetyindex.mapper.CoreSafetyIndexCalculateRuleMapper">
-
-    <resultMap type="com.xunmei.common.core.domain.safetyindex.domain.CoreSafetyIndexCalculateRule" id="CoreSafetyIndexCalculateRuleResult">
-                <result property="id" column="id"/>
-                <result property="typeCode" column="type_code"/>
-                <result property="projectCode" column="project_code"/>
-                <result property="pointCode" column="point_code"/>
-                <result property="deductionType" column="deduction_type"/>
-                <result property="score" column="score"/>
-                <result property="formula" column="formula"/>
-                <result property="orgType" column="org_type"/>
-                <result property="deleted" column="deleted"/>
-                <result property="cycle" column="cycle"/>
+    <resultMap type="com.xunmei.common.core.domain.safetyindex.domain.CoreSafetyIndexCalculateRule"
+               id="CoreSafetyIndexCalculateRuleResult">
+        <result property="id" column="id"/>
+        <result property="typeCode" column="type_code"/>
+        <result property="projectCode" column="project_code"/>
+        <result property="pointCode" column="point_code"/>
+        <result property="deductionType" column="deduction_type"/>
+        <result property="score" column="score"/>
+        <result property="formula" column="formula"/>
+        <result property="orgType" column="org_type"/>
+        <result property="deleted" column="deleted"/>
+        <result property="cycle" column="cycle"/>
     </resultMap>
 
     <sql id="selectCoreSafetyIndexCalculateRuleVo">
-        select id, type_code, project_code, point_code, deduction_type, score, formula, org_type, deleted, cycle, remark
+        select id,
+               type_code,
+               project_code,
+               point_code,
+               deduction_type,
+               score,
+               formula,
+               org_type,
+               deleted,
+               cycle,
+               remark
         from core_safety_index_calculate_rule
     </sql>
 
-    <select id="selectCoreSafetyIndexCalculateRuleList" parameterType="com.xunmei.common.core.domain.safetyindex.domain.CoreSafetyIndexCalculateRule"
+    <select id="selectCoreSafetyIndexCalculateRuleList"
+            parameterType="com.xunmei.common.core.domain.safetyindex.domain.CoreSafetyIndexCalculateRule"
             resultMap="CoreSafetyIndexCalculateRuleResult">
         <include refid="selectCoreSafetyIndexCalculateRuleVo"/>
         <where>
-                        <if test="typeCode != null  and typeCode != ''">
-                            and type_code = #{typeCode}
-                        </if>
-                        <if test="projectCode != null  and projectCode != ''">
-                            and project_code = #{projectCode}
-                        </if>
-                        <if test="pointCode != null  and pointCode != ''">
-                            and point_code = #{pointCode}
-                        </if>
-                        <if test="deductionType != null ">
-                            and deduction_type = #{deductionType}
-                        </if>
-                        <if test="score != null ">
-                            and score = #{score}
-                        </if>
-                        <if test="formula != null  and formula != ''">
-                            and formula = #{formula}
-                        </if>
-                        <if test="orgType != null ">
-                            and org_type = #{orgType}
-                        </if>
-                        <if test="deleted != null ">
-                            and deleted = #{deleted}
-                        </if>
-                        <if test="cycle != null ">
-                            and cycle = #{cycle}
-                        </if>
+            <if test="typeCode != null  and typeCode != ''">
+                and type_code = #{typeCode}
+            </if>
+            <if test="projectCode != null  and projectCode != ''">
+                and project_code = #{projectCode}
+            </if>
+            <if test="pointCode != null  and pointCode != ''">
+                and point_code = #{pointCode}
+            </if>
+            <if test="deductionType != null ">
+                and deduction_type = #{deductionType}
+            </if>
+            <if test="score != null ">
+                and score = #{score}
+            </if>
+            <if test="formula != null  and formula != ''">
+                and formula = #{formula}
+            </if>
+            <if test="orgType != null ">
+                and org_type = #{orgType}
+            </if>
+            <if test="deleted != null ">
+                and deleted = #{deleted}
+            </if>
+            <if test="cycle != null ">
+                and cycle = #{cycle}
+            </if>
         </where>
     </select>
 
     <select id="selectCoreSafetyIndexCalculateRuleById" parameterType="Long"
             resultMap="CoreSafetyIndexCalculateRuleResult">
-            <include refid="selectCoreSafetyIndexCalculateRuleVo"/>
-            where id = #{id}
+        <include refid="selectCoreSafetyIndexCalculateRuleVo"/>
+        where id = #{id}
     </select>
 
-    <insert id="insertCoreSafetyIndexCalculateRule" parameterType="com.xunmei.common.core.domain.safetyindex.domain.CoreSafetyIndexCalculateRule">
+    <insert id="insertCoreSafetyIndexCalculateRule"
+            parameterType="com.xunmei.common.core.domain.safetyindex.domain.CoreSafetyIndexCalculateRule">
         insert into core_safety_index_calculate_rule
         <trim prefix="(" suffix=")" suffixOverrides=",">
-                    <if test="id != null">id,
-                    </if>
-                    <if test="typeCode != null">type_code,
-                    </if>
-                    <if test="projectCode != null">project_code,
-                    </if>
-                    <if test="pointCode != null">point_code,
-                    </if>
-                    <if test="deductionType != null">deduction_type,
-                    </if>
-                    <if test="score != null">score,
-                    </if>
-                    <if test="formula != null">formula,
-                    </if>
-                    <if test="orgType != null">org_type,
-                    </if>
-                    <if test="deleted != null">deleted,
-                    </if>
-                    <if test="cycle != null">cycle,
-                    </if>
-                    <if test="remark != null">remark,
-                    </if>
+            <if test="id != null">
+                id,
+            </if>
+            <if test="typeCode != null">
+                type_code,
+            </if>
+            <if test="projectCode != null">
+                project_code,
+            </if>
+            <if test="pointCode != null">
+                point_code,
+            </if>
+            <if test="deductionType != null">
+                deduction_type,
+            </if>
+            <if test="score != null">
+                score,
+            </if>
+            <if test="formula != null">
+                formula,
+            </if>
+            <if test="orgType != null">
+                org_type,
+            </if>
+            <if test="deleted != null">
+                deleted,
+            </if>
+            <if test="cycle != null">
+                cycle,
+            </if>
+            <if test="remark != null">
+                remark,
+            </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-                    <if test="id != null">#{id},
-                    </if>
-                    <if test="typeCode != null">#{typeCode},
-                    </if>
-                    <if test="projectCode != null">#{projectCode},
-                    </if>
-                    <if test="pointCode != null">#{pointCode},
-                    </if>
-                    <if test="deductionType != null">#{deductionType},
-                    </if>
-                    <if test="score != null">#{score},
-                    </if>
-                    <if test="formula != null">#{formula},
-                    </if>
-                    <if test="orgType != null">#{orgType},
-                    </if>
-                    <if test="deleted != null">#{deleted},
-                    </if>
-                    <if test="cycle != null">#{cycle},
-                    </if>
-                    <if test="remark != null">#{remark},
-                    </if>
+            <if test="id != null">
+                #{id},
+            </if>
+            <if test="typeCode != null">
+                #{typeCode},
+            </if>
+            <if test="projectCode != null">
+                #{projectCode},
+            </if>
+            <if test="pointCode != null">
+                #{pointCode},
+            </if>
+            <if test="deductionType != null">
+                #{deductionType},
+            </if>
+            <if test="score != null">
+                #{score},
+            </if>
+            <if test="formula != null">
+                #{formula},
+            </if>
+            <if test="orgType != null">
+                #{orgType},
+            </if>
+            <if test="deleted != null">
+                #{deleted},
+            </if>
+            <if test="cycle != null">
+                #{cycle},
+            </if>
+            <if test="remark != null">
+                #{remark},
+            </if>
         </trim>
     </insert>
 
-    <update id="updateCoreSafetyIndexCalculateRule" parameterType="com.xunmei.common.core.domain.safetyindex.domain.CoreSafetyIndexCalculateRule">
+    <update id="updateCoreSafetyIndexCalculateRule"
+            parameterType="com.xunmei.common.core.domain.safetyindex.domain.CoreSafetyIndexCalculateRule">
         update core_safety_index_calculate_rule
         <trim prefix="SET" suffixOverrides=",">
-                    <if test="typeCode != null">type_code =
-                        #{typeCode},
-                    </if>
-                    <if test="projectCode != null">project_code =
-                        #{projectCode},
-                    </if>
-                    <if test="pointCode != null">point_code =
-                        #{pointCode},
-                    </if>
-                    <if test="deductionType != null">deduction_type =
-                        #{deductionType},
-                    </if>
-                    <if test="score != null">score =
-                        #{score},
-                    </if>
-                    <if test="formula != null">formula =
-                        #{formula},
-                    </if>
-                    <if test="orgType != null">org_type =
-                        #{orgType},
-                    </if>
-                    <if test="deleted != null">deleted =
-                        #{deleted},
-                    </if>
-                    <if test="cycle != null">cycle =
-                        #{cycle},
-                    </if>
-                    <if test="remark != null">remark =
-                        #{remark},
-                    </if>
+            <if test="typeCode != null">
+                type_code =
+                #{typeCode},
+            </if>
+            <if test="projectCode != null">
+                project_code =
+                #{projectCode},
+            </if>
+            <if test="pointCode != null">
+                point_code =
+                #{pointCode},
+            </if>
+            <if test="deductionType != null">
+                deduction_type =
+                #{deductionType},
+            </if>
+            <if test="score != null">
+                score =
+                #{score},
+            </if>
+            <if test="formula != null">
+                formula =
+                #{formula},
+            </if>
+            <if test="orgType != null">
+                org_type =
+                #{orgType},
+            </if>
+            <if test="deleted != null">
+                deleted =
+                #{deleted},
+            </if>
+            <if test="cycle != null">
+                cycle =
+                #{cycle},
+            </if>
+            <if test="remark != null">
+                remark =
+                #{remark},
+            </if>
         </trim>
         where id = #{id}
     </update>
 
     <delete id="deleteCoreSafetyIndexCalculateRuleById" parameterType="Long">
         delete
-        from core_safety_index_calculate_rule where id = #{id}
+        from core_safety_index_calculate_rule
+        where id = #{id}
     </delete>
 
     <delete id="deleteCoreSafetyIndexCalculateRuleByIds" parameterType="String">
@@ -165,18 +211,25 @@
 
     <select id="selectPageData"
             resultType="com.xunmei.common.core.domain.safetyindex.vo.CoreSafetyIndexCalculateRulePageVo"
-    parameterType="com.xunmei.common.core.domain.safetyindex.dto.CoreSafetyIndexCalculateRulePageDto">
-        select t.id, t.org_type,t.type_code,t.project_code,t.point_code,t.deduction_type,t.score from core_safety_index_calculate_rule t
-        where  t.deleted=0
-            <if test="request.orgType !=null">
-                and t.org_type = #{request.orgType}
-            </if>
-            <if test="request.projectCode !=null">
-                and t.project_code = #{request.pointCode}
-            </if>
-            <if test="request.pointCode !=null">
-                and t.point_code = #{request.pointCode}
-            </if>
+            parameterType="com.xunmei.common.core.domain.safetyindex.dto.CoreSafetyIndexCalculateRulePageDto">
+        select t.id, t.org_type,t.type_code,t.project_code,t.point_code,t.deduction_type,t.score from
+        core_safety_index_calculate_rule t
+        where t.deleted=0
+        <if test="request.orgType !=null">
+            and t.org_type = #{request.orgType}
+        </if>
+        <if test="request.projectCode !=null">
+            and t.project_code = #{request.pointCode}
+        </if>
+        <if test="request.pointCode !=null">
+            and t.point_code = #{request.pointCode}
+        </if>
+    </select>
 
+    <select id="findSafeIndexRuleVoList" resultType="com.xunmei.common.core.domain.safetyindex.vo.SafeIndexRuleCountVo">
+        select a.*, b.*, b.id as itemId
+        from core_safety_index_calculate_rule a
+                 left join core_safety_index_calculate_rule_item b on a.id = b.rule_id
+        where a.deleted = 0
     </select>
 </mapper>