wujianwei
2026-01-12 5dc6be84f02788d98a67a7488e7fb2c8d4b08c04
service/src/main/resources/mapper/cwgl/PayableFeeManagementMapper.xml
@@ -19,6 +19,7 @@
        <result property="businessTime"    column="business_time"    />
        <result property="payableConfirmTime"    column="payable_confirm_time"    />
        <result property="payableAmount"    column="payable_amount"    />
        <result property="payableAmountStr"    column="payable_amount_str"    />
        <result property="status"    column="status"    />
        <result property="remark"    column="remark"    />
        <result property="createBy"    column="create_by"    />
@@ -29,7 +30,7 @@
    </resultMap>
    <sql id="selectPayableFeeManagementVo">
        select thisTab.id, thisTab.system_no, thisTab.related_bill_no, thisTab.source_system, thisTab.business_sector, thisTab.document_type, thisTab.document_no, thisTab.is_internal_settlement, thisTab.internal_settlement_unit, thisTab.supplier_name, thisTab.project_name, thisTab.business_time, thisTab.payable_confirm_time, thisTab.payable_amount, thisTab.status, thisTab.remark, thisTab.create_by, thisTab.create_time, thisTab.update_by, thisTab.update_time, thisTab.deleted from payable_fee_management AS thisTab
        select thisTab.id, thisTab.system_no, thisTab.related_bill_no, thisTab.source_system, thisTab.business_sector, thisTab.document_type, thisTab.document_no, thisTab.is_internal_settlement, thisTab.internal_settlement_unit, thisTab.supplier_name, thisTab.project_name, thisTab.business_time, thisTab.payable_confirm_time, thisTab.payable_amount, thisTab.payable_amount_str, thisTab.status, thisTab.remark, thisTab.create_by, thisTab.create_time, thisTab.update_by, thisTab.update_time, thisTab.deleted from payable_fee_management AS thisTab
    </sql>
    <sql id="selectPayableFeeManagementVoCount">
        select count(0) from payable_fee_management as thisTab
@@ -91,6 +92,7 @@
            <if test="businessTime != null">business_time,</if>
            <if test="payableConfirmTime != null">payable_confirm_time,</if>
            <if test="payableAmount != null">payable_amount,</if>
            <if test="payableAmountStr != null and payableAmountStr != ''">payable_amount_str,</if>
            <if test="status != null">status,</if>
            <if test="remark != null">remark,</if>
            <if test="createBy != null">create_by,</if>
@@ -113,6 +115,7 @@
            <if test="businessTime != null">#{businessTime},</if>
            <if test="payableConfirmTime != null">#{payableConfirmTime},</if>
            <if test="payableAmount != null">#{payableAmount},</if>
            <if test="payableAmountStr != null and payableAmountStr != ''">#{payableAmountStr},</if>
            <if test="status != null">#{status},</if>
            <if test="remark != null">#{remark},</if>
            <if test="createBy != null">#{createBy},</if>
@@ -126,11 +129,11 @@
    <insert id="insertPayableFeeManagementBatch" parameterType="java.util.List"  useGeneratedKeys="true" keyProperty="id">
        insert into payable_fee_management
        <trim prefix="(" suffix=") values" suffixOverrides=",">
            id,system_no,related_bill_no,source_system,business_sector,document_type,document_no,is_internal_settlement,internal_settlement_unit,supplier_name,project_name,business_time,payable_confirm_time,payable_amount,status,remark,create_by,create_time,update_by,update_time,deleted,
            id,system_no,related_bill_no,source_system,business_sector,document_type,document_no,is_internal_settlement,internal_settlement_unit,supplier_name,project_name,business_time,payable_confirm_time,payable_amount,payable_amount_str,status,remark,create_by,create_time,update_by,update_time,deleted,
        </trim>
        <foreach item="item" index="index" collection="list" separator=",">
            <trim prefix="(" suffix=") " suffixOverrides=",">
                #{item.id},#{item.systemNo},#{item.relatedBillNo},#{item.sourceSystem},#{item.businessSector},#{item.documentType},#{item.documentNo},#{item.isInternalSettlement},#{item.internalSettlementUnit},#{item.supplierName},#{item.projectName},#{item.businessTime},#{item.payableConfirmTime},#{item.payableAmount},#{item.status},#{item.remark},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.deleted},
                #{item.id},#{item.systemNo},#{item.relatedBillNo},#{item.sourceSystem},#{item.businessSector},#{item.documentType},#{item.documentNo},#{item.isInternalSettlement},#{item.internalSettlementUnit},#{item.supplierName},#{item.projectName},#{item.businessTime},#{item.payableConfirmTime},#{item.payableAmount},#{item.payableAmountStr},#{item.status},#{item.remark},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.deleted},
            </trim>
        </foreach>
    </insert>
@@ -152,6 +155,7 @@
            <if test="businessTime != null">business_time = #{businessTime},</if>
            <if test="payableConfirmTime != null">payable_confirm_time = #{payableConfirmTime},</if>
            <if test="payableAmount != null">payable_amount = #{payableAmount},</if>
            <if test="payableAmountStr != null and payableAmountStr != ''">payable_amount_str = #{payableAmountStr},</if>
            <if test="status != null">status = #{status},</if>
            <if test="remark != null">remark = #{remark},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
@@ -180,6 +184,7 @@
                <if test="item.businessTime != null">business_time = #{item.businessTime},</if>
                <if test="item.payableConfirmTime != null">payable_confirm_time = #{item.payableConfirmTime},</if>
                <if test="item.payableAmount != null">payable_amount = #{item.payableAmount},</if>
                <if test="item.payableAmountStr != null and item.payableAmountStr != ''">payable_amount_str = #{item.payableAmountStr},</if>
                <if test="item.status != null">status = #{item.status},</if>
                <if test="item.remark != null">remark = #{item.remark},</if>
                <if test="item.createBy != null">create_by = #{item.createBy},</if>
@@ -203,4 +208,20 @@
        </foreach>
    </delete>
    <!--根据关联账单编号批量更新应付费用管理记录,清除关联账单编号并将状态改为0(待生成账单)-->
    <update id="updatePayableFeeManagementByRelatedBillNo" parameterType="String">
        update payable_fee_management
        set related_bill_no = null, status = '0', update_time = now()
        where related_bill_no = #{relatedBillNo}
    </update>
    <!--根据应付费用ID数组查询应付费用管理列表-->
    <select id="selectPayableFeeManagementByIds" parameterType="Integer" resultMap="PayableFeeManagementResult">
        <include refid="selectPayableFeeManagementVo"/>
        where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </select>
</mapper>