62 lines
3.4 KiB
XML
62 lines
3.4 KiB
XML
<?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.ruoyi.jarvis.mapper.JDOrderMapper">
|
|
|
|
<resultMap id="JDOrderResult" type="JDOrder">
|
|
<result property="id" column="id"/>
|
|
<result property="remark" column="remark"/>
|
|
<result property="distributionMark" column="distribution_mark"/>
|
|
<result property="modelNumber" column="model_number"/>
|
|
<result property="link" column="link"/>
|
|
<result property="paymentAmount" column="payment_amount"/>
|
|
<result property="rebateAmount" column="rebate_amount"/>
|
|
<result property="address" column="address"/>
|
|
<result property="logisticsLink" column="logistics_link"/>
|
|
<result property="orderId" column="order_id"/>
|
|
<result property="buyer" column="buyer"/>
|
|
<result property="orderTime" column="order_time"/>
|
|
<result property="createTime" column="create_time"/>
|
|
<result property="updateTime" column="update_time"/>
|
|
<result property="status" column="status"/>
|
|
</resultMap>
|
|
|
|
<sql id="selectJDOrderBase">
|
|
select id, remark, distribution_mark, model_number, link, payment_amount, rebate_amount,
|
|
address, logistics_link, order_id, buyer, order_time, create_time, update_time, status
|
|
from jd_order
|
|
</sql>
|
|
|
|
<select id="selectJDOrderList" parameterType="JDOrder" resultMap="JDOrderResult">
|
|
<include refid="selectJDOrderBase"/>
|
|
<where>
|
|
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
|
|
<if test="distributionMark != null and distributionMark != ''"> and distribution_mark = #{distributionMark}</if>
|
|
<if test="modelNumber != null and modelNumber != ''"> and model_number like concat('%', #{modelNumber}, '%')</if>
|
|
<if test="link != null and link != ''"> and link like concat('%', #{link}, '%')</if>
|
|
<if test="paymentAmount != null"> and payment_amount = #{paymentAmount}</if>
|
|
<if test="rebateAmount != null"> and rebate_amount = #{rebateAmount}</if>
|
|
<if test="address != null and address != ''"> and address like concat('%', #{address}, '%')</if>
|
|
<if test="logisticsLink != null and logisticsLink != ''"> and logistics_link like concat('%', #{logisticsLink}, '%')</if>
|
|
<if test="orderId != null and orderId != ''"> and order_id = #{orderId}</if>
|
|
<if test="buyer != null and buyer != ''"> and buyer like concat('%', #{buyer}, '%')</if>
|
|
<if test="orderTime != null"> and order_time = #{orderTime}</if>
|
|
<if test="status != null and status != ''"> and status like concat('%', #{status}, '%')</if>
|
|
<if test="params.beginTime != null and params.beginTime != ''">
|
|
and date_format(order_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
|
</if>
|
|
<if test="params.endTime != null and params.endTime != ''">
|
|
and date_format(order_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
|
</if>
|
|
</where>
|
|
order by order_time desc, id desc
|
|
</select>
|
|
|
|
<select id="selectJDOrderById" parameterType="long" resultMap="JDOrderResult">
|
|
<include refid="selectJDOrderBase"/>
|
|
where id = #{id}
|
|
</select>
|
|
|
|
</mapper>
|
|
|
|
|