1. 程式人生 > >sql if else

sql if else

rac sql nbsp insert type tor lte batch native

<insert id="insertSelective" parameterType="com.sto.platform.member.model.IntlOrderTrackingNo">
INSERT INTO intl_order_tracking_no (
consolidator_no,
order_id,
tracking_no,
sto_no,
batch_no,
order_type,
create_time
)
VALUES
(
#{consolidatorNo},
<include refid="alternative_order_id" />,
#{trackingNo},
#{stoNo},
#{batchNo},
#{orderType},
#{createTime}
)
</insert>

<sql id="alternative_order_id">
<choose>
<when test="connectOrderItem != null and connectOrderItem != ‘‘ ">
#{connectOrderItem}
</when>
<otherwise>
#{orderId}
</otherwise>
</choose>
</sql>

sql if else