自动化立体仓库 - WMS系统
zyx
2023-11-02 8808ebb9bb3eb8e6bc9ed8bfc6cfaf53e63d6614
src/main/resources/mapper/ViewStockUseMapper.xml
@@ -14,7 +14,7 @@
<select id="queryViewStockUseList" parameterType="com.zy.asrs.entity.ViewStockUseBean" resultType="com.zy.asrs.entity.ViewStockUseBean">
select top (#{pageSize}) * from asr_stk_use_view 
<where>
   row1 not in (select top ((#{pageNumber}-1)*#{pageSize}) row1 from asr_stk_use_view
   row1 not in (select top ((#{pageNumber}-1)*#{pageSize}) row1 from asr_stk_use_view
   <where>
      1=1
      <include refid="viewStockUseConditionSql"></include>      
@@ -50,67 +50,150 @@
   ]]>
</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>
<!-- 分页查询所有信息 -->
<select id="queryViewStockUse1List" parameterType="com.zy.asrs.entity.ViewStockUseBean" resultType="com.zy.asrs.entity.ViewStockUseBean">
   select top (#{pageSize}) * from agv_stk_use_view1
   <where>
      row1 not in (select top ((#{pageNumber}-1)*#{pageSize}) row1 from agv_stk_use_view1
      <where>
         1=1
         <include refid="viewStockUseConditionSql"></include>
      </where>
      order by row1 asc)
      <include refid="viewStockUseConditionSql"></include>
      <![CDATA[
   order by row1 asc
]]>
   </where>
</select>
              ) a ) b
      WHERE 1=1 and b.row between ((#{curr}-1)*#{limit}+1) and (#{curr}*#{limit})
<select id="getViewStockUse1Count" parameterType="com.zy.asrs.entity.ViewStockUseBean"   resultType="Integer">
   select count(1) from agv_stk_use_view1
   <where>
      <![CDATA[
1=1
]]>
      <include refid="viewStockUseConditionSql"></include>
   </where>
</select>
   </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})
<!-- 不分页查询所有信息,用于excel导出 -->
<select id="getViewStockUse1All" parameterType="com.zy.asrs.entity.ViewStockUseBean" resultType="com.zy.asrs.entity.ViewStockUseBean">
   select * from agv_stk_use_view1
   <where>
      <![CDATA[
   1=1
]]>
      <include refid="viewStockUseConditionSql"></include>
      <![CDATA[
   order by row1 asc
]]>
   </where>
</select>
      <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>
<!-- 分页查询所有信息 -->
<select id="queryViewStockUse3List" parameterType="com.zy.asrs.entity.ViewStockUseBean" resultType="com.zy.asrs.entity.ViewStockUseBean">
   select top (#{pageSize}) * from agv_stk_use_view3
   <where>
      row1 not in (select top ((#{pageNumber}-1)*#{pageSize}) row1 from agv_stk_use_view3
      <where>
         1=1
         <include refid="viewStockUseConditionSql"></include>
      </where>
      order by row1 asc)
      <include refid="viewStockUseConditionSql"></include>
      <![CDATA[
   order by row1 asc
]]>
   </where>
</select>
<select id="getViewStockUse3Count" parameterType="com.zy.asrs.entity.ViewStockUseBean"   resultType="Integer">
   select count(1) from agv_stk_use_view3
   <where>
      <![CDATA[
1=1
]]>
      <include refid="viewStockUseConditionSql"></include>
   </where>
</select>
<!-- 不分页查询所有信息,用于excel导出 -->
<select id="getViewStockUse3All" parameterType="com.zy.asrs.entity.ViewStockUseBean" resultType="com.zy.asrs.entity.ViewStockUseBean">
   select * from agv_stk_use_view3
   <where>
      <![CDATA[
   1=1
]]>
      <include refid="viewStockUseConditionSql"></include>
      <![CDATA[
   order by row1 asc
]]>
   </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>