Example usage for org.apache.ibatis.jdbc SQL SQL

List of usage examples for org.apache.ibatis.jdbc SQL SQL

Introduction

In this page you can find the example usage for org.apache.ibatis.jdbc SQL SQL.

Prototype

SQL

Source Link

Usage

From source file:com.hbc.api.trade.order.mapping.gen.OrderBeanSqlProvider.java

/**
 * This method was generated by MyBatis Generator.
 * This method corresponds to the database table `trade_order`
 *
 * @mbggenerated/*  w ww  .j  a  va 2 s . c o  m*/
 */
public String deleteByExample(OrderBeanExample example) {
    SQL sql = new SQL();
    sql.DELETE_FROM("`trade_order`");
    applyWhere(sql, example, false);
    return sql.toString();
}

From source file:com.hbc.api.trade.order.mapping.gen.OrderBeanSqlProvider.java

/**
 * This method was generated by MyBatis Generator.
 * This method corresponds to the database table `trade_order`
 *
 * @mbggenerated/* w  w  w  .j  a v  a 2 s  .  com*/
 */
public String insertSelective(OrderBean record) {
    SQL sql = new SQL();
    sql.INSERT_INTO("`trade_order`");

    if (record.getOrderNo() != null) {
        sql.VALUES("order_no", "#{orderNo,jdbcType=VARCHAR}");
    }

    if (record.getThirdTradeNo() != null) {
        sql.VALUES("third_trade_no", "#{thirdTradeNo,jdbcType=VARCHAR}");
    }

    if (record.getOrderStatus() != null) {
        sql.VALUES("order_status", "#{orderStatus,jdbcType=INTEGER}");
    }

    if (record.getOrderStatusName() != null) {
        sql.VALUES("order_status_name", "#{orderStatusName,jdbcType=VARCHAR}");
    }

    if (record.getOrderType() != null) {
        sql.VALUES("order_type", "#{orderType,jdbcType=INTEGER}");
    }

    if (record.getOrderGoodsType() != null) {
        sql.VALUES("order_goods_type", "#{orderGoodsType,jdbcType=INTEGER}");
    }

    if (record.getGoodNo() != null) {
        sql.VALUES("good_no", "#{goodNo,jdbcType=VARCHAR}");
    }

    if (record.getOrderSource() != null) {
        sql.VALUES("order_source", "#{orderSource,jdbcType=INTEGER}");
    }

    if (record.getOrderChannel() != null) {
        sql.VALUES("order_channel", "#{orderChannel,jdbcType=INTEGER}");
    }

    if (record.getServiceTime() != null) {
        sql.VALUES("service_time", "#{serviceTime,jdbcType=TIMESTAMP}");
    }

    if (record.getServiceEndTime() != null) {
        sql.VALUES("service_end_time", "#{serviceEndTime,jdbcType=TIMESTAMP}");
    }

    if (record.getServiceContinentId() != null) {
        sql.VALUES("service_continent_id", "#{serviceContinentId,jdbcType=INTEGER}");
    }

    if (record.getServiceContinentName() != null) {
        sql.VALUES("service_continent_name", "#{serviceContinentName,jdbcType=VARCHAR}");
    }

    if (record.getServiceCountryId() != null) {
        sql.VALUES("service_country_id", "#{serviceCountryId,jdbcType=INTEGER}");
    }

    if (record.getServiceCountryName() != null) {
        sql.VALUES("service_country_name", "#{serviceCountryName,jdbcType=VARCHAR}");
    }

    if (record.getServiceCityId() != null) {
        sql.VALUES("service_city_id", "#{serviceCityId,jdbcType=INTEGER}");
    }

    if (record.getServiceCitySpell() != null) {
        sql.VALUES("service_city_spell", "#{serviceCitySpell,jdbcType=VARCHAR}");
    }

    if (record.getServiceCityEnname() != null) {
        sql.VALUES("service_city_enname", "#{serviceCityEnname,jdbcType=VARCHAR}");
    }

    if (record.getServiceCityName() != null) {
        sql.VALUES("service_city_name", "#{serviceCityName,jdbcType=VARCHAR}");
    }

    if (record.getServiceAreaCode() != null) {
        sql.VALUES("service_area_code", "#{serviceAreaCode,jdbcType=VARCHAR}");
    }

    if (record.getServiceAddressTel() != null) {
        sql.VALUES("service_address_tel", "#{serviceAddressTel,jdbcType=VARCHAR}");
    }

    if (record.getServiceDailyType() != null) {
        sql.VALUES("service_daily_type", "#{serviceDailyType,jdbcType=SMALLINT}");
    }

    if (record.getServiceLocalDays() != null) {
        sql.VALUES("service_local_days", "#{serviceLocalDays,jdbcType=SMALLINT}");
    }

    if (record.getServiceNonlocalDays() != null) {
        sql.VALUES("service_nonlocal_days", "#{serviceNonlocalDays,jdbcType=SMALLINT}");
    }

    if (record.getTotalDays() != null) {
        sql.VALUES("total_days", "#{totalDays,jdbcType=TINYINT}");
    }

    if (record.getServicePassCity() != null) {
        sql.VALUES("service_pass_city", "#{servicePassCity,jdbcType=VARCHAR}");
    }

    if (record.getServiceEndCityid() != null) {
        sql.VALUES("service_end_cityid", "#{serviceEndCityid,jdbcType=INTEGER}");
    }

    if (record.getServiceEndCityname() != null) {
        sql.VALUES("service_end_cityname", "#{serviceEndCityname,jdbcType=VARCHAR}");
    }

    if (record.getExpectedCompTime() != null) {
        sql.VALUES("expected_comp_time", "#{expectedCompTime,jdbcType=INTEGER}");
    }

    if (record.getStartAddress() != null) {
        sql.VALUES("start_address", "#{startAddress,jdbcType=VARCHAR}");
    }

    if (record.getStartAddressDetail() != null) {
        sql.VALUES("start_address_detail", "#{startAddressDetail,jdbcType=VARCHAR}");
    }

    if (record.getStartAddressPoi() != null) {
        sql.VALUES("start_address_poi", "#{startAddressPoi,jdbcType=VARCHAR}");
    }

    if (record.getDestAddress() != null) {
        sql.VALUES("dest_address", "#{destAddress,jdbcType=VARCHAR}");
    }

    if (record.getDestAddressDetail() != null) {
        sql.VALUES("dest_address_detail", "#{destAddressDetail,jdbcType=VARCHAR}");
    }

    if (record.getDestAddressPoi() != null) {
        sql.VALUES("dest_address_poi", "#{destAddressPoi,jdbcType=VARCHAR}");
    }

    if (record.getDistance() != null) {
        sql.VALUES("distance", "#{distance,jdbcType=DOUBLE}");
    }

    if (record.getCarId() != null) {
        sql.VALUES("car_id", "#{carId,jdbcType=VARCHAR}");
    }

    if (record.getCarLicenseNum() != null) {
        sql.VALUES("car_license_num", "#{carLicenseNum,jdbcType=VARCHAR}");
    }

    if (record.getCarTypeId() != null) {
        sql.VALUES("car_type_id", "#{carTypeId,jdbcType=INTEGER}");
    }

    if (record.getCarSeatNum() != null) {
        sql.VALUES("car_seat_num", "#{carSeatNum,jdbcType=TINYINT}");
    }

    if (record.getCarName() != null) {
        sql.VALUES("car_name", "#{carName,jdbcType=VARCHAR}");
    }

    if (record.getCarDesc() != null) {
        sql.VALUES("car_desc", "#{carDesc,jdbcType=VARCHAR}");
    }

    if (record.getCoupId() != null) {
        sql.VALUES("coup_id", "#{coupId,jdbcType=VARCHAR}");
    }

    if (record.getCoupType() != null) {
        sql.VALUES("coup_type", "#{coupType,jdbcType=INTEGER}");
    }

    if (record.getCoupLabel() != null) {
        sql.VALUES("coup_label", "#{coupLabel,jdbcType=VARCHAR}");
    }

    if (record.getCoupPriceInfo() != null) {
        sql.VALUES("coup_price_info", "#{coupPriceInfo,jdbcType=VARCHAR}");
    }

    if (record.getPriceMark() != null) {
        sql.VALUES("price_mark", "#{priceMark,jdbcType=VARCHAR}");
    }

    if (record.getPriceBase() != null) {
        sql.VALUES("price_base", "#{priceBase,jdbcType=DOUBLE}");
    }

    if (record.getPriceGuide() != null) {
        sql.VALUES("price_guide", "#{priceGuide,jdbcType=DOUBLE}");
    }

    if (record.getPriceTicket() != null) {
        sql.VALUES("price_ticket", "#{priceTicket,jdbcType=DOUBLE}");
    }

    if (record.getPriceChannel() != null) {
        sql.VALUES("price_channel", "#{priceChannel,jdbcType=DOUBLE}");
    }

    if (record.getPriceGuideBase() != null) {
        sql.VALUES("price_guide_base", "#{priceGuideBase,jdbcType=DOUBLE}");
    }

    if (record.getPriceReward() != null) {
        sql.VALUES("price_reward", "#{priceReward,jdbcType=DOUBLE}");
    }

    if (record.getUserId() != null) {
        sql.VALUES("user_id", "#{userId,jdbcType=VARCHAR}");
    }

    if (record.getUserAccount() != null) {
        sql.VALUES("user_account", "#{userAccount,jdbcType=VARCHAR}");
    }

    if (record.getUserName() != null) {
        sql.VALUES("user_name", "#{userName,jdbcType=VARCHAR}");
    }

    if (record.getUserAreaCode1() != null) {
        sql.VALUES("user_area_code1", "#{userAreaCode1,jdbcType=VARCHAR}");
    }

    if (record.getUserMobile1() != null) {
        sql.VALUES("user_mobile1", "#{userMobile1,jdbcType=VARCHAR}");
    }

    if (record.getUserAreaCode2() != null) {
        sql.VALUES("user_area_code2", "#{userAreaCode2,jdbcType=VARCHAR}");
    }

    if (record.getUserMobile2() != null) {
        sql.VALUES("user_mobile2", "#{userMobile2,jdbcType=VARCHAR}");
    }

    if (record.getUserAreaCode3() != null) {
        sql.VALUES("user_area_code3", "#{userAreaCode3,jdbcType=VARCHAR}");
    }

    if (record.getUserMobile3() != null) {
        sql.VALUES("user_mobile3", "#{userMobile3,jdbcType=VARCHAR}");
    }

    if (record.getUserEmail() != null) {
        sql.VALUES("user_email", "#{userEmail,jdbcType=VARCHAR}");
    }

    if (record.getUserCommentStatus() != null) {
        sql.VALUES("user_comment_status", "#{userCommentStatus,jdbcType=TINYINT}");
    }

    if (record.getUserRemark() != null) {
        sql.VALUES("user_remark", "#{userRemark,jdbcType=VARCHAR}");
    }

    if (record.getSystemCommentStatus() != null) {
        sql.VALUES("system_comment_status", "#{systemCommentStatus,jdbcType=INTEGER}");
    }

    if (record.getGuideAssignTime() != null) {
        sql.VALUES("guide_assign_time", "#{guideAssignTime,jdbcType=TIMESTAMP}");
    }

    if (record.getGuidePreId() != null) {
        sql.VALUES("guide_pre_id", "#{guidePreId,jdbcType=VARCHAR}");
    }

    if (record.getGuideId() != null) {
        sql.VALUES("guide_id", "#{guideId,jdbcType=VARCHAR}");
    }

    if (record.getGuideNo() != null) {
        sql.VALUES("guide_no", "#{guideNo,jdbcType=VARCHAR}");
    }

    if (record.getGuideName() != null) {
        sql.VALUES("guide_name", "#{guideName,jdbcType=VARCHAR}");
    }

    if (record.getGuideAreaCode() != null) {
        sql.VALUES("guide_area_code", "#{guideAreaCode,jdbcType=VARCHAR}");
    }

    if (record.getGuideMobile() != null) {
        sql.VALUES("guide_mobile", "#{guideMobile,jdbcType=VARCHAR}");
    }

    if (record.getGuideCommentStatus() != null) {
        sql.VALUES("guide_comment_status", "#{guideCommentStatus,jdbcType=SMALLINT}");
    }

    if (record.getGuideAgencyType() != null) {
        sql.VALUES("guide_agency_type", "#{guideAgencyType,jdbcType=INTEGER}");
    }

    if (record.getGuideAgencyBossId() != null) {
        sql.VALUES("guide_agency_boss_id", "#{guideAgencyBossId,jdbcType=VARCHAR}");
    }

    if (record.getGuideAgencyBossName() != null) {
        sql.VALUES("guide_agency_boss_name", "#{guideAgencyBossName,jdbcType=VARCHAR}");
    }

    if (record.getGuideAccountNo() != null) {
        sql.VALUES("guide_account_no", "#{guideAccountNo,jdbcType=VARCHAR}");
    }

    if (record.getGuideAgencyId() != null) {
        sql.VALUES("guide_agency_id", "#{guideAgencyId,jdbcType=VARCHAR}");
    }

    if (record.getGuideAgencyName() != null) {
        sql.VALUES("guide_agency_name", "#{guideAgencyName,jdbcType=VARCHAR}");
    }

    if (record.getAgentId() != null) {
        sql.VALUES("agent_id", "#{agentId,jdbcType=VARCHAR}");
    }

    if (record.getAgentName() != null) {
        sql.VALUES("agent_name", "#{agentName,jdbcType=VARCHAR}");
    }

    if (record.getAgentOpid() != null) {
        sql.VALUES("agent_opid", "#{agentOpid,jdbcType=VARCHAR}");
    }

    if (record.getAgentOpname() != null) {
        sql.VALUES("agent_opname", "#{agentOpname,jdbcType=VARCHAR}");
    }

    if (record.getAdminId() != null) {
        sql.VALUES("admin_id", "#{adminId,jdbcType=INTEGER}");
    }

    if (record.getImToken() != null) {
        sql.VALUES("im_token", "#{imToken,jdbcType=VARCHAR}");
    }

    if (record.getDeliverStatus() != null) {
        sql.VALUES("deliver_status", "#{deliverStatus,jdbcType=INTEGER}");
    }

    if (record.getDeliverType() != null) {
        sql.VALUES("deliver_type", "#{deliverType,jdbcType=INTEGER}");
    }

    if (record.getDeliverAcpTime() != null) {
        sql.VALUES("deliver_acp_time", "#{deliverAcpTime,jdbcType=TIMESTAMP}");
    }

    if (record.getUrgentFlag() != null) {
        sql.VALUES("urgent_flag", "#{urgentFlag,jdbcType=INTEGER}");
    }

    if (record.getUrgentHour() != null) {
        sql.VALUES("urgent_hour", "#{urgentHour,jdbcType=INTEGER}");
    }

    if (record.getSerialFlag() != null) {
        sql.VALUES("serial_flag", "#{serialFlag,jdbcType=INTEGER}");
    }

    if (record.getSerialOrderNo() != null) {
        sql.VALUES("serial_order_no", "#{serialOrderNo,jdbcType=VARCHAR}");
    }

    if (record.getCargroupFlag() != null) {
        sql.VALUES("cargroup_flag", "#{cargroupFlag,jdbcType=INTEGER}");
    }

    if (record.getCargroupId() != null) {
        sql.VALUES("cargroup_id", "#{cargroupId,jdbcType=VARCHAR}");
    }

    if (record.getFlightNo() != null) {
        sql.VALUES("flight_no", "#{flightNo,jdbcType=VARCHAR}");
    }

    if (record.getFlightAirportCode() != null) {
        sql.VALUES("flight_airport_code", "#{flightAirportCode,jdbcType=VARCHAR}");
    }

    if (record.getFlightAirportName() != null) {
        sql.VALUES("flight_airport_name", "#{flightAirportName,jdbcType=VARCHAR}");
    }

    if (record.getFlightFlyTime() != null) {
        sql.VALUES("flight_fly_time", "#{flightFlyTime,jdbcType=TIMESTAMP}");
    }

    if (record.getFlightArriveTime() != null) {
        sql.VALUES("flight_arrive_time", "#{flightArriveTime,jdbcType=TIMESTAMP}");
    }

    if (record.getFlightIsCustom() != null) {
        sql.VALUES("flight_is_custom", "#{flightIsCustom,jdbcType=INTEGER}");
    }

    if (record.getFlightAirportBuiding() != null) {
        sql.VALUES("flight_airport_buiding", "#{flightAirportBuiding,jdbcType=VARCHAR}");
    }

    if (record.getFlightRegisterId() != null) {
        sql.VALUES("flight_register_id", "#{flightRegisterId,jdbcType=VARCHAR}");
    }

    if (record.getFlightBrandSign() != null) {
        sql.VALUES("flight_brand_sign", "#{flightBrandSign,jdbcType=VARCHAR}");
    }

    if (record.getFlightDestCode() != null) {
        sql.VALUES("flight_dest_code", "#{flightDestCode,jdbcType=VARCHAR}");
    }

    if (record.getFlightDestName() != null) {
        sql.VALUES("flight_dest_name", "#{flightDestName,jdbcType=VARCHAR}");
    }

    if (record.getFlightDestBuilding() != null) {
        sql.VALUES("flight_dest_building", "#{flightDestBuilding,jdbcType=VARCHAR}");
    }

    if (record.getLineSubject() != null) {
        sql.VALUES("line_subject", "#{lineSubject,jdbcType=VARCHAR}");
    }

    if (record.getLineDescription() != null) {
        sql.VALUES("line_description", "#{lineDescription,jdbcType=VARCHAR}");
    }

    if (record.getAdultNum() != null) {
        sql.VALUES("adult_num", "#{adultNum,jdbcType=INTEGER}");
    }

    if (record.getChildNum() != null) {
        sql.VALUES("child_num", "#{childNum,jdbcType=INTEGER}");
    }

    if (record.getChildSeat() != null) {
        sql.VALUES("child_seat", "#{childSeat,jdbcType=VARCHAR}");
    }

    if (record.getIsArrivalVisa() != null) {
        sql.VALUES("is_arrival_visa", "#{isArrivalVisa,jdbcType=SMALLINT}");
    }

    if (record.getCheckInPrice() != null) {
        sql.VALUES("check_in_price", "#{checkInPrice,jdbcType=DOUBLE}");
    }

    if (record.getCancelTime() != null) {
        sql.VALUES("cancel_time", "#{cancelTime,jdbcType=TIMESTAMP}");
    }

    if (record.getCompleteTime() != null) {
        sql.VALUES("complete_time", "#{completeTime,jdbcType=TIMESTAMP}");
    }

    if (record.getIsReadable() != null) {
        sql.VALUES("is_readable", "#{isReadable,jdbcType=INTEGER}");
    }

    if (record.getIsNewTrack() != null) {
        sql.VALUES("is_new_track", "#{isNewTrack,jdbcType=INTEGER}");
    }

    if (record.getCreateTime() != null) {
        sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
    }

    if (record.getUpdateTime() != null) {
        sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}");
    }

    if (record.getJourneyComment() != null) {
        sql.VALUES("journey_comment", "#{journeyComment,jdbcType=LONGVARCHAR}");
    }

    return sql.toString();
}

From source file:com.hbc.api.trade.order.mapping.gen.OrderBeanSqlProvider.java

/**
 * This method was generated by MyBatis Generator.
 * This method corresponds to the database table `trade_order`
 *
 * @mbggenerated// w ww  . j av a  2  s.c  o m
 */
public String selectByExampleWithBLOBs(OrderBeanExample example) {
    SQL sql = new SQL();
    if (example != null && example.isDistinct()) {
        sql.SELECT_DISTINCT("order_no");
    } else {
        sql.SELECT("order_no");
    }
    sql.SELECT("third_trade_no");
    sql.SELECT("order_status");
    sql.SELECT("order_status_name");
    sql.SELECT("order_type");
    sql.SELECT("order_goods_type");
    sql.SELECT("good_no");
    sql.SELECT("order_source");
    sql.SELECT("order_channel");
    sql.SELECT("service_time");
    sql.SELECT("service_end_time");
    sql.SELECT("service_continent_id");
    sql.SELECT("service_continent_name");
    sql.SELECT("service_country_id");
    sql.SELECT("service_country_name");
    sql.SELECT("service_city_id");
    sql.SELECT("service_city_spell");
    sql.SELECT("service_city_enname");
    sql.SELECT("service_city_name");
    sql.SELECT("service_area_code");
    sql.SELECT("service_address_tel");
    sql.SELECT("service_daily_type");
    sql.SELECT("service_local_days");
    sql.SELECT("service_nonlocal_days");
    sql.SELECT("total_days");
    sql.SELECT("service_pass_city");
    sql.SELECT("service_end_cityid");
    sql.SELECT("service_end_cityname");
    sql.SELECT("expected_comp_time");
    sql.SELECT("start_address");
    sql.SELECT("start_address_detail");
    sql.SELECT("start_address_poi");
    sql.SELECT("dest_address");
    sql.SELECT("dest_address_detail");
    sql.SELECT("dest_address_poi");
    sql.SELECT("distance");
    sql.SELECT("car_id");
    sql.SELECT("car_license_num");
    sql.SELECT("car_type_id");
    sql.SELECT("car_seat_num");
    sql.SELECT("car_name");
    sql.SELECT("car_desc");
    sql.SELECT("coup_id");
    sql.SELECT("coup_type");
    sql.SELECT("coup_label");
    sql.SELECT("coup_price_info");
    sql.SELECT("price_mark");
    sql.SELECT("price_base");
    sql.SELECT("price_guide");
    sql.SELECT("price_ticket");
    sql.SELECT("price_channel");
    sql.SELECT("price_guide_base");
    sql.SELECT("price_reward");
    sql.SELECT("user_id");
    sql.SELECT("user_account");
    sql.SELECT("user_name");
    sql.SELECT("user_area_code1");
    sql.SELECT("user_mobile1");
    sql.SELECT("user_area_code2");
    sql.SELECT("user_mobile2");
    sql.SELECT("user_area_code3");
    sql.SELECT("user_mobile3");
    sql.SELECT("user_email");
    sql.SELECT("user_comment_status");
    sql.SELECT("user_remark");
    sql.SELECT("system_comment_status");
    sql.SELECT("guide_assign_time");
    sql.SELECT("guide_pre_id");
    sql.SELECT("guide_id");
    sql.SELECT("guide_no");
    sql.SELECT("guide_name");
    sql.SELECT("guide_area_code");
    sql.SELECT("guide_mobile");
    sql.SELECT("guide_comment_status");
    sql.SELECT("guide_agency_type");
    sql.SELECT("guide_agency_boss_id");
    sql.SELECT("guide_agency_boss_name");
    sql.SELECT("guide_account_no");
    sql.SELECT("guide_agency_id");
    sql.SELECT("guide_agency_name");
    sql.SELECT("agent_id");
    sql.SELECT("agent_name");
    sql.SELECT("agent_opid");
    sql.SELECT("agent_opname");
    sql.SELECT("admin_id");
    sql.SELECT("im_token");
    sql.SELECT("deliver_status");
    sql.SELECT("deliver_type");
    sql.SELECT("deliver_acp_time");
    sql.SELECT("urgent_flag");
    sql.SELECT("urgent_hour");
    sql.SELECT("serial_flag");
    sql.SELECT("serial_order_no");
    sql.SELECT("cargroup_flag");
    sql.SELECT("cargroup_id");
    sql.SELECT("flight_no");
    sql.SELECT("flight_airport_code");
    sql.SELECT("flight_airport_name");
    sql.SELECT("flight_fly_time");
    sql.SELECT("flight_arrive_time");
    sql.SELECT("flight_is_custom");
    sql.SELECT("flight_airport_buiding");
    sql.SELECT("flight_register_id");
    sql.SELECT("flight_brand_sign");
    sql.SELECT("flight_dest_code");
    sql.SELECT("flight_dest_name");
    sql.SELECT("flight_dest_building");
    sql.SELECT("line_subject");
    sql.SELECT("line_description");
    sql.SELECT("adult_num");
    sql.SELECT("child_num");
    sql.SELECT("child_seat");
    sql.SELECT("is_arrival_visa");
    sql.SELECT("check_in_price");
    sql.SELECT("cancel_time");
    sql.SELECT("complete_time");
    sql.SELECT("is_readable");
    sql.SELECT("is_new_track");
    sql.SELECT("create_time");
    sql.SELECT("update_time");
    sql.SELECT("journey_comment");
    sql.FROM("`trade_order`");
    applyWhere(sql, example, false);

    if (example != null && example.getOrderByClause() != null) {
        sql.ORDER_BY(example.getOrderByClause());
    }

    String sqlStr = sql.toString();
    if (example.getPage() != null) {
        sqlStr = sqlStr + " limit " + example.getPage().getOffset() + "," + example.getPage().getLimit() + "";
    }
    return sqlStr;
}

From source file:com.hbc.api.trade.order.mapping.gen.OrderBeanSqlProvider.java

/**
 * This method was generated by MyBatis Generator.
 * This method corresponds to the database table `trade_order`
 *
 * @mbggenerated//from w w w  .j av  a  2  s  .c  o m
 */
