BuyerOrderViewMapper.xml 2.44 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.yohoufo.dal.order.BuyerOrderViewMapper">
    <resultMap id="BaseResultMap" type="com.yohoufo.dal.order.model.BuyerOrder">
        <id column="id" jdbcType="INTEGER" property="id" />
        <result column="uid" jdbcType="INTEGER" property="uid" />
        <result column="order_code" jdbcType="BIGINT" property="orderCode" />
        <result column="seller_uid" jdbcType="INTEGER" property="sellerUid" />
        <result column="client_type" jdbcType="INTEGER" property="clientType" />
        <result column="payment" jdbcType="INTEGER" property="payment" />
        <result column="payment_type" jdbcType="TINYINT" property="paymentType" />
        <result column="is_cancel" jdbcType="TINYINT" property="isCancel" />
        <result column="amount" jdbcType="DECIMAL" property="amount" />
        <result column="ship_fee" jdbcType="DECIMAL" property="shipFee" />
        <result column="status" jdbcType="INTEGER" property="status" />
        <result column="create_time" jdbcType="INTEGER" property="createTime" />
        <result column="update_time" jdbcType="INTEGER" property="updateTime" />
        <result column="buyer_order_status" jdbcType="INTEGER" property="buyerOrderStatus" />
        <result column="seller_order_status" jdbcType="INTEGER" property="sellerOrderStatus" />
        <result column="channel_no" jdbcType="VARCHAR" property="channelNo" />
        <result column="attributes" jdbcType="INTEGER" property="attributes" />
    </resultMap>
    <sql id="Base_Column_List">
        id, uid, order_code, seller_uid, client_type, payment, payment_type, is_cancel, amount,
        ship_fee, status, create_time, update_time, buyer_order_status, seller_order_status, channel_no, attributes
    </sql>


    <select id="selectAllByAttr" resultMap="BaseResultMap">
        select <include refid="Base_Column_List" /> from buyer_order
        where status = #{status,jdbcType=INTEGER}
        and attributes = #{attributes,jdbcType=INTEGER}
        <if test="tailId !=null"> and id &gt; #{tailId,jdbcType=INTEGER}</if>
        order by id limit #{offset}
    </select>

    <select id="selectAllCntByAttr" resultType="java.lang.Integer">
        select count(*) from buyer_order
        where status = #{status,jdbcType=INTEGER}
        and attributes = #{attributes,jdbcType=INTEGER}
    </select>

</mapper>