<?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.PayableBillManagementMapper">
|
|
<resultMap type="com.ruoyi.cwgl.domain.PayableBillManagement" id="PayableBillManagementResult">
|
<result property="id" column="id" />
|
<result property="systemNo" column="system_no" />
|
<result property="billName" column="bill_name" />
|
<result property="supplierName" column="supplier_name" />
|
<result property="isInternalSettlement" column="is_internal_settlement" />
|
<result property="internalSettlementUnit" column="internal_settlement_unit" />
|
<result property="documentCount" column="document_count" />
|
<result property="totalAmount" column="total_amount" />
|
<result property="currency" column="currency" />
|
<result property="discountAmount" column="discount_amount" />
|
<result property="paidAmount" column="paid_amount" />
|
<result property="pendingAmount" column="pending_amount" />
|
<result property="exchangeRate" column="exchange_rate" />
|
<result property="cnyAmount" column="cny_amount" />
|
<result property="periodType" column="period_type" />
|
<result property="businessStartDate" column="business_start_date" />
|
<result property="businessEndDate" column="business_end_date" />
|
<result property="billingStartDate" column="billing_start_date" />
|
<result property="billingEndDate" column="billing_end_date" />
|
<result property="billGenerateDate" column="bill_generate_date" />
|
<result property="billSendDate" column="bill_send_date" />
|
<result property="billDueDate" column="bill_due_date" />
|
<result property="status" column="status" />
|
<result property="auditStatus" column="audit_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="selectPayableBillManagementVo">
|
select thisTab.id, thisTab.system_no, thisTab.bill_name, thisTab.supplier_name, thisTab.is_internal_settlement, thisTab.internal_settlement_unit, thisTab.document_count, thisTab.total_amount, thisTab.currency, thisTab.discount_amount, thisTab.paid_amount, thisTab.pending_amount, thisTab.exchange_rate, thisTab.cny_amount, thisTab.period_type, thisTab.business_start_date, thisTab.business_end_date, thisTab.billing_start_date, thisTab.billing_end_date, thisTab.bill_generate_date, thisTab.bill_send_date, thisTab.bill_due_date, thisTab.status, thisTab.audit_status, thisTab.remark, thisTab.create_by, thisTab.create_time, thisTab.update_by, thisTab.update_time, thisTab.deleted from payable_bill_management AS thisTab
|
</sql>
|
<sql id="selectPayableBillManagementVoCount">
|
select count(0) from payable_bill_management as thisTab
|
</sql>
|
|
<sql id="whereCondition">
|
<if test="systemNo != null and systemNo != ''"> and thisTab.system_no = #{systemNo}</if>
|
<if test="billName != null and billName != ''"> and thisTab.bill_name like concat('%', #{billName}, '%')</if>
|
<if test="supplierName != null and supplierName != ''"> and thisTab.supplier_name like concat('%', #{supplierName}, '%')</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="documentCount != null "> and thisTab.document_count = #{documentCount}</if>
|
<if test="totalAmount != null "> and thisTab.total_amount = #{totalAmount}</if>
|
<if test="currency != null and currency != ''"> and thisTab.currency = #{currency}</if>
|
<if test="discountAmount != null "> and thisTab.discount_amount = #{discountAmount}</if>
|
<if test="paidAmount != null "> and thisTab.paid_amount = #{paidAmount}</if>
|
<if test="pendingAmount != null "> and thisTab.pending_amount = #{pendingAmount}</if>
|
<if test="exchangeRate != null "> and thisTab.exchange_rate = #{exchangeRate}</if>
|
<if test="cnyAmount != null "> and thisTab.cny_amount = #{cnyAmount}</if>
|
<if test="periodType != null and periodType != ''"> and thisTab.period_type = #{periodType}</if>
|
<if test="businessStartDate != null "> and thisTab.business_start_date = #{businessStartDate}</if>
|
<if test="businessEndDate != null "> and thisTab.business_end_date = #{businessEndDate}</if>
|
<if test="billingStartDate != null "> and thisTab.billing_start_date = #{billingStartDate}</if>
|
<if test="billingEndDate != null "> and thisTab.billing_end_date = #{billingEndDate}</if>
|
<if test="billGenerateDate != null "> and thisTab.bill_generate_date = #{billGenerateDate}</if>
|
<if test="billSendDate != null "> and thisTab.bill_send_date = #{billSendDate}</if>
|
<if test="billDueDate != null "> and thisTab.bill_due_date = #{billDueDate}</if>
|
<if test="status != null and status != ''">
|
<choose>
|
<when test="status == -1">
|
and thisTab.status in (0, 1)
|
</when>
|
<when test="status > 0">
|
and thisTab.status = #{status}
|
</when>
|
</choose>
|
</if>
|
<if test="deleted != null "> and thisTab.deleted = #{deleted}</if>
|
</sql>
|
|
<!--查询-->
|
<select id="selectPayableBillManagementById" parameterType="Integer" resultMap="PayableBillManagementResult">
|
<include refid="selectPayableBillManagementVo"/>
|
where id = #{id}
|
</select>
|
|
<select id="selectPayableBillManagementCount" parameterType="com.ruoyi.cwgl.domain.PayableBillManagement" resultType="int">
|
<include refid="selectPayableBillManagementVoCount"/>
|
<where>
|
<include refid="whereCondition"/>
|
</where>
|
</select>
|
|
<select id="selectPayableBillManagementList" parameterType="com.ruoyi.cwgl.domain.PayableBillManagement" resultMap="PayableBillManagementResult">
|
<include refid="selectPayableBillManagementVo"/>
|
<where>
|
<include refid="whereCondition"/>
|
</where>
|
order by thisTab.id desc
|
</select>
|
|
<select id="selectPayableBillManagementBySystemNo" parameterType="String" resultMap="PayableBillManagementResult">
|
<include refid="selectPayableBillManagementVo"/>
|
where system_no = #{systemNo}
|
</select>
|
|
<!-- 新增 -->
|
<insert id="insertPayableBillManagement" parameterType="com.ruoyi.cwgl.domain.PayableBillManagement" useGeneratedKeys="true" keyProperty="id">
|
insert into payable_bill_management
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="systemNo != null and systemNo != ''">system_no,</if>
|
<if test="billName != null and billName != ''">bill_name,</if>
|
<if test="supplierName != null and supplierName != ''">supplier_name,</if>
|
<if test="isInternalSettlement != null and isInternalSettlement != ''">is_internal_settlement,</if>
|
<if test="internalSettlementUnit != null">internal_settlement_unit,</if>
|
<if test="documentCount != null">document_count,</if>
|
<if test="totalAmount != null">total_amount,</if>
|
<if test="currency != null">currency,</if>
|
<if test="discountAmount != null">discount_amount,</if>
|
<if test="paidAmount != null">paid_amount,</if>
|
<if test="pendingAmount != null">pending_amount,</if>
|
<if test="exchangeRate != null">exchange_rate,</if>
|
<if test="cnyAmount != null">cny_amount,</if>
|
<if test="periodType != null and periodType != ''">period_type,</if>
|
<if test="businessStartDate != null">business_start_date,</if>
|
<if test="businessEndDate != null">business_end_date,</if>
|
<if test="billingStartDate != null">billing_start_date,</if>
|
<if test="billingEndDate != null">billing_end_date,</if>
|
<if test="billGenerateDate != null">bill_generate_date,</if>
|
<if test="billSendDate != null">bill_send_date,</if>
|
<if test="billDueDate != null">bill_due_date,</if>
|
<if test="status != null">status,</if>
|
<if test="auditStatus != null">audit_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="billName != null and billName != ''">#{billName},</if>
|
<if test="supplierName != null and supplierName != ''">#{supplierName},</if>
|
<if test="isInternalSettlement != null and isInternalSettlement != ''">#{isInternalSettlement},</if>
|
<if test="internalSettlementUnit != null">#{internalSettlementUnit},</if>
|
<if test="documentCount != null">#{documentCount},</if>
|
<if test="totalAmount != null">#{totalAmount},</if>
|
<if test="currency != null">#{currency},</if>
|
<if test="discountAmount != null">#{discountAmount},</if>
|
<if test="paidAmount != null">#{paidAmount},</if>
|
<if test="pendingAmount != null">#{pendingAmount},</if>
|
<if test="exchangeRate != null">#{exchangeRate},</if>
|
<if test="cnyAmount != null">#{cnyAmount},</if>
|
<if test="periodType != null and periodType != ''">#{periodType},</if>
|
<if test="businessStartDate != null">#{businessStartDate},</if>
|
<if test="businessEndDate != null">#{businessEndDate},</if>
|
<if test="billingStartDate != null">#{billingStartDate},</if>
|
<if test="billingEndDate != null">#{billingEndDate},</if>
|
<if test="billGenerateDate != null">#{billGenerateDate},</if>
|
<if test="billSendDate != null">#{billSendDate},</if>
|
<if test="billDueDate != null">#{billDueDate},</if>
|
<if test="status != null">#{status},</if>
|
<if test="auditStatus != null">#{auditStatus},</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="insertPayableBillManagementBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
insert into payable_bill_management
|
<trim prefix="(" suffix=") values" suffixOverrides=",">
|
id,system_no,bill_name,supplier_name,is_internal_settlement,internal_settlement_unit,document_count,total_amount,currency,discount_amount,paid_amount,pending_amount,exchange_rate,cny_amount,period_type,business_start_date,business_end_date,billing_start_date,billing_end_date,bill_generate_date,bill_send_date,bill_due_date,status,audit_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.billName},#{item.supplierName},#{item.isInternalSettlement},#{item.internalSettlementUnit},#{item.documentCount},#{item.totalAmount},#{item.currency},#{item.discountAmount},#{item.paidAmount},#{item.pendingAmount},#{item.exchangeRate},#{item.cnyAmount},#{item.periodType},#{item.businessStartDate},#{item.businessEndDate},#{item.billingStartDate},#{item.billingEndDate},#{item.billGenerateDate},#{item.billSendDate},#{item.billDueDate},#{item.status},#{item.auditStatus},#{item.remark},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.deleted},
|
</trim>
|
</foreach>
|
</insert>
|
|
<!-- 修改 -->
|
<update id="updatePayableBillManagement" parameterType="com.ruoyi.cwgl.domain.PayableBillManagement">
|
update payable_bill_management
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="systemNo != null and systemNo != ''">system_no = #{systemNo},</if>
|
<if test="billName != null and billName != ''">bill_name = #{billName},</if>
|
<if test="supplierName != null and supplierName != ''">supplier_name = #{supplierName},</if>
|
<if test="isInternalSettlement != null and isInternalSettlement != ''">is_internal_settlement = #{isInternalSettlement},</if>
|
<if test="internalSettlementUnit != null">internal_settlement_unit = #{internalSettlementUnit},</if>
|
<if test="documentCount != null">document_count = #{documentCount},</if>
|
<if test="totalAmount != null">total_amount = #{totalAmount},</if>
|
<if test="currency != null">currency = #{currency},</if>
|
<if test="discountAmount != null">discount_amount = #{discountAmount},</if>
|
<if test="paidAmount != null">paid_amount = #{paidAmount},</if>
|
<if test="pendingAmount != null">pending_amount = #{pendingAmount},</if>
|
<if test="exchangeRate != null">exchange_rate = #{exchangeRate},</if>
|
<if test="cnyAmount != null">cny_amount = #{cnyAmount},</if>
|
<if test="periodType != null and periodType != ''">period_type = #{periodType},</if>
|
<if test="businessStartDate != null">business_start_date = #{businessStartDate},</if>
|
<if test="businessEndDate != null">business_end_date = #{businessEndDate},</if>
|
<if test="billingStartDate != null">billing_start_date = #{billingStartDate},</if>
|
<if test="billingEndDate != null">billing_end_date = #{billingEndDate},</if>
|
<if test="billGenerateDate != null">bill_generate_date = #{billGenerateDate},</if>
|
<if test="billSendDate != null">bill_send_date = #{billSendDate},</if>
|
<if test="billDueDate != null">bill_due_date = #{billDueDate},</if>
|
<if test="status != null">status = #{status},</if>
|
<if test="auditStatus != null">audit_status = #{auditStatus},</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="updatePayableBillManagementBatch" parameterType="java.util.List">
|
<foreach collection="list" item="item" index="index" separator=";">
|
update payable_bill_management
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="item.systemNo != null and item.systemNo != ''">system_no = #{item.systemNo},</if>
|
<if test="item.billName != null and item.billName != ''">bill_name = #{item.billName},</if>
|
<if test="item.supplierName != null and item.supplierName != ''">supplier_name = #{item.supplierName},</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.documentCount != null">document_count = #{item.documentCount},</if>
|
<if test="item.totalAmount != null">total_amount = #{item.totalAmount},</if>
|
<if test="item.currency != null">currency = #{item.currency},</if>
|
<if test="item.discountAmount != null">discount_amount = #{item.discountAmount},</if>
|
<if test="item.paidAmount != null">paid_amount = #{item.paidAmount},</if>
|
<if test="item.pendingAmount != null">pending_amount = #{item.pendingAmount},</if>
|
<if test="item.exchangeRate != null">exchange_rate = #{item.exchangeRate},</if>
|
<if test="item.cnyAmount != null">cny_amount = #{item.cnyAmount},</if>
|
<if test="item.periodType != null and item.periodType != ''">period_type = #{item.periodType},</if>
|
<if test="item.businessStartDate != null">business_start_date = #{item.businessStartDate},</if>
|
<if test="item.businessEndDate != null">business_end_date = #{item.businessEndDate},</if>
|
<if test="item.billingStartDate != null">billing_start_date = #{item.billingStartDate},</if>
|
<if test="item.billingEndDate != null">billing_end_date = #{item.billingEndDate},</if>
|
<if test="item.billGenerateDate != null">bill_generate_date = #{item.billGenerateDate},</if>
|
<if test="item.billSendDate != null">bill_send_date = #{item.billSendDate},</if>
|
<if test="item.billDueDate != null">bill_due_date = #{item.billDueDate},</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="deletePayableBillManagementById" parameterType="Integer">
|
delete from payable_bill_management where id = #{id}
|
</delete>
|
<delete id="deletePayableBillManagementByIds" parameterType="Integer">
|
delete from payable_bill_management where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
|
</mapper>
|