<?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.platform.dao.AlipayJournalMapper">
<sql id="Base_Colunm_List">
id,statuscode,retmsg,sub_code,sub_msg,subject,out_trade_no,transaction_id,total_amount,
discountable_amount,undiscountable_amount,time_expire,trade_no,trade_status,receipt_amount,invoice_amount,
buyer_pay_amount,store_id,retry_flag,buyer_logon_id,fund_change,refund_fee,gmt_refund_pay,notify_id,create_time,
update_time,out_request_no,code,notify_time,notify_type,sign_type,seller_id,seller_email,send_back_fee,refund_status,delete_flag
</sql>
<insert id="insertAlipayJournal" parameterType="com.platform.pojo.AlipayJournal">
insert into alipay_journal
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id!=null">
id,
</if>
<if test="statuscode!=null">
statuscode,
</if>
<if test="retmsg!=null">
retmsg,
</if>
<if test="sub_code!=null">
sub_code,
</if>
<if test="sub_msg!=null">
sub_msg,
</if>
<if test="subject!=null">
subject,
</if>
<if test="out_trade_no!=null">
out_trade_no,
</if>
<if test="transaction_id!=null">
transaction_id,
</if>
<if test="total_amount!=null">
total_amount,
</if>
<if test="discountable_amount!=null">
discountable_amount
</if>
<if test="undiscountable_amount!=null">
undiscountable_amount,
</if>
<if test="time_expire!=null">
time_expire,
</if>
<if test="trade_no!=null">
trade_no,
</if>
<if test="trade_status!=null">
trade_status,
</if>
<if test="receipt_amount!=null">
receipt_amount,
</if>
<if test="invoice_amount!=null">
invoice_amount,
</if>
<if test="buyer_pay_amount!=null">
buyer_pay_amount,
</if>
<if test="store_id!=null">
store_id,
</if>
<if test="retry_flag!=null">
retry_flag,
</if>
<if test="buyer_logon_id!=null">
buyer_logon_id,
</if>
<if test="fund_change!=null">
fund_change,
</if>
<if test="refund_fee!=null">
refund_fee,
</if>
<if test="gmt_refund_pay!=null">
gmt_refund_pay,
</if>
<if test="notify_id!=null">
notify_id,
</if>
create_time,
update_time,
<if test="out_request_no!=null">
out_request_no,
</if>
<if test="code!=null">
code,
</if>
<if test="notify_time!=null">
notify_time,
</if>
<if test="notify_type!=null">
notify_type,
</if>
<if test="sign_type!=null">
sign_type,
</if>
<if test="seller_id!=null">
seller_id,
</if>
<if test="seller_email!=null">
seller_email,
</if>
<if test="refund_status!=null">
refund_status,
</if>
<if test="delete_flag!=null">
delete_flag,
</if>
</trim>
<trim prefix="values(" suffix=")" suffixOverrides=",">
<if test="id!=null">
#{id},
</if>
<if test="statuscode!=null">
#{statuscode},
</if>
<if test="retmsg!=null">
#{retmsg},
</if>
<if test="sub_code!=null">
#{sub_code},
</if>
<if test="sub_msg!=null">
#{sub_msg},
</if>
<if test="subject!=null">
#{subject},
</if>
<if test="out_trade_no!=null">
#{out_trade_no},
</if>
<if test="transaction_id!=null">
#{transaction_id},
</if>
<if test="total_amount!=null">
#{total_amount},
</if>
<if test="discountable_amount!=null">
#{discountable_amount},
</if>
<if test="undiscountable_amount!=null">
#{undiscountable_amount},
</if>
<if test="time_expire!=null">
#{time_expire},
</if>
<if test="trade_no!=null">
#{trade_no},
</if>
<if test="trade_status!=null">
#{trade_status},
</if>
<if test="receipt_amount!=null">
#{receipt_amount},
</if>
<if test="invoice_amount!=null">
#{invoice_amount},
</if>
<if test="buyer_pay_amount!=null">
#{buyer_pay_amount},
</if>
<if test="store_id!=null">
#{store_id},
</if>
<if test="retry_flag!=null">
#{retry_flag},
</if>
<if test="buyer_logon_id!=null">
#{buyer_logon_id},
</if>
<if test="fund_change!=null">
#{fund_change},
</if>
<if test="refund_fee!=null">
#{refund_fee},
</if>
<if test="gmt_refund_pay!=null">
#{gmt_refund_pay},
</if>
<if test="notify_id!=null">
#{notify_id},
</if>
SYSDATE(),
SYSDATE(),
<if test="out_request_no!=null">
#{out_request_no},
</if>
<if test="code!=null">
#{code},
</if>
<if test="notify_time!=null">
#{notify_time},
</if>
<if test="notify_type!=null">
#{notify_type},
</if>
<if test="sign_type!=null">
#{sign_type},
</if>
<if test="seller_id!=null">
#{seller_id},
</if>
<if test="seller_email!=null">
#{seller_email},
</if>
<if test="send_back_fee!=null">
#{send_back_fee},
</if>
<if test="refund_status!=null">
#{refund_status},
</if>
<if test="delete_flag!=null">
#{delete_flag},
</if>
</trim>
</insert>
<update id="updateAlipayJournal" parameterType="com.platform.pojo.AlipayJournal">
update alipay_journal
<set>
<if test="statuscode!=null">
statuscode=#{statuscode},
</if>
<if test="retmsg!=null">
retmsg=#{retmsg},
</if>
<if test="sub_code!=null">
sub_code=#{sub_code},
</if>
<if test="sub_msg!=null">
sub_msg=#{sub_msg},
</if>
<if test="subject!=null">
subject=#{subject},
</if>
<if test="out_trade_no!=null">
out_trade_no=#{out_trade_no},
</if>
<if test="transaction_id!=null">
transaction_id=#{transaction_id},
</if>
<if test="total_amount!=null">
total_amount=#{total_amount},
</if>
<if test="discountable_amount!=null">
discountable_amount=#{discountable_amount},
</if>
<if test="undiscountable_amount!=null">
undiscountable_amount=#{undiscountable_amount},
</if>
<if test="time_expire!=null">
time_expire=#{time_expire},
</if>
<if test="trade_no!=null">
trade_no=#{trade_no},
</if>
<if test="trade_status!=null">
trade_status=#{trade_status},
</if>
<if test="receipt_amount!=null">
receipt_amount=#{receipt_amount},
</if>
<if test="invoice_amount!=null">
invoice_amount=#{invoice_amount},
</if>
<if test="buyer_pay_amount!=null">
buyer_pay_amount=#{buyer_pay_amount},
</if>
<if test="store_id!=null">
store_id=#{store_id},
</if>
<if test="retry_flag!=null">
retry_flag=#{retry_flag},
</if>
<if test="buyer_logon_id!=null">
buyer_logon_id=#{buyer_logon_id},
</if>
<if test="fund_change!=null">
fund_change=#{fund_change},
</if>
<if test="refund_fee!=null">
refund_fee=#{refund_fee},
</if>
<if test="gmt_refund_pay!=null">
gmt_refund_pay=#{gmt_refund_pay},
</if>
<if test="notify_id!=null">
notify_id=#{notify_id},
</if>
update_time=SYSDATE(),
<if test="out_request_no!=null">
out_request_no=#{out_request_no},
</if>
<if test="code!=null">
code=#{code}
</if>
<if test="notify_time!=null">
notify_time=#{notify_time},
</if>
<if test="notify_type!=null">
notify_type=#{notify_type},
</if>
<if test="sign_type!=null">
sign_type=#{sign_type},
</if>
<if test="seller_id!=null">
seller_id=#{seller_id},
</if>
<if test="seller_email!=null">
seller_email=#{seller_email},
</if>
<if test="send_back_fee!=null">
send_back_fee=#{send_back_fee},
</if>
<if test="refund_status!=null">
refund_status=#{refund_status},
</if>
<if test="delete_flag!=null">
delete_flag=#{delete_flag}
</if>
</set>
where id=#{id}
</update>
<select id="selectAlipayJournalByAlipayId" parameterType="com.platform.pojo.AlipayJournal" resultType="com.platform.pojo.AlipayJournal">
select 
<include refid="Base_Colunm_List"></include> from alipay_journal where id=#{id}
</select>
<select id="selectAlipayJournal" parameterType="com.platform.pojo.AlipayJournal" resultType="com.platform.pojo.AlipayJournal">
select <include refid="Base_Colunm_List"></include> from alipay_journal 
<where>
<if test="id!=null and id!=''">
and id=#{id}
</if>
<if test="trade_no!=null and trade_no!=''">
and trade_no like '%${trade_no}'
</if>
</where>
</select>
</mapper>