子订单列表查询增加查询条件
This commit is contained in:
parent
2eda5293f8
commit
69a95f665a
|
|
@ -56,4 +56,10 @@ public class OrderDetail extends BaseEntity {
|
||||||
private Date workFinishTime;
|
private Date workFinishTime;
|
||||||
|
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
|
private Long goodsCategoryId;
|
||||||
|
|
||||||
|
private String goodsName;
|
||||||
|
|
||||||
|
private Long countryId;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,29 +45,71 @@
|
||||||
FROM order_detail
|
FROM order_detail
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
<sql id="selectOrderDetailMoreInfo">
|
||||||
|
SELECT od.id,
|
||||||
|
od.code,
|
||||||
|
od.order_master_id,
|
||||||
|
od.order_master_code,
|
||||||
|
od.customer_id,
|
||||||
|
od.order_type,
|
||||||
|
od.order_status,
|
||||||
|
od.worker_id,
|
||||||
|
od.rev_time,
|
||||||
|
od.expect_time_start,
|
||||||
|
od.expect_time_end,
|
||||||
|
od.work_begin_time,
|
||||||
|
od.work_finish_time,
|
||||||
|
od.create_by,
|
||||||
|
od.create_time,
|
||||||
|
od.remark
|
||||||
|
FROM order_detail od
|
||||||
|
LEFT JOIN order_master om ON om.id = od.order_master_id
|
||||||
|
LEFT JOIN customer_address ca ON ca.customer_address_id = om.address_id
|
||||||
|
LEFT JOIN goods g ON g.goods_id = om.goods_id
|
||||||
|
</sql>
|
||||||
|
|
||||||
<select id="selectOrderDetailList" parameterType="com.ghy.order.domain.OrderDetail" resultMap="OrderDetailResult">
|
<select id="selectOrderDetailList" parameterType="com.ghy.order.domain.OrderDetail" resultMap="OrderDetailResult">
|
||||||
<include refid="selectOrderDetail"/>
|
<include refid="selectOrderDetailMoreInfo"/>
|
||||||
<where>
|
<where>
|
||||||
<if test="code != null and code != ''">
|
<if test="code != null and code != ''">
|
||||||
AND code LIKE concat('%', #{code}, '%')
|
AND od.code LIKE concat('%', #{code}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="customerId != null and customerId != 0">
|
<if test="customerId != null and customerId != 0">
|
||||||
AND customer_id = #{customerId}
|
AND od.customer_id = #{customerId}
|
||||||
</if>
|
</if>
|
||||||
<if test="orderType != null">
|
<if test="orderType != null">
|
||||||
AND order_type = #{orderType}
|
AND od.order_type = #{orderType}
|
||||||
</if>
|
</if>
|
||||||
<if test="orderStatus != null">
|
<if test="orderStatus != null">
|
||||||
AND order_status = #{orderStatus}
|
AND od.order_status = #{orderStatus}
|
||||||
</if>
|
</if>
|
||||||
<if test="orderMasterCode != null and orderMasterCode != 0">
|
<if test="orderMasterCode != null and orderMasterCode != 0">
|
||||||
AND order_detail_code = #{orderMasterCode}
|
AND od.order_detail_code = #{orderMasterCode}
|
||||||
</if>
|
</if>
|
||||||
<if test="workerId != null and workerId != 0">
|
<if test="workerId != null and workerId != 0">
|
||||||
AND worker_id = #{workerId}
|
AND od.worker_id = #{workerId}
|
||||||
|
</if>
|
||||||
|
<if test="goodsCategoryId != null">
|
||||||
|
AND g.dept_goods_category_id = #{goodsCategoryId}
|
||||||
|
</if>
|
||||||
|
<if test="goodsName != null and goodsName != ''">
|
||||||
|
AND g.goods_name like concat('%', #{goodsName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="countryId != null">
|
||||||
|
AND ca.country_id = #{countryId}
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
order by create_time desc
|
order by od.create_time
|
||||||
|
<trim suffixOverrides=",">
|
||||||
|
<choose>
|
||||||
|
<when test="params.createTimeSort != null and params.createTimeSort != ''">
|
||||||
|
${params.createTimeSort}
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
desc
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
</trim>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectById" parameterType="long" resultMap="OrderDetailResult">
|
<select id="selectById" parameterType="long" resultMap="OrderDetailResult">
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@
|
||||||
AND ca.country_id = #{countryId}
|
AND ca.country_id = #{countryId}
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
order by create_time
|
order by om.create_time
|
||||||
<trim suffixOverrides=",">
|
<trim suffixOverrides=",">
|
||||||
<choose>
|
<choose>
|
||||||
<when test="params.createTimeSort != null and params.createTimeSort != ''">
|
<when test="params.createTimeSort != null and params.createTimeSort != ''">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue