|  |  |  | 
|---|
|  |  |  | package com.zy.asrs.mapper; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.zy.asrs.domain.dto.WorkChartAxis; | 
|---|
|  |  |  | import com.zy.asrs.domain.vo.LocChartPie; | 
|---|
|  |  |  | import com.zy.asrs.entity.*; | 
|---|
|  |  |  | import org.apache.ibatis.annotations.Mapper; | 
|---|
|  |  |  | import org.apache.ibatis.annotations.Param; | 
|---|
|  |  |  | import org.apache.ibatis.annotations.Select; | 
|---|
|  |  |  | import org.springframework.stereotype.Repository; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @Mapper | 
|---|
|  |  |  | @Repository | 
|---|
|  |  |  | public interface ReportQueryMapper { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //分页查询库位使用率 | 
|---|
|  |  |  | List<ViewStockUseBean> queryViewStockUseList(ViewStockUseBean viewStockUse); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | int getViewStockUseCount(ViewStockUseBean viewStockUse); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<ViewStockUseBean> getViewStockUseAll(ViewStockUseBean viewStockUse); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //分页查询库存滞留时间 | 
|---|
|  |  |  | public List<ViewStayTimeBean> queryViewStayTimeList(ViewStayTimeBean viewStayTime); | 
|---|
|  |  |  | public int getViewStayTimeCount(ViewStayTimeBean viewStayTime); | 
|---|
|  |  |  | //不分页查询所有信息,用于excel导出 | 
|---|
|  |  |  | public List<ViewStayTimeBean> getViewStayTimeAll(ViewStayTimeBean viewStayTime); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //   // 库位Map | 
|---|
|  |  |  | @Select("select distinct row1 from asr_loc_mast order by row1 asc") | 
|---|
|  |  |  | List<Integer> getViewLocRowTotal(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 库位Map | 
|---|
|  |  |  | @Select("select distinct bay1 from asr_loc_mast where row1=#{row1} order by bay1") | 
|---|
|  |  |  | public List<String> getViewLocBayCount(@Param("row1") int row1); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Select("select distinct lev1 from asr_loc_mast where row1=#{row1} order by lev1 desc") | 
|---|
|  |  |  | public List<String> getViewLocLevCount(@Param("row1") int row1); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Select("select loc_no as locNo, bay1,loc_sts as locSts from asr_loc_mast where row1=#{row1} and lev1=#{lev1} order by bay1") | 
|---|
|  |  |  | public List<ViewLocMapDto> getViewLocBays(@Param("row1") int row1, @Param("lev1") int lev1); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //分页查询站点入出库次数统计 | 
|---|
|  |  |  | public List<ViewInOutBean> queryViewInOutList(ViewInOutBean viewInOut); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public int getViewInOutCount(ViewInOutBean viewInOut); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //不分页查询所有信息,用于excel导出 | 
|---|
|  |  |  | public List<ViewInOutBean> getViewInOutAll(ViewInOutBean viewInOut); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //分页查询日入库记录 | 
|---|
|  |  |  | public List<ViewWorkInBean> queryViewWorkInList(ViewWorkInBean viewWorkIn); | 
|---|
|  |  |  | public int getViewWorkInCount(ViewWorkInBean viewWorkIn); | 
|---|
|  |  |  | //不分页查询所有信息,用于excel导出 | 
|---|
|  |  |  | public List<ViewWorkInBean> getViewWorkInAll(ViewWorkInBean viewWorkIn); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<ViewWorkCountInView> selectWorkCountIn(@Param("curr") Integer curr, @Param("limit") Integer limit, @Param("matnr")String matnr, @Param("start") String startTime, @Param("end") String endTime); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Integer selectWorkCountInTotal(String matnr, @Param("start") String startTime, @Param("end") String endTime); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Integer selectWorkCountInSum(String matnr, @Param("start") String startTime, @Param("end") String endTime); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<ViewWorkCountInView> selectWorkCountOut(@Param("curr") Integer pageNumber, @Param("limit") Integer pageSize, String matnr, @Param("start") String startTime, @Param("end") String endTime); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Integer selectWorkCountOutTotal(String matnr, @Param("start") String startTime, @Param("end") String endTime); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Integer selectWorkCountOutSum(String matnr, @Param("start") String startTime, @Param("end") String endTime); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //分页查询日出库记录 | 
|---|
|  |  |  | public List<ViewWorkInBean> queryViewWorkOutList(ViewWorkInBean viewWorkOut); | 
|---|
|  |  |  | public int getViewWorkOutCount(ViewWorkInBean viewWorkOut); | 
|---|
|  |  |  | //不分页查询所有信息,用于excel导出 | 
|---|
|  |  |  | public List<ViewWorkInBean> getViewWorkOutAll(ViewWorkInBean viewWorkOut); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Select("select \n" + | 
|---|
|  |  |  | 
|---|
|  |  |  | "order by Min(wm.io_time) asc\n") | 
|---|
|  |  |  | List<Map<String, Object>> queryPakinRep(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Select("select\n" + | 
|---|
|  |  |  | "Min(wm.io_time) as node,\n" + | 
|---|
|  |  |  | "isnull(count(1), 0) as val\n" + | 
|---|
|  |  |  | "from asr_wrk_mast_log wm\n" + | 
|---|
|  |  |  | "where 1=1\n" + | 
|---|
|  |  |  | "and ((wm.wrk_sts = 15 AND wm.io_type = 101) OR (wm.wrk_sts = 14 AND wm.io_type = 103))\n" + | 
|---|
|  |  |  | "and datediff(d, wm.io_time, getdate())<=7\n" + | 
|---|
|  |  |  | "group by datediff(day,wm.io_time,getdate())\n" + | 
|---|
|  |  |  | "order by Min(wm.io_time) asc") | 
|---|
|  |  |  | List<Map<String, Object>> queryPakOutRep(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //曲线图 | 
|---|
|  |  |  | @Select("select ymd,SUM(sto_qty) inqty,SUM(ret_qty) outqty from asr_sta_inout_view " | 
|---|
|  |  |  | + "where ymd>CONVERT(char(10), DATEADD(DAY,-12,GETDATE()), 120) group by ymd order by ymd") | 
|---|
|  |  |  | public List<WorkChartAxis> getChartAxis(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Select("select * from asr_loc_use_view") | 
|---|
|  |  |  | LocChartPie getLocUseRate(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Select("select count(1) as totalWrk from asr_wrk_mast_log where crn_no = #{crnNo}") | 
|---|
|  |  |  | Integer getTotalWrkByCrnId(Integer crnNo); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Select("select count(1) as totalLoc from asr_loc_mast") | 
|---|
|  |  |  | Integer getTotalLocByCrnId(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|