public String selectByExample(OrderBeanExample example) {
    SQL sql = new SQL();
    if (example != null && example.isDistinct()) {
        sql.SELECT_DISTINCT("order_no");
    } else {
        sql.SELECT("order_no");
    }
    sql.SELECT("third_trade_no");
    sql.SELECT("order_status");
    sql.SELECT("order_status_name");
    sql.SELECT("order_type");
    sql.SELECT("order_goods_type");
    sql.SELECT("good_no");
    sql.SELECT("order_source");
    sql.SELECT("order_channel");
    sql.SELECT("service_time");
    sql.SELECT("service_end_time");
    sql.SELECT("service_continent_id");
    sql.SELECT("service_continent_name");
    sql.SELECT("service_country_id");
    sql.SELECT("service_country_name");
    sql.SELECT("service_city_id");
    sql.SELECT("service_city_spell");
    sql.SELECT("service_city_enname");
    sql.SELECT("service_city_name");
    sql.SELECT("service_area_code");
    sql.SELECT("service_address_tel");
    sql.SELECT("service_daily_type");
    sql.SELECT("service_local_days");
    sql.SELECT("service_nonlocal_days");
    sql.SELECT("total_days");
    sql.SELECT("service_pass_city");
    sql.SELECT("service_end_cityid");
    sql.SELECT("service_end_cityname");
    sql.SELECT("expected_comp_time");
    sql.SELECT("start_address");
    sql.SELECT("start_address_detail");
    sql.SELECT("start_address_poi");
    sql.SELECT("dest_address");
    sql.SELECT("dest_address_detail");
    sql.SELECT("dest_address_poi");
    sql.SELECT("distance");
    sql.SELECT("car_id");
    sql.SELECT("car_license_num");
    sql.SELECT("car_type_id");
    sql.SELECT("car_seat_num");
    sql.SELECT("car_name");
    sql.SELECT("car_desc");
    sql.SELECT("coup_id");
    sql.SELECT("coup_type");
    sql.SELECT("coup_label");
    sql.SELECT("coup_price_info");
    sql.SELECT("price_mark");
    sql.SELECT("price_base");
    sql.SELECT("price_guide");
    sql.SELECT("price_ticket");
    sql.SELECT("price_channel");
    sql.SELECT("price_guide_base");
    sql.SELECT("price_reward");
    sql.SELECT("user_id");
    sql.SELECT("user_account");
    sql.SELECT("user_name");
    sql.SELECT("user_area_code1");
    sql.SELECT("user_mobile1");
    sql.SELECT("user_area_code2");
    sql.SELECT("user_mobile2");
    sql.SELECT("user_area_code3");
    sql.SELECT("user_mobile3");
    sql.SELECT("user_email");
    sql.SELECT("user_comment_status");
    sql.SELECT("user_remark");
    sql.SELECT("system_comment_status");
    sql.SELECT("guide_assign_time");
    sql.SELECT("guide_pre_id");
    sql.SELECT("guide_id");
    sql.SELECT("guide_no");
    sql.SELECT("guide_name");
    sql.SELECT("guide_area_code");
    sql.SELECT("guide_mobile");
    sql.SELECT("guide_comment_status");
    sql.SELECT("guide_agency_type");
    sql.SELECT("guide_agency_boss_id");
    sql.SELECT("guide_agency_boss_name");
    sql.SELECT("guide_account_no");
    sql.SELECT("guide_agency_id");
    sql.SELECT("guide_agency_name");
    sql.SELECT("agent_id");
    sql.SELECT("agent_name");
    sql.SELECT("agent_opid");
    sql.SELECT("agent_opname");
    sql.SELECT("admin_id");
    sql.SELECT("im_token");
    sql.SELECT("deliver_status");
    sql.SELECT("deliver_type");
    sql.SELECT("deliver_acp_time");
    sql.SELECT("urgent_flag");
    sql.SELECT("urgent_hour");
    sql.SELECT("serial_flag");
    sql.SELECT("serial_order_no");
    sql.SELECT("cargroup_flag");
    sql.SELECT("cargroup_id");
    sql.SELECT("flight_no");
    sql.SELECT("flight_airport_code");
    sql.SELECT("flight_airport_name");
    sql.SELECT("flight_fly_time");
    sql.SELECT("flight_arrive_time");
    sql.SELECT("flight_is_custom");
    sql.SELECT("flight_airport_buiding");
    sql.SELECT("flight_register_id");
    sql.SELECT("flight_brand_sign");
    sql.SELECT("flight_dest_code");
    sql.SELECT("flight_dest_name");
    sql.SELECT("flight_dest_building");
    sql.SELECT("line_subject");
    sql.SELECT("line_description");
    sql.SELECT("adult_num");
    sql.SELECT("child_num");
    sql.SELECT("child_seat");
    sql.SELECT("is_arrival_visa");
    sql.SELECT("check_in_price");
    sql.SELECT("cancel_time");
    sql.SELECT("complete_time");
    sql.SELECT("is_readable");
    sql.SELECT("is_new_track");
    sql.SELECT("create_time");
    sql.SELECT("update_time");
    sql.FROM("`trade_order`");
    applyWhere(sql, example, false);

    if (example != null && example.getOrderByClause() != null) {
        sql.ORDER_BY(example.getOrderByClause());
    }

    String sqlStr = sql.toString();
    if (example.getPage() != null) {
        sqlStr = sqlStr + " limit " + example.getPage().getOffset() + "," + example.getPage().getLimit() + "";
    }
    return sqlStr;
}

From source file:com.hbc.api.trade.order.mapping.gen.OrderBeanSqlProvider.java

/**
 * This method was generated by MyBatis Generator.
 * This method corresponds to the database table `trade_order`
 *
 * @mbggenerated/* w ww  .  j av  a  2 s .co m*/
 */
