From b88a288f4f787b509463678e3cd9ccfa3f37014b Mon Sep 17 00:00:00 2001
From: chengf <cgf12138@163.com>
Date: 星期三, 11 三月 2026 12:01:05 +0800
Subject: [PATCH] 导入测试

---
 java110-db/src/main/resources/mapper/fee/FeeServiceDaoImplMapper.xml |  479 +++++++++++++++++++++++++++++++++++------------------------
 1 files changed, 286 insertions(+), 193 deletions(-)

diff --git a/java110-db/src/main/resources/mapper/fee/FeeServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/fee/FeeServiceDaoImplMapper.xml
index 18d524a..76fee67 100755
--- a/java110-db/src/main/resources/mapper/fee/FeeServiceDaoImplMapper.xml
+++ b/java110-db/src/main/resources/mapper/fee/FeeServiceDaoImplMapper.xml
@@ -1,28 +1,27 @@
 <?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper
-        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="feeServiceDaoImpl">
 
     <!-- 淇濆瓨璐圭敤淇℃伅 add by wuxw 2018-07-03 -->
     <insert id="saveBusinessFeeInfo" parameterType="Map">
-        insert into business_pay_fee(
-        amount,operate,income_obj_id,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
-        ) values (
-        #{amount},#{operate},#{incomeObjId},#{feeTypeCd},#{startTime},#{endTime},#{communityId},#{bId},#{feeId},#{userId},#{payerObjId},
-        #{feeFlag},#{state},#{configId},#{payerObjType},#{batchId}
-        )
+        insert into business_pay_fee(amount, operate, income_obj_id, 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)
+        values (#{amount}, #{operate}, #{incomeObjId}, #{feeTypeCd}, #{startTime}, #{endTime}, #{communityId}, #{bId},
+                #{feeId}, #{userId}, #{payerObjId},
+                #{feeFlag}, #{state}, #{configId}, #{payerObjType}, #{batchId})
     </insert>
-
 
     <!-- 鏌ヨ璐圭敤淇℃伅锛圔usiness锛� add by wuxw 2018-07-03 -->
     <select id="getBusinessFeeInfo" parameterType="Map" resultType="Map">
         select t.amount,t.operate,t.income_obj_id,t.income_obj_id incomeObjId,t.fee_type_cd,t.fee_type_cd
-        feeTypeCd,t.start_time,t.start_time startTime,t.end_time,t.end_time endTime,t.community_id,t.community_id
+        feeTypeCd,s.secondary_fee_type_cd_name,s.secondary_fee_type_cd_name secondaryFeeTypeCdName,t.start_time,t.start_time startTime,t.end_time,t.end_time endTime,t.community_id,t.community_id
         communityId,t.b_id,t.b_id bId,t.fee_id,t.fee_id feeId,t.user_id,t.user_id userId,t.payer_obj_id,t.payer_obj_id
         payerObjId,t.fee_flag,t.fee_flag feeFlag,t.state,t.config_id,t.config_id
         configId,t.payer_obj_type,t.payer_obj_type payerObjType,t.batch_id,t.batch_id batchId
         from business_pay_fee t
+        left join secondary_fee_type_cd_tb s on t.secondary_fee_type_cd = s.secondary_fee_type_cd
         where 1 =1
         <if test="amount !=null and amount != ''">
             and t.amount= #{amount}
@@ -66,9 +65,7 @@
         <if test="payerObjType !=null and payerObjType != ''">
             and t.payer_obj_type = #{payerObjType}
         </if>
-
     </select>
-
 
     <!-- 淇濆瓨璐圭敤淇℃伅鑷� instance琛ㄤ腑 add by wuxw 2018-07-03 -->
     <insert id="saveFeeInfoInstance" parameterType="Map">
@@ -115,30 +112,254 @@
         <if test="configId !=null and configId != ''">
             and t.config_id= #{configId}
         </if>
-
         <if test="payerObjType !=null and payerObjType != ''">
             and t.payer_obj_type = #{payerObjType}
         </if>
-
     </insert>
-
 
     <!-- 鏌ヨ璐圭敤淇℃伅 add by wuxw 2018-07-03 -->
     <select id="getFeeInfo" parameterType="Map" resultType="Map">
         select t.amount,t.income_obj_id,t.income_obj_id incomeObjId,t.fee_type_cd,t.fee_type_cd
-        feeTypeCd,t.start_time,t.start_time startTime,t.status_cd,t.status_cd statusCd,t.end_time,t.end_time
+        feeTypeCd,s.secondary_fee_type_cd_name,s.secondary_fee_type_cd_name secondaryFeeTypeCdName,t.start_time,t.start_time startTime,t.status_cd,t.status_cd statusCd,t.end_time,t.end_time
         endTime,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.fee_id,t.fee_id feeId,t.user_id,t.user_id
         userId,t.payer_obj_id,t.payer_obj_id payerObjId,pfc.square_price squarePrice,pfc.additional_amount
-        additionalAmount,pfc.fee_flag,pfc.fee_flag feeFlag,t.state,t.config_id,t.config_id configId,
+        additionalAmount,t.fee_flag,t.fee_flag feeFlag,t.state,t.config_id,t.config_id configId,
         pfc.fee_name feeName,td1.name feeTypeCdName,td2.name stateName,td3.name feeFlagName,pfc.computing_formula
         computingFormula,pfc.computing_formula_text computingFormulaText,
         pfc.bill_type billType,t.payer_obj_type,t.payer_obj_type payerObjType,pfc.is_default isDefault,pfc.start_time
         configStartTime,pfc.end_time configEndTime,pfc.payment_cd paymentCd,pfc.payment_cycle paymentCycle,td4.name
         billTypeName,pfa.value importFeeName,ifd.end_time importFeeEndTime,mw.cur_degrees curDegrees,mw.pre_degrees
         preDegrees,
-        mw.pre_reading_time preReadingTime,mw.cur_reading_time curReadingTime,pfa1.`value` deadlineTime,pfa1.`value` maxEndTime,mw.price
+        mw.pre_reading_time preReadingTime,mw.cur_reading_time curReadingTime,pfa1.`value` deadlineTime,pfa1.`value`
+        maxEndTime,mw.price
         mwPrice,
-        pfa2.`value` ownerName,t.batch_id,t.batch_id batchId
+        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,t.is_contract_fee isContractFee,t.contract_fee contractFee
+        from pay_fee t
+        INNER join pay_fee_config pfc on t.config_id = pfc.config_id and
+        pfc.status_cd = '0'
+        left join t_dict td1 on pfc.fee_type_cd = td1.status_cd and td1.table_name = 'pay_fee_config' and
+        td1.table_columns = 'fee_type_cd'
+        left join t_dict td2 on t.state = td2.status_cd and td2.table_name = 'pay_fee' and td2.table_columns = 'state'
+        left join t_dict td3 on t.fee_flag = td3.status_cd and td3.table_name = 'pay_fee' and td3.table_columns =
+        'fee_flag'
+        left join t_dict td4 on pfc.bill_type = td4.status_cd and td4.table_name = 'pay_fee_config' and
+        td4.table_columns = 'bill_type'
+        LEFT JOIN pay_fee_attrs pfa on t.fee_id = pfa.fee_id and pfa.spec_cd = '390002' and pfa.status_cd = '0'
+        LEFT JOIN pay_fee_attrs pfa1 on t.fee_id = pfa1.fee_id and pfa1.spec_cd = '390010' and pfa1.status_cd = '0'
+        LEFT JOIN pay_fee_attrs pfa2 on t.fee_id = pfa2.fee_id and pfa2.spec_cd = '390008' and pfa2.status_cd = '0'
+        left join import_fee_detail ifd on t.fee_id = ifd.fee_id and ifd.status_cd = '0' and t.fee_flag = '2006012'
+        LEFT JOIN meter_water mw on t.fee_id = mw.fee_id and mw.status_cd = '0' and mw.community_id = t.community_id
+        LEFT JOIN pay_fee_rule_bill pfrb on t.fee_id = pfrb.fee_id and pfrb.status_cd = '0' and pfrb.community_id =
+        t.community_id
+        left join secondary_fee_type_cd_tb s on t.secondary_fee_type_cd = s.secondary_fee_type_cd
+        <if test="ownerId != null and ownerId != ''">
+            LEFT JOIN pay_fee_attrs pfao on t.fee_id = pfao.fee_id and pfao.spec_cd = '390007' and pfao.status_cd = '0'
+        </if>
+        where 1 =1
+        <if test="amount !=null and amount != ''">
+            and t.amount= #{amount}
+        </if>
+        <if test="ownerId !=null and ownerId != ''">
+            and pfao.value= #{ownerId}
+        </if>
+        <if test="incomeObjId !=null and incomeObjId != ''">
+            and t.income_obj_id= #{incomeObjId}
+        </if>
+          <if test="feeName != null and feeName != ''">
+              and pfc.fee_name = #{feeName}
+          </if>
+        <if test="feeTypeCd !=null and feeTypeCd != ''">
+            and t.fee_type_cd= #{feeTypeCd}
+        </if>
+        <if test="feeTypeCds != null ">
+            and t.fee_type_cd in
+            <foreach collection="feeTypeCds" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="startTime !=null ">
+            and t.start_time= #{startTime}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="endTime !=null ">
+            and t.end_time= #{endTime}
+        </if>
+        <if test="arrearsEndTime != null">
+            and t.end_time &lt; #{arrearsEndTime}
+        </if>
+        <if test="nowDate != null">
+            and t.end_time &gt; #{nowDate}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id in (#{communityId},'9999')
+            and pfc.community_id in (#{communityId},'9999')
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+        <if test="feeId !=null and feeId != ''">
+            and t.fee_id= #{feeId}
+        </if>
+        <if test="useFeeName !=null and useFeeName != ''">
+            and pfc.fee_name like '%${useFeeName}%'
+        </if>
+        <if test="payerObjId !=null and payerObjId != ''">
+            and (t.payer_obj_id= #{payerObjId} or t.contract_fee = #{payerObjId})
+        </if>
+        <if test="payerObjIds != null and payerObjIds.length > 0">
+            and t.payer_obj_id in
+            <foreach collection="payerObjIds" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="state !=null and state != ''">
+            and t.state= #{state}
+        </if>
+        <if test="feeFlag !=null and feeFlag != ''">
+            and t.fee_flag= #{feeFlag}
+        </if>
+        <if test="configId !=null and configId != ''">
+            and t.config_id= #{configId}
+        </if>
+        <if test="configIds != null and configIds.length > 0">
+            and t.config_id in
+            <foreach collection="configIds" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="payerObjType !=null and payerObjType != ''">
+            and t.payer_obj_type = #{payerObjType}
+        </if>
+        <if test="deductFrom !=null and deductFrom != ''">
+            and pfc.deduct_from = #{deductFrom}
+        </if>
+        <if test="curYear !=null and curYear != ''">
+            and DATE_FORMAT(t.end_time,'%Y') = #{curYear}
+        </if>
+        <if test="contractFee != null">
+            and t.contract_fee = ${contractFee}
+        </if>
+        <if test="useStart != null">
+            and t.end_time &lt;= #{useStart}
+        </if>
+        <if test="useEnd != null">
+            and DATE_ADD(STR_TO_DATE(pfa1.`value`, '%Y-%m-%d 23:59:59.%f'), INTERVAL 2 DAY) >= #{useEnd}
+        </if>
+        order by t.create_time desc
+        <if test="page != -1 and page != null ">
+            limit #{page}, #{row}
+        </if>
+    </select>
+
+    <select id="getFeeInfoBus" resultType="Map" parameterType="Map">
+        select count(1) count
+        from pay_fee t
+            INNER join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
+            left join t_dict td1 on pfc.fee_type_cd = td1.status_cd and td1.table_name = 'pay_fee_config' and td1.table_columns = 'fee_type_cd'
+            left join t_dict td2 on t.state = td2.status_cd and td2.table_name = 'pay_fee' and td2.table_columns = 'state'
+            left join t_dict td3 on pfc.fee_flag = td3.status_cd and td3.table_name = 'pay_fee' and td3.table_columns = 'fee_flag'
+            left join t_dict td4 on pfc.bill_type = td4.status_cd and td4.table_name = 'pay_fee_config' and td4.table_columns = 'bill_type'
+            LEFT JOIN pay_fee_attrs pfa on t.fee_id = pfa.fee_id and pfa.spec_cd = '390002' and pfa.status_cd = '0'
+            LEFT JOIN pay_fee_attrs pfa1 on t.fee_id = pfa1.fee_id and pfa1.spec_cd = '390010' and pfa1.status_cd = '0'
+            LEFT JOIN pay_fee_attrs pfa2 on t.fee_id = pfa2.fee_id and pfa2.spec_cd = '390008' and pfa2.status_cd = '0'
+            left join import_fee_detail ifd on t.fee_id = ifd.fee_id and ifd.status_cd = '0' and t.fee_flag = '2006012'
+            LEFT JOIN meter_water mw on t.fee_id = mw.fee_id and mw.status_cd = '0' and mw.community_id = t.community_id
+        where 1 = 1
+        <if test="feeTypeCd != null and feeTypeCd != ''">
+            and t.fee_type_cd = #{feeTypeCd}
+        </if>
+        <if test="startTime != null">  <!-- 淇鍘熸潯浠朵腑鐨勫彉閲忛敊璇� -->
+            and t.start_time = #{startTime}
+        </if>
+        <if test="statusCd != null and statusCd != ''">  <!-- 淇鍘熸潯浠朵腑鐨勫彉閲忛敊璇� -->
+            and t.status_cd = #{statusCd}
+        </if>
+        <if test="endTime != null">
+            and STR_TO_DATE(pfa1.`value`, '%Y-%m-%d %H:%i:%s.%f') = #{endTime}
+        </if>
+        <if test="communityId != null and communityId != ''">  <!-- 淇鍘熸潯浠朵腑鐨勫彉閲忛敊璇� -->
+            and t.community_id = #{communityId}
+            and pfc.community_id in (#{communityId}, '9999')
+        </if>
+        <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>
+        <if test="contractFee != null">
+            and t.contract_fee = ${contractFee}
+        </if>
+        <if test="feeName != null">
+            and pfc.fee_name = ${feeName}
+        </if>
+    </select>
+
+    <!-- 淇敼璐圭敤淇℃伅 add by wuxw 2018-07-03 -->
+    <update id="updateFeeInfoInstance" parameterType="Map">
+        update pay_fee t set t.status_cd = #{statusCd}
+        <if test="newBId != null and newBId != ''">
+            ,t.b_id = #{newBId}
+        </if>
+        <if test="amount !=null and amount != ''">
+            , t.amount= #{amount}
+        </if>
+        <if test="incomeObjId !=null and incomeObjId != ''">
+            , t.income_obj_id= #{incomeObjId}
+        </if>
+        <if test="feeTypeCd !=null and feeTypeCd != ''">
+            , t.fee_type_cd= #{feeTypeCd}
+        </if>
+        <if test="secondaryFeeTypeCd !=null and secondaryFeeTypeCd != ''">
+            , t.secondary_fee_type_cd= #{secondaryFeeTypeCd}
+        </if>
+        <if test="startTime !=null ">
+            , t.start_time= #{startTime}
+        </if>
+        <if test="endTime !=null">
+            , t.end_time= #{endTime}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            , t.community_id= #{communityId}
+        </if>
+        <if test="userId !=null and userId != ''">
+            , t.user_id= #{userId}
+        </if>
+        <if test="payerObjId !=null and payerObjId != ''">
+            , t.payer_obj_id= #{payerObjId}
+        </if>
+        <if test="state !=null and state != ''">
+            , t.state= #{state}
+        </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 != ''">
+            and t.b_id= #{bId}
+        </if>
+        <if test="feeId !=null and feeId != ''">
+            and t.fee_id= #{feeId}
+        </if>
+        <if test="contractFee != null">
+            and t.contract_fee = ${contractFee}
+        </if>
+    </update>
+
+    <!-- 鏌ヨ璐圭敤鏁伴噺 add by wuxw 2018-07-03 -->
+    <select id="queryFeesCount" parameterType="Map" resultType="Map">
+        select count(1) count
         from pay_fee t
         INNER join pay_fee_config pfc on t.config_id = pfc.config_id and
         pfc.status_cd = '0'
@@ -195,6 +416,7 @@
             and t.community_id= #{communityId}
             and pfc.community_id in (#{communityId},'9999')
         </if>
+
         <if test="bId !=null and bId != ''">
             and t.b_id= #{bId}
         </if>
@@ -204,7 +426,7 @@
         <if test="payerObjId !=null and payerObjId != ''">
             and t.payer_obj_id= #{payerObjId}
         </if>
-        <if test="payerObjIds != null ">
+        <if test="payerObjIds != null and payerObjIds.length > 0">
             and t.payer_obj_id in
             <foreach collection="payerObjIds" item="item" open="(" close=")" separator=",">
                 #{item}
@@ -225,154 +447,13 @@
         <if test="deductFrom !=null and deductFrom != ''">
             and pfc.deduct_from = #{deductFrom}
         </if>
-
-        order by t.create_time desc
-        <if test="page != -1 and page != null ">
-            limit #{page}, #{row}
+        <if test="contractFee != null">
+            and t.contract_fee = ${contractFee}
         </if>
-
+        <if test="curYear !=null and curYear != ''">
+            and DATE_FORMAT(t.end_time,'%Y') = #{curYear}
+        </if>
     </select>
-
-
-    <!-- 淇敼璐圭敤淇℃伅 add by wuxw 2018-07-03 -->
-    <update id="updateFeeInfoInstance" parameterType="Map">
-        update pay_fee t set t.status_cd = #{statusCd}
-        <if test="newBId != null and newBId != ''">
-            ,t.b_id = #{newBId}
-        </if>
-        <if test="amount !=null and amount != ''">
-            , t.amount= #{amount}
-        </if>
-        <if test="incomeObjId !=null and incomeObjId != ''">
-            , t.income_obj_id= #{incomeObjId}
-        </if>
-        <if test="feeTypeCd !=null and feeTypeCd != ''">
-            , t.fee_type_cd= #{feeTypeCd}
-        </if>
-        <if test="startTime !=null ">
-            , t.start_time= #{startTime}
-        </if>
-        <if test="endTime !=null">
-            , t.end_time= #{endTime}
-        </if>
-        <if test="communityId !=null and communityId != ''">
-            , t.community_id= #{communityId}
-        </if>
-        <if test="userId !=null and userId != ''">
-            , t.user_id= #{userId}
-        </if>
-        <if test="payerObjId !=null and payerObjId != ''">
-            , t.payer_obj_id= #{payerObjId}
-        </if>
-        <if test="state !=null and state != ''">
-            , t.state= #{state}
-        </if>
-        <if test="feeFlag !=null and feeFlag != ''">
-            , t.fee_flag= #{feeFlag}
-        </if>
-        where 1=1
-        <if test="bId !=null and bId != ''">
-            and t.b_id= #{bId}
-        </if>
-        <if test="feeId !=null and feeId != ''">
-            and t.fee_id= #{feeId}
-        </if>
-
-    </update>
-
-    <!-- 鏌ヨ璐圭敤鏁伴噺 add by wuxw 2018-07-03 -->
-    <select id="queryFeesCount" parameterType="Map" resultType="Map">
-        select count(1) count
-        from pay_fee t,pay_fee_config pfc,t_dict td1,t_dict td2,t_dict td3,t_dict td4
-        <if test="ownerId != null and ownerId != ''">
-            ,pay_fee_attrs pfao
-        </if>
-        where 1 =1
-        and t.fee_type_cd = pfc.fee_type_cd
-        and t.config_id = pfc.config_id
-        and pfc.status_cd = '0'
-        and pfc.fee_type_cd = td1.status_cd
-        and td1.table_name = 'pay_fee_config'
-        and td1.table_columns = 'fee_type_cd'
-        and t.state = td2.status_cd
-        and td2.table_name = 'pay_fee'
-        and td2.table_columns = 'state'
-        and t.fee_flag = td3.status_cd
-        and td3.table_name = 'pay_fee'
-        and td3.table_columns = 'fee_flag'
-        and pfc.bill_type = td4.status_cd
-        and td4.table_name = 'pay_fee_config'
-        and td4.table_columns = 'bill_type'
-        <if test="ownerId != null and ownerId != ''">
-            and t.fee_id = pfao.fee_id
-            and pfao.spec_cd = '390007'
-            and pfao.status_cd = '0'
-            and pfao.value= #{ownerId}
-        </if>
-        <if test="amount !=null and amount != ''">
-            and t.amount= #{amount}
-        </if>
-        <if test="incomeObjId !=null and incomeObjId != ''">
-            and t.income_obj_id= #{incomeObjId}
-        </if>
-        <if test="feeTypeCd !=null and feeTypeCd != ''">
-            and t.fee_type_cd= #{feeTypeCd}
-        </if>
-        <if test="feeTypeCds != null ">
-            and t.fee_type_cd in
-            <foreach collection="feeTypeCds" item="item" open="(" close=")" separator=",">
-                #{item}
-            </foreach>
-        </if>
-        <if test="startTime !=null">
-            and t.start_time= #{startTime}
-        </if>
-        <if test="statusCd !=null and statusCd != ''">
-            and t.status_cd= #{statusCd}
-        </if>
-        <if test="endTime !=null ">
-            and t.end_time= #{endTime}
-        </if>
-        <if test="arrearsEndTime != null">
-            and t.end_time &lt; #{arrearsEndTime}
-        </if>
-        <if test="noArrearsEndTime != null">
-            and t.end_time &gt; #{noArrearsEndTime}
-        </if>
-        <if test="communityId !=null and communityId != ''">
-            and t.community_id= #{communityId}
-            and pfc.community_id= #{communityId}
-        </if>
-        <if test="bId !=null and bId != ''">
-            and t.b_id= #{bId}
-        </if>
-        <if test="feeId !=null and feeId != ''">
-            and t.fee_id= #{feeId}
-        </if>
-        <if test="payerObjId !=null and payerObjId != ''">
-            and t.payer_obj_id= #{payerObjId}
-        </if>
-        <if test="payerObjIds != null ">
-            and t.payer_obj_id in
-            <foreach collection="payerObjIds" item="item" open="(" close=")" separator=",">
-                #{item}
-            </foreach>
-        </if>
-        <if test="state !=null and state != ''">
-            and t.state= #{state}
-        </if>
-        <if test="feeFlag !=null and feeFlag != ''">
-            and t.fee_flag= #{feeFlag}
-        </if>
-        <if test="configId !=null and configId != ''">
-            and t.config_id= #{configId}
-        </if>
-        <if test="payerObjType !=null and payerObjType != ''">
-            and t.payer_obj_type = #{payerObjType}
-        </if>
-
-    </select>
-
 
     <!-- 鏌ヨ璐︽湡 -->
     <select id="queryBills" parameterType="Map" resultType="Map">
@@ -461,7 +542,6 @@
             and t.cur_bill = #{curBill}
         </if>
     </select>
-
 
     <!-- 鏌ヨ璐︽湡 -->
     <select id="queryBillOweFees" parameterType="Map" resultType="Map">
@@ -574,32 +654,35 @@
         </if>
     </select>
 
-
     <insert id="insertBillOweFees" parameterType="Map">
         INSERT INTO bill_owe_fee
         (`owe_id`, `bill_id`, `fee_id`, `bill_amount_owed`, `amount_owed`, `fee_end_time`, `owner_id`, `owner_name`,
-        `owner_tel`, `payer_obj_name`, `payer_obj_type`, `community_id`, `state`,deadline_time)
+         `owner_tel`, `payer_obj_name`, `payer_obj_type`, `community_id`, `state`, deadline_time)
         VALUES (#{oweId}, #{billId}, #{feeId}, #{billAmountOwed}, #{amountOwed}, #{feeEndTime}, #{ownerId},
-        #{ownerName},
-        #{ownerTel}, #{payerObjName}, #{payerObjType}, #{communityId}, #{state},#{deadlineTime})
+                #{ownerName},
+                #{ownerTel}, #{payerObjName}, #{payerObjType}, #{communityId}, #{state}, #{deadlineTime})
     </insert>
 
     <update id="updateBillOweFees" parameterType="Map">
-        update bill_owe_fee t set t.state = #{state} where t.fee_id = #{feeId} and t.community_id=#{communityId}
-        and t.bill_id=#{billId}
+        update bill_owe_fee t
+        set t.state = #{state}
+        where t.fee_id = #{feeId}
+          and t.community_id = #{communityId}
+          and t.bill_id = #{billId}
     </update>
 
     <insert id="insertBill" parameterType="Map">
         INSERT INTO bill (`bill_id`, `bill_name`, `receivable`, `receipts`, `bill_time`, `community_id`, `config_id`,
-        `remark`, `cur_bill`, `cur_receivable`)
+                          `remark`, `cur_bill`, `cur_receivable`)
         VALUES (#{billId}, #{billName}, #{receivable}, #{receipts}, #{billTime}, #{communityId}, #{configId},
-        #{remark}, #{curBill}, #{curReceivable})
+                #{remark}, #{curBill}, #{curReceivable})
     </insert>
 
     <update id="updateBill" parameterType="Map">
-        update bill set cur_bill= 'F' where config_id = #{configId}
+        update bill
+        set cur_bill= 'F'
+        where config_id = #{configId}
     </update>
-
 
     <!-- 鏌ヨ璐圭敤鏁伴噺 add by wuxw 2018-07-03 -->
     <select id="queryFeeByAttrCount" parameterType="Map" resultType="Map">
@@ -676,14 +759,15 @@
         <if test="payerObjType !=null and payerObjType != ''">
             and t.payer_obj_type = #{payerObjType}
         </if>
-
+        <if test="contractFee != null">
+            and t.contract_fee = ${contractFee}
+        </if>
     </select>
-
 
     <!-- 鏌ヨ璐圭敤淇℃伅 add by wuxw 2018-07-03 -->
     <select id="queryFeeByAttr" parameterType="Map" resultType="Map">
         select t.amount,t.income_obj_id,t.income_obj_id incomeObjId,t.fee_type_cd,t.fee_type_cd
-        feeTypeCd,t.start_time,t.start_time startTime,t.status_cd,t.status_cd statusCd,t.end_time,t.end_time
+        feeTypeCd,s.secondary_fee_type_cd_name,s.secondary_fee_type_cd_name secondaryFeeTypeCdName,t.start_time,t.start_time startTime,t.status_cd,t.status_cd statusCd,t.end_time,t.end_time
         endTime,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.fee_id,t.fee_id feeId,t.user_id,t.user_id
         userId,t.payer_obj_id,t.payer_obj_id payerObjId,pfc.square_price squarePrice,pfc.additional_amount
         additionalAmount,t.fee_flag,t.fee_flag feeFlag,t.state,t.config_id,t.config_id configId,
@@ -700,6 +784,7 @@
         left join t_dict td3 on t.fee_flag = td3.status_cd and td3.table_name = 'pay_fee' and td3.table_columns =
         'fee_flag'
         left join pay_fee_attrs pfa on t.fee_id = pfa.fee_id and pfa.status_cd='0'
+        left join secondary_fee_type_cd_tb s on t.secondary_fee_type_cd = s.secondary_fee_type_cd
         where pfa.spec_cd = #{specCd}
         and pfa.value = #{value}
         <if test="amount !=null and amount != ''">
@@ -764,20 +849,26 @@
         <if test="page != -1 and page != null ">
             limit #{page}, #{row}
         </if>
-
     </select>
 
     <!-- 鎵归噺鎻掑叆璐圭敤 -->
     <insert id="insertFees" parameterType="Map">
-        insert into pay_fee (amount,status_cd,income_obj_id,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)
+        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,is_contract_fee,contract_fee,create_time)
         VALUES
         <foreach collection="payFeePos" item="item" separator=",">
-            (#{item.amount},'0',#{item.incomeObjId},#{item.feeTypeCd},#{item.startTime},#{item.endTime},#{item.communityId},
-            '-1',#{item.feeId},#{item.userId},#{item.payerObjId},#{item.feeFlag},#{item.state},#{item.configId},#{item.payerObjType},#{item.batchId})
+            (#{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},#{item.isContractFee},#{item.contractFee}
+
+            <if test="item.createTime != null and item.createTime != ''">
+                ,#{item.createTime}
+            </if>
+            <if test="item.createTime == null or item.createTime == ''">
+                ,now()
+            </if>
+            )
         </foreach>
     </insert>
-
 
     <select id="computeBillOweFeeCount" parameterType="Map" resultType="Map">
         select count(1) count
@@ -823,7 +914,6 @@
         </if>
     </select>
 
-
     <select id="computeEveryOweFeeCount" parameterType="Map" resultType="Map">
         select count(1) count
         from pay_fee pf
@@ -866,13 +956,16 @@
         </if>
     </select>
 
-
     <!-- 鏍规嵁鎵规鍒犻櫎璐圭敤 add by wuxw 2018-07-03 -->
     <update id="deleteFeesByBatch" parameterType="Map">
-        update pay_fee t set t.status_cd = '1'
-        where 1=1
-        and t.batch_id= #{batchId}
-        and t.community_id= #{communityId}
-
+        update pay_fee t
+        set t.status_cd = '1'
+        where 1 = 1
+          and t.batch_id = #{batchId}
+          and t.community_id = #{communityId}
     </update>
+
+    <select id="countValidPayFeeByConfigId" parameterType="Map" resultType="Map">
+        select count(1) count from pay_fee where config_id = #{configId} and state != 2009001
+    </select>
 </mapper>

--
Gitblit v1.8.0