<?xml version="1.0" encoding="UTF-8" ?>
|
<!DOCTYPE mapper
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="com.ruoyi.cwgl.mapper.PayableFeeManagementMapper">
|
|
<resultMap type="com.ruoyi.cwgl.domain.PayableFeeManagement" id="PayableFeeManagementResult">
|
<result property="id" column="id" />
|
<result property="systemNo" column="system_no" />
|
<result property="relatedBillNo" column="related_bill_no" />
|
<result property="sourceSystem" column="source_system" />
|
<result property="businessSector" column="business_sector" />
|
<result property="documentType" column="document_type" />
|
<result property="documentNo" column="document_no" />
|
<result property="isInternalSettlement" column="is_internal_settlement" />
|
<result property="internalSettlementUnit" column="internal_settlement_unit" />
|
<result property="supplierName" column="supplier_name" />
|
<result property="projectName" column="project_name" />
|
<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" />
|
<result property="createTime" column="create_time" />
|
<result property="updateBy" column="update_by" />
|
<result property="updateTime" column="update_time" />
|
<result property="deleted" column="deleted" />
|
</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.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
|
</sql>
|
|
<sql id="whereCondition">
|
<if test="systemNo != null and systemNo != ''"> and thisTab.system_no = #{systemNo}</if>
|
<if test="relatedBillNo != null and relatedBillNo != ''"> and thisTab.related_bill_no = #{relatedBillNo}</if>
|
<if test="sourceSystem != null and sourceSystem != ''"> and thisTab.source_system = #{sourceSystem}</if>
|
<if test="businessSector != null and businessSector != ''"> and thisTab.business_sector = #{businessSector}</if>
|
<if test="documentType != null and documentType != ''"> and thisTab.document_type = #{documentType}</if>
|
<if test="documentNo != null and documentNo != ''"> and thisTab.document_no = #{documentNo}</if>
|
<if test="isInternalSettlement != null and isInternalSettlement != ''"> and thisTab.is_internal_settlement = #{isInternalSettlement}</if>
|
<if test="internalSettlementUnit != null and internalSettlementUnit != ''"> and thisTab.internal_settlement_unit = #{internalSettlementUnit}</if>
|
<if test="supplierName != null and supplierName != ''"> and thisTab.supplier_name like concat('%', #{supplierName}, '%')</if>
|
<if test="projectName != null and projectName != ''"> and thisTab.project_name like concat('%', #{projectName}, '%')</if>
|
<if test="businessTime != null "> and thisTab.business_time = #{businessTime}</if>
|
<if test="payableConfirmTime != null "> and thisTab.payable_confirm_time = #{payableConfirmTime}</if>
|
<if test="payableAmount != null "> and thisTab.payable_amount = #{payableAmount}</if>
|
<if test="status != null and status != ''"> and thisTab.status = #{status}</if>
|
<if test="deleted != null "> and thisTab.deleted = #{deleted}</if>
|
</sql>
|
|
<!--查询-->
|
<select id="selectPayableFeeManagementById" parameterType="Integer" resultMap="PayableFeeManagementResult">
|
<include refid="selectPayableFeeManagementVo"/>
|
where id = #{id}
|
</select>
|
|
<select id="selectPayableFeeManagementCount" parameterType="com.ruoyi.cwgl.domain.PayableFeeManagement" resultType="int">
|
<include refid="selectPayableFeeManagementVoCount"/>
|
<where>
|
<include refid="whereCondition"/>
|
</where>
|
</select>
|
|
<select id="selectPayableFeeManagementList" parameterType="com.ruoyi.cwgl.domain.PayableFeeManagement" resultMap="PayableFeeManagementResult">
|
<include refid="selectPayableFeeManagementVo"/>
|
<where>
|
<include refid="whereCondition"/>
|
</where>
|
order by thisTab.id desc
|
</select>
|
|
<!-- 新增 -->
|
<insert id="insertPayableFeeManagement" parameterType="com.ruoyi.cwgl.domain.PayableFeeManagement" useGeneratedKeys="true" keyProperty="id">
|
insert into payable_fee_management
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="systemNo != null and systemNo != ''">system_no,</if>
|
<if test="relatedBillNo != null and relatedBillNo != ''">related_bill_no,</if>
|
<if test="sourceSystem != null and sourceSystem != ''">source_system,</if>
|
<if test="businessSector != null and businessSector != ''">business_sector,</if>
|
<if test="documentType != null and documentType != ''">document_type,</if>
|
<if test="documentNo != null and documentNo != ''">document_no,</if>
|
<if test="isInternalSettlement != null and isInternalSettlement != ''">is_internal_settlement,</if>
|
<if test="internalSettlementUnit != null">internal_settlement_unit,</if>
|
<if test="supplierName != null and supplierName != ''">supplier_name,</if>
|
<if test="projectName != null">project_name,</if>
|
<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>
|
<if test="createTime != null">create_time,</if>
|
<if test="updateBy != null">update_by,</if>
|
<if test="updateTime != null">update_time,</if>
|
<if test="deleted != null">deleted,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="systemNo != null and systemNo != ''">#{systemNo},</if>
|
<if test="relatedBillNo != null and relatedBillNo != ''">#{relatedBillNo},</if>
|
<if test="sourceSystem != null and sourceSystem != ''">#{sourceSystem},</if>
|
<if test="businessSector != null and businessSector != ''">#{businessSector},</if>
|
<if test="documentType != null and documentType != ''">#{documentType},</if>
|
<if test="documentNo != null and documentNo != ''">#{documentNo},</if>
|
<if test="isInternalSettlement != null and isInternalSettlement != ''">#{isInternalSettlement},</if>
|
<if test="internalSettlementUnit != null">#{internalSettlementUnit},</if>
|
<if test="supplierName != null and supplierName != ''">#{supplierName},</if>
|
<if test="projectName != null">#{projectName},</if>
|
<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>
|
<if test="createTime != null">#{createTime},</if>
|
<if test="updateBy != null">#{updateBy},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
<if test="deleted != null">#{deleted},</if>
|
</trim>
|
</insert>
|
|
<insert id="insertPayableFeeManagementBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
insert into payable_fee_management
|
<trim prefix="(" suffix=") values" suffixOverrides=",">
|
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.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>
|
|
<!-- 修改 -->
|
<update id="updatePayableFeeManagement" parameterType="com.ruoyi.cwgl.domain.PayableFeeManagement">
|
update payable_fee_management
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="systemNo != null and systemNo != ''">system_no = #{systemNo},</if>
|
<if test="relatedBillNo != null and relatedBillNo != ''">related_bill_no = #{relatedBillNo},</if>
|
<if test="sourceSystem != null and sourceSystem != ''">source_system = #{sourceSystem},</if>
|
<if test="businessSector != null and businessSector != ''">business_sector = #{businessSector},</if>
|
<if test="documentType != null and documentType != ''">document_type = #{documentType},</if>
|
<if test="documentNo != null and documentNo != ''">document_no = #{documentNo},</if>
|
<if test="isInternalSettlement != null and isInternalSettlement != ''">is_internal_settlement = #{isInternalSettlement},</if>
|
<if test="internalSettlementUnit != null">internal_settlement_unit = #{internalSettlementUnit},</if>
|
<if test="supplierName != null and supplierName != ''">supplier_name = #{supplierName},</if>
|
<if test="projectName != null">project_name = #{projectName},</if>
|
<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>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
<if test="deleted != null">deleted = #{deleted},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
<!-- 修改 -->
|
<update id="updatePayableFeeManagementBatch" parameterType="java.util.List">
|
<foreach collection="list" item="item" index="index" separator=";">
|
update payable_fee_management
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="item.systemNo != null and item.systemNo != ''">system_no = #{item.systemNo},</if>
|
<if test="item.relatedBillNo != null and item.relatedBillNo != ''">related_bill_no = #{item.relatedBillNo},</if>
|
<if test="item.sourceSystem != null and item.sourceSystem != ''">source_system = #{item.sourceSystem},</if>
|
<if test="item.businessSector != null and item.businessSector != ''">business_sector = #{item.businessSector},</if>
|
<if test="item.documentType != null and item.documentType != ''">document_type = #{item.documentType},</if>
|
<if test="item.documentNo != null and item.documentNo != ''">document_no = #{item.documentNo},</if>
|
<if test="item.isInternalSettlement != null and item.isInternalSettlement != ''">is_internal_settlement = #{item.isInternalSettlement},</if>
|
<if test="item.internalSettlementUnit != null">internal_settlement_unit = #{item.internalSettlementUnit},</if>
|
<if test="item.supplierName != null and item.supplierName != ''">supplier_name = #{item.supplierName},</if>
|
<if test="item.projectName != null">project_name = #{item.projectName},</if>
|
<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>
|
<if test="item.createTime != null">create_time = #{item.createTime},</if>
|
<if test="item.updateBy != null">update_by = #{item.updateBy},</if>
|
<if test="item.updateTime != null">update_time = #{item.updateTime},</if>
|
<if test="item.deleted != null">deleted = #{item.deleted},</if>
|
</trim>
|
where id = #{item.id}
|
</foreach>
|
</update>
|
|
<!--删除-->
|
<delete id="deletePayableFeeManagementById" parameterType="Integer">
|
delete from payable_fee_management where id = #{id}
|
</delete>
|
<delete id="deletePayableFeeManagementByIds" parameterType="Integer">
|
delete from payable_fee_management where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</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>
|