package com.zy.asrs.mapper; import com.baomidou.mybatisplus.mapper.BaseMapper; import com.zy.asrs.entity.LocDetl; import com.zy.asrs.entity.LocDetlWarningDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Update; import org.springframework.stereotype.Repository; import java.util.List; import java.util.Map; @Mapper @Repository public interface LocDetlMapper extends BaseMapper { List getStockOutPage(Map map); Integer getStockOutPageCount(Map map); @Update("update asr_loc_detl set qty=#{qty}, modi_time = getDate(),all_weight=#{weight},all_qty=#{allQty} where loc_no = #{locNo} and mat_no = #{matNo}") int updateAnfme(Double qty, String locNo, String matNo,Double weight,Double allQty); @Update("update asr_loc_detl set loc_no = #{newLocNo}, modi_time=getDate() where loc_no = #{oldLocNo}") int updateLocNo(String newLocNo, String oldLocNo); @Select("SELECT ld.loc_no FROM asr_loc_detl ld LEFT JOIN asr_loc_mast lm ON ld.loc_no = lm.loc_no WHERE (1 = 1 AND ld.mat_no = #{matNo} AND (lm.row1 >= #{start} AND lm.row1 <= #{end}) AND lm.loc_sts = 'F' AND DateDiff(dd, lm.modi_time, getdate()) = 0) ORDER BY lm.modi_time ASC") List selectSameDetlToday(@Param("matNo") String matNo, @Param("start") Integer start, @Param("end") Integer end); List selectLocDetlList(@Param("mat_no") String matNo); Double selectLocDetlSumQty(String locNo); List getStockStatis(Map condition); Integer getStockStatisCount(Map condition); List getStockStatisExcel(LocDetl locDetl); /** * 库存上报ERP时,根据物料汇总查询库存总量 * @return */ @Select("select mat_no,mat_name,sum(qty) qty from asr_loc_detl group by mat_no,mat_name") List getStockSum(); List selectAllWarning(LocDetlWarningDTO locDetlWarningDTO); int getAllWarningCount(LocDetlWarningDTO locDetlWarningDTO); }