package com.hfkj.dao;

import com.hfkj.entity.CyymallOrderExample.Criteria;
import com.hfkj.entity.CyymallOrderExample.Criterion;
import com.hfkj.entity.CyymallOrderExample;
import com.hfkj.entity.CyymallOrderWithBLOBs;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;

public class CyymallOrderSqlProvider {

    public String countByExample(CyymallOrderExample example) {
        SQL sql = new SQL();
        sql.SELECT("count(*)").FROM("cyymall_order");
        applyWhere(sql, example, false);
        return sql.toString();
    }

    public String deleteByExample(CyymallOrderExample example) {
        SQL sql = new SQL();
        sql.DELETE_FROM("cyymall_order");
        applyWhere(sql, example, false);
        return sql.toString();
    }

    public String insertSelective(CyymallOrderWithBLOBs record) {
        SQL sql = new SQL();
        sql.INSERT_INTO("cyymall_order");
        
        if (record.getStoreId() != null) {
            sql.VALUES("store_id", "#{storeId,jdbcType=INTEGER}");
        }
        
        if (record.getUserId() != null) {
            sql.VALUES("user_id", "#{userId,jdbcType=INTEGER}");
        }
        
        if (record.getOrderNo() != null) {
            sql.VALUES("order_no", "#{orderNo,jdbcType=VARCHAR}");
        }
        
        if (record.getTotalPrice() != null) {
            sql.VALUES("total_price", "#{totalPrice,jdbcType=DECIMAL}");
        }
        
        if (record.getPayPrice() != null) {
            sql.VALUES("pay_price", "#{payPrice,jdbcType=DECIMAL}");
        }
        
        if (record.getExpressPrice() != null) {
            sql.VALUES("express_price", "#{expressPrice,jdbcType=DECIMAL}");
        }
        
        if (record.getName() != null) {
            sql.VALUES("`name`", "#{name,jdbcType=VARCHAR}");
        }
        
        if (record.getMobile() != null) {
            sql.VALUES("mobile", "#{mobile,jdbcType=VARCHAR}");
        }
        
        if (record.getAddress() != null) {
            sql.VALUES("address", "#{address,jdbcType=VARCHAR}");
        }
        
        if (record.getRemark() != null) {
            sql.VALUES("remark", "#{remark,jdbcType=VARCHAR}");
        }
        
        if (record.getIsPay() != null) {
            sql.VALUES("is_pay", "#{isPay,jdbcType=SMALLINT}");
        }
        
        if (record.getPayType() != null) {
            sql.VALUES("pay_type", "#{payType,jdbcType=SMALLINT}");
        }
        
        if (record.getPayTime() != null) {
            sql.VALUES("pay_time", "#{payTime,jdbcType=INTEGER}");
        }
        
        if (record.getIsSend() != null) {
            sql.VALUES("is_send", "#{isSend,jdbcType=SMALLINT}");
        }
        
        if (record.getSendTime() != null) {
            sql.VALUES("send_time", "#{sendTime,jdbcType=INTEGER}");
        }
        
        if (record.getExpress() != null) {
            sql.VALUES("express", "#{express,jdbcType=VARCHAR}");
        }
        
        if (record.getExpressNo() != null) {
            sql.VALUES("express_no", "#{expressNo,jdbcType=VARCHAR}");
        }
        
        if (record.getIsConfirm() != null) {
            sql.VALUES("is_confirm", "#{isConfirm,jdbcType=SMALLINT}");
        }
        
        if (record.getConfirmTime() != null) {
            sql.VALUES("confirm_time", "#{confirmTime,jdbcType=INTEGER}");
        }
        
        if (record.getIsComment() != null) {
            sql.VALUES("is_comment", "#{isComment,jdbcType=SMALLINT}");
        }
        
        if (record.getApplyDelete() != null) {
            sql.VALUES("apply_delete", "#{applyDelete,jdbcType=SMALLINT}");
        }
        
        if (record.getAddtime() != null) {
            sql.VALUES("addtime", "#{addtime,jdbcType=INTEGER}");
        }
        
        if (record.getIsDelete() != null) {
            sql.VALUES("is_delete", "#{isDelete,jdbcType=SMALLINT}");
        }
        
        if (record.getIsPrice() != null) {
            sql.VALUES("is_price", "#{isPrice,jdbcType=SMALLINT}");
        }
        
        if (record.getParentId() != null) {
            sql.VALUES("parent_id", "#{parentId,jdbcType=INTEGER}");
        }
        
        if (record.getFirstPrice() != null) {
            sql.VALUES("first_price", "#{firstPrice,jdbcType=DECIMAL}");
        }
        
        if (record.getSecondPrice() != null) {
            sql.VALUES("second_price", "#{secondPrice,jdbcType=DECIMAL}");
        }
        
        if (record.getThirdPrice() != null) {
            sql.VALUES("third_price", "#{thirdPrice,jdbcType=DECIMAL}");
        }
        
        if (record.getCouponSubPrice() != null) {
            sql.VALUES("coupon_sub_price", "#{couponSubPrice,jdbcType=DECIMAL}");
        }
        
        if (record.getIsOffline() != null) {
            sql.VALUES("is_offline", "#{isOffline,jdbcType=INTEGER}");
        }
        
        if (record.getClerkId() != null) {
            sql.VALUES("clerk_id", "#{clerkId,jdbcType=INTEGER}");
        }
        
        if (record.getIsCancel() != null) {
            sql.VALUES("is_cancel", "#{isCancel,jdbcType=SMALLINT}");
        }
        
        if (record.getBeforeUpdatePrice() != null) {
            sql.VALUES("before_update_price", "#{beforeUpdatePrice,jdbcType=DECIMAL}");
        }
        
        if (record.getShopId() != null) {
            sql.VALUES("shop_id", "#{shopId,jdbcType=INTEGER}");
        }
        
        if (record.getDiscount() != null) {
            sql.VALUES("discount", "#{discount,jdbcType=DECIMAL}");
        }
        
        if (record.getUserCouponId() != null) {
            sql.VALUES("user_coupon_id", "#{userCouponId,jdbcType=INTEGER}");
        }
        
        if (record.getGiveIntegral() != null) {
            sql.VALUES("give_integral", "#{giveIntegral,jdbcType=SMALLINT}");
        }
        
        if (record.getParentId1() != null) {
            sql.VALUES("parent_id_1", "#{parentId1,jdbcType=INTEGER}");
        }
        
        if (record.getParentId2() != null) {
            sql.VALUES("parent_id_2", "#{parentId2,jdbcType=INTEGER}");
        }
        
        if (record.getIsSale() != null) {
            sql.VALUES("is_sale", "#{isSale,jdbcType=INTEGER}");
        }
        
        if (record.getVersion() != null) {
            sql.VALUES("version", "#{version,jdbcType=VARCHAR}");
        }
        
        if (record.getExpressPrice1() != null) {
            sql.VALUES("express_price_1", "#{expressPrice1,jdbcType=DECIMAL}");
        }
        
        if (record.getIsRecycle() != null) {
            sql.VALUES("is_recycle", "#{isRecycle,jdbcType=SMALLINT}");
        }
        
        if (record.getRebate() != null) {
            sql.VALUES("rebate", "#{rebate,jdbcType=DECIMAL}");
        }
        
        if (record.getBeforeUpdateExpress() != null) {
            sql.VALUES("before_update_express", "#{beforeUpdateExpress,jdbcType=DECIMAL}");
        }
        
        if (record.getMchId() != null) {
            sql.VALUES("mch_id", "#{mchId,jdbcType=INTEGER}");
        }
        
        if (record.getOrderUnionId() != null) {
            sql.VALUES("order_union_id", "#{orderUnionId,jdbcType=INTEGER}");
        }
        
        if (record.getIsTransfer() != null) {
            sql.VALUES("is_transfer", "#{isTransfer,jdbcType=SMALLINT}");
        }
        
        if (record.getType() != null) {
            sql.VALUES("`type`", "#{type,jdbcType=INTEGER}");
        }
        
        if (record.getSharePrice() != null) {
            sql.VALUES("share_price", "#{sharePrice,jdbcType=DECIMAL}");
        }
        
        if (record.getIsShow() != null) {
            sql.VALUES("is_show", "#{isShow,jdbcType=SMALLINT}");
        }
        
        if (record.getCurrency() != null) {
            sql.VALUES("currency", "#{currency,jdbcType=DECIMAL}");
        }
        
        if (record.getOrderOrigin() != null) {
            sql.VALUES("order_origin", "#{orderOrigin,jdbcType=BIT}");
        }
        
        if (record.getDeliveryId() != null) {
            sql.VALUES("delivery_id", "#{deliveryId,jdbcType=INTEGER}");
        }
        
        if (record.getDeliveryStatus() != null) {
            sql.VALUES("delivery_status", "#{deliveryStatus,jdbcType=BIT}");
        }
        
        if (record.getFyStatus() != null) {
            sql.VALUES("fy_status", "#{fyStatus,jdbcType=BIT}");
        }
        
        if (record.getFyjine() != null) {
            sql.VALUES("fyjine", "#{fyjine,jdbcType=DECIMAL}");
        }
        
        if (record.getFysingle() != null) {
            sql.VALUES("fysingle", "#{fysingle,jdbcType=DECIMAL}");
        }
        
        if (record.getMchFyjine() != null) {
            sql.VALUES("mch_fyjine", "#{mchFyjine,jdbcType=DECIMAL}");
        }
        
        if (record.getMchFysingle() != null) {
            sql.VALUES("mch_fysingle", "#{mchFysingle,jdbcType=DECIMAL}");
        }
        
        if (record.getIsFan() != null) {
            sql.VALUES("is_fan", "#{isFan,jdbcType=BIT}");
        }
        
        if (record.getIsDada() != null) {
            sql.VALUES("is_dada", "#{isDada,jdbcType=BIT}");
        }
        
        if (record.getShopPeisong() != null) {
            sql.VALUES("shop_peisong", "#{shopPeisong,jdbcType=INTEGER}");
        }
        
        if (record.getIsOpenOffline() != null) {
            sql.VALUES("is_open_offline", "#{isOpenOffline,jdbcType=BIT}");
        }
        
        if (record.getSupplierId() != null) {
            sql.VALUES("supplier_id", "#{supplierId,jdbcType=INTEGER}");
        }
        
        if (record.getIsSupTransfer() != null) {
            sql.VALUES("is_sup_transfer", "#{isSupTransfer,jdbcType=BIT}");
        }
        
        if (record.getDabaoPrice() != null) {
            sql.VALUES("dabao_price", "#{dabaoPrice,jdbcType=DECIMAL}");
        }
        
        if (record.getSettlementAmount() != null) {
            sql.VALUES("settlement_amount", "#{settlementAmount,jdbcType=DECIMAL}");
        }
        
        if (record.getIsSettlement() != null) {
            sql.VALUES("is_settlement", "#{isSettlement,jdbcType=SMALLINT}");
        }
        
        if (record.getSettlementTime() != null) {
            sql.VALUES("settlement_time", "#{settlementTime,jdbcType=INTEGER}");
        }
        
        if (record.getIsMchShop() != null) {
            sql.VALUES("is_mch_shop", "#{isMchShop,jdbcType=BIT}");
        }
        
        if (record.getIsDivideMoney() != null) {
            sql.VALUES("is_divide_money", "#{isDivideMoney,jdbcType=BIT}");
        }
        
        if (record.getTransactionId() != null) {
            sql.VALUES("transaction_id", "#{transactionId,jdbcType=VARCHAR}");
        }
        
        if (record.getPayUserId() != null) {
            sql.VALUES("pay_user_id", "#{payUserId,jdbcType=INTEGER}");
        }
        
        if (record.getPayTypeTrue() != null) {
            sql.VALUES("pay_type_true", "#{payTypeTrue,jdbcType=BIT}");
        }
        
        if (record.getIsVgoods() != null) {
            sql.VALUES("is_vgoods", "#{isVgoods,jdbcType=INTEGER}");
        }
        
        if (record.getReductionPrice() != null) {
            sql.VALUES("reduction_price", "#{reductionPrice,jdbcType=DECIMAL}");
        }
        
        if (record.getMinusPrice() != null) {
            sql.VALUES("minus_price", "#{minusPrice,jdbcType=DECIMAL}");
        }
        
        if (record.getOrderFrom() != null) {
            sql.VALUES("order_from", "#{orderFrom,jdbcType=INTEGER}");
        }
        
        if (record.getDiscountPrice() != null) {
            sql.VALUES("discount_price", "#{discountPrice,jdbcType=DECIMAL}");
        }
        
        if (record.getDiscountNum() != null) {
            sql.VALUES("discount_num", "#{discountNum,jdbcType=DECIMAL}");
        }
        
        if (record.getGiveGoodsId() != null) {
            sql.VALUES("give_goods_id", "#{giveGoodsId,jdbcType=INTEGER}");
        }
        
        if (record.getCouponRecordId() != null) {
            sql.VALUES("coupon_record_id", "#{couponRecordId,jdbcType=VARCHAR}");
        }
        
        if (record.getIdCardNo() != null) {
            sql.VALUES("id_card_no", "#{idCardNo,jdbcType=VARCHAR}");
        }
        
        if (record.getRefundTime() != null) {
            sql.VALUES("refund_time", "#{refundTime,jdbcType=INTEGER}");
        }
        
        if (record.getContent() != null) {
            sql.VALUES("content", "#{content,jdbcType=LONGVARCHAR}");
        }
        
        if (record.getAddressData() != null) {
            sql.VALUES("address_data", "#{addressData,jdbcType=LONGVARCHAR}");
        }
        
        if (record.getOfflineQrcode() != null) {
            sql.VALUES("offline_qrcode", "#{offlineQrcode,jdbcType=LONGVARCHAR}");
        }
        
        if (record.getIntegral() != null) {
            sql.VALUES("integral", "#{integral,jdbcType=LONGVARCHAR}");
        }
        
        if (record.getWords() != null) {
            sql.VALUES("words", "#{words,jdbcType=LONGVARCHAR}");
        }
        
        if (record.getSellerComments() != null) {
            sql.VALUES("seller_comments", "#{sellerComments,jdbcType=LONGVARCHAR}");
        }
        
        return sql.toString();
    }