public String updateByExampleSelective(Map<String, Object> parameter) {
    OrderBean record = (OrderBean) parameter.get("record");
    OrderBeanExample example = (OrderBeanExample) parameter.get("example");

    SQL sql = new SQL();
    sql.UPDATE("`trade_order`");

    if (record.getOrderNo() != null) {
        sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}");
    }

    if (record.getThirdTradeNo() != null) {
        sql.SET("third_trade_no = #{record.thirdTradeNo,jdbcType=VARCHAR}");
    }

    if (record.getOrderStatus() != null) {
        sql.SET("order_status = #{record.orderStatus,jdbcType=INTEGER}");
    }

    if (record.getOrderStatusName() != null) {
        sql.SET("order_status_name = #{record.orderStatusName,jdbcType=VARCHAR}");
    }

    if (record.getOrderType() != null) {
        sql.SET("order_type = #{record.orderType,jdbcType=INTEGER}");
    }

    if (record.getOrderGoodsType() != null) {
        sql.SET("order_goods_type = #{record.orderGoodsType,jdbcType=INTEGER}");
    }

    if (record.getGoodNo() != null) {
        sql.SET("good_no = #{record.goodNo,jdbcType=VARCHAR}");
    }

    if (record.getOrderSource() != null) {
        sql.SET("order_source = #{record.orderSource,jdbcType=INTEGER}");
    }

    if (record.getOrderChannel() != null) {
        sql.SET("order_channel = #{record.orderChannel,jdbcType=INTEGER}");
    }

    if (record.getServiceTime() != null) {
        sql.SET("service_time = #{record.serviceTime,jdbcType=TIMESTAMP}");
    }

    if (record.getServiceEndTime() != null) {
        sql.SET("service_end_time = #{record.serviceEndTime,jdbcType=TIMESTAMP}");
    }

    if (record.getServiceContinentId() != null) {
        sql.SET("service_continent_id = #{record.serviceContinentId,jdbcType=INTEGER}");
    }

    if (record.getServiceContinentName() != null) {
        sql.SET("service_continent_name = #{record.serviceContinentName,jdbcType=VARCHAR}");
    }

    if (record.getServiceCountryId() != null) {
        sql.SET("service_country_id = #{record.serviceCountryId,jdbcType=INTEGER}");
    }

    if (record.getServiceCountryName() != null) {
        sql.SET("service_country_name = #{record.serviceCountryName,jdbcType=VARCHAR}");
    }

    if (record.getServiceCityId() != null) {
        sql.SET("service_city_id = #{record.serviceCityId,jdbcType=INTEGER}");
    }

    if (record.getServiceCitySpell() != null) {
        sql.SET("service_city_spell = #{record.serviceCitySpell,jdbcType=VARCHAR}");
    }

    if (record.getServiceCityEnname() != null) {
        sql.SET("service_city_enname = #{record.serviceCityEnname,jdbcType=VARCHAR}");
    }

    if (record.getServiceCityName() != null) {
        sql.SET("service_city_name = #{record.serviceCityName,jdbcType=VARCHAR}");
    }

    if (record.getServiceAreaCode() != null) {
        sql.SET("service_area_code = #{record.serviceAreaCode,jdbcType=VARCHAR}");
    }

    if (record.getServiceAddressTel() != null) {
        sql.SET("service_address_tel = #{record.serviceAddressTel,jdbcType=VARCHAR}");
    }

    if (record.getServiceDailyType() != null) {
        sql.SET("service_daily_type = #{record.serviceDailyType,jdbcType=SMALLINT}");
    }

    if (record.getServiceLocalDays() != null) {
        sql.SET("service_local_days = #{record.serviceLocalDays,jdbcType=SMALLINT}");
    }

    if (record.getServiceNonlocalDays() != null) {
        sql.SET("service_nonlocal_days = #{record.serviceNonlocalDays,jdbcType=SMALLINT}");
    }

    if (record.getTotalDays() != null) {
        sql.SET("total_days = #{record.totalDays,jdbcType=TINYINT}");
    }

    if (record.getServicePassCity() != null) {
        sql.SET("service_pass_city = #{record.servicePassCity,jdbcType=VARCHAR}");
    }

    if (record.getServiceEndCityid() != null) {
        sql.SET("service_end_cityid = #{record.serviceEndCityid,jdbcType=INTEGER}");
    }

    if (record.getServiceEndCityname() != null) {
        sql.SET("service_end_cityname = #{record.serviceEndCityname,jdbcType=VARCHAR}");
    }

    if (record.getExpectedCompTime() != null) {
        sql.SET("expected_comp_time = #{record.expectedCompTime,jdbcType=INTEGER}");
    }

    if (record.getStartAddress() != null) {
        sql.SET("start_address = #{record.startAddress,jdbcType=VARCHAR}");
    }

    if (record.getStartAddressDetail() != null) {
        sql.SET("start_address_detail = #{record.startAddressDetail,jdbcType=VARCHAR}");
    }

    if (record.getStartAddressPoi() != null) {
        sql.SET("start_address_poi = #{record.startAddressPoi,jdbcType=VARCHAR}");
    }

    if (record.getDestAddress() != null) {
        sql.SET("dest_address = #{record.destAddress,jdbcType=VARCHAR}");
    }

    if (record.getDestAddressDetail() != null) {
        sql.SET("dest_address_detail = #{record.destAddressDetail,jdbcType=VARCHAR}");
    }

    if (record.getDestAddressPoi() != null) {
        sql.SET("dest_address_poi = #{record.destAddressPoi,jdbcType=VARCHAR}");
    }

    if (record.getDistance() != null) {
        sql.SET("distance = #{record.distance,jdbcType=DOUBLE}");
    }

    if (record.getCarId() != null) {
        sql.SET("car_id = #{record.carId,jdbcType=VARCHAR}");
    }

    if (record.getCarLicenseNum() != null) {
        sql.SET("car_license_num = #{record.carLicenseNum,jdbcType=VARCHAR}");
    }

    if (record.getCarTypeId() != null) {
        sql.SET("car_type_id = #{record.carTypeId,jdbcType=INTEGER}");
    }

    if (record.getCarSeatNum() != null) {
        sql.SET("car_seat_num = #{record.carSeatNum,jdbcType=TINYINT}");
    }

    if (record.getCarName() != null) {
        sql.SET("car_name = #{record.carName,jdbcType=VARCHAR}");
    }

    if (record.getCarDesc() != null) {
        sql.SET("car_desc = #{record.carDesc,jdbcType=VARCHAR}");
    }

    if (record.getCoupId() != null) {
        sql.SET("coup_id = #{record.coupId,jdbcType=VARCHAR}");
    }

    if (record.getCoupType() != null) {
        sql.SET("coup_type = #{record.coupType,jdbcType=INTEGER}");
    }

    if (record.getCoupLabel() != null) {
        sql.SET("coup_label = #{record.coupLabel,jdbcType=VARCHAR}");
    }

    if (record.getCoupPriceInfo() != null) {
        sql.SET("coup_price_info = #{record.coupPriceInfo,jdbcType=VARCHAR}");
    }

    if (record.getPriceMark() != null) {
        sql.SET("price_mark = #{record.priceMark,jdbcType=VARCHAR}");
    }

    if (record.getPriceBase() != null) {
        sql.SET("price_base = #{record.priceBase,jdbcType=DOUBLE}");
    }

    if (record.getPriceGuide() != null) {
        sql.SET("price_guide = #{record.priceGuide,jdbcType=DOUBLE}");
    }

    if (record.getPriceTicket() != null) {
        sql.SET("price_ticket = #{record.priceTicket,jdbcType=DOUBLE}");
    }

    if (record.getPriceChannel() != null) {
        sql.SET("price_channel = #{record.priceChannel,jdbcType=DOUBLE}");
    }

    if (record.getPriceGuideBase() != null) {
        sql.SET("price_guide_base = #{record.priceGuideBase,jdbcType=DOUBLE}");
    }

    if (record.getPriceReward() != null) {
        sql.SET("price_reward = #{record.priceReward,jdbcType=DOUBLE}");
    }

    if (record.getUserId() != null) {
        sql.SET("user_id = #{record.userId,jdbcType=VARCHAR}");
    }

    if (record.getUserAccount() != null) {
        sql.SET("user_account = #{record.userAccount,jdbcType=VARCHAR}");
    }

    if (record.getUserName() != null) {
        sql.SET("user_name = #{record.userName,jdbcType=VARCHAR}");
    }

    if (record.getUserAreaCode1() != null) {
        sql.SET("user_area_code1 = #{record.userAreaCode1,jdbcType=VARCHAR}");
    }

    if (record.getUserMobile1() != null) {
        sql.SET("user_mobile1 = #{record.userMobile1,jdbcType=VARCHAR}");
    }

    if (record.getUserAreaCode2() != null) {
        sql.SET("user_area_code2 = #{record.userAreaCode2,jdbcType=VARCHAR}");
    }

    if (record.getUserMobile2() != null) {
        sql.SET("user_mobile2 = #{record.userMobile2,jdbcType=VARCHAR}");
    }

    if (record.getUserAreaCode3() != null) {
        sql.SET("user_area_code3 = #{record.userAreaCode3,jdbcType=VARCHAR}");
    }

    if (record.getUserMobile3() != null) {
        sql.SET("user_mobile3 = #{record.userMobile3,jdbcType=VARCHAR}");
    }

    if (record.getUserEmail() != null) {
        sql.SET("user_email = #{record.userEmail,jdbcType=VARCHAR}");
    }

    if (record.getUserCommentStatus() != null) {
        sql.SET("user_comment_status = #{record.userCommentStatus,jdbcType=TINYINT}");
    }

    if (record.getUserRemark() != null) {
        sql.SET("user_remark = #{record.userRemark,jdbcType=VARCHAR}");
    }

    if (record.getSystemCommentStatus() != null) {
        sql.SET("system_comment_status = #{record.systemCommentStatus,jdbcType=INTEGER}");
    }

    if (record.getGuideAssignTime() != null) {
        sql.SET("guide_assign_time = #{record.guideAssignTime,jdbcType=TIMESTAMP}");
    }

    if (record.getGuidePreId() != null) {
        sql.SET("guide_pre_id = #{record.guidePreId,jdbcType=VARCHAR}");
    }

    if (record.getGuideId() != null) {
        sql.SET("guide_id = #{record.guideId,jdbcType=VARCHAR}");
    }

    if (record.getGuideNo() != null) {
        sql.SET("guide_no = #{record.guideNo,jdbcType=VARCHAR}");
    }

    if (record.getGuideName() != null) {
        sql.SET("guide_name = #{record.guideName,jdbcType=VARCHAR}");
    }

    if (record.getGuideAreaCode() != null) {
        sql.SET("guide_area_code = #{record.guideAreaCode,jdbcType=VARCHAR}");
    }

    if (record.getGuideMobile() != null) {
        sql.SET("guide_mobile = #{record.guideMobile,jdbcType=VARCHAR}");
    }

    if (record.getGuideCommentStatus() != null) {
        sql.SET("guide_comment_status = #{record.guideCommentStatus,jdbcType=SMALLINT}");
    }

    if (record.getGuideAgencyType() != null) {
        sql.SET("guide_agency_type = #{record.guideAgencyType,jdbcType=INTEGER}");
    }

    if (record.getGuideAgencyBossId() != null) {
        sql.SET("guide_agency_boss_id = #{record.guideAgencyBossId,jdbcType=VARCHAR}");
    }

    if (record.getGuideAgencyBossName() != null) {
        sql.SET("guide_agency_boss_name = #{record.guideAgencyBossName,jdbcType=VARCHAR}");
    }

    if (record.getGuideAccountNo() != null) {
        sql.SET("guide_account_no = #{record.guideAccountNo,jdbcType=VARCHAR}");
    }

    if (record.getGuideAgencyId() != null) {
        sql.SET("guide_agency_id = #{record.guideAgencyId,jdbcType=VARCHAR}");
    }

    if (record.getGuideAgencyName() != null) {
        sql.SET("guide_agency_name = #{record.guideAgencyName,jdbcType=VARCHAR}");
    }

    if (record.getAgentId() != null) {
        sql.SET("agent_id = #{record.agentId,jdbcType=VARCHAR}");
    }

    if (record.getAgentName() != null) {
        sql.SET("agent_name = #{record.agentName,jdbcType=VARCHAR}");
    }

    if (record.getAgentOpid() != null) {
        sql.SET("agent_opid = #{record.agentOpid,jdbcType=VARCHAR}");
    }

    if (record.getAgentOpname() != null) {
        sql.SET("agent_opname = #{record.agentOpname,jdbcType=VARCHAR}");
    }

    if (record.getAdminId() != null) {
        sql.SET("admin_id = #{record.adminId,jdbcType=INTEGER}");
    }

    if (record.getImToken() != null) {
        sql.SET("im_token = #{record.imToken,jdbcType=VARCHAR}");
    }

    if (record.getDeliverStatus() != null) {
        sql.SET("deliver_status = #{record.deliverStatus,jdbcType=INTEGER}");
    }

    if (record.getDeliverType() != null) {
        sql.SET("deliver_type = #{record.deliverType,jdbcType=INTEGER}");
    }

    if (record.getDeliverAcpTime() != null) {
        sql.SET("deliver_acp_time = #{record.deliverAcpTime,jdbcType=TIMESTAMP}");
    }

    if (record.getUrgentFlag() != null) {
        sql.SET("urgent_flag = #{record.urgentFlag,jdbcType=INTEGER}");
    }

    if (record.getUrgentHour() != null) {
        sql.SET("urgent_hour = #{record.urgentHour,jdbcType=INTEGER}");
    }

    if (record.getSerialFlag() != null) {
        sql.SET("serial_flag = #{record.serialFlag,jdbcType=INTEGER}");
    }

    if (record.getSerialOrderNo() != null) {
        sql.SET("serial_order_no = #{record.serialOrderNo,jdbcType=VARCHAR}");
    }

    if (record.getCargroupFlag() != null) {
        sql.SET("cargroup_flag = #{record.cargroupFlag,jdbcType=INTEGER}");
    }

    if (record.getCargroupId() != null) {
        sql.SET("cargroup_id = #{record.cargroupId,jdbcType=VARCHAR}");
    }

    if (record.getFlightNo() != null) {
        sql.SET("flight_no = #{record.flightNo,jdbcType=VARCHAR}");
    }

    if (record.getFlightAirportCode() != null) {
        sql.SET("flight_airport_code = #{record.flightAirportCode,jdbcType=VARCHAR}");
    }

    if (record.getFlightAirportName() != null) {
        sql.SET("flight_airport_name = #{record.flightAirportName,jdbcType=VARCHAR}");
    }

    if (record.getFlightFlyTime() != null) {
        sql.SET("flight_fly_time = #{record.flightFlyTime,jdbcType=TIMESTAMP}");
    }

    if (record.getFlightArriveTime() != null) {
        sql.SET("flight_arrive_time = #{record.flightArriveTime,jdbcType=TIMESTAMP}");
    }

    if (record.getFlightIsCustom() != null) {
        sql.SET("flight_is_custom = #{record.flightIsCustom,jdbcType=INTEGER}");
    }

    if (record.getFlightAirportBuiding() != null) {
        sql.SET("flight_airport_buiding = #{record.flightAirportBuiding,jdbcType=VARCHAR}");
    }

    if (record.getFlightRegisterId() != null) {
        sql.SET("flight_register_id = #{record.flightRegisterId,jdbcType=VARCHAR}");
    }

    if (record.getFlightBrandSign() != null) {
        sql.SET("flight_brand_sign = #{record.flightBrandSign,jdbcType=VARCHAR}");
    }

    if (record.getFlightDestCode() != null) {
        sql.SET("flight_dest_code = #{record.flightDestCode,jdbcType=VARCHAR}");
    }

    if (record.getFlightDestName() != null) {
        sql.SET("flight_dest_name = #{record.flightDestName,jdbcType=VARCHAR}");
    }

    if (record.getFlightDestBuilding() != null) {
        sql.SET("flight_dest_building = #{record.flightDestBuilding,jdbcType=VARCHAR}");
    }

    if (record.getLineSubject() != null) {
        sql.SET("line_subject = #{record.lineSubject,jdbcType=VARCHAR}");
    }

    if (record.getLineDescription() != null) {
        sql.SET("line_description = #{record.lineDescription,jdbcType=VARCHAR}");
    }

    if (record.getAdultNum() != null) {
        sql.SET("adult_num = #{record.adultNum,jdbcType=INTEGER}");
    }

    if (record.getChildNum() != null) {
        sql.SET("child_num = #{record.childNum,jdbcType=INTEGER}");
    }

    if (record.getChildSeat() != null) {
        sql.SET("child_seat = #{record.childSeat,jdbcType=VARCHAR}");
    }

    if (record.getIsArrivalVisa() != null) {
        sql.SET("is_arrival_visa = #{record.isArrivalVisa,jdbcType=SMALLINT}");
    }

    if (record.getCheckInPrice() != null) {
        sql.SET("check_in_price = #{record.checkInPrice,jdbcType=DOUBLE}");
    }

    if (record.getCancelTime() != null) {
        sql.SET("cancel_time = #{record.cancelTime,jdbcType=TIMESTAMP}");
    }

    if (record.getCompleteTime() != null) {
        sql.SET("complete_time = #{record.completeTime,jdbcType=TIMESTAMP}");
    }

    if (record.getIsReadable() != null) {
        sql.SET("is_readable = #{record.isReadable,jdbcType=INTEGER}");
    }

    if (record.getIsNewTrack() != null) {
        sql.SET("is_new_track = #{record.isNewTrack,jdbcType=INTEGER}");
    }

    if (record.getCreateTime() != null) {
        sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
    }

    if (record.getUpdateTime() != null) {
        sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
    }

    if (record.getJourneyComment() != null) {
        sql.SET("journey_comment = #{record.journeyComment,jdbcType=LONGVARCHAR}");
    }

    applyWhere(sql, example, true);
    return sql.toString();
}

From source file:com.hbc.api.trade.order.mapping.gen.OrderBeanSqlProvider.java

/**
 * This method was generated by MyBatis Generator.
 * This method corresponds to the database table `trade_order`
 *
 * @mbggenerated//from  www. j  ava  2  s .c o m
 */
