<?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="zy.cloud.wms.manager.mapper.OrderMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="zy.cloud.wms.manager.entity.Order">
|
<id column="id" property="id" />
|
<result column="host_id" property="hostId" />
|
<result column="uuid" property="uuid" />
|
<result column="order_no" property="orderNo" />
|
<result column="order_time" property="orderTime" />
|
<result column="doc_type" property="docType" />
|
<result column="item_id" property="itemId" />
|
<result column="item_name" property="itemName" />
|
<result column="allot_item_id" property="allotItemId" />
|
<result column="def_number" property="defNumber" />
|
<result column="number" property="number" />
|
<result column="cstmr" property="cstmr" />
|
<result column="cstmr_name" property="cstmrName" />
|
<result column="tel" property="tel" />
|
<result column="oper_memb" property="operMemb" />
|
<result column="total_fee" property="totalFee" />
|
<result column="discount" property="discount" />
|
<result column="discount_fee" property="discountFee" />
|
<result column="other_fee" property="otherFee" />
|
<result column="act_fee" property="actFee" />
|
<result column="pay_type" property="payType" />
|
<result column="salesman" property="salesman" />
|
<result column="account_day" property="accountDay" />
|
<result column="post_fee_type" property="postFeeType" />
|
<result column="post_fee" property="postFee" />
|
<result column="pay_time" property="payTime" />
|
<result column="send_time" property="sendTime" />
|
<result column="ship_name" property="shipName" />
|
<result column="ship_code" property="shipCode" />
|
<result column="settle" property="settle" />
|
<result column="status" property="status" />
|
<result column="create_by" property="createBy" />
|
<result column="create_time" property="createTime" />
|
<result column="update_by" property="updateBy" />
|
<result column="update_time" property="updateTime" />
|
<result column="memo" property="memo" />
|
|
</resultMap>
|
|
<update id="updateSettle">
|
update man_receive set settle = #{settle} where 1=1 and order_no = #{orderNo} and host_id = #{hostId}
|
</update>
|
|
<select id="getPage" resultMap="BaseResultMap">
|
select * from
|
(
|
select *,
|
ROW_NUMBER() over (order by create_time desc) as row
|
from (
|
select distinct mo.*
|
from man_order mo
|
left join man_order_detl mod on mo.id = mod.order_id
|
where 1=1
|
<include refid="condition"></include>
|
) r
|
) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})
|
</select>
|
|
<select id="getPageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
|
select count(1) from
|
(
|
select *,
|
ROW_NUMBER() over (order by create_time desc) as row
|
from (
|
select distinct mo.*
|
from man_order mo
|
left join man_order_detl mod on mo.id = mod.order_id
|
where 1=1
|
<include refid="condition"></include>
|
) r
|
) t
|
</select>
|
|
<sql id="condition">
|
<if test="host_id!=null and host_id!='' ">
|
and mo.host_id = #{host_id}
|
</if>
|
<if test="bill_no!=null and bill_no!='' ">
|
and mo.bill_no like '%' + #{bill_no} + '%'
|
</if>
|
<if test="bill_type!=null and bill_type!='' ">
|
and bill_type like '%' + #{bill_type} + '%'
|
</if>
|
<if test="mat_name!=null and mat_name!='' ">
|
and a.mat_name like '%' + #{mat_name} + '%'
|
</if>
|
<if test="qty!=null and qty!='' ">
|
and a.qty = #{qty}
|
</if>
|
<if test="altme!=null and altme!='' ">
|
and a.unit like '%' + #{unit} + '%'
|
</if>
|
<if test="startTime!=null and endTime!=null">
|
and appe_time between #{startTime} and #{endTime}
|
</if>
|
</sql>
|
|
|
</mapper>
|