From 9a1843b565b97326c78b2e41fc6b7953f5af84d9 Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期二, 23 七月 2024 10:15:34 +0800
Subject: [PATCH] 运维阈值key

---
 ycl-server/src/main/resources/mapper/zgyw/CalculateRuleMapper.xml |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/ycl-server/src/main/resources/mapper/zgyw/CalculateRuleMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/CalculateRuleMapper.xml
index ec90956..5ec3a0d 100644
--- a/ycl-server/src/main/resources/mapper/zgyw/CalculateRuleMapper.xml
+++ b/ycl-server/src/main/resources/mapper/zgyw/CalculateRuleMapper.xml
@@ -35,6 +35,21 @@
         where id = #{id}
     </select>
 
+    <select id="getRuleListByUnitId" resultType="com.ycl.platform.domain.vo.CalculateRuleCascaderVO">
+        select id,
+               deduct_category,
+               calc_fraction,
+               calc_unit,
+               id as value,
+               contract_id,
+               if(rule_condition is not null, rule_condition, if(rule_desc is not null, rule_desc, rule_name)) as label,
+               parent_id
+        from t_calculate_rule
+        where deleted = 0
+          and contract_id
+            in (select id from t_contract where unit_id = #{unitId} and deleted = 0 and start_time <![CDATA[ <=  ]]> #{now} and end_time >= #{now} )
+    </select>
+
     <insert id="insertDefaultRule" useGeneratedKeys="true" keyProperty="id">
         insert into t_calculate_rule
         <trim prefix="(" suffix=")" suffixOverrides=",">

--
Gitblit v1.8.0