自动化立体仓库 - WMS系统
pang.jiabao
7 天以前 6797af492e55d2e63a95ed8f6d86e274f85a09c3
src/main/resources/mapper/ViewStockUseMapper.xml
@@ -9,9 +9,20 @@
         and row1 like '%' + #{row1} + '%'
      </if>
</sql>
   <resultMap id="ViewStockUseMap" type="com.zy.asrs.entity.ViewStockUseBean">
      <id column="row1" property="row1"/>
      <result column="total_qty"  property="total_qty"/>
      <result column="full_qty"   property="full_qty"/>
      <result column="null_qty"   property="null_qty"/>
      <result column="forbid_qty" property="forbid_qty"/>
      <result column="empty_qty"  property="empty_qty"/>
      <!--      <result column="use_qty"    property="use_qty"/>-->
      <result column="full_rate"  property="full_rate"/>
      <result column="occ_rate"   property="occ_rate"/>
   </resultMap>
<!-- 分页查询所有信息 -->
<select id="queryViewStockUseList" parameterType="com.zy.asrs.entity.ViewStockUseBean" resultType="com.zy.asrs.entity.ViewStockUseBean">
<select id="queryViewStockUseList" parameterType="com.zy.asrs.entity.ViewStockUseBean" resultMap="ViewStockUseMap">
select top (#{pageSize}) * from asr_stk_use_view 
<where>
   row1 not in (select top ((#{pageNumber}-1)*#{pageSize}) row1 from asr_stk_use_view 
@@ -50,5 +61,67 @@
   ]]>
</where>
</select>
    <select id="selectWorkCountIn" resultType="com.zy.asrs.entity.ViewWorkCountInView">
      SELECT *
      FROM (
      select
         ROW_NUMBER() OVER(Order by a.oneday desc) as row
      , *
      FROM(
      SELECT * FROM asr_wrkin_count_view
               WHERE
               1 = 1 AND
               (oneday > #{start}
               AND
            oneday &lt; #{end})
               <if test="matnr != null and matnr !=''">
                and matnr = #{matnr}
             </if>
              ) a ) b
      WHERE 1=1 and b.row between ((#{curr}-1)*#{limit}+1) and (#{curr}*#{limit})
   </select>
   <select id="selectWorkCountInTotal" resultType="java.lang.Integer">
      SELECT COUNT(*) FROM asr_wrkin_count_view
      WHERE 1= 1 AND
      (oneday > #{start}
      AND
      oneday &lt; #{end})
      <if test="matnr != null and matnr !='' ">
         and matnr = #{matnr}
      </if>
   </select>
   <select id="selectWorkCountOut" resultType="com.zy.asrs.entity.ViewWorkCountInView">
      SELECT *
      FROM (
             select
                ROW_NUMBER() OVER(Order by a.oneday desc) as row
      , *
             FROM(
                   SELECT * FROM asr_wrkout_count_view
      WHERE
      1 = 1 AND
      (oneday > #{start}
      AND
      oneday &lt; #{end})
      <if test="matnr != null and matnr !=''">
         and matnr = #{matnr}
      </if>
      ) a ) b
      WHERE 1=1 and b.row between ((#{curr}-1)*#{limit}+1) and (#{curr}*#{limit})
   </select>
   <select id="selectWorkCountOutTotal" resultType="java.lang.Integer">
      SELECT COUNT(*) FROM asr_wrkout_count_view
      WHERE 1= 1 AND
      (oneday > #{start}
      AND
      oneday &lt; #{end})
      <if test="matnr != null and matnr !='' ">
         and matnr = #{matnr}
      </if>
   </select>
</mapper>