public String updateByExampleWithBLOBs(Map<String, Object> parameter) {
    SQL sql = new SQL();
    sql.UPDATE("`trade_order`");

    sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}");
    sql.SET("third_trade_no = #{record.thirdTradeNo,jdbcType=VARCHAR}");
    sql.SET("order_status = #{record.orderStatus,jdbcType=INTEGER}");
    sql.SET("order_status_name = #{record.orderStatusName,jdbcType=VARCHAR}");
    sql.SET("order_type = #{record.orderType,jdbcType=INTEGER}");
    sql.SET("order_goods_type = #{record.orderGoodsType,jdbcType=INTEGER}");
    sql.SET("good_no = #{record.goodNo,jdbcType=VARCHAR}");
    sql.SET("order_source = #{record.orderSource,jdbcType=INTEGER}");
    sql.SET("order_channel = #{record.orderChannel,jdbcType=INTEGER}");
    sql.SET("service_time = #{record.serviceTime,jdbcType=TIMESTAMP}");
    sql.SET("service_end_time = #{record.serviceEndTime,jdbcType=TIMESTAMP}");
    sql.SET("service_continent_id = #{record.serviceContinentId,jdbcType=INTEGER}");
    sql.SET("service_continent_name = #{record.serviceContinentName,jdbcType=VARCHAR}");
    sql.SET("service_country_id = #{record.serviceCountryId,jdbcType=INTEGER}");
    sql.SET("service_country_name = #{record.serviceCountryName,jdbcType=VARCHAR}");
    sql.SET("service_city_id = #{record.serviceCityId,jdbcType=INTEGER}");
    sql.SET("service_city_spell = #{record.serviceCitySpell,jdbcType=VARCHAR}");
    sql.SET("service_city_enname = #{record.serviceCityEnname,jdbcType=VARCHAR}");
    sql.SET("service_city_name = #{record.serviceCityName,jdbcType=VARCHAR}");
    sql.SET("service_area_code = #{record.serviceAreaCode,jdbcType=VARCHAR}");
    sql.SET("service_address_tel = #{record.serviceAddressTel,jdbcType=VARCHAR}");
    sql.SET("service_daily_type = #{record.serviceDailyType,jdbcType=SMALLINT}");
    sql.SET("service_local_days = #{record.serviceLocalDays,jdbcType=SMALLINT}");
    sql.SET("service_nonlocal_days = #{record.serviceNonlocalDays,jdbcType=SMALLINT}");
    sql.SET("total_days = #{record.totalDays,jdbcType=TINYINT}");
    sql.SET("service_pass_city = #{record.servicePassCity,jdbcType=VARCHAR}");
    sql.SET("service_end_cityid = #{record.serviceEndCityid,jdbcType=INTEGER}");
    sql.SET("service_end_cityname = #{record.serviceEndCityname,jdbcType=VARCHAR}");
    sql.SET("expected_comp_time = #{record.expectedCompTime,jdbcType=INTEGER}");
    sql.SET("start_address = #{record.startAddress,jdbcType=VARCHAR}");
    sql.SET("start_address_detail = #{record.startAddressDetail,jdbcType=VARCHAR}");
    sql.SET("start_address_poi = #{record.startAddressPoi,jdbcType=VARCHAR}");
    sql.SET("dest_address = #{record.destAddress,jdbcType=VARCHAR}");
    sql.SET("dest_address_detail = #{record.destAddressDetail,jdbcType=VARCHAR}");
    sql.SET("dest_address_poi = #{record.destAddressPoi,jdbcType=VARCHAR}");
    sql.SET("distance = #{record.distance,jdbcType=DOUBLE}");
    sql.SET("car_id = #{record.carId,jdbcType=VARCHAR}");
    sql.SET("car_license_num = #{record.carLicenseNum,jdbcType=VARCHAR}");
    sql.SET("car_type_id = #{record.carTypeId,jdbcType=INTEGER}");
    sql.SET("car_seat_num = #{record.carSeatNum,jdbcType=TINYINT}");
    sql.SET("car_name = #{record.carName,jdbcType=VARCHAR}");
    sql.SET("car_desc = #{record.carDesc,jdbcType=VARCHAR}");
    sql.SET("coup_id = #{record.coupId,jdbcType=VARCHAR}");
    sql.SET("coup_type = #{record.coupType,jdbcType=INTEGER}");
    sql.SET("coup_label = #{record.coupLabel,jdbcType=VARCHAR}");
    sql.SET("coup_price_info = #{record.coupPriceInfo,jdbcType=VARCHAR}");
    sql.SET("price_mark = #{record.priceMark,jdbcType=VARCHAR}");
    sql.SET("price_base = #{record.priceBase,jdbcType=DOUBLE}");
    sql.SET("price_guide = #{record.priceGuide,jdbcType=DOUBLE}");
    sql.SET("price_ticket = #{record.priceTicket,jdbcType=DOUBLE}");
    sql.SET("price_channel = #{record.priceChannel,jdbcType=DOUBLE}");
    sql.SET("price_guide_base = #{record.priceGuideBase,jdbcType=DOUBLE}");
    sql.SET("price_reward = #{record.priceReward,jdbcType=DOUBLE}");
    sql.SET("user_id = #{record.userId,jdbcType=VARCHAR}");
    sql.SET("user_account = #{record.userAccount,jdbcType=VARCHAR}");
    sql.SET("user_name = #{record.userName,jdbcType=VARCHAR}");
    sql.SET("user_area_code1 = #{record.userAreaCode1,jdbcType=VARCHAR}");
    sql.SET("user_mobile1 = #{record.userMobile1,jdbcType=VARCHAR}");
    sql.SET("user_area_code2 = #{record.userAreaCode2,jdbcType=VARCHAR}");
    sql.SET("user_mobile2 = #{record.userMobile2,jdbcType=VARCHAR}");
    sql.SET("user_area_code3 = #{record.userAreaCode3,jdbcType=VARCHAR}");
    sql.SET("user_mobile3 = #{record.userMobile3,jdbcType=VARCHAR}");
    sql.SET("user_email = #{record.userEmail,jdbcType=VARCHAR}");
    sql.SET("user_comment_status = #{record.userCommentStatus,jdbcType=TINYINT}");
    sql.SET("user_remark = #{record.userRemark,jdbcType=VARCHAR}");
    sql.SET("system_comment_status = #{record.systemCommentStatus,jdbcType=INTEGER}");
    sql.SET("guide_assign_time = #{record.guideAssignTime,jdbcType=TIMESTAMP}");
    sql.SET("guide_pre_id = #{record.guidePreId,jdbcType=VARCHAR}");
    sql.SET("guide_id = #{record.guideId,jdbcType=VARCHAR}");
    sql.SET("guide_no = #{record.guideNo,jdbcType=VARCHAR}");
    sql.SET("guide_name = #{record.guideName,jdbcType=VARCHAR}");
    sql.SET("guide_area_code = #{record.guideAreaCode,jdbcType=VARCHAR}");
    sql.SET("guide_mobile = #{record.guideMobile,jdbcType=VARCHAR}");
    sql.SET("guide_comment_status = #{record.guideCommentStatus,jdbcType=SMALLINT}");
    sql.SET("guide_agency_type = #{record.guideAgencyType,jdbcType=INTEGER}");
    sql.SET("guide_agency_boss_id = #{record.guideAgencyBossId,jdbcType=VARCHAR}");
    sql.SET("guide_agency_boss_name = #{record.guideAgencyBossName,jdbcType=VARCHAR}");
    sql.SET("guide_account_no = #{record.guideAccountNo,jdbcType=VARCHAR}");
    sql.SET("guide_agency_id = #{record.guideAgencyId,jdbcType=VARCHAR}");
    sql.SET("guide_agency_name = #{record.guideAgencyName,jdbcType=VARCHAR}");
    sql.SET("agent_id = #{record.agentId,jdbcType=VARCHAR}");
    sql.SET("agent_name = #{record.agentName,jdbcType=VARCHAR}");
    sql.SET("agent_opid = #{record.agentOpid,jdbcType=VARCHAR}");
    sql.SET("agent_opname = #{record.agentOpname,jdbcType=VARCHAR}");
    sql.SET("admin_id = #{record.adminId,jdbcType=INTEGER}");
    sql.SET("im_token = #{record.imToken,jdbcType=VARCHAR}");
    sql.SET("deliver_status = #{record.deliverStatus,jdbcType=INTEGER}");
    sql.SET("deliver_type = #{record.deliverType,jdbcType=INTEGER}");
    sql.SET("deliver_acp_time = #{record.deliverAcpTime,jdbcType=TIMESTAMP}");
    sql.SET("urgent_flag = #{record.urgentFlag,jdbcType=INTEGER}");
    sql.SET("urgent_hour = #{record.urgentHour,jdbcType=INTEGER}");
    sql.SET("serial_flag = #{record.serialFlag,jdbcType=INTEGER}");
    sql.SET("serial_order_no = #{record.serialOrderNo,jdbcType=VARCHAR}");
    sql.SET("cargroup_flag = #{record.cargroupFlag,jdbcType=INTEGER}");
    sql.SET("cargroup_id = #{record.cargroupId,jdbcType=VARCHAR}");
    sql.SET("flight_no = #{record.flightNo,jdbcType=VARCHAR}");
    sql.SET("flight_airport_code = #{record.flightAirportCode,jdbcType=VARCHAR}");
    sql.SET("flight_airport_name = #{record.flightAirportName,jdbcType=VARCHAR}");
    sql.SET("flight_fly_time = #{record.flightFlyTime,jdbcType=TIMESTAMP}");
    sql.SET("flight_arrive_time = #{record.flightArriveTime,jdbcType=TIMESTAMP}");
    sql.SET("flight_is_custom = #{record.flightIsCustom,jdbcType=INTEGER}");
    sql.SET("flight_airport_buiding = #{record.flightAirportBuiding,jdbcType=VARCHAR}");
    sql.SET("flight_register_id = #{record.flightRegisterId,jdbcType=VARCHAR}");
    sql.SET("flight_brand_sign = #{record.flightBrandSign,jdbcType=VARCHAR}");
    sql.SET("flight_dest_code = #{record.flightDestCode,jdbcType=VARCHAR}");
    sql.SET("flight_dest_name = #{record.flightDestName,jdbcType=VARCHAR}");
    sql.SET("flight_dest_building = #{record.flightDestBuilding,jdbcType=VARCHAR}");
    sql.SET("line_subject = #{record.lineSubject,jdbcType=VARCHAR}");
    sql.SET("line_description = #{record.lineDescription,jdbcType=VARCHAR}");
    sql.SET("adult_num = #{record.adultNum,jdbcType=INTEGER}");
    sql.SET("child_num = #{record.childNum,jdbcType=INTEGER}");
    sql.SET("child_seat = #{record.childSeat,jdbcType=VARCHAR}");
    sql.SET("is_arrival_visa = #{record.isArrivalVisa,jdbcType=SMALLINT}");
    sql.SET("check_in_price = #{record.checkInPrice,jdbcType=DOUBLE}");
    sql.SET("cancel_time = #{record.cancelTime,jdbcType=TIMESTAMP}");
    sql.SET("complete_time = #{record.completeTime,jdbcType=TIMESTAMP}");
    sql.SET("is_readable = #{record.isReadable,jdbcType=INTEGER}");
    sql.SET("is_new_track = #{record.isNewTrack,jdbcType=INTEGER}");
    sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
    sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
    sql.SET("journey_comment = #{record.journeyComment,jdbcType=LONGVARCHAR}");

    OrderBeanExample example = (OrderBeanExample) parameter.get("example");
    applyWhere(sql, example, true);
    return sql.toString();
}

From source file:com.hbc.api.trade.order.mapping.gen.OrderBeanSqlProvider.java

/**
 * This method was generated by MyBatis Generator.
 * This method corresponds to the database table `trade_order`
 *
 * @mbggenerated/*  w ww  .java  2  s.co m*/
 */