    public String selectByExampleWithBLOBs(CyymallOrderExample example) {
        SQL sql = new SQL();
        if (example != null && example.isDistinct()) {
            sql.SELECT_DISTINCT("id");
        } else {
            sql.SELECT("id");
        }
        sql.SELECT("store_id");
        sql.SELECT("user_id");
        sql.SELECT("order_no");
        sql.SELECT("total_price");
        sql.SELECT("pay_price");
        sql.SELECT("express_price");
        sql.SELECT("`name`");
        sql.SELECT("mobile");
        sql.SELECT("address");
        sql.SELECT("remark");
        sql.SELECT("is_pay");
        sql.SELECT("pay_type");
        sql.SELECT("pay_time");
        sql.SELECT("is_send");
        sql.SELECT("send_time");
        sql.SELECT("express");
        sql.SELECT("express_no");
        sql.SELECT("is_confirm");
        sql.SELECT("confirm_time");
        sql.SELECT("is_comment");
        sql.SELECT("apply_delete");
        sql.SELECT("addtime");
        sql.SELECT("is_delete");
        sql.SELECT("is_price");
        sql.SELECT("parent_id");
        sql.SELECT("first_price");
        sql.SELECT("second_price");
        sql.SELECT("third_price");
        sql.SELECT("coupon_sub_price");
        sql.SELECT("is_offline");
        sql.SELECT("clerk_id");
        sql.SELECT("is_cancel");
        sql.SELECT("before_update_price");
        sql.SELECT("shop_id");
        sql.SELECT("discount");
        sql.SELECT("user_coupon_id");
        sql.SELECT("give_integral");
        sql.SELECT("parent_id_1");
        sql.SELECT("parent_id_2");
        sql.SELECT("is_sale");
        sql.SELECT("version");
        sql.SELECT("express_price_1");
        sql.SELECT("is_recycle");
        sql.SELECT("rebate");
        sql.SELECT("before_update_express");
        sql.SELECT("mch_id");
        sql.SELECT("order_union_id");
        sql.SELECT("is_transfer");
        sql.SELECT("`type`");
        sql.SELECT("share_price");
        sql.SELECT("is_show");
        sql.SELECT("currency");
        sql.SELECT("order_origin");
        sql.SELECT("delivery_id");
        sql.SELECT("delivery_status");
        sql.SELECT("fy_status");
        sql.SELECT("fyjine");
        sql.SELECT("fysingle");
        sql.SELECT("mch_fyjine");
        sql.SELECT("mch_fysingle");
        sql.SELECT("is_fan");
        sql.SELECT("is_dada");
        sql.SELECT("shop_peisong");
        sql.SELECT("is_open_offline");
        sql.SELECT("supplier_id");
        sql.SELECT("is_sup_transfer");
        sql.SELECT("dabao_price");
        sql.SELECT("settlement_amount");
        sql.SELECT("is_settlement");
        sql.SELECT("settlement_time");
        sql.SELECT("is_mch_shop");
        sql.SELECT("is_divide_money");
        sql.SELECT("transaction_id");
        sql.SELECT("pay_user_id");
        sql.SELECT("pay_type_true");
        sql.SELECT("is_vgoods");
        sql.SELECT("reduction_price");
        sql.SELECT("minus_price");
        sql.SELECT("order_from");
        sql.SELECT("discount_price");
        sql.SELECT("discount_num");
        sql.SELECT("give_goods_id");
        sql.SELECT("coupon_record_id");
        sql.SELECT("id_card_no");
        sql.SELECT("refund_time");
        sql.SELECT("content");
        sql.SELECT("address_data");
        sql.SELECT("offline_qrcode");
        sql.SELECT("integral");
        sql.SELECT("words");
        sql.SELECT("seller_comments");
        sql.FROM("cyymall_order");
        applyWhere(sql, example, false);
        
        if (example != null && example.getOrderByClause() != null) {
            sql.ORDER_BY(example.getOrderByClause());
        }
        
        return sql.toString();
    }

