IOrdersMapper.xml 5.94 KB
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yoho.unions.dal.IOrdersMapper">
    <resultMap id="BaseResultMap" type="com.yoho.unions.dal.model.Orders">
        <id column="id" property="id" jdbcType="INTEGER"/>
        <result column="order_code" property="orderCode" jdbcType="BIGINT"/>
        <result column="uid" property="uid" jdbcType="INTEGER"/>
        <result column="express_number" property="expressNumber" jdbcType="VARCHAR"/>
        <result column="order_type" property="orderType" jdbcType="TINYINT"/>
        <result column="is_invoice" property="isInvoice" jdbcType="CHAR"/>
        <result column="invoices_type" property="invoicesType" jdbcType="VARCHAR"/>
        <result column="invoices_payable" property="invoicesPayable" jdbcType="VARCHAR"/>
        <result column="yoho_coin_num" property="yohoCoinNum" jdbcType="SMALLINT"/>
        <result column="payment_type" property="paymentType" jdbcType="TINYINT"/>
        <result column="payment" property="payment" jdbcType="TINYINT"/>
        <result column="bank_code" property="bankCode" jdbcType="VARCHAR"/>
        <result column="payment_status" property="paymentStatus" jdbcType="CHAR"/>
        <result column="shipping_type_id" property="shippingTypeId" jdbcType="TINYINT"/>
        <result column="shipping_cost" property="shippingCost" jdbcType="DECIMAL"/>
        <result column="express_id" property="expressId" jdbcType="TINYINT"/>
        <result column="user_name" property="userName" jdbcType="VARCHAR"/>
        <result column="phone" property="phone" jdbcType="VARCHAR"/>
        <result column="mobile" property="mobile" jdbcType="VARCHAR"/>
        <result column="area_code" property="areaCode" jdbcType="INTEGER"/>
        <result column="address" property="address" jdbcType="VARCHAR"/>
        <result column="zip_code" property="zipCode" jdbcType="INTEGER"/>
        <result column="remark" property="remark" jdbcType="VARCHAR"/>
        <result column="receiving_time" property="receivingTime" jdbcType="INTEGER"/>
        <result column="receipt_time" property="receiptTime" jdbcType="VARCHAR"/>
        <result column="exception_status" property="exceptionStatus" jdbcType="TINYINT"/>
        <result column="is_lock" property="isLock" jdbcType="CHAR"/>
        <result column="is_arrive" property="isArrive" jdbcType="CHAR"/>
        <result column="status" property="status" jdbcType="TINYINT"/>
        <result column="is_cancel" property="isCancel" jdbcType="CHAR"/>
        <result column="cancel_type" property="cancelType" jdbcType="TINYINT"/>
        <result column="exchange_status" property="exchangeStatus" jdbcType="TINYINT"/>
        <result column="refund_status" property="refundStatus" jdbcType="TINYINT"/>
        <result column="arrive_time" property="arriveTime" jdbcType="INTEGER"/>
        <result column="shipment_time" property="shipmentTime" jdbcType="INTEGER"/>
        <result column="create_time" property="createTime" jdbcType="INTEGER"/>
        <result column="amount" property="amount" jdbcType="DECIMAL"/>
        <result column="is_print_price" property="isPrintPrice" jdbcType="CHAR"/>
        <result column="is_pre_contact" property="isPreContact" jdbcType="CHAR"/>
        <result column="is_need_rapid" property="isNeedRapid" jdbcType="CHAR"/>
        <result column="update_time" property="updateTime" jdbcType="INTEGER"/>
        <result column="attribute" property="attribute" jdbcType="TINYINT"/>
        <result column="is_payed" property="isPayed" jdbcType="CHAR"/>
        <result column="activities_id" property="activitiesId" jdbcType="SMALLINT"/>
        <result column="parent_order_code" property="parentOrderCode" jdbcType="BIGINT"/>
        <result column="orders_status" property="ordersStatus" jdbcType="TINYINT"/>
        <result column="province" property="province" jdbcType="VARCHAR"/>
        <result column="user_level" property="userLevel" jdbcType="TINYINT"/>
        <result column="is_jit" property="isJit" jdbcType="CHAR"/>
        <result column="email" property="email" jdbcType="VARCHAR"/>
        <result column="city" property="city" jdbcType="VARCHAR"/>
        <result column="district" property="district" jdbcType="VARCHAR"/>
        <result column="is_multi_package" property="isMultiPackage" jdbcType="CHAR"/>
        <result column="is_advance" property="isAdvance" jdbcType="CHAR"/>
        <result column="deliver_yoho_coin" property="deliverYohoCoin" jdbcType="INTEGER"/>
        <result column="is_jit_already_split" property="isJitAlreadySplit" jdbcType="CHAR"/>
        <result column="is_blk" property="isBlk" jdbcType="CHAR"/>
    </resultMap>
    
    <sql id="Base_Column_List">
    id, order_code, uid, express_number, order_type, is_invoice, invoices_type, invoices_payable, 
    yoho_coin_num, payment_type, payment, bank_code, payment_status, shipping_type_id, 
    shipping_cost, express_id, user_name, phone, mobile, area_code, address, zip_code, 
    remark, receiving_time, receipt_time, exception_status, is_lock, is_arrive, status, 
    is_cancel, cancel_type, exchange_status, refund_status, arrive_time, shipment_time, 
    create_time, amount, is_print_price, is_pre_contact, is_need_rapid, update_time, 
    attribute, is_payed, activities_id, parent_order_code, orders_status,province, user_level,
    is_jit, email, city, district, is_multi_package, is_advance, deliver_yoho_coin, is_jit_already_split,is_blk
  	</sql>


    <select id="selectByUidAndOrderCode" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from orders
        where order_code = #{orderCode,jdbcType=BIGINT} and uid = #{uid,jdbcType=INTEGER}
    </select>
    
    <select id="selectCountShipStatusOrderSince" resultType="java.lang.Integer">
        select count(1)
        from orders
        where uid = #{uid,jdbcType=INTEGER}
        	and status >= 4 
			and create_time > #{createTime,jdbcType=INTEGER}
    </select>    

</mapper>