| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- <?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.xingxi.web.controller.business.order.mapper.OrderVoMapper">
- <resultMap type="OrderVo" id="OrderVoResult">
- <result property="orderId" column="orderId" />
- <result property="orderNo" column="orderNo" />
- <result property="orderTime" column="orderTime" />
- <result property="payTime" column="payTime" />
- <result property="orderStatus" column="orderStatus" />
- <result property="orderAmount" column="orderAmount" />
- <result property="payAmount" column="payAmount" />
- <result property="prodQuantity" column="prodQuantity" />
- <result property="buyerId" column="buyerId" />
- <result property="sellerId" column="sellerId" />
- <result property="cancelTime" column="cancelTime" />
- <result property="finishTime" column="finishTime" />
- <result property="recProv" column="recProv" />
- <result property="recCity" column="recCity" />
- <result property="recDistrict" column="recDistrict" />
- <result property="recAddress" column="recAddress" />
- <result property="recName" column="recName" />
- <result property="recMobile" column="recMobile" />
- <result property="remark" column="remark" />
- <result property="delFlag" column="delFlag" />
- <result property="createTime" column="createTime" />
- <result property="createUser" column="createUser" />
- <result property="updateUser" column="updateUser" />
- <result property="updateTime" column="updateTime" />
- <result property="sellerName" column="sellerName" />
- <result property="sellerMobile" column="sellerMobile" />
- <result property="buyerName" column="buyerName" />
- <result property="prodName" column="prodName" />
- </resultMap>
- <sql id="selectOrderVo">
- select t_order.orderId
- , t_order.orderNo
- , t_order.orderTime
- , t_order.payTime
- , t_order.orderStatus
- , t_order.orderAmount
- , t_order.payAmount
- , t_order.prodQuantity
- , t_order.buyerId
- , t_order.sellerId
- , t_order.cancelTime
- , t_order.finishTime
- , t_order.recProv
- , t_order.recCity
- , t_order.recDistrict
- , t_order.recAddress
- , t_order.recName
- , t_order.recMobile
- , t_order.remark
- , t_order.delFlag
- , t_order.createUser
- , t_order.createTime
- , t_order.updateUser
- , t_order.updateTime
- , m_merchant.mercName as sellerName
- , m_merchant.mobile as sellerMobile
- , sys_user.user_name as buyerName
- from t_order
- inner join m_merchant on m_merchant.mercId = t_order.sellerId
- inner join sys_user on sys_user.user_id = t_order.buyerId
- </sql>
- <select id="selectOrderVoByOrderId" parameterType="Long" resultMap="OrderVoResult">
- <include refid="selectOrderVo"/>
- where t_order.orderId = #{orderId}
- </select>
- <select id="selectOrderVoList" parameterType="OrderVo" resultMap="OrderVoResult">
- <include refid="selectOrderVo"/>
- <where>
- <if test="orderNo != null and orderNo != ''"> and t_order.orderNo like concat('%', #{orderNo}, '%')</if>
- <if test="orderStatus != null and orderStatus != ''"> and t_order.orderStatus = #{orderStatus}</if>
- <if test="recProv != null and recProv != ''"> and t_order.recProv like concat('%', #{recProv}, '%')</if>
- <if test="recCity != null and recCity != ''"> and t_order.recCity like concat('%', #{recCity}, '%')</if>
- <if test="recDistrict != null and recDistrict != ''"> and t_order.recDistrict like concat('%', #{recDistrict}, '%')</if>
- <if test="recName != null and recName != ''"> and t_order.recName like concat('%', #{recName}, '%')</if>
- <if test="recMobile != null and recMobile != ''"> and t_order.recMobile like concat('%', #{recMobile}, '%')</if>
- <if test="delFlag != null and delFlag != ''"> and t_order.delFlag = #{delFlag}</if>
- <if test="params.orderTimeFrom != null and params.orderTimeFrom != ''"><!-- 开始时间检索 -->
- and date_format(t_order.orderTime,'%y%m%d') >= date_format(#{params.orderTimeFrom},'%y%m%d')
- </if>
- <if test="params.orderTimeTo != null and params.orderTimeTo != ''"><!-- 结束时间检索 -->
- and date_format(t_order.orderTime,'%y%m%d') <= date_format(#{params.orderTimeTo},'%y%m%d')
- </if>
- <if test="params.cancelTimeFrom != null and params.cancelTimeFrom != ''"><!-- 开始时间检索 -->
- and date_format(t_order.cancelTime,'%y%m%d') >= date_format(#{params.cancelTimeFrom},'%y%m%d')
- </if>
- <if test="params.cancelTimeTo != null and params.cancelTimeTo != ''"><!-- 结束时间检索 -->
- and date_format(t_order.cancelTime,'%y%m%d') <= date_format(#{params.cancelTimeTo},'%y%m%d')
- </if>
- <if test="buyerName != null and buyerName != ''"> and sys_user.user_name like concat('%', #{buyerName}, '%')</if>
- <if test="sellerName != null and sellerName != ''"> and m_merchant.mercName like concat('%', #{sellerName}, '%')</if>
- <if test="prodName != null and prodName != '' ">
- and exists(select t_order_detail.id from t_order_detail
- where t_order_detail.prodName like concat('%', #{prodName}, '%')
- )
- </if>
- </where>
- </select>
- </mapper>
|