cgf
2025-08-23 9ec0a61f90ac2464eebc643bfe2d93ac9ba6e569
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,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'
@@ -203,7 +203,7 @@
            and t.fee_id= #{feeId}
        </if>
        <if test="payerObjId !=null and payerObjId != ''">
            and t.payer_obj_id= #{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
@@ -235,6 +235,10 @@
        <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>
        order by t.create_time desc
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
@@ -274,6 +278,16 @@
        <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>
    </select>
    <!-- 修改费用信息 add by wuxw 2018-07-03 -->
@@ -315,12 +329,18 @@
        <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>
@@ -383,6 +403,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>
@@ -412,6 +433,9 @@
        </if>
        <if test="deductFrom !=null and deductFrom != ''">
            and pfc.deduct_from = #{deductFrom}
        </if>
        <if test="contractFee != null">
            and t.contract_fee = ${contractFee}
        </if>
        <if test="curYear !=null and curYear != ''">
            and DATE_FORMAT(t.end_time,'%Y') = #{curYear}
@@ -722,6 +746,9 @@
        <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 -->
@@ -814,11 +841,19 @@
    <!-- 批量插入费用 -->
    <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,contract_fee,create_time)
        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},#{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>