public String updateByExample(Map<String, Object> parameter) {
    SQL sql = new SQL();
    sql.UPDATE("`trade_order`");

    sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}");
    sql.SET("third_trade_no = #{record.thirdTradeNo,jdbcType=VARCHAR}");
    sql.SET("order_status = #{record.orderStatus,jdbcType=INTEGER}");
    sql.SET("order_status_name = #{record.orderStatusName,jdbcType=VARCHAR}");
    sql.SET("order_type = #{record.orderType,jdbcType=INTEGER}");
    sql.SET("order_goods_type = #{record.orderGoodsType,jdbcType=INTEGER}");
    sql.SET("good_no = #{record.goodNo,jdbcType=VARCHAR}");
    sql.SET("order_source = #{record.orderSource,jdbcType=INTEGER}");
    sql.SET("order_channel = #{record.orderChannel,jdbcType=INTEGER}");
    sql.SET("service_time = #{record.serviceTime,jdbcType=TIMESTAMP}");
    sql.SET("service_end_time = #{record.serviceEndTime,jdbcType=TIMESTAMP}");
    sql.SET("service_continent_id = #{record.serviceContinentId,jdbcType=INTEGER}");
    sql.SET("service_continent_name = #{record.serviceContinentName,jdbcType=VARCHAR}");
    sql.SET("service_country_id = #{record.serviceCountryId,jdbcType=INTEGER}");
    sql.SET("service_country_name = #{record.serviceCountryName,jdbcType=VARCHAR}");
    sql.SET("service_city_id = #{record.serviceCityId,jdbcType=INTEGER}");
    sql.SET("service_city_spell = #{record.serviceCitySpell,jdbcType=VARCHAR}");
    sql.SET("service_city_enname = #{record.serviceCityEnname,jdbcType=VARCHAR}");
    sql.SET("service_city_name = #{record.serviceCityName,jdbcType=VARCHAR}");
    sql.SET("service_area_code = #{record.serviceAreaCode,jdbcType=VARCHAR}");
    sql.SET("service_address_tel = #{record.serviceAddressTel,jdbcType=VARCHAR}");
    sql.SET("service_daily_type = #{record.serviceDailyType,jdbcType=SMALLINT}");
    sql.SET("service_local_days = #{record.serviceLocalDays,jdbcType=SMALLINT}");
    sql.SET("service_nonlocal_days = #{record.serviceNonlocalDays,jdbcType=SMALLINT}");
    sql.SET("total_days = #{record.totalDays,jdbcType=TINYINT}");
    sql.SET("service_pass_city = #{record.servicePassCity,jdbcType=VARCHAR}");
    sql.SET("service_end_cityid = #{record.serviceEndCityid,jdbcType=INTEGER}");
    sql.SET("service_end_cityname = #{record.serviceEndCityname,jdbcType=VARCHAR}");
    sql.SET("expected_comp_time = #{record.expectedCompTime,jdbcType=INTEGER}");
    sql.SET("start_address = #{record.startAddress,jdbcType=VARCHAR}");
    sql.SET("start_address_detail = #{record.startAddressDetail,jdbcType=VARCHAR}");
    sql.SET("start_address_poi = #{record.startAddressPoi,jdbcType=VARCHAR}");
    sql.SET("dest_address = #{record.destAddress,jdbcType=VARCHAR}");
    sql.SET("dest_address_detail = #{record.destAddressDetail,jdbcType=VARCHAR}");
    sql.SET("dest_address_poi = #{record.destAddressPoi,jdbcType=VARCHAR}");
    sql.SET("distance = #{record.distance,jdbcType=DOUBLE}");
    sql.SET("car_id = #{record.carId,jdbcType=VARCHAR}");
    sql.SET("car_license_num = #{record.carLicenseNum,jdbcType=VARCHAR}");
    sql.SET("car_type_id = #{record.carTypeId,jdbcType=INTEGER}");
    sql.SET("car_seat_num = #{record.carSeatNum,jdbcType=TINYINT}");
    sql.SET("car_name = #{record.carName,jdbcType=VARCHAR}");
    sql.SET("car_desc = #{record.carDesc,jdbcType=VARCHAR}");
    sql.SET("coup_id = #{record.coupId,jdbcType=VARCHAR}");
    sql.SET("coup_type = #{record.coupType,jdbcType=INTEGER}");
    sql.SET("coup_label = #{record.coupLabel,jdbcType=VARCHAR}");
    sql.SET("coup_price_info = #{record.coupPriceInfo,jdbcType=VARCHAR}");
    sql.SET("price_mark = #{record.priceMark,jdbcType=VARCHAR}");
    sql.SET("price_base = #{record.priceBase,jdbcType=DOUBLE}");
    sql.SET("price_guide = #{record.priceGuide,jdbcType=DOUBLE}");
    sql.SET("price_ticket = #{record.priceTicket,jdbcType=DOUBLE}");
    sql.SET("price_channel = #{record.priceChannel,jdbcType=DOUBLE}");
    sql.SET("price_guide_base = #{record.priceGuideBase,jdbcType=DOUBLE}");
    sql.SET("price_reward = #{record.priceReward,jdbcType=DOUBLE}");
    sql.SET("user_id = #{record.userId,jdbcType=VARCHAR}");
    sql.SET("user_account = #{record.userAccount,jdbcType=VARCHAR}");
    sql.SET("user_name = #{record.userName,jdbcType=VARCHAR}");
    sql.SET("user_area_code1 = #{record.userAreaCode1,jdbcType=VARCHAR}");
    sql.SET("user_mobile1 = #{record.userMobile1,jdbcType=VARCHAR}");
    sql.SET("user_area_code2 = #{record.userAreaCode2,jdbcType=VARCHAR}");
    sql.SET("user_mobile2 = #{record.userMobile2,jdbcType=VARCHAR}");
    sql.SET("user_area_code3 = #{record.userAreaCode3,jdbcType=VARCHAR}");
    sql.SET("user_mobile3 = #{record.userMobile3,jdbcType=VARCHAR}");
    sql.SET("user_email = #{record.userEmail,jdbcType=VARCHAR}");
    sql.SET("user_comment_status = #{record.userCommentStatus,jdbcType=TINYINT}");
    sql.SET("user_remark = #{record.userRemark,jdbcType=VARCHAR}");
    sql.SET("system_comment_status = #{record.systemCommentStatus,jdbcType=INTEGER}");
    sql.SET("guide_assign_time = #{record.guideAssignTime,jdbcType=TIMESTAMP}");
    sql.SET("guide_pre_id = #{record.guidePreId,jdbcType=VARCHAR}");
    sql.SET("guide_id = #{record.guideId,jdbcType=VARCHAR}");
    sql.SET("guide_no = #{record.guideNo,jdbcType=VARCHAR}");
    sql.SET("guide_name = #{record.guideName,jdbcType=VARCHAR}");
    sql.SET("guide_area_code = #{record.guideAreaCode,jdbcType=VARCHAR}");
    sql.SET("guide_mobile = #{record.guideMobile,jdbcType=VARCHAR}");
    sql.SET("guide_comment_status = #{record.guideCommentStatus,jdbcType=SMALLINT}");
    sql.SET("guide_agency_type = #{record.guideAgencyType,jdbcType=INTEGER}");
    sql.SET("guide_agency_boss_id = #{record.guideAgencyBossId,jdbcType=VARCHAR}");
    sql.SET("guide_agency_boss_name = #{record.guideAgencyBossName,jdbcType=VARCHAR}");
    sql.SET("guide_account_no = #{record.guideAccountNo,jdbcType=VARCHAR}");
    sql.SET("guide_agency_id = #{record.guideAgencyId,jdbcType=VARCHAR}");
    sql.SET("guide_agency_name = #{record.guideAgencyName,jdbcType=VARCHAR}");
    sql.SET("agent_id = #{record.agentId,jdbcType=VARCHAR}");
    sql.SET("agent_name = #{record.agentName,jdbcType=VARCHAR}");
    sql.SET("agent_opid = #{record.agentOpid,jdbcType=VARCHAR}");
    sql.SET("agent_opname = #{record.agentOpname,jdbcType=VARCHAR}");
    sql.SET("admin_id = #{record.adminId,jdbcType=INTEGER}");
    sql.SET("im_token = #{record.imToken,jdbcType=VARCHAR}");
    sql.SET("deliver_status = #{record.deliverStatus,jdbcType=INTEGER}");
    sql.SET("deliver_type = #{record.deliverType,jdbcType=INTEGER}");
    sql.SET("deliver_acp_time = #{record.deliverAcpTime,jdbcType=TIMESTAMP}");
    sql.SET("urgent_flag = #{record.urgentFlag,jdbcType=INTEGER}");
    sql.SET("urgent_hour = #{record.urgentHour,jdbcType=INTEGER}");
    sql.SET("serial_flag = #{record.serialFlag,jdbcType=INTEGER}");
    sql.SET("serial_order_no = #{record.serialOrderNo,jdbcType=VARCHAR}");
    sql.SET("cargroup_flag = #{record.cargroupFlag,jdbcType=INTEGER}");
    sql.SET("cargroup_id = #{record.cargroupId,jdbcType=VARCHAR}");
    sql.SET("flight_no = #{record.flightNo,jdbcType=VARCHAR}");
    sql.SET("flight_airport_code = #{record.flightAirportCode,jdbcType=VARCHAR}");
    sql.SET("flight_airport_name = #{record.flightAirportName,jdbcType=VARCHAR}");
    sql.SET("flight_fly_time = #{record.flightFlyTime,jdbcType=TIMESTAMP}");
    sql.SET("flight_arrive_time = #{record.flightArriveTime,jdbcType=TIMESTAMP}");
    sql.SET("flight_is_custom = #{record.flightIsCustom,jdbcType=INTEGER}");
    sql.SET("flight_airport_buiding = #{record.flightAirportBuiding,jdbcType=VARCHAR}");
    sql.SET("flight_register_id = #{record.flightRegisterId,jdbcType=VARCHAR}");
    sql.SET("flight_brand_sign = #{record.flightBrandSign,jdbcType=VARCHAR}");
    sql.SET("flight_dest_code = #{record.flightDestCode,jdbcType=VARCHAR}");
    sql.SET("flight_dest_name = #{record.flightDestName,jdbcType=VARCHAR}");
    sql.SET("flight_dest_building = #{record.flightDestBuilding,jdbcType=VARCHAR}");
    sql.SET("line_subject = #{record.lineSubject,jdbcType=VARCHAR}");
    sql.SET("line_description = #{record.lineDescription,jdbcType=VARCHAR}");
    sql.SET("adult_num = #{record.adultNum,jdbcType=INTEGER}");
    sql.SET("child_num = #{record.childNum,jdbcType=INTEGER}");
    sql.SET("child_seat = #{record.childSeat,jdbcType=VARCHAR}");
    sql.SET("is_arrival_visa = #{record.isArrivalVisa,jdbcType=SMALLINT}");
    sql.SET("check_in_price = #{record.checkInPrice,jdbcType=DOUBLE}");
    sql.SET("cancel_time = #{record.cancelTime,jdbcType=TIMESTAMP}");
    sql.SET("complete_time = #{record.completeTime,jdbcType=TIMESTAMP}");
    sql.SET("is_readable = #{record.isReadable,jdbcType=INTEGER}");
    sql.SET("is_new_track = #{record.isNewTrack,jdbcType=INTEGER}");
    sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
    sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");

    OrderBeanExample example = (OrderBeanExample) parameter.get("example");
    applyWhere(sql, example, true);
    return sql.toString();
}

From source file:com.hbc.api.trade.order.mapping.gen.OrderBeanSqlProvider.java

/**
 * This method was generated by MyBatis Generator.
 * This method corresponds to the database table `trade_order`
 *
 * @mbggenerated/* www  . j  a v  a 2  s  .c  om*/
 */
