<?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.zy.asrs.mapper.OutStockMapper">
|
|
<!-- 映射结果 -->
|
<resultMap id="OutStockResultMap" type="com.zy.common.service.erp.entity.OutStockBillEntry">
|
<result column="FBrNo" property="FBrNo"/>
|
<result column="FInterID" property="FInterID"/>
|
<result column="FEntryID" property="FEntryID"/>
|
<result column="FOrderInterID" property="FOrderInterID"/>
|
<result column="FAuxQty" property="FAuxQty"/>
|
<result column="FCommitQty" property="FCommitQty"/>
|
<result column="FAuxPrice" property="FAuxPrice"/>
|
<result column="FDate" property="FDate"/>
|
<result column="FNote" property="FNote"/>
|
<result column="FBillNo" property="FBillNo"/>
|
<result column="FAdd" property="FAdd"/>
|
</resultMap>
|
|
<sql id="stockOutCondition">
|
<if test="FBillNo!=null and FBillNo!='' ">
|
and b.FBillNo like '%' + #{FBillNo} + '%'
|
</if>
|
</sql>
|
|
<select id="queryOutStock" resultMap="OutStockResultMap">
|
select * from
|
(
|
select ROW_NUMBER() over (order by a.FInterID,a.FEntryID) as row,a.FBrNo,a.FInterID,a.FEntryID,
|
a.FOrderInterID,a.FAuxQty,a.FCommitQty,a.FAuxPrice,a.FDate,a.FNote, b.FBillNo, b.FAdd
|
from OutStockBillEntry a left join OutStockBill b on a.FInterID = b.FInterID
|
where 1=1
|
<include refid="stockOutCondition"></include>
|
) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})
|
</select>
|
|
<select id="queryOutStockCount" parameterType="java.util.Map" resultType="java.lang.Integer">
|
select
|
count(1)
|
from OutStockBillEntry a
|
left join OutStockBill b on a.FInterID = b.FInterID
|
where 1=1
|
</select>
|
</mapper>
|