    public String selectByExample(CyymallOrderExample example) {
        SQL sql = new SQL();
        if (example != null && example.isDistinct()) {
            sql.SELECT_DISTINCT("id");
        } else {
            sql.SELECT("id");
        }
        sql.SELECT("store_id");
        sql.SELECT("user_id");
        sql.SELECT("order_no");
        sql.SELECT("total_price");
        sql.SELECT("pay_price");
        sql.SELECT("express_price");
        sql.SELECT("`name`");
        sql.SELECT("mobile");
        sql.SELECT("address");
        sql.SELECT("remark");
        sql.SELECT("is_pay");
        sql.SELECT("pay_type");
        sql.SELECT("pay_time");
        sql.SELECT("is_send");
        sql.SELECT("send_time");
        sql.SELECT("express");
        sql.SELECT("express_no");
        sql.SELECT("is_confirm");
        sql.SELECT("confirm_time");
        sql.SELECT("is_comment");
        sql.SELECT("apply_delete");
        sql.SELECT("addtime");
        sql.SELECT("is_delete");
        sql.SELECT("is_price");
        sql.SELECT("parent_id");
        sql.SELECT("first_price");
        sql.SELECT("second_price");
        sql.SELECT("third_price");
        sql.SELECT("coupon_sub_price");
        sql.SELECT("is_offline");
        sql.SELECT("clerk_id");
        sql.SELECT("is_cancel");
        sql.SELECT("before_update_price");
        sql.SELECT("shop_id");
        sql.SELECT("discount");
        sql.SELECT("user_coupon_id");
        sql.SELECT("give_integral");
        sql.SELECT("parent_id_1");
        sql.SELECT("parent_id_2");
        sql.SELECT("is_sale");
        sql.SELECT("version");
        sql.SELECT("express_price_1");
        sql.SELECT("is_recycle");
        sql.SELECT("rebate");
        sql.SELECT("before_update_express");
        sql.SELECT("mch_id");
        sql.SELECT("order_union_id");
        sql.SELECT("is_transfer");
        sql.SELECT("`type`");
        sql.SELECT("share_price");
        sql.SELECT("is_show");
        sql.SELECT("currency");
        sql.SELECT("order_origin");
        sql.SELECT("delivery_id");
        sql.SELECT("delivery_status");
        sql.SELECT("fy_status");
        sql.SELECT("fyjine");
        sql.SELECT("fysingle");
        sql.SELECT("mch_fyjine");
        sql.SELECT("mch_fysingle");
        sql.SELECT("is_fan");
        sql.SELECT("is_dada");
        sql.SELECT("shop_peisong");
        sql.SELECT("is_open_offline");
        sql.SELECT("supplier_id");
        sql.SELECT("is_sup_transfer");
        sql.SELECT("dabao_price");
        sql.SELECT("settlement_amount");
        sql.SELECT("is_settlement");
        sql.SELECT("settlement_time");
        sql.SELECT("is_mch_shop");
        sql.SELECT("is_divide_money");
        sql.SELECT("transaction_id");
        sql.SELECT("pay_user_id");
        sql.SELECT("pay_type_true");
        sql.SELECT("is_vgoods");
        sql.SELECT("reduction_price");
        sql.SELECT("minus_price");
        sql.SELECT("order_from");
        sql.SELECT("discount_price");
        sql.SELECT("discount_num");
        sql.SELECT("give_goods_id");
        sql.SELECT("coupon_record_id");
        sql.SELECT("id_card_no");
        sql.SELECT("refund_time");
        sql.FROM("cyymall_order");
        applyWhere(sql, example, false);
        
        if (example != null && example.getOrderByClause() != null) {
            sql.ORDER_BY(example.getOrderByClause());
        }
        
        return sql.toString();
    }

    public String updateByExampleSelective(Map<String, Object> parameter) {
        CyymallOrderWithBLOBs record = (CyymallOrderWithBLOBs) parameter.get("record");
        CyymallOrderExample example = (CyymallOrderExample) parameter.get("example");
        
        SQL sql = new SQL();
        sql.UPDATE("cyymall_order");
        
        if (record.getId() != null) {
            sql.SET("id = #{record.id,jdbcType=INTEGER}");
        }
        
        if (record.getStoreId() != null) {
            sql.SET("store_id = #{record.storeId,jdbcType=INTEGER}");
        }
        
        if (record.getUserId() != null) {
            sql.SET("user_id = #{record.userId,jdbcType=INTEGER}");
        }
        
        if (record.getOrderNo() != null) {
            sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}");
        }
        
        if (record.getTotalPrice() != null) {
            sql.SET("total_price = #{record.totalPrice,jdbcType=DECIMAL}");
        }
        
        if (record.getPayPrice() != null) {
            sql.SET("pay_price = #{record.payPrice,jdbcType=DECIMAL}");
        }
        
        if (record.getExpressPrice() != null) {
            sql.SET("express_price = #{record.expressPrice,jdbcType=DECIMAL}");
        }
        
        if (record.getName() != null) {
            sql.SET("`name` = #{record.name,jdbcType=VARCHAR}");
        }
        
        if (record.getMobile() != null) {
            sql.SET("mobile = #{record.mobile,jdbcType=VARCHAR}");
        }
        
        if (record.getAddress() != null) {
            sql.SET("address = #{record.address,jdbcType=VARCHAR}");
        }
        
        if (record.getRemark() != null) {
            sql.SET("remark = #{record.remark,jdbcType=VARCHAR}");
        }
        
        if (record.getIsPay() != null) {
            sql.SET("is_pay = #{record.isPay,jdbcType=SMALLINT}");
        }
        
        if (record.getPayType() != null) {
            sql.SET("pay_type = #{record.payType,jdbcType=SMALLINT}");
        }
        
        if (record.getPayTime() != null) {
            sql.SET("pay_time = #{record.payTime,jdbcType=INTEGER}");
        }
        
        if (record.getIsSend() != null) {
            sql.SET("is_send = #{record.isSend,jdbcType=SMALLINT}");
        }
        
        if (record.getSendTime() != null) {
            sql.SET("send_time = #{record.sendTime,jdbcType=INTEGER}");
        }
        
        if (record.getExpress() != null) {
            sql.SET("express = #{record.express,jdbcType=VARCHAR}");
        }
        
        if (record.getExpressNo() != null) {
            sql.SET("express_no = #{record.expressNo,jdbcType=VARCHAR}");
        }
        
        if (record.getIsConfirm() != null) {
            sql.SET("is_confirm = #{record.isConfirm,jdbcType=SMALLINT}");
        }
        
        if (record.getConfirmTime() != null) {
            sql.SET("confirm_time = #{record.confirmTime,jdbcType=INTEGER}");
        }
        
        if (record.getIsComment() != null) {
            sql.SET("is_comment = #{record.isComment,jdbcType=SMALLINT}");
        }
        
        if (record.getApplyDelete() != null) {
            sql.SET("apply_delete = #{record.applyDelete,jdbcType=SMALLINT}");
        }
        
