<?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="cn.pluss.platform.mapper.MercOrderNewMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="cn.pluss.platform.entity.MercOrderNew">
        <id column="id" property="id" />
        <result column="orderNo" property="orderNo" />
        <result column="userId" property="userId" />
        <result column="transNo" property="transNo" />
        <result column="thirdTransNo" property="thirdTransNo" />
        <result column="receiver" property="receiver" />
        <result column="phone" property="phone" />
        <result column="province" property="province" />
        <result column="city" property="city" />
        <result column="district" property="district" />
        <result column="address" property="address" />
        <result column="remark" property="remark" />
        <result column="status" property="status" />
        <result column="createTime" property="createTime" />
        <result column="creator" property="creator" />
        <result column="updateTime" property="updateTime" />
        <result column="updater" property="updater" />
        <result column="payType" property="payType" />
        <result column="transDt" property="transDt" />
        <result column="orderAmt" property="orderAmt" />
        <result column="discountAmt" property="discountAmt" />
        <result column="actualAmt" property="actualAmt" />
        <result column="postage" property="postage" />
        <result column="areaName" property="areaName" />
        <result column="merchantCode" property="merchantCode" />
        <result column="merchantName" property="merchantName" />
        <result column="channel" property="channel" />
        <result column="payData" property="payData" />
        <result column="payUserId" property="payUserId" />
    </resultMap>

    <select id="pageInfo" resultType="cn.pluss.platform.vo.MercOrderNewVO">
        select
           mon.*
        from tb_pluss_merc_order_new mon
        <where>
            mon.status != '00'
            <if test="condition.orderNo != null and condition.orderNo != ''">
                and mon.orderNo = #{condition.orderNo}
            </if>
            <if test="condition.userId != null">
                and mon.userId = #{condition.userId}
            </if>
<!--            <if test="condition.pStatus != null and condition.pStatus != '' and condition.pStatus != '-1'">-->
<!--                <if test="condition.pStatus == '1'">-->
<!--                    and md.status = '06'-->
<!--                </if>-->
<!--                <if test="condition.pStatus == '2'">-->
<!--                    and md.status = '05'-->
<!--                </if>-->
<!--                <if test="condition.pStatus == '3'">-->
<!--                    and md.status in ('02','03','04')-->
<!--                </if>-->
<!--            </if>-->
            <if test="condition.transNo != null and condition.transNo != ''">
                and mon.transNo = #{condition.transNo}
            </if>
        </where>
    </select>
</mapper>
