|
|
|
@ -9,12 +9,12 @@ |
|
|
|
cash_record(order_type,jwcode,name,market,activity, |
|
|
|
order_code,goods_name,good_num,permanent_gold,free_gold, |
|
|
|
payment_currency,payment_amount,received_market, |
|
|
|
pay_type,pay_time,status,submitter_id, |
|
|
|
pay_type,pay_time,status,submitter_id,submitter_market, |
|
|
|
voucher,remark) |
|
|
|
values(#{orderType},#{jwcode},#{name},#{market},#{activity}, |
|
|
|
#{orderCode},#{goodsName},#{goodNum},#{permanentGold},#{freeGold},#{paymentCurrency}, |
|
|
|
#{paymentAmount},#{receivedMarket},#{payType},#{payTime}, |
|
|
|
#{status},#{submitterId},#{voucher},#{remark}) |
|
|
|
#{status},#{submitterId},#{submitterMarket},#{voucher},#{remark}) |
|
|
|
</insert> |
|
|
|
<!-- <insert id="syncToCashRecord"> |
|
|
|
insert into cash_record(order_type,jwcode,name,market,activity, |
|
|
|
@ -94,6 +94,12 @@ |
|
|
|
WHERE order_code = #{cashRecord.orderCode} |
|
|
|
AND status IN (1, 3) |
|
|
|
</update> |
|
|
|
<!--设置gOrder订单为已同步--> |
|
|
|
<update id="markSynced"> |
|
|
|
update g_order |
|
|
|
set is_synced = 1 |
|
|
|
where id = #{orderId} |
|
|
|
</update> |
|
|
|
<!--根据jwcode获取所属地区--> |
|
|
|
<select id="getMarketByJwcode" resultType="java.lang.String"> |
|
|
|
select market from user where jwcode=#{jwcode} |
|
|
|
@ -109,18 +115,17 @@ |
|
|
|
select cr.id,cr.jwcode,cr.name,cr.market, |
|
|
|
m1.name as marketName, |
|
|
|
cr.activity,cr.order_code,cr.bank_code, |
|
|
|
cr.goods_name,cr.good_num,cr.permanent_gold,cr.free_gold,cr.payment_amount/100 as paymentAmount, |
|
|
|
cr.goods_name,cr.good_num, |
|
|
|
cr.permanent_gold/100 as permanentGold,cr.free_gold/100 as freeGold,cr.payment_amount/100 as paymentAmount, |
|
|
|
r1.rate_name as paymentCurrency, |
|
|
|
r2.rate_name as receivedCurrency, |
|
|
|
m2.name as receivedMarket, |
|
|
|
cr.received_amount/100 as receivedAmount,cr.handling_charge/100 as handlingCharge, |
|
|
|
cr.pay_type,cr.pay_time,cr.received_time, |
|
|
|
cr.status,cr.submitter_id,cr.voucher,cr.remark,cr.reject_reason, |
|
|
|
cr.status,cr.submitter_id,cr.submitter_market,cr.voucher,cr.remark,cr.reject_reason, |
|
|
|
cr.audit_id,cr.create_time,cr.update_time,cr.audit_time, |
|
|
|
a1.admin_name as submitterName, |
|
|
|
a2.admin_name as auditName |
|
|
|
|
|
|
|
|
|
|
|
from cash_record cr |
|
|
|
left join admin a1 on cr.submitter_id = a1.id |
|
|
|
left join admin a2 on cr.audit_id = a2.id |
|
|
|
@ -142,9 +147,32 @@ |
|
|
|
<if test="cashCollection.submitterId!=null and cashCollection.submitterId !=''"> |
|
|
|
AND cr.submitter_id = #{cashCollection.submitterId} |
|
|
|
</if> |
|
|
|
<if test="cashCollection.receivedMarket!=null and cashCollection.receivedMarket!=''"> |
|
|
|
AND cr.received_market = #{cashCollection.receivedMarket} |
|
|
|
</if> |
|
|
|
<!-- 其他原有条件不变 --> |
|
|
|
<choose> |
|
|
|
<when test="cashCollection.status != null and cashCollection.status == 46"> |
|
|
|
<if test="cashCollection.receivedMarket != null and cashCollection.receivedMarket != ''"> |
|
|
|
AND (cr.received_market = #{cashCollection.receivedMarket} |
|
|
|
<if test="cashCollection.submitterMarket != null and cashCollection.submitterMarket != ''"> |
|
|
|
OR cr.submitter_market = #{cashCollection.submitterMarket} |
|
|
|
</if> |
|
|
|
) |
|
|
|
</if> |
|
|
|
<if test="(cashCollection.receivedMarket == null or cashCollection.receivedMarket == '') |
|
|
|
and cashCollection.submitterMarket != null and cashCollection.submitterMarket != ''"> |
|
|
|
AND cr.submitter_market = #{cashCollection.submitterMarket} |
|
|
|
</if> |
|
|
|
</when> |
|
|
|
|
|
|
|
<!-- 非 status=46 保持原逻辑:同时满足 --> |
|
|
|
<otherwise> |
|
|
|
<if test="cashCollection.receivedMarket != null and cashCollection.receivedMarket != ''"> |
|
|
|
AND cr.received_market = #{cashCollection.receivedMarket} |
|
|
|
</if> |
|
|
|
<if test="cashCollection.submitterMarket != null and cashCollection.submitterMarket != ''"> |
|
|
|
AND cr.submitter_market = #{cashCollection.submitterMarket} |
|
|
|
</if> |
|
|
|
</otherwise> |
|
|
|
</choose> |
|
|
|
<if test="cashCollection.activity!=null and cashCollection.activity!=''"> |
|
|
|
AND cr.activity like concat('%',#{cashCollection.activity},'%') |
|
|
|
</if> |
|
|
|
@ -196,11 +224,11 @@ |
|
|
|
</select> |
|
|
|
<!--查找未同步的订单--> |
|
|
|
<select id="getUnSync" resultType="com.example.demo.domain.entity.GOrder"> |
|
|
|
select jwcode,order_no,type,price,count,pay_style,state, |
|
|
|
select id,jwcode,order_no,type,price,count,pay_style,state, |
|
|
|
success_time,ios_environment,ios_transaction_id,ios_receipt_data, |
|
|
|
paypal_order_id,add_time,is_synced |
|
|
|
add_time,is_synced |
|
|
|
from g_order |
|
|
|
where is_synced=0 and state=1 and type='gold_coin' |
|
|
|
where is_synced=0 and state=1 and type='gold_coin' and pay_style in(3,5,6,7,9) |
|
|
|
limit #{size} |
|
|
|
</select> |
|
|
|
</mapper> |