|
|
|
@ -47,16 +47,50 @@ |
|
|
|
</update> |
|
|
|
<!--补全手续费等字段--> |
|
|
|
<update id="complete"> |
|
|
|
update cash_record |
|
|
|
set handling_charge=#{cashRecord.handlingCharge}, |
|
|
|
received_currency=#{cashRecord.receivedCurrency}, |
|
|
|
received_amount=#{cashRecord.receivedAmount}, |
|
|
|
received_time=#{cashRecord.receivedTime}, |
|
|
|
received_remark= #{cashRecord.receivedRemark}, |
|
|
|
status=4, |
|
|
|
bank_code= #{cashRecord.bankCode} |
|
|
|
where order_code=#{cashRecord.orderCode} and status in (1,3) |
|
|
|
|
|
|
|
UPDATE cash_record |
|
|
|
<set> |
|
|
|
<if test="cashRecord.handlingCharge != null and cashRecord.handlingCharge!=''"> |
|
|
|
handling_charge = #{cashRecord.handlingCharge}, |
|
|
|
</if> |
|
|
|
<if test="cashRecord.receivedCurrency != null and cashRecord.receivedCurrency != ''"> |
|
|
|
received_currency = #{cashRecord.receivedCurrency}, |
|
|
|
</if> |
|
|
|
<if test="cashRecord.receivedAmount != null"> |
|
|
|
received_amount = #{cashRecord.receivedAmount}, |
|
|
|
</if> |
|
|
|
<if test="cashRecord.receivedTime != null"> |
|
|
|
received_time = #{cashRecord.receivedTime}, |
|
|
|
</if> |
|
|
|
<if test="cashRecord.receivedRemark != null and cashRecord.receivedRemark != ''"> |
|
|
|
received_remark = #{cashRecord.receivedRemark}, |
|
|
|
</if> |
|
|
|
<if test="cashRecord.paymentCurrency != null and cashRecord.paymentCurrency != ''"> |
|
|
|
payment_currency = #{cashRecord.paymentCurrency}, |
|
|
|
</if> |
|
|
|
<!-- 关键:null 就不拼这一列 --> |
|
|
|
<if test="cashRecord.paymentAmount != null"> |
|
|
|
payment_amount = #{cashRecord.paymentAmount}, |
|
|
|
</if> |
|
|
|
<if test="cashRecord.bankCode != null and cashRecord.bankCode != ''"> |
|
|
|
bank_code = #{cashRecord.bankCode}, |
|
|
|
</if> |
|
|
|
<!-- 只有 这些字段全部非空才更新状态 --> |
|
|
|
status = CASE |
|
|
|
WHEN |
|
|
|
handling_charge IS NOT NULL |
|
|
|
AND received_currency IS NOT NULL AND received_currency != '' |
|
|
|
AND received_amount IS NOT NULL |
|
|
|
AND received_time IS NOT NULL |
|
|
|
AND received_remark IS NOT NULL AND received_remark != '' |
|
|
|
AND payment_currency IS NOT NULL AND payment_currency != '' |
|
|
|
AND payment_amount IS NOT NULL |
|
|
|
AND bank_code IS NOT NULL AND bank_code != '' |
|
|
|
THEN 4 |
|
|
|
ELSE status |
|
|
|
END |
|
|
|
</set> |
|
|
|
WHERE order_code = #{cashRecord.orderCode} |
|
|
|
AND status IN (1, 3) |
|
|
|
</update> |
|
|
|
<!--根据jwcode获取所属地区--> |
|
|
|
<select id="getMarketByJwcode" resultType="java.lang.String"> |
|
|
|
@ -72,8 +106,8 @@ |
|
|
|
<select id="selectCollection1" resultType="com.example.demo.domain.vo.cash.CashCollection"> |
|
|
|
select cr.id,cr.jwcode,cr.name,cr.market, |
|
|
|
m.name as marketName,cr.activity,cr.order_code,cr.bank_code, |
|
|
|
cr.goods_name,cr.good_num,cr.payment_currency,cr.payment_amount, |
|
|
|
cr.received_currency,cr.received_amount,cr.handling_charge, |
|
|
|
cr.goods_name,cr.good_num,cr.permanent_gold,cr.free_gold,cr.payment_currency,cr.payment_amount/100 as paymentAmount, |
|
|
|
cr.received_currency,cr.received_amount/100 as receivedAmount,cr.handling_charge/100 as handlingCharge, |
|
|
|
cr.received_market,cr.pay_type,cr.pay_time,cr.received_time, |
|
|
|
cr.status,cr.submitter_id,cr.voucher,cr.remark,cr.reject_reason, |
|
|
|
cr.audit_id,cr.create_time,cr.update_time,cr.audit_time, |
|
|
|
@ -131,7 +165,7 @@ |
|
|
|
</otherwise> |
|
|
|
</choose> |
|
|
|
</select> |
|
|
|
<select id="selectUnAuditByOrderCode" resultType="com.example.demo.domain.entity.CashRecord"> |
|
|
|
<select id="selectAuditByOrderCode" resultType="com.example.demo.domain.entity.CashRecord"> |
|
|
|
select status,order_code from cash_record where order_code=#{orderCode} |
|
|
|
</select> |
|
|
|
<!--根据精网号获取姓名--> |
|
|
|
|