自动化立体仓库 - WMS系统
Administrator
2024-12-30 8e36d6e7a2837df41b35ca46bd3678cc1a8d0533
src/main/resources/mapper/ViewWorkInMapper.xml
@@ -99,11 +99,13 @@
<!-- 不分页查询所有信息,用于excel导出 -->
<select id="getViewWorkInAll" parameterType="com.zy.asrs.entity.ViewWorkInBean" resultType="com.zy.asrs.entity.ViewWorkInBean">
   select count(1)
   from asr_wrkin_view a
<!--   select count(1)-->
<!--   from asr_wrkin_view a-->
<!--   where 1=1-->
<!--   <include refid="viewWorkInConditionSql"></include>-->
   select * from asr_wrkin_view
   where 1=1
   <include refid="viewWorkInConditionSql"></include>
   order by io_time desc
</select>
<!-- 出库统计 -->
@@ -142,5 +144,114 @@
   <include refid="viewWorkInConditionSql"></include>
   Order by a.io_time desc
</select>
<sql id="viewWorkInTtlConditionSql">
   <if test="matnr!=null and matnr!='' ">
      and matnr like '%' + #{matnr} + '%'
   </if>
   <if test="maktx!=null and maktx!='' ">
      and (maktx like '%' + #{maktx} + '%'
      or matnr like '%' + #{maktx} + '%'
      or maktx like '%' + #{maktx} + '%'
      or specs like '%' + #{maktx} + '%'
      or anfme like '%' + #{maktx} + '%'
      or batch like '%' + #{maktx} + '%'
      or brand like '%' + #{maktx} + '%'
      or unit like '%' + #{maktx} + '%'
      )
   </if>
   <if test="begin_date!=null and begin_date!='' ">
      <![CDATA[
      and io_date >= #{begin_date}
      ]]>
   </if>
   <if test="end_date!=null and end_date!='' ">
      <![CDATA[
      and io_date <= #{end_date}
      ]]>
   </if>
</sql>
<sql id="viewWorkOutTtlConditionSql">
   <if test="matnr!=null and matnr!='' ">
      and matnr like '%' + #{matnr} + '%'
   </if>
   <if test="maktx!=null and maktx!='' ">
      and (maktx like '%' + #{maktx} + '%'
      or matnr like '%' + #{maktx} + '%'
      or maktx like '%' + #{maktx} + '%'
      or specs like '%' + #{maktx} + '%'
      or anfme like '%' + #{maktx} + '%'
      or batch like '%' + #{maktx} + '%'
      or brand like '%' + #{maktx} + '%'
      or unit like '%' + #{maktx} + '%'
      )
   </if>
   <if test="begin_date!=null and begin_date!='' ">
      <![CDATA[
      and io_date >= #{begin_date}
      ]]>
   </if>
   <if test="end_date!=null and end_date!='' ">
      <![CDATA[
      and io_date <= #{end_date}
      ]]>
   </if>
</sql>
<select id="queryViewWorkInTtlList" parameterType="com.zy.asrs.entity.ViewWorkInAllBean" resultType="com.zy.asrs.entity.ViewWorkInAllBean">
   select
   *
   from (
   select
   ROW_NUMBER() OVER(Order by t.io_date desc) as row
   , *
   from (
   select *
   from asr_wrkin_ttl_view
   where 1=1
   <include refid="viewWorkInTtlConditionSql"></include>
   ) t
   ) a where 1=1 and a.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})
</select>
<select id="getViewWorkInTtlCount" parameterType="com.zy.asrs.entity.ViewWorkInAllBean"   resultType="Integer">
   select count(1)
   from asr_wrkin_ttl_view a
   where 1=1
   <include refid="viewWorkInTtlConditionSql"></include>
</select>
<select id="getViewWorkInTtlAll" parameterType="com.zy.asrs.entity.ViewWorkInAllBean" resultType="com.zy.asrs.entity.ViewWorkInAllBean">
   select * from asr_wrkin_ttl_view
   where 1=1
   <include refid="viewWorkInTtlConditionSql"></include>
</select>
<select id="queryViewWorkOutTtlList" parameterType="com.zy.asrs.entity.ViewWorkInAllBean" resultType="com.zy.asrs.entity.ViewWorkInAllBean">
   select
   *
   from (
   select
   ROW_NUMBER() OVER(Order by t.io_date desc) as row
   , *
   from (
   select *
   from asr_wrkout_ttl_view
   where 1=1
   <include refid="viewWorkInTtlConditionSql"></include>
   ) t
   ) a where 1=1 and a.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})
</select>
<select id="getViewWorkOutTtlCount" parameterType="com.zy.asrs.entity.ViewWorkInAllBean"   resultType="Integer">
   select count(1)
   from asr_wrkout_ttl_view a
   where 1=1
   <include refid="viewWorkInTtlConditionSql"></include>
</select>
<select id="getViewWorkOutTtlAll" parameterType="com.zy.asrs.entity.ViewWorkInAllBean" resultType="com.zy.asrs.entity.ViewWorkInAllBean">
   select *
   from asr_wrkout_ttl_view a
   where 1=1
   <include refid="viewWorkInTtlConditionSql"></include>
   Order by a.io_date desc
</select>
</mapper>