`id`, `tenant_id`, `parent_tenant_id`, `source_app_id`, `source_type`,`notice_id`, `notice_create_time`, `notice_event_type`, `summary`,`shop_name`, `shop_number`, `user_phone`, `user_number`, `time_end`, `amount`, `pay_amount`, `transaction_id`, `create_time`, `update_time`, `merchant_id`,`merchant_name`, `c_user_id`, `c_user_nick_name`, `c_user_phone`, `earn_points`, `increased_points`, `points_update_time`, `is_refund`, `order_status`, `refund_id`, `refund_amount` where 1 = 1 and `id` = #{id} and `tenant_id` = #{tenantId} and `parent_tenant_id` = #{parentTenantId} and `source_app_id` = #{sourceAppId} and `source_type` = #{sourceType} and `shop_name` like concat('%', #{shopName},'%') and `shop_number` = #{shopNumber} and `user_phone` = #{userPhone} and `user_number` = #{userNumber} and `notice_id` = #{noticeId} and `time_end` >= #{startTime} and `time_end` < #{endTime} and `transaction_id` = #{transactionId} and `merchant_id` = #{merchantId} and `merchant_name` like concat('%', #{merchantName},'%') and `c_user_id` = #{cUserId} and `c_user_nick_name` like concat('%', #{cUserNickName},'%') and `c_user_phone` like concat('%', #{cUserPhone},'%') and `earn_points` = #{earnPoints} and `is_refund` = #{isRefund} and `order_status` = #{orderStatus} and `refund_id` = #{refundId} and `id` in #{idItem} INSERT INTO wx_third_party_orders ( `id`, `tenant_id`, `parent_tenant_id`,`source_app_id`, `source_type`, `notice_id`, `notice_create_time`, `notice_event_type`, `summary`, `shop_name`, `shop_number`, `user_phone`, `user_number`,`time_end`, `amount`, `pay_amount`, `transaction_id`, `create_time`, `update_time`, `merchant_id`,`merchant_name`, `c_user_id`, `c_user_nick_name`, `c_user_phone`, `earn_points`, `is_refund` ) VALUES( #{id},#{tenantId},#{parentTenantId},#{sourceAppId},#{sourceType},#{noticeId},#{noticeCreateTime},#{noticeEventType}, #{summary},#{shopName},#{shopNumber},#{userPhone},#{userNumber},#{timeEnd},#{amount},#{payAmount},#{transactionId},#{createTime},#{updateTime}, #{merchantId},#{merchantName},#{cUserId},#{cUserNickName},#{cUserPhone},0,0 ); update wx_third_party_orders set `earn_points` = 1, `increased_points` = #{increasedPoints}, `points_update_time` = #{pointsUpdateTime}, `update_time` = #{updateTime} where `id` = #{id} and `tenant_id` = #{tenantId} INSERT INTO wx_third_party_orders ( `id`, `tenant_id`, `parent_tenant_id`,`source_app_id`, `source_type`, `notice_id`, `notice_create_time`, `notice_event_type`, `summary`,`shop_name`, `shop_number`, `user_phone`, `user_number`, `time_end`, `amount`,`pay_amount`, `transaction_id`, `create_time`, `update_time`, `merchant_id`,`merchant_name`, `c_user_id`, `c_user_nick_name`, `c_user_phone`, `earn_points`, `is_refund`, `refund_id`, `refund_amount` ) VALUES( #{id},#{tenantId},#{parentTenantId},#{sourceAppId},#{sourceType},#{noticeId},#{noticeCreateTime},#{noticeEventType}, #{summary},#{shopName},#{shopNumber},#{userPhone},#{userNumber},#{timeEnd},#{amount},#{payAmount},#{transactionId},#{createTime},#{updateTime}, #{merchantId},#{merchantName},#{cUserId},#{cUserNickName},#{cUserPhone},0,1,#{refundId},#{refundAmount} ); update wx_third_party_orders set `order_status` = #{orderStatus}, `update_time` = #{updateTime} where `id` = #{id} and `tenant_id` = #{tenantId}