From f44187822ea6217070c0f6fc585c3feadea03cb1 Mon Sep 17 00:00:00 2001
From: chengf <2156125618@qq.com>
Date: 星期三, 13 八月 2025 09:30:18 +0800
Subject: [PATCH] 折扣逻辑修改2025/08/13

---
 java110-db/src/main/resources/mapper/fee/FeeServiceDaoImplMapper.xml |   31 ++++++++++++++++++++++++++++---
 1 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/java110-db/src/main/resources/mapper/fee/FeeServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/fee/FeeServiceDaoImplMapper.xml
index a852ad6..f8a86a3 100755
--- a/java110-db/src/main/resources/mapper/fee/FeeServiceDaoImplMapper.xml
+++ b/java110-db/src/main/resources/mapper/fee/FeeServiceDaoImplMapper.xml
@@ -136,7 +136,7 @@
         pfa2.`value` ownerName,t.batch_id,t.batch_id batchId,
         pfc.pay_online payOnline,pfc.scale,pfc.decimal_place decimalPlace,pfc.units,pfc.prepayment_period
         prepaymentPeriod,
-        pfrb.rule_id ruleId,pfrb.month_cycle monthCycle
+        pfrb.rule_id ruleId,pfrb.month_cycle monthCycle,t.is_contract_fee isContractFee
         from pay_fee t
         INNER join pay_fee_config pfc on t.config_id = pfc.config_id and
         pfc.status_cd = '0'
@@ -235,6 +235,13 @@
         <if test="curYear !=null and curYear != ''">
             and DATE_FORMAT(t.end_time,'%Y') = #{curYear}
         </if>
+        <if test="isContractFee != null">
+            and t.is_contract_fee = #{isContractFee}
+        </if>
+        <if test="isContractFee == null">
+            and t.is_contract_fee IS NULL
+        </if>
+
         order by t.create_time desc
         <if test="page != -1 and page != null ">
             limit #{page}, #{row}
@@ -274,6 +281,13 @@
         <if test="payerObjId != null and payerObjId != ''">  <!-- 淇鍘熸潯浠朵腑鐨勫彉閲忛敊璇� -->
             and t.payer_obj_id = #{payerObjId}
         </if>
+        <if test="isContractFee != null">
+            and t.is_contract_fee = #{isContractFee}
+        </if>
+        <if test="isContractFee == null">
+            and t.is_contract_fee IS NULL
+        </if>
+
     </select>
 
     <!-- 淇敼璐圭敤淇℃伅 add by wuxw 2018-07-03 -->
@@ -314,6 +328,9 @@
         </if>
         <if test="feeFlag !=null and feeFlag != ''">
             , t.fee_flag= #{feeFlag}
+        </if>
+        <if test="isContractFee !=null and isContractFee != ''">
+            , t.is_contract_fee = #{isContractFee}
         </if>
         where 1=1
         <if test="bId !=null and bId != ''">
@@ -383,6 +400,14 @@
             and t.community_id= #{communityId}
             and pfc.community_id in (#{communityId},'9999')
         </if>
+
+        <if test="isContractFee != null">
+            and is_contract_fee = #{isContractFee}
+        </if>
+        <if test="isContractFee == null">
+            and is_contract_fee IS NULL
+        </if>
+
         <if test="bId !=null and bId != ''">
             and t.b_id= #{bId}
         </if>
@@ -814,11 +839,11 @@
     <!-- 鎵归噺鎻掑叆璐圭敤 -->
     <insert id="insertFees" parameterType="Map">
         insert into pay_fee (amount,status_cd,income_obj_id,fee_type_cd,secondary_fee_type_cd,start_time,end_time,community_id,b_id,fee_id,
-        user_id,payer_obj_id,fee_flag,state,config_id,payer_obj_type,batch_id)
+        user_id,payer_obj_id,fee_flag,state,config_id,payer_obj_type,batch_id,is_contract_fee)
         VALUES
         <foreach collection="payFeePos" item="item" separator=",">
             (#{item.amount},'0',#{item.incomeObjId},#{item.feeTypeCd},#{item.secondaryFeeTypeCd},#{item.startTime},#{item.endTime},#{item.communityId},
-            '-1',#{item.feeId},#{item.userId},#{item.payerObjId},#{item.feeFlag},#{item.state},#{item.configId},#{item.payerObjType},#{item.batchId})
+            '-1',#{item.feeId},#{item.userId},#{item.payerObjId},#{item.feeFlag},#{item.state},#{item.configId},#{item.payerObjType},#{item.batchId},#{item.isContractFee})
         </foreach>
     </insert>
 

--
Gitblit v1.8.0