万材erp项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

253 lines
16 KiB

2 years ago
<?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.invoice.mapper.PoInvoiceHeadMapper">
<resultMap type="PoInvoiceHead" id="PoInvoiceHeadResult">
<result property="invoiceid" column="invoiceid"/>
<result property="Invoiceno" column="Invoiceno"/>
<result property="pCode" column="p_code"/>
<result property="pName" column="P_name"/>
<result property="HTNO" column="HTNO"/>
<result property="PAYWAY" column="PAYWAY"/>
<result property="invoicedate" column="invoicedate"/>
<result property="sendcompany" column="sendcompany"/>
<result property="getcompany" column="getcompany"/>
<result property="swater" column="swater"/>
<result property="dwater" column="dwater"/>
<result property="totalqty" column="totalqty"/>
<result property="totalamt" column="totalamt"/>
<result property="allenamt" column="allenamt"/>
<result property="opman" column="opman"/>
<result property="boxNum" column="box_num"/>
<result property="sendway" column="sendway"/>
<result property="sendtool" column="sendtool"/>
<result property="leavechinaDate" column="leavechina_date"/>
<result property="getFormNo" column="get_form_no"/>
<result property="ciqName" column="CIQ_NAME"/>
<result property="CPSendID" column="CPSendID"/>
<result property="crlName" column="CRL_NAME"/>
<result property="getmoneyFlag" column="GetMoney_Flag"/>
<result property="koukuanAmt" column="Koukuan_Amt"/>
<result property="koukuanMemotext" column="KouKuan_MemoText"/>
<result property="getmoneyMemotext" column="GetMoney_MemoText"/>
<result property="getmoneyDate" column="GetMoney_date"/>
<result property="getmoneyMan" column="getmoney_man"/>
<result property="getmoney" column="getmoney"/>
<result property="taxInvoiceNo" column="tax_invoice_no"/>
<result property="taxPrintVersion" column="tax_print_version"/>
<result property="payall" column="payall"/>
<result property="MemoText" column="MemoText"/>
<result property="ShouldPayDate" column="ShouldPayDate"/>
<result property="haveAppAmt" column="Have_APP_AMT"/>
</resultMap>
<sql id="selectPoInvoiceHeadVo">
select invoiceid, Invoiceno, p_code, P_name, HTNO, PAYWAY, invoicedate, sendcompany, getcompany, swater, dwater, totalqty, totalamt, allenamt, opman, box_num, sendway, sendtool, leavechina_date, get_form_no, CIQ_NAME, CPSendID, CRL_NAME, GetMoney_Flag, Koukuan_Amt, KouKuan_MemoText, GetMoney_MemoText, GetMoney_date, getmoney_man, getmoney, tax_invoice_no, tax_print_version, payall, MemoText, ShouldPayDate, Have_APP_AMT from poinvoicehead
</sql>
<select id="selectPoInvoiceHeadList" parameterType="PoInvoiceHead" resultMap="PoInvoiceHeadResult">
<include refid="selectPoInvoiceHeadVo"/>
<where>
<if test="invoiceid != null and invoiceid != ''">and invoiceid like concat('%', #{invoiceid}, '%')</if>
<if test="Invoiceno != null and Invoiceno != ''">and Invoiceno like concat('%', #{Invoiceno}, '%')</if>
<if test="pCode != null and pCode != ''">and p_code like concat('%', #{pCode}, '%')</if>
<if test="pName != null and pName != ''">and P_name like concat('%', #{pName}, '%')</if>
<if test="HTNO != null and HTNO != ''">and HTNO like concat('%', #{HTNO}, '%')</if>
<if test="PAYWAY != null and PAYWAY != ''">and PAYWAY like concat('%', #{PAYWAY}, '%')</if>
<if test="params.beginInvoiceDate != null and params.beginInvoiceDate !=''">and invoiceDate >=
#{params.beginInvoiceDate}
</if>
<if test="params.endInvoiceDate != null and params.endInvoiceDate != ''">and #{params.endInvoiceDate} >=
invoiceDate
</if>
<if test="sendcompany != null and sendcompany != ''">and sendcompany like concat('%', #{sendcompany}, '%')
</if>
<if test="getcompany != null and getcompany != ''">and getcompany like concat('%', #{getcompany}, '%')</if>
<if test="swater != null and swater != ''">and swater like concat('%', #{swater}, '%')</if>
<if test="dwater != null and dwater != ''">and dwater like concat('%', #{dwater}, '%')</if>
<if test="totalqty != null and totalqty != ''">and totalqty like concat('%', #{totalqty}, '%')</if>
<if test="totalamt != null and totalamt != ''">and totalamt like concat('%', #{totalamt}, '%')</if>
<if test="allenamt != null and allenamt != ''">and allenamt like concat('%', #{allenamt}, '%')</if>
<if test="opman != null and opman != ''">and opman like concat('%', #{opman}, '%')</if>
<if test="boxNum != null ">and box_num like concat('%', #{boxNum}, '%')</if>
<if test="sendway != null and sendway != ''">and sendway like concat('%', #{sendway}, '%')</if>
<if test="sendtool != null and sendtool != ''">and sendtool like concat('%', #{sendtool}, '%')</if>
<if test="leavechinaDate != null ">and leavechina_date like concat('%', #{leavechinaDate}, '%')</if>
<if test="getFormNo != null and getFormNo != ''">and get_form_no like concat('%', #{getFormNo}, '%')</if>
<if test="ciqName != null and ciqName != ''">and CIQ_NAME like concat('%', #{ciqName}, '%')</if>
<if test="CPSendID != null and CPSendID != ''">and CPSendID like concat('%', #{CPSendID}, '%')</if>
<if test="crlName != null and crlName != ''">and CRL_NAME like concat('%', #{crlName}, '%')</if>
<if test="getmoneyFlag != null and getmoneyFlag!=''">and GetMoney_Flag = #{getmoneyFlag}</if>
<if test="koukuanAmt != null ">and Koukuan_Amt like concat('%', #{koukuanAmt}, '%')</if>
<if test="koukuanMemotext != null and koukuanMemotext != ''">and KouKuan_MemoText like concat('%',
#{koukuanMemotext}, '%')
</if>
<if test="getmoneyMemotext != null and getmoneyMemotext != ''">and GetMoney_MemoText like concat('%',
#{getmoneyMemotext}, '%')
</if>
<if test="getmoneyDate != null ">and GetMoney_date like concat('%', #{getmoneyDate}, '%')</if>
<if test="getmoneyMan != null and getmoneyMan != ''">and getmoney_man like concat('%', #{getmoneyMan},
'%')
</if>
<if test="getmoney != null ">and getmoney like concat('%', #{getmoney}, '%')</if>
<if test="taxInvoiceNo != null and taxInvoiceNo != ''">and tax_invoice_no like concat('%', #{taxInvoiceNo},
'%')
</if>
<if test="taxPrintVersion != null and taxPrintVersion != ''">and tax_print_version like concat('%',
#{taxPrintVersion}, '%')
</if>
<if test="payall != null and payall != ''">and payall like concat('%', #{payall}, '%')</if>
<if test="MemoText != null and MemoText != ''">and MemoText like concat('%', #{MemoText}, '%')</if>
<if test="ShouldPayDate != null ">and ShouldPayDate like concat('%', #{ShouldPayDate}, '%')</if>
<if test="haveAppAmt != null ">and Have_APP_AMT like concat('%', #{haveAppAmt}, '%')</if>
<if test="isAllPay == 0 and isAllPay!='' and isAllPay!=null">and SUBSTRING(totalamt,4,LENGTH(totalamt)-3)-getmoney<![CDATA[ <> ]]>0</if>
<if test="isAllPay == 1 and isAllPay!='' and isAllPay!=null">and SUBSTRING(totalamt,4,LENGTH(totalamt)-3)-getmoney=0</if>
<if test="surplusPayDay !=null and surplusPayDay!=''">and TO_DAYS(ShouldPayDate)-TO_DAYS(NOW())>=#{surplusPayDay}</if>
</where>
</select>
<select id="selectPoInvoiceHeadById" parameterType="String" resultMap="PoInvoiceHeadResult">
<include refid="selectPoInvoiceHeadVo"/>
where invoiceid = #{invoiceid}
</select>
<insert id="insertPoInvoiceHead" parameterType="PoInvoiceHead">
insert into poinvoicehead
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="invoiceid != null">invoiceid,</if>
<if test="Invoiceno != null">Invoiceno,</if>
<if test="pCode != null">p_code,</if>
<if test="pName != null">P_name,</if>
<if test="HTNO != null">HTNO,</if>
<if test="PAYWAY != null">PAYWAY,</if>
<if test="invoicedate != null">invoicedate,</if>
<if test="sendcompany != null">sendcompany,</if>
<if test="getcompany != null">getcompany,</if>
<if test="swater != null">swater,</if>
<if test="dwater != null">dwater,</if>
<if test="totalqty != null">totalqty,</if>
<if test="totalamt != null">totalamt,</if>
<if test="allenamt != null">allenamt,</if>
<if test="opman != null">opman,</if>
<if test="boxNum != null">box_num,</if>
<if test="sendway != null">sendway,</if>
<if test="sendtool != null">sendtool,</if>
<if test="leavechinaDate != null">leavechina_date,</if>
<if test="getFormNo != null">get_form_no,</if>
<if test="ciqName != null">CIQ_NAME,</if>
<if test="CPSendID != null">CPSendID,</if>
<if test="crlName != null">CRL_NAME,</if>
<if test="getmoneyFlag != null">GetMoney_Flag,</if>
<if test="koukuanAmt != null">Koukuan_Amt,</if>
<if test="koukuanMemotext != null">KouKuan_MemoText,</if>
<if test="getmoneyMemotext != null">GetMoney_MemoText,</if>
<if test="getmoneyDate != null">GetMoney_date,</if>
<if test="getmoneyMan != null">getmoney_man,</if>
<if test="getmoney != null">getmoney,</if>
<if test="taxInvoiceNo != null">tax_invoice_no,</if>
<if test="taxPrintVersion != null">tax_print_version,</if>
<if test="payall != null">payall,</if>
<if test="MemoText != null">MemoText,</if>
<if test="ShouldPayDate != null">ShouldPayDate,</if>
<if test="haveAppAmt != null">Have_APP_AMT,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="invoiceid != null">#{invoiceid},</if>
<if test="Invoiceno != null">#{Invoiceno},</if>
<if test="pCode != null">#{pCode},</if>
<if test="pName != null">#{pName},</if>
<if test="HTNO != null">#{HTNO},</if>
<if test="PAYWAY != null">#{PAYWAY},</if>
<if test="invoicedate != null">#{invoicedate},</if>
<if test="sendcompany != null">#{sendcompany},</if>
<if test="getcompany != null">#{getcompany},</if>
<if test="swater != null">#{swater},</if>
<if test="dwater != null">#{dwater},</if>
<if test="totalqty != null">#{totalqty},</if>
<if test="totalamt != null">#{totalamt},</if>
<if test="allenamt != null">#{allenamt},</if>
<if test="opman != null">#{opman},</if>
<if test="boxNum != null">#{boxNum},</if>
<if test="sendway != null">#{sendway},</if>
<if test="sendtool != null">#{sendtool},</if>
<if test="leavechinaDate != null">#{leavechinaDate},</if>
<if test="getFormNo != null">#{getFormNo},</if>
<if test="ciqName != null">#{ciqName},</if>
<if test="CPSendID != null">#{CPSendID},</if>
<if test="crlName != null">#{crlName},</if>
<if test="getmoneyFlag != null">#{getmoneyFlag},</if>
<if test="koukuanAmt != null">#{koukuanAmt},</if>
<if test="koukuanMemotext != null">#{koukuanMemotext},</if>
<if test="getmoneyMemotext != null">#{getmoneyMemotext},</if>
<if test="getmoneyDate != null">#{getmoneyDate},</if>
<if test="getmoneyMan != null">#{getmoneyMan},</if>
<if test="getmoney != null">#{getmoney},</if>
<if test="taxInvoiceNo != null">#{taxInvoiceNo},</if>
<if test="taxPrintVersion != null">#{taxPrintVersion},</if>
<if test="payall != null">#{payall},</if>
<if test="MemoText != null">#{MemoText},</if>
<if test="ShouldPayDate != null">#{ShouldPayDate},</if>
<if test="haveAppAmt != null">#{haveAppAmt},</if>
</trim>
</insert>
<update id="updatePoInvoiceHead" parameterType="PoInvoiceHead">
update poinvoicehead
<trim prefix="SET" suffixOverrides=",">
<if test="Invoiceno != null">Invoiceno = #{Invoiceno},</if>
<if test="pCode != null">p_code = #{pCode},</if>
<if test="pName != null">P_name = #{pName},</if>
<if test="HTNO != null">HTNO = #{HTNO},</if>
<if test="PAYWAY != null">PAYWAY = #{PAYWAY},</if>
<if test="invoicedate != null">invoicedate = #{invoicedate},</if>
<if test="sendcompany != null">sendcompany = #{sendcompany},</if>
<if test="getcompany != null">getcompany = #{getcompany},</if>
<if test="swater != null">swater = #{swater},</if>
<if test="dwater != null">dwater = #{dwater},</if>
<if test="totalqty != null">totalqty = #{totalqty},</if>
<if test="totalamt != null">totalamt = #{totalamt},</if>
<if test="allenamt != null">allenamt = #{allenamt},</if>
<if test="opman != null">opman = #{opman},</if>
<if test="boxNum != null">box_num = #{boxNum},</if>
<if test="sendway != null">sendway = #{sendway},</if>
<if test="sendtool != null">sendtool = #{sendtool},</if>
<if test="leavechinaDate != null">leavechina_date = #{leavechinaDate},</if>
<if test="getFormNo != null">get_form_no = #{getFormNo},</if>
<if test="ciqName != null">CIQ_NAME = #{ciqName},</if>
<if test="CPSendID != null">CPSendID = #{CPSendID},</if>
<if test="crlName != null">CRL_NAME = #{crlName},</if>
<if test="getmoneyFlag != null">GetMoney_Flag = #{getmoneyFlag},</if>
<if test="koukuanAmt != null">Koukuan_Amt = #{koukuanAmt},</if>
<if test="koukuanMemotext != null">KouKuan_MemoText = #{koukuanMemotext},</if>
<if test="getmoneyMemotext != null">GetMoney_MemoText = #{getmoneyMemotext},</if>
<if test="getmoneyDate != null">GetMoney_date = #{getmoneyDate},</if>
<if test="getmoneyMan != null">getmoney_man = #{getmoneyMan},</if>
<if test="getmoney != null">getmoney = #{getmoney},</if>
<if test="taxInvoiceNo != null">tax_invoice_no = #{taxInvoiceNo},</if>
<if test="taxPrintVersion != null">tax_print_version = #{taxPrintVersion},</if>
<if test="payall != null">payall = #{payall},</if>
<if test="MemoText != null">MemoText = #{MemoText},</if>
<if test="ShouldPayDate != null">ShouldPayDate = #{ShouldPayDate},</if>
<if test="haveAppAmt != null">Have_APP_AMT = #{haveAppAmt},</if>
</trim>
where invoiceid = #{invoiceid}
</update>
<delete id="deletePoInvoiceHeadById" parameterType="String">
delete from poinvoicehead where invoiceid = #{invoiceid}
</delete>
<delete id="deletePoInvoiceHeadByIds" parameterType="String">
delete from poinvoicehead where invoiceid in
<foreach item="invoiceid" collection="array" open="(" separator="," close=")">
#{invoiceid}
</foreach>
</delete>
<select id="selectCountByDay" resultType="Integer">
select count(*) from poinvoicehead where to_days(invoicedate) = to_days(now());
</select>
</mapper>