        if (record.getAddtime() != null) {
            sql.SET("addtime = #{record.addtime,jdbcType=INTEGER}");
        }
        
        if (record.getIsDelete() != null) {
            sql.SET("is_delete = #{record.isDelete,jdbcType=SMALLINT}");
        }
        
        if (record.getIsPrice() != null) {
            sql.SET("is_price = #{record.isPrice,jdbcType=SMALLINT}");
        }
        
        if (record.getParentId() != null) {
            sql.SET("parent_id = #{record.parentId,jdbcType=INTEGER}");
        }
        
        if (record.getFirstPrice() != null) {
            sql.SET("first_price = #{record.firstPrice,jdbcType=DECIMAL}");
        }
        
        if (record.getSecondPrice() != null) {
            sql.SET("second_price = #{record.secondPrice,jdbcType=DECIMAL}");
        }
        
        if (record.getThirdPrice() != null) {
            sql.SET("third_price = #{record.thirdPrice,jdbcType=DECIMAL}");
        }
        
        if (record.getCouponSubPrice() != null) {
            sql.SET("coupon_sub_price = #{record.couponSubPrice,jdbcType=DECIMAL}");
        }
        
        if (record.getIsOffline() != null) {
            sql.SET("is_offline = #{record.isOffline,jdbcType=INTEGER}");
        }
        
        if (record.getClerkId() != null) {
            sql.SET("clerk_id = #{record.clerkId,jdbcType=INTEGER}");
        }
        
        if (record.getIsCancel() != null) {
            sql.SET("is_cancel = #{record.isCancel,jdbcType=SMALLINT}");
        }
        
        if (record.getBeforeUpdatePrice() != null) {
            sql.SET("before_update_price = #{record.beforeUpdatePrice,jdbcType=DECIMAL}");
        }
        
        if (record.getShopId() != null) {
            sql.SET("shop_id = #{record.shopId,jdbcType=INTEGER}");
        }
        
        if (record.getDiscount() != null) {
            sql.SET("discount = #{record.discount,jdbcType=DECIMAL}");
        }
        
        if (record.getUserCouponId() != null) {
            sql.SET("user_coupon_id = #{record.userCouponId,jdbcType=INTEGER}");
        }
        
        if (record.getGiveIntegral() != null) {
            sql.SET("give_integral = #{record.giveIntegral,jdbcType=SMALLINT}");
        }
        
        if (record.getParentId1() != null) {
            sql.SET("parent_id_1 = #{record.parentId1,jdbcType=INTEGER}");
        }
        
        if (record.getParentId2() != null) {
            sql.SET("parent_id_2 = #{record.parentId2,jdbcType=INTEGER}");
        }
        
        if (record.getIsSale() != null) {
            sql.SET("is_sale = #{record.isSale,jdbcType=INTEGER}");
        }
        
        if (record.getVersion() != null) {
            sql.SET("version = #{record.version,jdbcType=VARCHAR}");
        }
        
        if (record.getExpressPrice1() != null) {
            sql.SET("express_price_1 = #{record.expressPrice1,jdbcType=DECIMAL}");
        }
        
        if (record.getIsRecycle() != null) {
            sql.SET("is_recycle = #{record.isRecycle,jdbcType=SMALLINT}");
        }
        
        if (record.getRebate() != null) {
            sql.SET("rebate = #{record.rebate,jdbcType=DECIMAL}");
        }
        
        if (record.getBeforeUpdateExpress() != null) {
            sql.SET("before_update_express = #{record.beforeUpdateExpress,jdbcType=DECIMAL}");
        }
        
        if (record.getMchId() != null) {
            sql.SET("mch_id = #{record.mchId,jdbcType=INTEGER}");
        }
        
        if (record.getOrderUnionId() != null) {
            sql.SET("order_union_id = #{record.orderUnionId,jdbcType=INTEGER}");
        }
        
        if (record.getIsTransfer() != null) {
            sql.SET("is_transfer = #{record.isTransfer,jdbcType=SMALLINT}");
        }
        
        if (record.getType() != null) {
            sql.SET("`type` = #{record.type,jdbcType=INTEGER}");
        }
        
        if (record.getSharePrice() != null) {
            sql.SET("share_price = #{record.sharePrice,jdbcType=DECIMAL}");
        }
        
        if (record.getIsShow() != null) {
            sql.SET("is_show = #{record.isShow,jdbcType=SMALLINT}");
        }
        
        if (record.getCurrency() != null) {
            sql.SET("currency = #{record.currency,jdbcType=DECIMAL}");
        }
        
        if (record.getOrderOrigin() != null) {
            sql.SET("order_origin = #{record.orderOrigin,jdbcType=BIT}");
        }
        
        if (record.getDeliveryId() != null) {
            sql.SET("delivery_id = #{record.deliveryId,jdbcType=INTEGER}");
        }
        
        if (record.getDeliveryStatus() != null) {
            sql.SET("delivery_status = #{record.deliveryStatus,jdbcType=BIT}");
        }
        
        if (record.getFyStatus() != null) {
            sql.SET("fy_status = #{record.fyStatus,jdbcType=BIT}");
        }
        
        if (record.getFyjine() != null) {
            sql.SET("fyjine = #{record.fyjine,jdbcType=DECIMAL}");
        }
        
        if (record.getFysingle() != null) {
            sql.SET("fysingle = #{record.fysingle,jdbcType=DECIMAL}");
        }
        
        if (record.getMchFyjine() != null) {
            sql.SET("mch_fyjine = #{record.mchFyjine,jdbcType=DECIMAL}");
        }
        
        if (record.getMchFysingle() != null) {
            sql.SET("mch_fysingle = #{record.mchFysingle,jdbcType=DECIMAL}");
        }
        
        if (record.getIsFan() != null) {
            sql.SET("is_fan = #{record.isFan,jdbcType=BIT}");
        }
        
        if (record.getIsDada() != null) {
            sql.SET("is_dada = #{record.isDada,jdbcType=BIT}");
        }
        
        if (record.getShopPeisong() != null) {
            sql.SET("shop_peisong = #{record.shopPeisong,jdbcType=INTEGER}");
        }
        
        if (record.getIsOpenOffline() != null) {
            sql.SET("is_open_offline = #{record.isOpenOffline,jdbcType=BIT}");
        }
        
        if (record.getSupplierId() != null) {
            sql.SET("supplier_id = #{record.supplierId,jdbcType=INTEGER}");
        }
        
        if (record.getIsSupTransfer() != null) {
            sql.SET("is_sup_transfer = #{record.isSupTransfer,jdbcType=BIT}");
        }
        
        if (record.getDabaoPrice() != null) {
            sql.SET("dabao_price = #{record.dabaoPrice,jdbcType=DECIMAL}");
        }
        
        if (record.getSettlementAmount() != null) {
            sql.SET("settlement_amount = #{record.settlementAmount,jdbcType=DECIMAL}");
        }
        
        if (record.getIsSettlement() != null) {
            sql.SET("is_settlement = #{record.isSettlement,jdbcType=SMALLINT}");
        }
        
        if (record.getSettlementTime() != null) {
            sql.SET("settlement_time = #{record.settlementTime,jdbcType=INTEGER}");
        }
        
        if (record.getIsMchShop() != null) {
            sql.SET("is_mch_shop = #{record.isMchShop,jdbcType=BIT}");
        }
        
        if (record.getIsDivideMoney() != null) {
            sql.SET("is_divide_money = #{record.isDivideMoney,jdbcType=BIT}");
        }
        
        if (record.getTransactionId() != null) {
            sql.SET("transaction_id = #{record.transactionId,jdbcType=VARCHAR}");
        }
        
        if (record.getPayUserId() != null) {
            sql.SET("pay_user_id = #{record.payUserId,jdbcType=INTEGER}");
        }
        
        if (record.getPayTypeTrue() != null) {
            sql.SET("pay_type_true = #{record.payTypeTrue,jdbcType=BIT}");
        }
        
        if (record.getIsVgoods() != null) {
            sql.SET("is_vgoods = #{record.isVgoods,jdbcType=INTEGER}");
        }
        
        if (record.getReductionPrice() != null) {
            sql.SET("reduction_price = #{record.reductionPrice,jdbcType=DECIMAL}");
        }
        
        if (record.getMinusPrice() != null) {
            sql.SET("minus_price = #{record.minusPrice,jdbcType=DECIMAL}");
        }
        
        if (record.getOrderFrom() != null) {
            sql.SET("order_from = #{record.orderFrom,jdbcType=INTEGER}");
        }
        