public String updateByPrimaryKeySelective(OrderBean record) {
    SQL sql = new SQL();
    sql.UPDATE("`trade_order`");

    if (record.getThirdTradeNo() != null) {
        sql.SET("third_trade_no = #{thirdTradeNo,jdbcType=VARCHAR}");
    }

    if (record.getOrderStatus() != null) {
        sql.SET("order_status = #{orderStatus,jdbcType=INTEGER}");
    }

    if (record.getOrderStatusName() != null) {
        sql.SET("order_status_name = #{orderStatusName,jdbcType=VARCHAR}");
    }

    if (record.getOrderType() != null) {
        sql.SET("order_type = #{orderType,jdbcType=INTEGER}");
    }

    if (record.getOrderGoodsType() != null) {
        sql.SET("order_goods_type = #{orderGoodsType,jdbcType=INTEGER}");
    }

    if (record.getGoodNo() != null) {
        sql.SET("good_no = #{goodNo,jdbcType=VARCHAR}");
    }

    if (record.getOrderSource() != null) {
        sql.SET("order_source = #{orderSource,jdbcType=INTEGER}");
    }

    if (record.getOrderChannel() != null) {
        sql.SET("order_channel = #{orderChannel,jdbcType=INTEGER}");
    }

    if (record.getServiceTime() != null) {
        sql.SET("service_time = #{serviceTime,jdbcType=TIMESTAMP}");
    }

    if (record.getServiceEndTime() != null) {
        sql.SET("service_end_time = #{serviceEndTime,jdbcType=TIMESTAMP}");
    }

    if (record.getServiceContinentId() != null) {
        sql.SET("service_continent_id = #{serviceContinentId,jdbcType=INTEGER}");
    }

    if (record.getServiceContinentName() != null) {
        sql.SET("service_continent_name = #{serviceContinentName,jdbcType=VARCHAR}");
    }

    if (record.getServiceCountryId() != null) {
        sql.SET("service_country_id = #{serviceCountryId,jdbcType=INTEGER}");
    }

    if (record.getServiceCountryName() != null) {
        sql.SET("service_country_name = #{serviceCountryName,jdbcType=VARCHAR}");
    }

    if (record.getServiceCityId() != null) {
        sql.SET("service_city_id = #{serviceCityId,jdbcType=INTEGER}");
    }

    if (record.getServiceCitySpell() != null) {
        sql.SET("service_city_spell = #{serviceCitySpell,jdbcType=VARCHAR}");
    }

    if (record.getServiceCityEnname() != null) {
        sql.SET("service_city_enname = #{serviceCityEnname,jdbcType=VARCHAR}");
    }

    if (record.getServiceCityName() != null) {
        sql.SET("service_city_name = #{serviceCityName,jdbcType=VARCHAR}");
    }

    if (record.getServiceAreaCode() != null) {
        sql.SET("service_area_code = #{serviceAreaCode,jdbcType=VARCHAR}");
    }

    if (record.getServiceAddressTel() != null) {
        sql.SET("service_address_tel = #{serviceAddressTel,jdbcType=VARCHAR}");
    }

    if (record.getServiceDailyType() != null) {
        sql.SET("service_daily_type = #{serviceDailyType,jdbcType=SMALLINT}");
    }

    if (record.getServiceLocalDays() != null) {
        sql.SET("service_local_days = #{serviceLocalDays,jdbcType=SMALLINT}");
    }

    if (record.getServiceNonlocalDays() != null) {
        sql.SET("service_nonlocal_days = #{serviceNonlocalDays,jdbcType=SMALLINT}");
    }

    if (record.getTotalDays() != null) {
        sql.SET("total_days = #{totalDays,jdbcType=TINYINT}");
    }

    if (record.getServicePassCity() != null) {
        sql.SET("service_pass_city = #{servicePassCity,jdbcType=VARCHAR}");
    }

    if (record.getServiceEndCityid() != null) {
        sql.SET("service_end_cityid = #{serviceEndCityid,jdbcType=INTEGER}");
    }

    if (record.getServiceEndCityname() != null) {
        sql.SET("service_end_cityname = #{serviceEndCityname,jdbcType=VARCHAR}");
    }

    if (record.getExpectedCompTime() != null) {
        sql.SET("expected_comp_time = #{expectedCompTime,jdbcType=INTEGER}");
    }

    if (record.getStartAddress() != null) {
        sql.SET("start_address = #{startAddress,jdbcType=VARCHAR}");
    }

    if (record.getStartAddressDetail() != null) {
        sql.SET("start_address_detail = #{startAddressDetail,jdbcType=VARCHAR}");
    }

    if (record.getStartAddressPoi() != null) {
        sql.SET("start_address_poi = #{startAddressPoi,jdbcType=VARCHAR}");
    }

    if (record.getDestAddress() != null) {
        sql.SET("dest_address = #{destAddress,jdbcType=VARCHAR}");
    }

    if (record.getDestAddressDetail() != null) {
        sql.SET("dest_address_detail = #{destAddressDetail,jdbcType=VARCHAR}");
    }

    if (record.getDestAddressPoi() != null) {
        sql.SET("dest_address_poi = #{destAddressPoi,jdbcType=VARCHAR}");
    }

    if (record.getDistance() != null) {
        sql.SET("distance = #{distance,jdbcType=DOUBLE}");
    }

    if (record.getCarId() != null) {
        sql.SET("car_id = #{carId,jdbcType=VARCHAR}");
    }

    if (record.getCarLicenseNum() != null) {
        sql.SET("car_license_num = #{carLicenseNum,jdbcType=VARCHAR}");
    }

    if (record.getCarTypeId() != null) {
        sql.SET("car_type_id = #{carTypeId,jdbcType=INTEGER}");
    }

    if (record.getCarSeatNum() != null) {
        sql.SET("car_seat_num = #{carSeatNum,jdbcType=TINYINT}");
    }

    if (record.getCarName() != null) {
        sql.SET("car_name = #{carName,jdbcType=VARCHAR}");
    }

    if (record.getCarDesc() != null) {
        sql.SET("car_desc = #{carDesc,jdbcType=VARCHAR}");
    }

    if (record.getCoupId() != null) {
        sql.SET("coup_id = #{coupId,jdbcType=VARCHAR}");
    }

    if (record.getCoupType() != null) {
        sql.SET("coup_type = #{coupType,jdbcType=INTEGER}");
    }

    if (record.getCoupLabel() != null) {
        sql.SET("coup_label = #{coupLabel,jdbcType=VARCHAR}");
    }

    if (record.getCoupPriceInfo() != null) {
        sql.SET("coup_price_info = #{coupPriceInfo,jdbcType=VARCHAR}");
    }

    if (record.getPriceMark() != null) {
        sql.SET("price_mark = #{priceMark,jdbcType=VARCHAR}");
    }

    if (record.getPriceBase() != null) {
        sql.SET("price_base = #{priceBase,jdbcType=DOUBLE}");
    }

    if (record.getPriceGuide() != null) {
        sql.SET("price_guide = #{priceGuide,jdbcType=DOUBLE}");
    }

    if (record.getPriceTicket() != null) {
        sql.SET("price_ticket = #{priceTicket,jdbcType=DOUBLE}");
    }

    if (record.getPriceChannel() != null) {
        sql.SET("price_channel = #{priceChannel,jdbcType=DOUBLE}");
    }

    if (record.getPriceGuideBase() != null) {
        sql.SET("price_guide_base = #{priceGuideBase,jdbcType=DOUBLE}");
    }

    if (record.getPriceReward() != null) {
        sql.SET("price_reward = #{priceReward,jdbcType=DOUBLE}");
    }

    if (record.getUserId() != null) {
        sql.SET("user_id = #{userId,jdbcType=VARCHAR}");
    }

    if (record.getUserAccount() != null) {
        sql.SET("user_account = #{userAccount,jdbcType=VARCHAR}");
    }

    if (record.getUserName() != null) {
        sql.SET("user_name = #{userName,jdbcType=VARCHAR}");
    }

    if (record.getUserAreaCode1() != null) {
        sql.SET("user_area_code1 = #{userAreaCode1,jdbcType=VARCHAR}");
    }

    if (record.getUserMobile1() != null) {
        sql.SET("user_mobile1 = #{userMobile1,jdbcType=VARCHAR}");
    }

    if (record.getUserAreaCode2() != null) {
        sql.SET("user_area_code2 = #{userAreaCode2,jdbcType=VARCHAR}");
    }

    if (record.getUserMobile2() != null) {
        sql.SET("user_mobile2 = #{userMobile2,jdbcType=VARCHAR}");
    }

    if (record.getUserAreaCode3() != null) {
        sql.SET("user_area_code3 = #{userAreaCode3,jdbcType=VARCHAR}");
    }

    if (record.getUserMobile3() != null) {
        sql.SET("user_mobile3 = #{userMobile3,jdbcType=VARCHAR}");
    }

    if (record.getUserEmail() != null) {
        sql.SET("user_email = #{userEmail,jdbcType=VARCHAR}");
    }

    if (record.getUserCommentStatus() != null) {
        sql.SET("user_comment_status = #{userCommentStatus,jdbcType=TINYINT}");
    }

    if (record.getUserRemark() != null) {
        sql.SET("user_remark = #{userRemark,jdbcType=VARCHAR}");
    }

    if (record.getSystemCommentStatus() != null) {
        sql.SET("system_comment_status = #{systemCommentStatus,jdbcType=INTEGER}");
    }

    if (record.getGuideAssignTime() != null) {
        sql.SET("guide_assign_time = #{guideAssignTime,jdbcType=TIMESTAMP}");
    }

    if (record.getGuidePreId() != null) {
        sql.SET("guide_pre_id = #{guidePreId,jdbcType=VARCHAR}");
    }

    if (record.getGuideId() != null) {
        sql.SET("guide_id = #{guideId,jdbcType=VARCHAR}");
    }

    if (record.getGuideNo() != null) {
        sql.SET("guide_no = #{guideNo,jdbcType=VARCHAR}");
    }

    if (record.getGuideName() != null) {
        sql.SET("guide_name = #{guideName,jdbcType=VARCHAR}");
    }

    if (record.getGuideAreaCode() != null) {
        sql.SET("guide_area_code = #{guideAreaCode,jdbcType=VARCHAR}");
    }

    if (record.getGuideMobile() != null) {
        sql.SET("guide_mobile = #{guideMobile,jdbcType=VARCHAR}");
    }

    if (record.getGuideCommentStatus() != null) {
        sql.SET("guide_comment_status = #{guideCommentStatus,jdbcType=SMALLINT}");
    }

    if (record.getGuideAgencyType() != null) {
        sql.SET("guide_agency_type = #{guideAgencyType,jdbcType=INTEGER}");
    }

    if (record.getGuideAgencyBossId() != null) {
        sql.SET("guide_agency_boss_id = #{guideAgencyBossId,jdbcType=VARCHAR}");
    }

    if (record.getGuideAgencyBossName() != null) {
        sql.SET("guide_agency_boss_name = #{guideAgencyBossName,jdbcType=VARCHAR}");
    }

    if (record.getGuideAccountNo() != null) {
        sql.SET("guide_account_no = #{guideAccountNo,jdbcType=VARCHAR}");
    }

    if (record.getGuideAgencyId() != null) {
        sql.SET("guide_agency_id = #{guideAgencyId,jdbcType=VARCHAR}");
    }

    if (record.getGuideAgencyName() != null) {
        sql.SET("guide_agency_name = #{guideAgencyName,jdbcType=VARCHAR}");
    }

    if (record.getAgentId() != null) {
        sql.SET("agent_id = #{agentId,jdbcType=VARCHAR}");
    }

    if (record.getAgentName() != null) {
        sql.SET("agent_name = #{agentName,jdbcType=VARCHAR}");
    }

    if (record.getAgentOpid() != null) {
        sql.SET("agent_opid = #{agentOpid,jdbcType=VARCHAR}");
    }

    if (record.getAgentOpname() != null) {
        sql.SET("agent_opname = #{agentOpname,jdbcType=VARCHAR}");
    }

    if (record.getAdminId() != null) {
        sql.SET("admin_id = #{adminId,jdbcType=INTEGER}");
    }

    if (record.getImToken() != null) {
        sql.SET("im_token = #{imToken,jdbcType=VARCHAR}");
    }

    if (record.getDeliverStatus() != null) {
        sql.SET("deliver_status = #{deliverStatus,jdbcType=INTEGER}");
    }

    if (record.getDeliverType() != null) {
        sql.SET("deliver_type = #{deliverType,jdbcType=INTEGER}");
    }

    if (record.getDeliverAcpTime() != null) {
        sql.SET("deliver_acp_time = #{deliverAcpTime,jdbcType=TIMESTAMP}");
    }

    if (record.getUrgentFlag() != null) {
        sql.SET("urgent_flag = #{urgentFlag,jdbcType=INTEGER}");
    }

    if (record.getUrgentHour() != null) {
        sql.SET("urgent_hour = #{urgentHour,jdbcType=INTEGER}");
    }

    if (record.getSerialFlag() != null) {
        sql.SET("serial_flag = #{serialFlag,jdbcType=INTEGER}");
    }

    if (record.getSerialOrderNo() != null) {
        sql.SET("serial_order_no = #{serialOrderNo,jdbcType=VARCHAR}");
    }

    if (record.getCargroupFlag() != null) {
        sql.SET("cargroup_flag = #{cargroupFlag,jdbcType=INTEGER}");
    }

    if (record.getCargroupId() != null) {
        sql.SET("cargroup_id = #{cargroupId,jdbcType=VARCHAR}");
    }

    if (record.getFlightNo() != null) {
        sql.SET("flight_no = #{flightNo,jdbcType=VARCHAR}");
    }

    if (record.getFlightAirportCode() != null) {
        sql.SET("flight_airport_code = #{flightAirportCode,jdbcType=VARCHAR}");
    }

    if (record.getFlightAirportName() != null) {
        sql.SET("flight_airport_name = #{flightAirportName,jdbcType=VARCHAR}");
    }

    if (record.getFlightFlyTime() != null) {
        sql.SET("flight_fly_time = #{flightFlyTime,jdbcType=TIMESTAMP}");
    }

    if (record.getFlightArriveTime() != null) {
        sql.SET("flight_arrive_time = #{flightArriveTime,jdbcType=TIMESTAMP}");
    }

    if (record.getFlightIsCustom() != null) {
        sql.SET("flight_is_custom = #{flightIsCustom,jdbcType=INTEGER}");
    }

    if (record.getFlightAirportBuiding() != null) {
        sql.SET("flight_airport_buiding = #{flightAirportBuiding,jdbcType=VARCHAR}");
    }

    if (record.getFlightRegisterId() != null) {
        sql.SET("flight_register_id = #{flightRegisterId,jdbcType=VARCHAR}");
    }

    if (record.getFlightBrandSign() != null) {
        sql.SET("flight_brand_sign = #{flightBrandSign,jdbcType=VARCHAR}");
    }

    if (record.getFlightDestCode() != null) {
        sql.SET("flight_dest_code = #{flightDestCode,jdbcType=VARCHAR}");
    }

    if (record.getFlightDestName() != null) {
        sql.SET("flight_dest_name = #{flightDestName,jdbcType=VARCHAR}");
    }

    if (record.getFlightDestBuilding() != null) {
        sql.SET("flight_dest_building = #{flightDestBuilding,jdbcType=VARCHAR}");
    }

    if (record.getLineSubject() != null) {
        sql.SET("line_subject = #{lineSubject,jdbcType=VARCHAR}");
    }

    if (record.getLineDescription() != null) {
        sql.SET("line_description = #{lineDescription,jdbcType=VARCHAR}");
    }

    if (record.getAdultNum() != null) {
        sql.SET("adult_num = #{adultNum,jdbcType=INTEGER}");
    }

    if (record.getChildNum() != null) {
        sql.SET("child_num = #{childNum,jdbcType=INTEGER}");
    }

    if (record.getChildSeat() != null) {
        sql.SET("child_seat = #{childSeat,jdbcType=VARCHAR}");
    }

    if (record.getIsArrivalVisa() != null) {
        sql.SET("is_arrival_visa = #{isArrivalVisa,jdbcType=SMALLINT}");
    }

    if (record.getCheckInPrice() != null) {
        sql.SET("check_in_price = #{checkInPrice,jdbcType=DOUBLE}");
    }

    if (record.getCancelTime() != null) {
        sql.SET("cancel_time = #{cancelTime,jdbcType=TIMESTAMP}");
    }

    if (record.getCompleteTime() != null) {
        sql.SET("complete_time = #{completeTime,jdbcType=TIMESTAMP}");
    }

    if (record.getIsReadable() != null) {
        sql.SET("is_readable = #{isReadable,jdbcType=INTEGER}");
    }

    if (record.getIsNewTrack() != null) {
        sql.SET("is_new_track = #{isNewTrack,jdbcType=INTEGER}");
    }

    if (record.getCreateTime() != null) {
        sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
    }

    if (record.getUpdateTime() != null) {
        sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}");
    }

    if (record.getJourneyComment() != null) {
        sql.SET("journey_comment = #{journeyComment,jdbcType=LONGVARCHAR}");
    }

    sql.WHERE("order_no = #{orderNo,jdbcType=VARCHAR}");

    return sql.toString();
}

From source file:com.mybatisX.test.activerecord.ActiveRecordTest.java

License:Apache License

