484 lines
27 KiB
XML
484 lines
27 KiB
XML
<?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.sip.mapper.OmsPaymentBillMapper">
|
|
|
|
<resultMap type="OmsPaymentBill" id="OmsPaymentBillResult">
|
|
<result property="id" column="id" />
|
|
<result property="paymentBillCode" column="payment_bill_code" />
|
|
<result property="paymentBillType" column="payment_bill_type" />
|
|
<result property="paymentTime" column="payment_time" />
|
|
<result property="vendorCode" column="vendor_code" />
|
|
<result property="orderCode" column="order_code" />
|
|
<result property="totalPriceWithTax" column="total_price_with_tax" />
|
|
<result property="totalPriceWithoutTax" column="total_price_without_tax" />
|
|
<result property="taxAmount" column="tax_amount" />
|
|
<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="remark" column="remark" />
|
|
<result property="delFlag" column="del_flag" />
|
|
<result property="projectCode" column="project_code" />
|
|
<result property="projectName" column="project_name" />
|
|
<result property="preResidueAmount" column="pre_residue_amount" />
|
|
<result property="actualPaymentTime" column="actual_payment_time" />
|
|
<result property="paymentStatus" column="payment_status" />
|
|
<result property="approveStatus" column="approve_status" />
|
|
<result property="approveNode" column="approve_node" />
|
|
<result property="approveTime" column="approve_time" />
|
|
<result property="paymentMethod" column="payment_method" />
|
|
<result property="payableBillCode" column="payable_bill_code" />
|
|
<result property="payName" column="pay_name" />
|
|
<result property="payBankNumber" column="pay_bank_number" />
|
|
<result property="payBankOpenAddress" column="pay_bank_open_address" />
|
|
<result property="bankNumber" column="bank_number" />
|
|
|
|
<result property="refundStatus" column="refund_status" />
|
|
</resultMap>
|
|
|
|
<resultMap type="com.ruoyi.sip.domain.dto.PaymentBillDetailDTO" id="PaymentBillDetailResult">
|
|
<result property="id" column="id" />
|
|
<result property="paymentBillCode" column="payment_bill_code" />
|
|
<result property="paymentTime" column="payment_time" />
|
|
<result property="vendorCode" column="vendor_code" />
|
|
<result property="totalPriceWithTax" column="total_price_with_tax" />
|
|
<result property="totalPriceWithoutTax" column="total_price_without_tax" />
|
|
<result property="taxAmount" column="tax_amount" />
|
|
<result property="paymentBillType" column="payment_bill_type" />
|
|
<result property="preResidueAmount" column="pre_residue_amount" />
|
|
<result property="actualPaymentTime" column="actual_payment_time" />
|
|
<result property="paymentMethod" column="payment_method" />
|
|
<result property="paymentStatus" column="payment_status" />
|
|
<result property="remark" column="remark" />
|
|
<result property="createBy" column="create_by" />
|
|
<result property="payName" column="pay_name" />
|
|
<result property="payBankNumber" column="pay_bank_number" />
|
|
<result property="payBankOpenAddress" column="pay_bank_open_address" />
|
|
<result property="bankNumber" column="bank_number" />
|
|
<result property="approveNode" column="approve_node" />
|
|
<result property="approveStatus" column="approve_status" />
|
|
<result property="approveTime" column="approve_time" />
|
|
</resultMap>
|
|
|
|
<resultMap type="com.ruoyi.sip.domain.dto.PaymentBillPayableDetailDTO" id="PaymentBillPayableDetailResult">
|
|
<result property="projectCode" column="project_code" />
|
|
<result property="projectName" column="project_name" />
|
|
<result property="payableBillCode" column="payable_bill_code" />
|
|
<result property="totalPriceWithTax" column="total_price_with_tax" />
|
|
<result property="paymentAmount" column="payment_amount" />
|
|
<result property="paymentRate" column="payment_rate" />
|
|
</resultMap>
|
|
|
|
<sql id="selectOmsPaymentBillVo">
|
|
select
|
|
pb.id,
|
|
pb.payment_bill_code,
|
|
pb.payment_bill_type,
|
|
pb.payment_time,
|
|
pb.vendor_code,
|
|
pb.order_code,
|
|
pb.total_price_with_tax,
|
|
pb.total_price_without_tax,
|
|
pb.tax_amount,
|
|
pb.create_by,
|
|
pb.create_time,
|
|
pb.update_by,
|
|
pb.update_time,
|
|
pb.remark,
|
|
pb.del_flag,
|
|
pb.project_code,
|
|
pb.project_name,
|
|
pb.pre_residue_amount,
|
|
pb.actual_payment_time,
|
|
pb.payment_status,
|
|
pb.approve_status,
|
|
pb.approve_node,
|
|
pb.approve_time,
|
|
pb.payment_method,
|
|
pb.pay_name,
|
|
pb.pay_bank_number,
|
|
pb.pay_bank_open_address,
|
|
pb.bank_number,
|
|
|
|
pb.refund_status,
|
|
ovi.vendor_name
|
|
from oms_payment_bill pb
|
|
left join oms_vendor_info ovi on pb.vendor_code = ovi.vendor_code
|
|
</sql>
|
|
|
|
<select id="selectOmsPaymentBillList" parameterType="OmsPaymentBill" resultMap="OmsPaymentBillResult">
|
|
<include refid="selectOmsPaymentBillVo"/>
|
|
<where>
|
|
<if test="paymentBillCode != null and paymentBillCode != ''">and pb.payment_bill_code like concat('%',
|
|
#{paymentBillCode}, '%')
|
|
</if>
|
|
<if test="paymentBillCodeList != null and paymentBillCodeList.size>0">and pb.payment_bill_code in
|
|
<foreach item="item" collection="paymentBillCodeList" separator="," open="(" close=")" index="">
|
|
#{item}
|
|
</foreach>
|
|
</if>
|
|
<if test="paymentBillType != null and paymentBillType != ''">and pb.payment_bill_type =
|
|
#{paymentBillType}
|
|
</if>
|
|
<if test="paymentTime != null ">and date_format(pb.payment_time,'%Y-%m-%d') =
|
|
date_format(#{paymentTime},'%Y-%m-%d')
|
|
</if>
|
|
<if test="vendorCode != null and vendorCode != ''">and pb.vendor_code = #{vendorCode}
|
|
</if>
|
|
<if test="vendorName != null and vendorName != ''">
|
|
and ovi.vendor_name like concat('%', #{vendorName}, '%')
|
|
</if>
|
|
<if test="orderCode != null and orderCode != ''">and pb.order_code like concat('%', #{orderCode}, '%')</if>
|
|
<if test="totalPriceWithTax != null ">and pb.total_price_with_tax = #{totalPriceWithTax}</if>
|
|
<if test="totalPriceWithoutTax != null ">and pb.total_price_without_tax = #{totalPriceWithoutTax}</if>
|
|
<if test="taxAmount != null ">and pb.tax_amount = #{taxAmount}</if>
|
|
<if test="projectCode != null and projectCode != ''">and pb.project_code like concat('%', #{projectCode},
|
|
'%')
|
|
</if>
|
|
<if test="projectName != null and projectName != ''">and pb.project_name like concat('%', #{projectName},
|
|
'%')
|
|
</if>
|
|
<if test="paymentStatus != null and paymentStatus != ''">and pb.payment_status = #{paymentStatus}</if>
|
|
<if test="approveStatus != null and approveStatus != ''">and pb.approve_status = #{approveStatus}</if>
|
|
<if test="approveNode != null and approveNode != ''">and pb.approve_node = #{approveNode}</if>
|
|
<if test="approveTime != null ">and date_format(pb.approve_time,'%Y-%m-%d') =
|
|
date_format(#{approveTime},'%Y-%m-%d')
|
|
</if>
|
|
<if test="(params.beginApproveTime != null and params.beginApproveTime != '') or (params.endApproveTime != null and params.endApproveTime!='')">
|
|
<choose>
|
|
<when test="(params.beginApproveTime != null and params.beginApproveTime != '') and (params.endApproveTime != null and params.endApproveTime!='')">
|
|
and pb.approve_time between #{params.beginApproveTime} and #{params.endApproveTime}
|
|
</when>
|
|
<when test="(params.beginApproveTime != null and params.beginApproveTime != '')">
|
|
and pb.approve_time <![CDATA[ >= ]]> #{params.beginApproveTime}
|
|
</when>
|
|
<when test="(params.endApproveTime != null and params.endApproveTime!='')">
|
|
and pb.approve_time <![CDATA[ <= ]]> #{params.endApproveTime}
|
|
</when>
|
|
|
|
</choose>
|
|
</if>
|
|
<if test="(params.beginPaymentTime != null and params.beginPaymentTime != '') or (params.endPaymentTime != null and params.endPaymentTime!='')">
|
|
<choose>
|
|
<when test="(params.beginPaymentTime != null and params.beginPaymentTime != '') and (params.endPaymentTime != null and params.endPaymentTime!='')">
|
|
and pb.payment_time between #{params.beginPaymentTime} and #{params.endPaymentTime}
|
|
</when>
|
|
<when test="(params.beginPaymentTime != null and params.beginPaymentTime != '')">
|
|
and pb.payment_time <![CDATA[ >= ]]> #{params.beginPaymentTime}
|
|
</when>
|
|
<when test="(params.endPaymentTime != null and params.endPaymentTime!='')">
|
|
and pb.payment_time <![CDATA[ <= ]]> #{params.endPaymentTime}
|
|
</when>
|
|
|
|
</choose>
|
|
</if>
|
|
<if test="(params.beginActualPaymentTime != null and params.beginActualPaymentTime != '') or (params.endActualPaymentTime != null and params.endActualPaymentTime!='')">
|
|
<choose>
|
|
<when test="(params.beginActualPaymentTime != null and params.beginActualPaymentTime != '') and (params.endActualPaymentTime != null and params.endActualPaymentTime!='')">
|
|
and pb.actual_payment_time between #{params.beginActualPaymentTime } and #{params.endActualPaymentTime}
|
|
</when>
|
|
<when test="(params.beginActualPaymentTime != null and params.beginActualPaymentTime != '')">
|
|
and pb.actual_payment_time <![CDATA[ >= ]]> #{params.beginActualPaymentTime }
|
|
</when>
|
|
<when test="(params.endActualPaymentTime != null and params.endActualPaymentTime!='')">
|
|
and pb.actual_payment_time <![CDATA[ <= ]]> #{params.endActualPaymentTime}
|
|
</when>
|
|
|
|
</choose>
|
|
</if>
|
|
<if test="actualPaymentTime != null ">and date_format(pb.actual_payment_time,'%Y-%m-%d') =
|
|
date_format(#{actualPaymentTime},'%Y-%m-%d')
|
|
</if>
|
|
<if test="paymentMethod != null and paymentMethod != ''">and pb.payment_method = #{paymentMethod}</if>
|
|
<if test="approveNode != null and approveNode != ''">and pb.payment_bill_code in
|
|
(
|
|
select business_key from bu_todo where approve_user_name like concat('%', #{approveNode}, '%') and process_key in (
|
|
'finance_payment','finance_refund')
|
|
)
|
|
</if>
|
|
<if test="payableBillCode != null and payableBillCode != ''">and pb.payment_bill_code in (
|
|
select payment_bill_code from oms_payable_payment_detail t1 left join oms_payable_bill t2 on
|
|
t1.payable_bill_id=t2.id
|
|
where t2.payable_bill_code=#{payableBillCode}
|
|
)
|
|
</if>
|
|
<if test="preResidueAmount != null and preResidueAmount != ''">
|
|
<choose>
|
|
<when test="preResidueAmount == -1">
|
|
and pb.pre_residue_amount != 0
|
|
</when>
|
|
<when test="preResidueAmount !== -1">
|
|
and pb.pre_residue_amount = #{preResidueAmount}
|
|
</when>
|
|
</choose>
|
|
</if>
|
|
|
|
and pb.del_flag = '0'
|
|
</where>
|
|
order by pb.create_time desc
|
|
</select>
|
|
<select id="selectOmsPaymentBillById" parameterType="Long" resultMap="OmsPaymentBillResult">
|
|
<include refid="selectOmsPaymentBillVo"/>
|
|
where pb.id = #{id}
|
|
|
|
</select>
|
|
|
|
<insert id="insertOmsPaymentBill" parameterType="OmsPaymentBill" useGeneratedKeys="true" keyProperty="id">
|
|
insert into oms_payment_bill
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="paymentBillCode != null and paymentBillCode != ''">payment_bill_code,</if>
|
|
<if test="paymentBillType != null">payment_bill_type,</if>
|
|
<if test="paymentTime != null">payment_time,</if>
|
|
<if test="vendorCode != null">vendor_code,</if>
|
|
<if test="orderCode != null">order_code,</if>
|
|
<if test="totalPriceWithTax != null">total_price_with_tax,</if>
|
|
<if test="totalPriceWithoutTax != null">total_price_without_tax,</if>
|
|
<if test="taxAmount != null">tax_amount,</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="remark != null">remark,</if>
|
|
<if test="delFlag != null">del_flag,</if>
|
|
<if test="projectCode != null">project_code,</if>
|
|
<if test="projectName != null">project_name,</if>
|
|
<if test="preResidueAmount != null">pre_residue_amount,</if>
|
|
<if test="actualPaymentTime != null">actual_payment_time,</if>
|
|
<if test="paymentStatus != null">payment_status,</if>
|
|
<if test="approveStatus != null">approve_status,</if>
|
|
<if test="approveNode != null">approve_node,</if>
|
|
<if test="approveTime != null">approve_time,</if>
|
|
<if test="paymentMethod != null">payment_method,</if>
|
|
<if test="payName != null">pay_name,</if>
|
|
<if test="payBankNumber != null">pay_bank_number,</if>
|
|
<if test="payBankOpenAddress != null">pay_bank_open_address,</if>
|
|
<if test="bankNumber != null">bank_number,</if>
|
|
<if test="refundStatus != null">refund_status,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="paymentBillCode != null and paymentBillCode != ''">#{paymentBillCode},</if>
|
|
<if test="paymentBillType != null">#{paymentBillType},</if>
|
|
<if test="paymentTime != null">#{paymentTime},</if>
|
|
<if test="vendorCode != null">#{vendorCode},</if>
|
|
<if test="orderCode != null">#{orderCode},</if>
|
|
<if test="totalPriceWithTax != null">#{totalPriceWithTax},</if>
|
|
<if test="totalPriceWithoutTax != null">#{totalPriceWithoutTax},</if>
|
|
<if test="taxAmount != null">#{taxAmount},</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="remark != null">#{remark},</if>
|
|
<if test="delFlag != null">#{delFlag},</if>
|
|
<if test="projectCode != null">#{projectCode},</if>
|
|
<if test="projectName != null">#{projectName},</if>
|
|
<if test="preResidueAmount != null">#{preResidueAmount},</if>
|
|
<if test="actualPaymentTime != null">#{actualPaymentTime},</if>
|
|
<if test="paymentStatus != null">#{paymentStatus},</if>
|
|
<if test="approveStatus != null">#{approveStatus},</if>
|
|
<if test="approveNode != null">#{approveNode},</if>
|
|
<if test="approveTime != null">#{approveTime},</if>
|
|
<if test="paymentMethod != null">#{paymentMethod},</if>
|
|
<if test="payName != null">#{payName},</if>
|
|
<if test="payBankNumber != null">#{payBankNumber},</if>
|
|
<if test="payBankOpenAddress != null">#{payBankOpenAddress},</if>
|
|
<if test="bankNumber != null">#{bankNumber},</if>
|
|
<if test="refundStatus != null">#{refundStatus},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateOmsPaymentBill" parameterType="OmsPaymentBill">
|
|
update oms_payment_bill
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="paymentBillCode != null and paymentBillCode != ''">payment_bill_code = #{paymentBillCode},</if>
|
|
<if test="paymentBillType != null">payment_bill_type = #{paymentBillType},</if>
|
|
<if test="paymentTime != null">payment_time = #{paymentTime},</if>
|
|
<if test="vendorCode != null">vendor_code = #{vendorCode},</if>
|
|
<if test="orderCode != null">order_code = #{orderCode},</if>
|
|
<if test="totalPriceWithTax != null">total_price_with_tax = #{totalPriceWithTax},</if>
|
|
<if test="totalPriceWithoutTax != null">total_price_without_tax = #{totalPriceWithoutTax},</if>
|
|
<if test="taxAmount != null">tax_amount = #{taxAmount},</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="remark != null">remark = #{remark},</if>
|
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
<if test="projectCode != null">project_code = #{projectCode},</if>
|
|
<if test="projectName != null">project_name = #{projectName},</if>
|
|
<if test="preResidueAmount != null">pre_residue_amount = #{preResidueAmount},</if>
|
|
<if test="actualPaymentTime != null">actual_payment_time = #{actualPaymentTime},</if>
|
|
<if test="paymentStatus != null">payment_status = #{paymentStatus},</if>
|
|
<if test="approveStatus != null">approve_status = #{approveStatus},</if>
|
|
<if test="approveNode != null">approve_node = #{approveNode},</if>
|
|
<if test="approveTime != null">approve_time = #{approveTime},</if>
|
|
<if test="paymentMethod != null">payment_method = #{paymentMethod},</if>
|
|
<if test="payName != null">pay_name = #{payName},</if>
|
|
<if test="payBankNumber != null">pay_bank_number = #{payBankNumber},</if>
|
|
<if test="payBankOpenAddress != null">pay_bank_open_address = #{payBankOpenAddress},</if>
|
|
<if test="bankNumber != null">bank_number = #{bankNumber},</if>
|
|
|
|
<if test="refundStatus != null">refund_status = #{refundStatus},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
<update id="updateOmsPaymentBillByCode">
|
|
update oms_payment_bill
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="paymentBillType != null">payment_bill_type = #{paymentBillType},</if>
|
|
<if test="paymentTime != null">payment_time = #{paymentTime},</if>
|
|
<if test="vendorCode != null">vendor_code = #{vendorCode},</if>
|
|
<if test="orderCode != null">order_code = #{orderCode},</if>
|
|
<if test="totalPriceWithTax != null">total_price_with_tax = #{totalPriceWithTax},</if>
|
|
<if test="totalPriceWithoutTax != null">total_price_without_tax = #{totalPriceWithoutTax},</if>
|
|
<if test="taxAmount != null">tax_amount = #{taxAmount},</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="remark != null">remark = #{remark},</if>
|
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
<if test="projectCode != null">project_code = #{projectCode},</if>
|
|
<if test="projectName != null">project_name = #{projectName},</if>
|
|
<if test="preResidueAmount != null">pre_residue_amount = #{preResidueAmount},</if>
|
|
<if test="actualPaymentTime != null">actual_payment_time = #{actualPaymentTime},</if>
|
|
<if test="paymentStatus != null">payment_status = #{paymentStatus},</if>
|
|
<if test="approveStatus != null">approve_status = #{approveStatus},</if>
|
|
<if test="approveNode != null">approve_node = #{approveNode},</if>
|
|
<if test="approveTime != null">approve_time = #{approveTime},</if>
|
|
<if test="paymentMethod != null">payment_method = #{paymentMethod},</if>
|
|
<if test="payName != null">pay_name = #{payName},</if>
|
|
<if test="payBankNumber != null">pay_bank_number = #{payBankNumber},</if>
|
|
<if test="payBankOpenAddress != null">pay_bank_open_address = #{payBankOpenAddress},</if>
|
|
<if test="bankNumber != null">bank_number = #{bankNumber},</if>
|
|
|
|
<if test="refundStatus != null">refund_status = #{refundStatus},</if>
|
|
</trim>
|
|
where payment_bill_code = #{paymentBillCode}
|
|
</update>
|
|
<update id="revoke">
|
|
update oms_payment_bill
|
|
set approve_status = #{approveStatus},
|
|
approve_time =null,
|
|
pre_residue_amount=null,
|
|
update_time=now()
|
|
where id = #{id}
|
|
</update>
|
|
<update id="updateReturnWriteOffBatch">
|
|
<foreach collection="list" item="item" separator=";">
|
|
update oms_payment_bill
|
|
set actual_payment_time=null,
|
|
payment_status=#{item.paymentStatus},
|
|
update_time=now()
|
|
where id = #{item.id}
|
|
</foreach>
|
|
|
|
|
|
</update>
|
|
|
|
<delete id="deleteOmsPaymentBillById" parameterType="Long">
|
|
delete from oms_payment_bill where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteOmsPaymentBillByIds" parameterType="String">
|
|
delete from oms_payment_bill where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
<delete id="clearRelationPayable">
|
|
delete from oms_payable_payment_detail where payment_bill_code=#{code}
|
|
</delete>
|
|
|
|
<select id="selectMaxCodeByPrefix" parameterType="String" resultType="Integer">
|
|
SELECT IFNULL(MAX(CAST(SUBSTRING(payment_bill_code, LENGTH(#{prefix}) + 1) AS SIGNED)), 0)
|
|
FROM oms_payment_bill
|
|
WHERE payment_bill_code LIKE CONCAT(#{prefix}, '%')
|
|
</select>
|
|
<select id="selectPaymentBillDetail" resultType="com.ruoyi.sip.domain.dto.PaymentBillDetailDTO">
|
|
<include refid="selectOmsPaymentBillVo"/>
|
|
where pb.id = #{id}
|
|
</select>
|
|
|
|
<select id="selectOmsPaymentBillByCode" resultType="com.ruoyi.sip.domain.OmsPaymentBill">
|
|
<include refid="selectOmsPaymentBillVo"/>
|
|
where pb.payment_bill_code = #{code}
|
|
</select>
|
|
<select id="listApprove" resultType="com.ruoyi.sip.domain.OmsPaymentBill">
|
|
select
|
|
pb.id,
|
|
pb.payment_bill_code,
|
|
pb.payment_bill_type,
|
|
pb.payment_time,
|
|
pb.vendor_code,
|
|
pb.order_code,
|
|
pb.total_price_with_tax,
|
|
pb.total_price_without_tax,
|
|
pb.tax_amount,
|
|
pb.create_by,
|
|
pb.create_time,
|
|
pb.update_by,
|
|
pb.update_time,
|
|
pb.remark,
|
|
pb.del_flag,
|
|
pb.project_code,
|
|
pb.project_name,
|
|
pb.pre_residue_amount,
|
|
pb.actual_payment_time,
|
|
pb.payment_status,
|
|
pb.approve_status,
|
|
pb.approve_node,
|
|
pb.approve_time,
|
|
pb.payment_method,
|
|
pb.pay_name,
|
|
pb.pay_bank_number,
|
|
pb.pay_bank_open_address,
|
|
pb.bank_number,
|
|
pb.refund_status,
|
|
t2.vendor_name
|
|
|
|
,t3.apply_time,t3.process_key,t3.todo_id,t3.task_id
|
|
<if test="'bu_todo_completed'.equals(tableName)">
|
|
,t3.approve_time as todo_approve_time
|
|
</if>
|
|
from oms_payment_bill pb
|
|
left join oms_vendor_info t2 on pb.vendor_code = t2.vendor_code
|
|
inner join ${tableName} t3 on (t3.process_key in (#{entity.processKey}) and t3.approve_user=#{entity.approveUser} and t3.task_name!='商务' and t3.business_key=pb.payment_bill_code)
|
|
<where>
|
|
<if test="entity.paymentBillCode != null and entity.paymentBillCode != ''"> and pb.payment_bill_code like concat('%', #{entity.paymentBillCode}, '%')</if>
|
|
<if test="entity.paymentBillType != null and entity.paymentBillType != ''"> and pb.payment_bill_type = #{entity.paymentBillType}</if>
|
|
<if test="entity.paymentTime != null "> and date_format(pb.payment_time,'%Y-%m-%d') = date_format(#{entity.paymentTime},'%Y-%m-%d')</if>
|
|
<if test="entity.vendorCode != null and entity.vendorCode != ''"> and pb.vendor_code like concat('%', #{entity.vendorCode}, '%')</if>
|
|
<if test="entity.orderCode != null and entity.orderCode != ''"> and pb.order_code like concat('%', #{entity.orderCode}, '%')</if>
|
|
<if test="entity.totalPriceWithTax != null "> and pb.total_price_with_tax = #{entity.totalPriceWithTax}</if>
|
|
<if test="entity.totalPriceWithoutTax != null "> and pb.total_price_without_tax = #{entity.totalPriceWithoutTax}</if>
|
|
<if test="entity.taxAmount != null "> and pb.tax_amount = #{taxAmount}</if>
|
|
<if test="entity.projectCode != null and entity.projectCode != ''"> and pb.project_code like concat('%', #{entity.projectCode}, '%')</if>
|
|
<if test="entity.projectName != null and entity.projectName != ''"> and pb.project_name like concat('%', #{entity.projectName}, '%')</if>
|
|
<if test="entity.paymentStatus != null and entity.paymentStatus != ''"> and pb.payment_status = #{entity.paymentStatus}</if>
|
|
<if test="entity.approveStatus != null and entity.approveStatus != ''"> and pb.approve_status = #{entity.approveStatus}</if>
|
|
<if test="entity.approveNode != null and entity.approveNode != ''"> and pb.approve_node = #{entity.approveNode}</if>
|
|
<if test="entity.approveTime != null "> and date_format(pb.approve_time,'%Y-%m-%d') = date_format(#{entity.approveTime},'%Y-%m-%d')</if>
|
|
<if test="entity.actualPaymentTime != null "> and date_format(pb.actual_payment_time,'%Y-%m-%d') = date_format(#{entity.actualPaymentTime},'%Y-%m-%d')</if>
|
|
<if test="entity.paymentMethod != null and entity.paymentMethod != ''"> and pb.payment_method = #{entity.paymentMethod}</if>
|
|
<if test="entity.payableBillCode != null and entity.payableBillCode != ''"> and apb.payable_bill_code like concat('%', #{entity.payableBillCode}, '%')</if>
|
|
and pb.del_flag = '0'
|
|
</where>
|
|
</select>
|
|
<select id="listPreResidueAmountByVendorCodeList" resultType="com.ruoyi.sip.domain.OmsPaymentBill">
|
|
SELECT
|
|
sum( pre_residue_amount ) pre_residue_amount,vendor_code
|
|
FROM
|
|
oms_payment_bill
|
|
where payment_status='2' and vendor_code in
|
|
<foreach item="item" collection="list" separator="," open="(" close=")" index="index">
|
|
#{item}
|
|
</foreach>
|
|
GROUP BY
|
|
vendor_code
|
|
</select>
|
|
|
|
|
|
</mapper> |