        if (record.getDiscountPrice() != null) {
            sql.SET("discount_price = #{record.discountPrice,jdbcType=DECIMAL}");
        }
        
        if (record.getDiscountNum() != null) {
            sql.SET("discount_num = #{record.discountNum,jdbcType=DECIMAL}");
        }
        
        if (record.getGiveGoodsId() != null) {
            sql.SET("give_goods_id = #{record.giveGoodsId,jdbcType=INTEGER}");
        }
        
        if (record.getCouponRecordId() != null) {
            sql.SET("coupon_record_id = #{record.couponRecordId,jdbcType=VARCHAR}");
        }
        
        if (record.getIdCardNo() != null) {
            sql.SET("id_card_no = #{record.idCardNo,jdbcType=VARCHAR}");
        }
        
        if (record.getRefundTime() != null) {
            sql.SET("refund_time = #{record.refundTime,jdbcType=INTEGER}");
        }
        
        if (record.getContent() != null) {
            sql.SET("content = #{record.content,jdbcType=LONGVARCHAR}");
        }
        
        if (record.getAddressData() != null) {
            sql.SET("address_data = #{record.addressData,jdbcType=LONGVARCHAR}");
        }
        
        if (record.getOfflineQrcode() != null) {
            sql.SET("offline_qrcode = #{record.offlineQrcode,jdbcType=LONGVARCHAR}");
        }
        
        if (record.getIntegral() != null) {
            sql.SET("integral = #{record.integral,jdbcType=LONGVARCHAR}");
        }
        
        if (record.getWords() != null) {
            sql.SET("words = #{record.words,jdbcType=LONGVARCHAR}");
        }
        
        if (record.getSellerComments() != null) {
            sql.SET("seller_comments = #{record.sellerComments,jdbcType=LONGVARCHAR}");
        }
        