public static void main(String[] args) {
    // ?//from   w w  w.  j  a v a2s  . c  om
    InputStream in = TestMapper.class.getClassLoader().getResourceAsStream("mysql-config.xml");
    MybatisSessionFactoryBuilder mf = new MybatisSessionFactoryBuilder();
    SqlSessionFactory sqlSessionFactory = mf.build(in);
    TableInfoHelper.initSqlSessionFactory(sqlSessionFactory);
    sqlSessionFactory.openSession(false);
    // ??
    Test t1 = new Test();
    t1.setType("test10");
    boolean rlt = t1.insert();
    print(" ar save=" + rlt + ", id=" + t1.getId());

    // ?ID
    t1.setType("t1023");
    rlt = t1.updateById();
    print(" ar updateById:" + rlt);

    //  SQL
    Test t11 = new Test();
    t11.setType("123");
    rlt = t11.update("id={0}", t1.getId());
    print("update sql=" + rlt);

    //  SQL
    Test t10 = t1.selectOne("id={0}", t1.getId());
    print("selectOne=" + t10.getType());

    // ?OR
    t1.setType("t1021");
    rlt = t1.insertOrUpdate();
    print(" ar saveOrUpdate:" + rlt);

    // ?ID
    Test t2 = t1.selectById();
    print(" t2 = " + t2.toString());
    t2.setId(IdWorker.getId());
    t2.insert();

    // 
    List<Test> tl = t2.selectAll();
    for (Test t : tl) {
        print("selectAll=" + t.toString());
    }

    // 
    print(" count=" + t2.selectCount());

    // 
    Page<Test> page = new Page<Test>(0, 10);
    page = t2.selectPage(page, null);
    print(page.toString());

    // ?ID
    rlt = t2.deleteById();
    print("deleteById=" + rlt + ", id=" + t2.getId());

    //  SQL 
    List<Map<String, Object>> ul = t2.selectListSql(new SQL() {
        {
            SELECT("*");
            FROM("test");
            WHERE("type='t1021'");
        }
    }.toString());
    System.err.println("selectList SQL:");
    for (Map<String, Object> map : ul) {
        System.err.println(map);
    }

    // ?ID
    Test t20 = t2.selectById();
    print("t2 ??" + (null != t20));

    //  SQL
    rlt = t2.delete("type={0}", "t1021");
    System.err.println("delete sql=" + rlt);
}

From source file:com.mybatisX.test.mysql.UserMapperTest.java

License:Apache License

/**
 * RUN //from ww w  .  j a  va  2 s  . c  o  m
 * <p>
 * <p>
 * MybatisPlus  SQL ?
 * </p>
 * 1?XMLSQL<br>
 * 2?sqlProviderSQL<br>
 * 3?xmlSql  sqlProvider???SQL<br>
 * <br>
 * ?SQLxmlSql > sqlProvider > crudSql <br>
 */
public static void main(String[] args) {

    // ?
    InputStream in = UserMapperTest.class.getClassLoader().getResourceAsStream("mysql-config.xml");

    /*
     *  MybatisSessionFactoryBuilder 
     * SqlSessionFactoryBaseMapper
     */
    MybatisSessionFactoryBuilder mf = new MybatisSessionFactoryBuilder();

    /*
     * 1?????? 2????? 3?????
     * ?? @TableId(value = "test_id") 
     */
    // mf.setDbColumnUnderline(true);

    /**
     *  SQL 
     */
    mf.setSqlInjector(new MySqlInjector());

    /**
     *  
     */
    mf.setMetaObjectHandler(new MyMetaObjectHandler());

    SqlSessionFactory sessionFactory = mf.build(in);
    SqlSession session = sessionFactory.openSession();
    UserMapper userMapper = session.getMapper(UserMapper.class);
    System.err.println(" debug run  user ??? ");
    userMapper.deleteAll();

    /**
     * sjy @TableFieldel
     */
    Role role = new Role();
    role.setId(IdWorker.getId());
    role.setName("admin");

    User userA = new User();
    userA.setId(IdWorker.getId());
    userA.setName("junyu_shi");
    userA.setAge(1);
    userA.setDesc("");
    userA.setTestType(1);
    userA.setRole(role);

    int rlt = userMapper.insert(userA);
    User whereUser = userMapper.selectOne(userA);
    print(whereUser);

    userA.setAge(18);
    userMapper.updateById(userA);
    userMapper.delete(new EntityWrapper<User>(userA));
    System.err.println("--------- @TableField el() --------- " + rlt);

    /**
     * ?
     */
    rlt = userMapper.insertInjector(new User(1L, "1", 1, 1));
    System.err.println("--------- insertInjector --------- " + rlt);

    /**
     * ehcache 
     */
    User cacheUser = userMapper.selectOne(new User(1L, 1));
    print(cacheUser);
    cacheUser = userMapper.selectOne(new User(1L, 1));
    print(cacheUser);

    /**
     * ?
     */
    long id = IdWorker.getId();
    rlt = userMapper.insert(new User(id, "abc", 18, 1));
    System.err.println("\n--------------insert-------" + rlt);
    sleep();

    rlt = userMapper.insert(new User(18));
    System.err.println("\n---------- name ?----insert-------" + rlt);
    sleep();

    List<User> ul = new ArrayList<User>();

    /*  ID */
    ul.add(new User(11L, "1", 1, 0));
    ul.add(new User(12L, "2", 2, 1));
    ul.add(new User(13L, "3", 3, 1));
    ul.add(new User(14L, "delname", 4, 0));
    ul.add(new User(15L, "5", 5, 1));
    ul.add(new User(16L, "6", 6, 0));

    /*  name test_type  */
    ul.add(new User(17L, 7));
    ul.add(new User(18L, 8));
    ul.add(new User(19L, 9));
    ul.add(new User(7));
    ul.add(new User(20L, "deleteByMap", 7, 0));

    /*  ID_WORKER ? ID */
    ul.add(new User("8", 8, 1));
    ul.add(new User("9", 9, 1));
    for (User u : ul) {
        rlt = userMapper.insert(u);
    }
    System.err.println("\n--------------insertBatch----------------" + rlt + "\n\n");

    /**
     * ??????
     */
    session.commit();

    /*
     * 
     */
    rlt = userMapper.deleteById(id);
    System.err.println("---------deleteById------- delete id=" + id + " ,result=" + rlt + "\n\n");
    sleep();

    Map<String, Object> columnMap = new HashMap<String, Object>();
    columnMap.put("name", "deleteByMap");
    columnMap.put("age", null);
    rlt = userMapper.deleteByMap(columnMap);
    System.err.println("---------deleteByMap------- result=" + rlt + "\n\n");
    sleep();

    List<Long> il = new ArrayList<Long>();
    il.add(16L);
    il.add(17L);
    rlt = userMapper.deleteBatchIds(il);
    System.err.println("---------deleteBatchIds------- delete id=" + id + " ,result=" + rlt + "\n\n");
    sleep();

    rlt = userMapper.delete(new EntityWrapper<User>(new User(14L, "delname")));
    System.err.println("--------------delete------------------ result=" + rlt + "\n\n");
    sleep();

    /*
     * <p>  </p>
     * 
     * updateById  BaseMapper ?UserMapper.xmlsql
     */
    rlt = userMapper.updateById(new User(12L, "MybatisPlus"));
    System.err.println("------------------updateById---------------------- result=" + rlt + "\n\n");
    sleep();

    rlt = userMapper.updateById(new User(12L, "update all column", 12, 12));
    System.err.println("------------------updateById---------------------- result=" + rlt + "\n\n");
    sleep();

    rlt = userMapper.update(new User("55", 55, 5), new EntityWrapper<User>(new User(15L, "5")));
    System.err.println("------------------update---------------------- result=" + rlt + "\n\n");
    sleep();

    EntityWrapper<User> ew1 = new EntityWrapper<User>();
    ew1.addFilter("test_id={0} AND name={1}", 15L, "55");
    rlt = userMapper.update(new User("00"), ew1);
    System.err.println("------------------update---------------------- result=" + rlt + "\n\n");
    sleep();

    /* ? */
    // userMapper.update(new User("11"), null);

    List<User> userList = new ArrayList<User>();
    userList.add(new User(11L, "updateBatchById-1", 1, 1));
    userList.add(new User(12L, "updateBatchById-2", 2, 1));
    userList.add(new User(13L, "updateBatchById-3", 3, 1));
    for (User u : userList) {
        rlt = userMapper.updateById(u);
    }
    System.err.println("------------------updateBatchById---------------------- result=" + rlt + "\n\n");
    sleep();

    /*
     * <p>  </p>
     */
    System.err.println("\n------------------selectById----------------------");
    User user = userMapper.selectById(12L);
    print(user);

    System.err.println("\n------------------selectBatchIds----------------------");
    List<Long> idList = new ArrayList<Long>();
    idList.add(11L);
    idList.add(12L);
    List<User> ul0 = userMapper.selectBatchIds(idList);
    for (User anUl0 : ul0) {
        print(anUl0);
    }

    System.err.println("\n------------------selectByMap----- map ??----");
    Map<String, Object> cm = new HashMap<String, Object>();
    cm.put("test_type", 1);
    List<User> ul1 = userMapper.selectByMap(cm);
    for (User anUl1 : ul1) {
        print(anUl1);
    }

    System.err.println("\n------------------selectOne----------------------");
    User userOne = userMapper.selectOne(new User("abc"));
    print(userOne);

    System.err.println("\n------------------selectCount----------------------");
    System.err.println(
            " type=1 " + userMapper.selectCount(new EntityWrapper<User>(new User(1))));
    System.err.println("" + userMapper.selectCount(null));

    System.err.println("\n------------------selectList-----?----id--DESC--?----");
    List<User> ul2 = userMapper.selectList(new EntityWrapper<User>(null, "age,name"));
    for (User anUl2 : ul2) {
        print(anUl2);
    }

    System.err.println(
            "\n------------------list  ---- testType = 1 ?--id--DESC--?--------");
    Page<User> page = new Page<User>(1, 2);
    EntityWrapper<User> ew = new EntityWrapper<User>(new User(1));

    /*
     * 
     */
    ew.setSqlSelect("age,name");

    /*
     * ?SQL (?SQL?????)
     */
    ew.where("name like {0}", "'%dateBatch%'").and("age={0}", 3).orderBy("age,name", true);
    List<User> paginList = userMapper.selectPage(page, ew);
    page.setRecords(paginList);
    for (int i = 0; i < page.getRecords().size(); i++) {
        print(page.getRecords().get(i));
    }
    System.err.println(" " + page.toString());

    System.err.println(
            "\n---------------xml---selectListRow ?? count ----?--------------");
    // TODO  Page ??
    List<User> rowList = userMapper.selectListRow(new Pagination(0, 2, false));
    for (User aRowList : rowList) {
        print(aRowList);
    }

    /*
     * 
     */
    System.err.println(" selectList EntityWrapper == null \n");
    paginList = userMapper.selectList(null);
    for (User aPaginList : paginList) {
        print(aPaginList);
    }

    /*
     * <p>
     *  SQL ???
     * </p>
     * <p>
     * ?/mybatis-plus/src/test/java/com/baomidou/mybatisplus/test/SqlBuilderTest.java
     * </p>
     */
    SQL sql = new SQL() {
        {
            SELECT("a.test_id as id, a.name, a.age");
            FROM("user a");
            WHERE("a.test_type=1");
        }
    };
    // SQL ?
    System.err.println(" insertSql  SQL \n");
    rlt = userMapper.insertSql(new SQL() {
        {
            INSERT_INTO("user");
            VALUES("test_id, name, age, test_type", IdWorker.getId() + ", 'testInsertSql', 5, 1");
        }
    }.toString());
    System.err.println("???" + rlt);

    // SQL 
    System.err.println(" selectListSql  SQL \n");
    List<Map<String, Object>> ul3 = userMapper.selectListSql(sql.toString());
    for (Map<String, Object> u : ul3) {
        System.err.println(u);
    }

    // SQL 
    System.err.println(" selectPageSql  SQL \n");
    Page<Map<String, Object>> page3 = new Page<Map<String, Object>>(0, 10);
    List<Map<String, Object>> ml = userMapper.selectPageSql(page3, sql.toString());
    for (Map<String, Object> map : ml) {
        System.err.println(" map " + map);
    }
    System.err.println("" + page3.toString());

    // SQL 
    System.err.println(" deleteSql  SQL \n");
    rlt = userMapper.deleteSql(new SQL() {
        {
            DELETE_FROM("user");
            WHERE("name='testInsertSql'");
        }
    }.toString());
    System.err.println("??" + rlt);

    // SQL 
    System.err.println(" updateSql  SQL \n");
    rlt = userMapper.updateSql(new SQL() {
        {
            UPDATE("user");
            SET("age=6");
            WHERE("test_type=1");
        }
    }.toString());
    System.err.println("???" + rlt);

    /**
     * ?
     */
    rlt = userMapper.deleteAll();
    System.err.println("?? rlt=" + rlt);

    /**
     * ??
     */
    session.commit();
}