自动化立体仓库 - WMS系统
#
zjj
2023-09-08 871867d77bf116d9450f2c63c33d3f6e97c8a1e9
src/main/resources/mapper/ViewStayTimeMapper.xml
@@ -44,20 +44,20 @@
   select
   *
   from (
      select
      ROW_NUMBER() over (order by stay_time desc) as row
      , *
      from
      (
         SELECT
         GETDATE() AS today
         , CONVERT(decimal, DATEDIFF(second,asr_loc_detl.appe_time, GETDATE()) / 86400.0, 9) AS stay_time
         , asr_loc_detl.*
         FROM asr_loc_detl
         INNER JOIN asr_loc_mast ON asr_loc_detl.loc_no = asr_loc_mast.loc_no
         where 1=1
         <include refid="viewStayTimeConditionSql"></include>
      ) t
   select
   ROW_NUMBER() over (order by stay_time desc) as row
   , *
   from
   (
   SELECT
   GETDATE() AS today
   , CONVERT(decimal, DATEDIFF(second,man_loc_detl.create_time, GETDATE()) / 86400.0, 9) AS stay_time
   , man_loc_detl.*
   FROM man_loc_detl
   INNER JOIN man_node ON man_loc_detl.loc_no = man_node.name
   where 1=1
   <include refid="viewStayTimeConditionSql"></include>
   ) ts
   ) a where a.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})
</select>
@@ -65,20 +65,20 @@
   select
   count(1)
   from (
      select
      ROW_NUMBER() over (order by stay_time desc) as row
      , *
      from
      (
         SELECT
         GETDATE() AS today
         , CONVERT(decimal, DATEDIFF(second,asr_loc_detl.appe_time, GETDATE()) / 86400.0, 9) AS stay_time
         , dbo.asr_loc_detl.*
         FROM asr_loc_detl
         INNER JOIN asr_loc_mast ON asr_loc_detl.loc_no = asr_loc_mast.loc_no
         where 1=1
         <include refid="viewStayTimeConditionSql"></include>
      ) t
   select
   ROW_NUMBER() over (order by stay_time desc) as row
   , *
   from
   (
   SELECT
   GETDATE() AS today
   , CONVERT(decimal, DATEDIFF(second,man_loc_detl.create_time, GETDATE()) / 86400.0, 9) AS stay_time
   , man_loc_detl.*
   FROM man_loc_detl
   INNER JOIN man_node ON man_loc_detl.loc_no = man_node.name
   where 1=1
   <include refid="viewStayTimeConditionSql"></include>
   ) t
   ) a
</select>