        applyWhere(sql, example, true);
        return sql.toString();
    }

    public String updateByExampleWithBLOBs(Map<String, Object> parameter) {
        SQL sql = new SQL();
        sql.UPDATE("cyymall_order");
        
        sql.SET("id = #{record.id,jdbcType=INTEGER}");
        sql.SET("store_id = #{record.storeId,jdbcType=INTEGER}");
        sql.SET("user_id = #{record.userId,jdbcType=INTEGER}");
        sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}");
        sql.SET("total_price = #{record.totalPrice,jdbcType=DECIMAL}");
        sql.SET("pay_price = #{record.payPrice,jdbcType=DECIMAL}");
        sql.SET("express_price = #{record.expressPrice,jdbcType=DECIMAL}");
        sql.SET("`name` = #{record.name,jdbcType=VARCHAR}");
        sql.SET("mobile = #{record.mobile,jdbcType=VARCHAR}");
        sql.SET("address = #{record.address,jdbcType=VARCHAR}");
        sql.SET("remark = #{record.remark,jdbcType=VARCHAR}");
        sql.SET("is_pay = #{record.isPay,jdbcType=SMALLINT}");
        sql.SET("pay_type = #{record.payType,jdbcType=SMALLINT}");
        sql.SET("pay_time = #{record.payTime,jdbcType=INTEGER}");
        sql.SET("is_send = #{record.isSend,jdbcType=SMALLINT}");
        sql.SET("send_time = #{record.sendTime,jdbcType=INTEGER}");
        sql.SET("express = #{record.express,jdbcType=VARCHAR}");
        sql.SET("express_no = #{record.expressNo,jdbcType=VARCHAR}");
        sql.SET("is_confirm = #{record.isConfirm,jdbcType=SMALLINT}");
        sql.SET("confirm_time = #{record.confirmTime,jdbcType=INTEGER}");
        sql.SET("is_comment = #{record.isComment,jdbcType=SMALLINT}");
        sql.SET("apply_delete = #{record.applyDelete,jdbcType=SMALLINT}");
        sql.SET("addtime = #{record.addtime,jdbcType=INTEGER}");
        sql.SET("is_delete = #{record.isDelete,jdbcType=SMALLINT}");
        sql.SET("is_price = #{record.isPrice,jdbcType=SMALLINT}");
        sql.SET("parent_id = #{record.parentId,jdbcType=INTEGER}");
        sql.SET("first_price = #{record.firstPrice,jdbcType=DECIMAL}");
        sql.SET("second_price = #{record.secondPrice,jdbcType=DECIMAL}");
        sql.SET("third_price = #{record.thirdPrice,jdbcType=DECIMAL}");
        sql.SET("coupon_sub_price = #{record.couponSubPrice,jdbcType=DECIMAL}");
        sql.SET("is_offline = #{record.isOffline,jdbcType=INTEGER}");
        sql.SET("clerk_id = #{record.clerkId,jdbcType=INTEGER}");
        sql.SET("is_cancel = #{record.isCancel,jdbcType=SMALLINT}");
        sql.SET("before_update_price = #{record.beforeUpdatePrice,jdbcType=DECIMAL}");
        sql.SET("shop_id = #{record.shopId,jdbcType=INTEGER}");
        sql.SET("discount = #{record.discount,jdbcType=DECIMAL}");
        sql.SET("user_coupon_id = #{record.userCouponId,jdbcType=INTEGER}");
        sql.SET("give_integral = #{record.giveIntegral,jdbcType=SMALLINT}");
        sql.SET("parent_id_1 = #{record.parentId1,jdbcType=INTEGER}");
        sql.SET("parent_id_2 = #{record.parentId2,jdbcType=INTEGER}");
        sql.SET("is_sale = #{record.isSale,jdbcType=INTEGER}");
        sql.SET("version = #{record.version,jdbcType=VARCHAR}");
        sql.SET("express_price_1 = #{record.expressPrice1,jdbcType=DECIMAL}");
        sql.SET("is_recycle = #{record.isRecycle,jdbcType=SMALLINT}");
        sql.SET("rebate = #{record.rebate,jdbcType=DECIMAL}");
        sql.SET("before_update_express = #{record.beforeUpdateExpress,jdbcType=DECIMAL}");
        sql.SET("mch_id = #{record.mchId,jdbcType=INTEGER}");
        sql.SET("order_union_id = #{record.orderUnionId,jdbcType=INTEGER}");
        sql.SET("is_transfer = #{record.isTransfer,jdbcType=SMALLINT}");
        sql.SET("`type` = #{record.type,jdbcType=INTEGER}");
        sql.SET("share_price = #{record.sharePrice,jdbcType=DECIMAL}");
        sql.SET("is_show = #{record.isShow,jdbcType=SMALLINT}");
        sql.SET("currency = #{record.currency,jdbcType=DECIMAL}");
        sql.SET("order_origin = #{record.orderOrigin,jdbcType=BIT}");
        sql.SET("delivery_id = #{record.deliveryId,jdbcType=INTEGER}");
        sql.SET("delivery_status = #{record.deliveryStatus,jdbcType=BIT}");
        sql.SET("fy_status = #{record.fyStatus,jdbcType=BIT}");
        sql.SET("fyjine = #{record.fyjine,jdbcType=DECIMAL}");
        sql.SET("fysingle = #{record.fysingle,jdbcType=DECIMAL}");
        sql.SET("mch_fyjine = #{record.mchFyjine,jdbcType=DECIMAL}");
        sql.SET("mch_fysingle = #{record.mchFysingle,jdbcType=DECIMAL}");
        sql.SET("is_fan = #{record.isFan,jdbcType=BIT}");
        sql.SET("is_dada = #{record.isDada,jdbcType=BIT}");
        sql.SET("shop_peisong = #{record.shopPeisong,jdbcType=INTEGER}");
        sql.SET("is_open_offline = #{record.isOpenOffline,jdbcType=BIT}");
        sql.SET("supplier_id = #{record.supplierId,jdbcType=INTEGER}");
        sql.SET("is_sup_transfer = #{record.isSupTransfer,jdbcType=BIT}");
        sql.SET("dabao_price = #{record.dabaoPrice,jdbcType=DECIMAL}");
        sql.SET("settlement_amount = #{record.settlementAmount,jdbcType=DECIMAL}");
        sql.SET("is_settlement = #{record.isSettlement,jdbcType=SMALLINT}");
        sql.SET("settlement_time = #{record.settlementTime,jdbcType=INTEGER}");
        sql.SET("is_mch_shop = #{record.isMchShop,jdbcType=BIT}");
        sql.SET("is_divide_money = #{record.isDivideMoney,jdbcType=BIT}");
        sql.SET("transaction_id = #{record.transactionId,jdbcType=VARCHAR}");
        sql.SET("pay_user_id = #{record.payUserId,jdbcType=INTEGER}");
        sql.SET("pay_type_true = #{record.payTypeTrue,jdbcType=BIT}");
        sql.SET("is_vgoods = #{record.isVgoods,jdbcType=INTEGER}");
        sql.SET("reduction_price = #{record.reductionPrice,jdbcType=DECIMAL}");
        sql.SET("minus_price = #{record.minusPrice,jdbcType=DECIMAL}");
        sql.SET("order_from = #{record.orderFrom,jdbcType=INTEGER}");
        sql.SET("discount_price = #{record.discountPrice,jdbcType=DECIMAL}");
        sql.SET("discount_num = #{record.discountNum,jdbcType=DECIMAL}");
        sql.SET("give_goods_id = #{record.giveGoodsId,jdbcType=INTEGER}");
        sql.SET("coupon_record_id = #{record.couponRecordId,jdbcType=VARCHAR}");
        sql.SET("id_card_no = #{record.idCardNo,jdbcType=VARCHAR}");
        sql.SET("refund_time = #{record.refundTime,jdbcType=INTEGER}");
        sql.SET("content = #{record.content,jdbcType=LONGVARCHAR}");
        sql.SET("address_data = #{record.addressData,jdbcType=LONGVARCHAR}");
        sql.SET("offline_qrcode = #{record.offlineQrcode,jdbcType=LONGVARCHAR}");
        sql.SET("integral = #{record.integral,jdbcType=LONGVARCHAR}");
        sql.SET("words = #{record.words,jdbcType=LONGVARCHAR}");
        sql.SET("seller_comments = #{record.sellerComments,jdbcType=LONGVARCHAR}");
        
        CyymallOrderExample example = (CyymallOrderExample) parameter.get("example");
        applyWhere(sql, example, true);
        return sql.toString();
    }

    public String updateByExample(Map<String, Object> parameter) {
        SQL sql = new SQL();
        sql.UPDATE("cyymall_order");
        
        sql.SET("id = #{record.id,jdbcType=INTEGER}");
        sql.SET("store_id = #{record.storeId,jdbcType=INTEGER}");
        sql.SET("user_id = #{record.userId,jdbcType=INTEGER}");
        sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}");
        sql.SET("total_price = #{record.totalPrice,jdbcType=DECIMAL}");
        sql.SET("pay_price = #{record.payPrice,jdbcType=DECIMAL}");
        sql.SET("express_price = #{record.expressPrice,jdbcType=DECIMAL}");
        sql.SET("`name` = #{record.name,jdbcType=VARCHAR}");
        sql.SET("mobile = #{record.mobile,jdbcType=VARCHAR}");
        sql.SET("address = #{record.address,jdbcType=VARCHAR}");
        sql.SET("remark = #{record.remark,jdbcType=VARCHAR}");
        sql.SET("is_pay = #{record.isPay,jdbcType=SMALLINT}");
        sql.SET("pay_type = #{record.payType,jdbcType=SMALLINT}");
        sql.SET("pay_time = #{record.payTime,jdbcType=INTEGER}");
        sql.SET("is_send = #{record.isSend,jdbcType=SMALLINT}");
        sql.SET("send_time = #{record.sendTime,jdbcType=INTEGER}");
        sql.SET("express = #{record.express,jdbcType=VARCHAR}");
        sql.SET("express_no = #{record.expressNo,jdbcType=VARCHAR}");
        sql.SET("is_confirm = #{record.isConfirm,jdbcType=SMALLINT}");
        sql.SET("confirm_time = #{record.confirmTime,jdbcType=INTEGER}");
        sql.SET("is_comment = #{record.isComment,jdbcType=SMALLINT}");
        sql.SET("apply_delete = #{record.applyDelete,jdbcType=SMALLINT}");
        sql.SET("addtime = #{record.addtime,jdbcType=INTEGER}");
        sql.SET("is_delete = #{record.isDelete,jdbcType=SMALLINT}");
        sql.SET("is_price = #{record.isPrice,jdbcType=SMALLINT}");
        sql.SET("parent_id = #{record.parentId,jdbcType=INTEGER}");
        sql.SET("first_price = #{record.firstPrice,jdbcType=DECIMAL}");
        sql.SET("second_price = #{record.secondPrice,jdbcType=DECIMAL}");
        sql.SET("third_price = #{record.thirdPrice,jdbcType=DECIMAL}");
        sql.SET("coupon_sub_price = #{record.couponSubPrice,jdbcType=DECIMAL}");
        sql.SET("is_offline = #{record.isOffline,jdbcType=INTEGER}");
        sql.SET("clerk_id = #{record.clerkId,jdbcType=INTEGER}");
        sql.SET("is_cancel = #{record.isCancel,jdbcType=SMALLINT}");
        sql.SET("before_update_price = #{record.beforeUpdatePrice,jdbcType=DECIMAL}");
        sql.SET("shop_id = #{record.shopId,jdbcType=INTEGER}");
        sql.SET("discount = #{record.discount,jdbcType=DECIMAL}");
        sql.SET("user_coupon_id = #{record.userCouponId,jdbcType=INTEGER}");
        sql.SET("give_integral = #{record.giveIntegral,jdbcType=SMALLINT}");
        sql.SET("parent_id_1 = #{record.parentId1,jdbcType=INTEGER}");
        sql.SET("parent_id_2 = #{record.parentId2,jdbcType=INTEGER}");
        sql.SET("is_sale = #{record.isSale,jdbcType=INTEGER}");
        sql.SET("version = #{record.version,jdbcType=VARCHAR}");
        sql.SET("express_price_1 = #{record.expressPrice1,jdbcType=DECIMAL}");
        sql.SET("is_recycle = #{record.isRecycle,jdbcType=SMALLINT}");
        sql.SET("rebate = #{record.rebate,jdbcType=DECIMAL}");
        sql.SET("before_update_express = #{record.beforeUpdateExpress,jdbcType=DECIMAL}");
        sql.SET("mch_id = #{record.mchId,jdbcType=INTEGER}");
        sql.SET("order_union_id = #{record.orderUnionId,jdbcType=INTEGER}");
        sql.SET("is_transfer = #{record.isTransfer,jdbcType=SMALLINT}");
        sql.SET("`type` = #{record.type,jdbcType=INTEGER}");
        sql.SET("share_price = #{record.sharePrice,jdbcType=DECIMAL}");
        sql.SET("is_show = #{record.isShow,jdbcType=SMALLINT}");
        sql.SET("currency = #{record.currency,jdbcType=DECIMAL}");
        sql.SET("order_origin = #{record.orderOrigin,jdbcType=BIT}");
        sql.SET("delivery_id = #{record.deliveryId,jdbcType=INTEGER}");
        sql.SET("delivery_status = #{record.deliveryStatus,jdbcType=BIT}");
        sql.SET("fy_status = #{record.fyStatus,jdbcType=BIT}");
        sql.SET("fyjine = #{record.fyjine,jdbcType=DECIMAL}");
        sql.SET("fysingle = #{record.fysingle,jdbcType=DECIMAL}");
        sql.SET("mch_fyjine = #{record.mchFyjine,jdbcType=DECIMAL}");
        sql.SET("mch_fysingle = #{record.mchFysingle,jdbcType=DECIMAL}");
        sql.SET("is_fan = #{record.isFan,jdbcType=BIT}");
        sql.SET("is_dada = #{record.isDada,jdbcType=BIT}");
        sql.SET("shop_peisong = #{record.shopPeisong,jdbcType=INTEGER}");
        sql.SET("is_open_offline = #{record.isOpenOffline,jdbcType=BIT}");
        sql.SET("supplier_id = #{record.supplierId,jdbcType=INTEGER}");
        sql.SET("is_sup_transfer = #{record.isSupTransfer,jdbcType=BIT}");
        sql.SET("dabao_price = #{record.dabaoPrice,jdbcType=DECIMAL}");
        sql.SET("settlement_amount = #{record.settlementAmount,jdbcType=DECIMAL}");
        sql.SET("is_settlement = #{record.isSettlement,jdbcType=SMALLINT}");
        sql.SET("settlement_time = #{record.settlementTime,jdbcType=INTEGER}");
        sql.SET("is_mch_shop = #{record.isMchShop,jdbcType=BIT}");
        sql.SET("is_divide_money = #{record.isDivideMoney,jdbcType=BIT}");
        sql.SET("transaction_id = #{record.transactionId,jdbcType=VARCHAR}");
        sql.SET("pay_user_id = #{record.payUserId,jdbcType=INTEGER}");
        sql.SET("pay_type_true = #{record.payTypeTrue,jdbcType=BIT}");
        sql.SET("is_vgoods = #{record.isVgoods,jdbcType=INTEGER}");
        sql.SET("reduction_price = #{record.reductionPrice,jdbcType=DECIMAL}");
        sql.SET("minus_price = #{record.minusPrice,jdbcType=DECIMAL}");
        sql.SET("order_from = #{record.orderFrom,jdbcType=INTEGER}");
        sql.SET("discount_price = #{record.discountPrice,jdbcType=DECIMAL}");
        sql.SET("discount_num = #{record.discountNum,jdbcType=DECIMAL}");
        sql.SET("give_goods_id = #{record.giveGoodsId,jdbcType=INTEGER}");
        sql.SET("coupon_record_id = #{record.couponRecordId,jdbcType=VARCHAR}");
        sql.SET("id_card_no = #{record.idCardNo,jdbcType=VARCHAR}");
        sql.SET("refund_time = #{record.refundTime,jdbcType=INTEGER}");
        
        CyymallOrderExample example = (CyymallOrderExample) parameter.get("example");
        applyWhere(sql, example, true);
        return sql.toString();
    }

    public String updateByPrimaryKeySelective(CyymallOrderWithBLOBs record) {
        SQL sql = new SQL();
        sql.UPDATE("cyymall_order");
        
        if (record.getStoreId() != null) {
            sql.SET("store_id = #{storeId,jdbcType=INTEGER}");
        }
        
        if (record.getUserId() != null) {
            sql.SET("user_id = #{userId,jdbcType=INTEGER}");
        }
        
        if (record.getOrderNo() != null) {
            sql.SET("order_no = #{orderNo,jdbcType=VARCHAR}");
        }
        
        if (record.getTotalPrice() != null) {
            sql.SET("total_price = #{totalPrice,jdbcType=DECIMAL}");
        }
        
        if (record.getPayPrice() != null) {
            sql.SET("pay_price = #{payPrice,jdbcType=DECIMAL}");
        }
        
        if (record.getExpressPrice() != null) {
            sql.SET("express_price = #{expressPrice,jdbcType=DECIMAL}");
        }
        
        if (record.getName() != null) {
            sql.SET("`name` = #{name,jdbcType=VARCHAR}");
        }
        
        if (record.getMobile() != null) {
            sql.SET("mobile = #{mobile,jdbcType=VARCHAR}");
        }
        
        if (record.getAddress() != null) {
            sql.SET("address = #{address,jdbcType=VARCHAR}");
        }
        
        if (record.getRemark() != null) {
            sql.SET("remark = #{remark,jdbcType=VARCHAR}");
        }
        
        if (record.getIsPay() != null) {
            sql.SET("is_pay = #{isPay,jdbcType=SMALLINT}");
        }
        
        if (record.getPayType() != null) {
            sql.SET("pay_type = #{payType,jdbcType=SMALLINT}");
        }
        
        if (record.getPayTime() != null) {
            sql.SET("pay_time = #{payTime,jdbcType=INTEGER}");
        }
        
        if (record.getIsSend() != null) {
            sql.SET("is_send = #{isSend,jdbcType=SMALLINT}");
        }
        
        if (record.getSendTime() != null) {
            sql.SET("send_time = #{sendTime,jdbcType=INTEGER}");
        }
        
        if (record.getExpress() != null) {
            sql.SET("express = #{express,jdbcType=VARCHAR}");
        }
        
        if (record.getExpressNo() != null) {
            sql.SET("express_no = #{expressNo,jdbcType=VARCHAR}");
        }
        
        if (record.getIsConfirm() != null) {
            sql.SET("is_confirm = #{isConfirm,jdbcType=SMALLINT}");
        }
        
        if (record.getConfirmTime() != null) {
            sql.SET("confirm_time = #{confirmTime,jdbcType=INTEGER}");
        }
        
        if (record.getIsComment() != null) {
            sql.SET("is_comment = #{isComment,jdbcType=SMALLINT}");
        }
        
        if (record.getApplyDelete() != null) {
            sql.SET("apply_delete = #{applyDelete,jdbcType=SMALLINT}");
        }
        
        if (record.getAddtime() != null) {
            sql.SET("addtime = #{addtime,jdbcType=INTEGER}");
        }
        
        if (record.getIsDelete() != null) {
            sql.SET("is_delete = #{isDelete,jdbcType=SMALLINT}");
        }
        
        if (record.getIsPrice() != null) {
            sql.SET("is_price = #{isPrice,jdbcType=SMALLINT}");
        }
        
        if (record.getParentId() != null) {
            sql.SET("parent_id = #{parentId,jdbcType=INTEGER}");
        }
        
        if (record.getFirstPrice() != null) {
            sql.SET("first_price = #{firstPrice,jdbcType=DECIMAL}");
        }
        
        if (record.getSecondPrice() != null) {
            sql.SET("second_price = #{secondPrice,jdbcType=DECIMAL}");
        }
        
        if (record.getThirdPrice() != null) {
            sql.SET("third_price = #{thirdPrice,jdbcType=DECIMAL}");
        }
        
        if (record.getCouponSubPrice() != null) {
            sql.SET("coupon_sub_price = #{couponSubPrice,jdbcType=DECIMAL}");
        }
        
        if (record.getIsOffline() != null) {
            sql.SET("is_offline = #{isOffline,jdbcType=INTEGER}");
        }
        
        if (record.getClerkId() != null) {
            sql.SET("clerk_id = #{clerkId,jdbcType=INTEGER}");
        }
        
        if (record.getIsCancel() != null) {
            sql.SET("is_cancel = #{isCancel,jdbcType=SMALLINT}");
        }
        
        if (record.getBeforeUpdatePrice() != null) {
            sql.SET("before_update_price = #{beforeUpdatePrice,jdbcType=DECIMAL}");
        }
        
        if (record.getShopId() != null) {
            sql.SET("shop_id = #{shopId,jdbcType=INTEGER}");
        }
        
        if (record.getDiscount() != null) {
            sql.SET("discount = #{discount,jdbcType=DECIMAL}");
        }
        
        if (record.getUserCouponId() != null) {
            sql.SET("user_coupon_id = #{userCouponId,jdbcType=INTEGER}");
        }
        
        if (record.getGiveIntegral() != null) {
            sql.SET("give_integral = #{giveIntegral,jdbcType=SMALLINT}");
        }
        
        if (record.getParentId1() != null) {
            sql.SET("parent_id_1 = #{parentId1,jdbcType=INTEGER}");
        }
        
        if (record.getParentId2() != null) {
            sql.SET("parent_id_2 = #{parentId2,jdbcType=INTEGER}");
        }
        
        if (record.getIsSale() != null) {
            sql.SET("is_sale = #{isSale,jdbcType=INTEGER}");
        }
        
        if (record.getVersion() != null) {
            sql.SET("version = #{version,jdbcType=VARCHAR}");
        }
        
        if (record.getExpressPrice1() != null) {
            sql.SET("express_price_1 = #{expressPrice1,jdbcType=DECIMAL}");
        }
        
        if (record.getIsRecycle() != null) {
            sql.SET("is_recycle = #{isRecycle,jdbcType=SMALLINT}");
        }
        
        if (record.getRebate() != null) {
            sql.SET("rebate = #{rebate,jdbcType=DECIMAL}");
        }
        
        if (record.getBeforeUpdateExpress() != null) {
            sql.SET("before_update_express = #{beforeUpdateExpress,jdbcType=DECIMAL}");
        }
        
        if (record.getMchId() != null) {
            sql.SET("mch_id = #{mchId,jdbcType=INTEGER}");
        }
        
        if (record.getOrderUnionId() != null) {
            sql.SET("order_union_id = #{orderUnionId,jdbcType=INTEGER}");
        }
        
        if (record.getIsTransfer() != null) {
            sql.SET("is_transfer = #{isTransfer,jdbcType=SMALLINT}");
        }
        
        if (record.getType() != null) {
            sql.SET("`type` = #{type,jdbcType=INTEGER}");
        }
        
        if (record.getSharePrice() != null) {
            sql.SET("share_price = #{sharePrice,jdbcType=DECIMAL}");
        }
        
        if (record.getIsShow() != null) {
            sql.SET("is_show = #{isShow,jdbcType=SMALLINT}");
        }
        
        if (record.getCurrency() != null) {
            sql.SET("currency = #{currency,jdbcType=DECIMAL}");
        }
        
        if (record.getOrderOrigin() != null) {
            sql.SET("order_origin = #{orderOrigin,jdbcType=BIT}");
        }
        
        if (record.getDeliveryId() != null) {
            sql.SET("delivery_id = #{deliveryId,jdbcType=INTEGER}");
        }
        
        if (record.getDeliveryStatus() != null) {
            sql.SET("delivery_status = #{deliveryStatus,jdbcType=BIT}");
        }
        
        if (record.getFyStatus() != null) {
            sql.SET("fy_status = #{fyStatus,jdbcType=BIT}");
        }
        
        if (record.getFyjine() != null) {
            sql.SET("fyjine = #{fyjine,jdbcType=DECIMAL}");
        }
        
        if (record.getFysingle() != null) {
            sql.SET("fysingle = #{fysingle,jdbcType=DECIMAL}");
        }
        
        if (record.getMchFyjine() != null) {
            sql.SET("mch_fyjine = #{mchFyjine,jdbcType=DECIMAL}");
        }
        
        if (record.getMchFysingle() != null) {
            sql.SET("mch_fysingle = #{mchFysingle,jdbcType=DECIMAL}");
        }
        
        if (record.getIsFan() != null) {
            sql.SET("is_fan = #{isFan,jdbcType=BIT}");
        }
        
        if (record.getIsDada() != null) {
            sql.SET("is_dada = #{isDada,jdbcType=BIT}");
        }
        
        if (record.getShopPeisong() != null) {
            sql.SET("shop_peisong = #{shopPeisong,jdbcType=INTEGER}");
        }
        
        if (record.getIsOpenOffline() != null) {
            sql.SET("is_open_offline = #{isOpenOffline,jdbcType=BIT}");
        }
        
        if (record.getSupplierId() != null) {
            sql.SET("supplier_id = #{supplierId,jdbcType=INTEGER}");
        }
        
        if (record.getIsSupTransfer() != null) {
            sql.SET("is_sup_transfer = #{isSupTransfer,jdbcType=BIT}");
        }
        
        if (record.getDabaoPrice() != null) {
            sql.SET("dabao_price = #{dabaoPrice,jdbcType=DECIMAL}");
        }
        
        if (record.getSettlementAmount() != null) {
            sql.SET("settlement_amount = #{settlementAmount,jdbcType=DECIMAL}");
        }
        
        if (record.getIsSettlement() != null) {
            sql.SET("is_settlement = #{isSettlement,jdbcType=SMALLINT}");
        }
        
        if (record.getSettlementTime() != null) {
            sql.SET("settlement_time = #{settlementTime,jdbcType=INTEGER}");
        }
        
        if (record.getIsMchShop() != null) {
            sql.SET("is_mch_shop = #{isMchShop,jdbcType=BIT}");
        }
        
        if (record.getIsDivideMoney() != null) {
            sql.SET("is_divide_money = #{isDivideMoney,jdbcType=BIT}");
        }
        
        if (record.getTransactionId() != null) {
            sql.SET("transaction_id = #{transactionId,jdbcType=VARCHAR}");
        }
        
        if (record.getPayUserId() != null) {
            sql.SET("pay_user_id = #{payUserId,jdbcType=INTEGER}");
        }
        
        if (record.getPayTypeTrue() != null) {
            sql.SET("pay_type_true = #{payTypeTrue,jdbcType=BIT}");
        }
        
        if (record.getIsVgoods() != null) {
            sql.SET("is_vgoods = #{isVgoods,jdbcType=INTEGER}");
        }
        
        if (record.getReductionPrice() != null) {
            sql.SET("reduction_price = #{reductionPrice,jdbcType=DECIMAL}");
        }
        
        if (record.getMinusPrice() != null) {
            sql.SET("minus_price = #{minusPrice,jdbcType=DECIMAL}");
        }
        
        if (record.getOrderFrom() != null) {
            sql.SET("order_from = #{orderFrom,jdbcType=INTEGER}");
        }
        
        if (record.getDiscountPrice() != null) {
            sql.SET("discount_price = #{discountPrice,jdbcType=DECIMAL}");
        }
        
        if (record.getDiscountNum() != null) {
            sql.SET("discount_num = #{discountNum,jdbcType=DECIMAL}");
        }
        
        if (record.getGiveGoodsId() != null) {
            sql.SET("give_goods_id = #{giveGoodsId,jdbcType=INTEGER}");
        }
        
        if (record.getCouponRecordId() != null) {
            sql.SET("coupon_record_id = #{couponRecordId,jdbcType=VARCHAR}");
        }
        
        if (record.getIdCardNo() != null) {
            sql.SET("id_card_no = #{idCardNo,jdbcType=VARCHAR}");
        }
        
        if (record.getRefundTime() != null) {
            sql.SET("refund_time = #{refundTime,jdbcType=INTEGER}");
        }
        
        if (record.getContent() != null) {
            sql.SET("content = #{content,jdbcType=LONGVARCHAR}");
        }
        
        if (record.getAddressData() != null) {
            sql.SET("address_data = #{addressData,jdbcType=LONGVARCHAR}");
        }
        
        if (record.getOfflineQrcode() != null) {
            sql.SET("offline_qrcode = #{offlineQrcode,jdbcType=LONGVARCHAR}");
        }
        
        if (record.getIntegral() != null) {
            sql.SET("integral = #{integral,jdbcType=LONGVARCHAR}");
        }
        
        if (record.getWords() != null) {
            sql.SET("words = #{words,jdbcType=LONGVARCHAR}");
        }
        
        if (record.getSellerComments() != null) {
            sql.SET("seller_comments = #{sellerComments,jdbcType=LONGVARCHAR}");
        }
        
        sql.WHERE("id = #{id,jdbcType=INTEGER}");
        
        return sql.toString();
    }

    protected void applyWhere(SQL sql, CyymallOrderExample example, boolean includeExamplePhrase) {
        if (example == null) {
            return;
        }
        
        String parmPhrase1;
        String parmPhrase1_th;
        String parmPhrase2;
        String parmPhrase2_th;
        String parmPhrase3;
        String parmPhrase3_th;
        if (includeExamplePhrase) {
            parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}";
            parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
            parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}";
            parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
            parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}";
            parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
        } else {
            parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}";
            parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
            parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}";
            parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
            parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}";
            parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
        }
        
        StringBuilder sb = new StringBuilder();
        List<Criteria> oredCriteria = example.getOredCriteria();
        boolean firstCriteria = true;
        for (int i = 0; i < oredCriteria.size(); i++) {
            Criteria criteria = oredCriteria.get(i);
            if (criteria.isValid()) {
                if (firstCriteria) {
                    firstCriteria = false;
                } else {
                    sb.append(" or ");
                }
                
                sb.append('(');
                List<Criterion> criterions = criteria.getAllCriteria();
                boolean firstCriterion = true;
                for (int j = 0; j < criterions.size(); j++) {
                    Criterion criterion = criterions.get(j);
                    if (firstCriterion) {
                        firstCriterion = false;
                    } else {
                        sb.append(" and ");
                    }
                    
                    if (criterion.isNoValue()) {
                        sb.append(criterion.getCondition());
                    } else if (criterion.isSingleValue()) {
                        if (criterion.getTypeHandler() == null) {
                            sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j));
                        } else {
                            sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler()));
                        }
                    } else if (criterion.isBetweenValue()) {
                        if (criterion.getTypeHandler() == null) {
                            sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j));
                        } else {
                            sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler()));
                        }
                    } else if (criterion.isListValue()) {
                        sb.append(criterion.getCondition());
                        sb.append(" (");
                        List<?> listItems = (List<?>) criterion.getValue();
                        boolean comma = false;
                        for (int k = 0; k < listItems.size(); k++) {
                            if (comma) {
                                sb.append(", ");
                            } else {
                                comma = true;
                            }
                            if (criterion.getTypeHandler() == null) {
                                sb.append(String.format(parmPhrase3, i, j, k));
                            } else {
                                sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler()));
                            }
                        }
                        sb.append(')');
                    }
                }
                sb.append(')');
            }
        }
        
        if (sb.length() > 0) {
            sql.WHERE(sb.toString());
        }
    }
}