package com.slcf.dao; import java.util.List; import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Update; import org.springframework.stereotype.Repository; import com.slcf.bean.WaitPakInCondition; import com.slcf.pojo.WaitPakInBean; @Repository public interface WaitPakInDao { /** * 添加 * @param waitPakIn * @return */ @Insert("insert into cust_wait_pakin(lgnum,tbnum,tbpos,zmatid,matnr,maktx,werks,anfme,altme, " + " zpallet,bname,memo,modi_user,modi_time) " + " values(#{lgnum},#{tbnum},#{tbpos},#{zmatid},#{matnr},#{maktx},#{werks},#{anfme},#{altme}, " + " #{zpallet},#{bname},#{memo},#{modi_user},getdate())") public int insertWaitPakIn(WaitPakInBean waitPakIn); //分页查询所有信息 // @Select("select top (#{epage}) * from cust_wait_pakin where loc_no not in " // @Select("select top (#{epage}) a.*,b.loc_desc loc_sts_name from cust_wait_pakin a,asr_bas_loc_type b where a.loc_sts=b.loc_sts and loc_no not in " // + " (select top (#{spage}) loc_no from cust_wait_pakin order by loc_no asc) order by loc_no asc") public List queryWaitPakInList(WaitPakInCondition waitPakInCon); // //统计所有数据总数量 // @Select("select count(*) from cust_wait_pakin") // public int getLocationCount(); //根据过滤条件统计总数量 public int getWaitPakInCount(WaitPakInCondition waitPakInCon); /** * 查询所有 * @return */ @Select("select * from cust_wait_pakin order by sheet_no,mat_no desc") public List getWaitPakInList(); /** * 查询信息 * @param id * @return */ @Select("select * from cust_wait_pakin where lgnum=#{lgnum} and tbnum=#{tbnum} and tbpos=#{tbpos} and zmatid=#{zmatid}") public WaitPakInBean getWaitPakInById(WaitPakInBean waitPakIn); //更新 @Update("update cust_wait_pakin set io_status=#{io_status},memo=#{memo},modi_time=getdate() " + " where lgnum=#{lgnum} and tbnum=#{tbnum} and tbpos=#{tbpos} and zmatid=#{zmatid} and matnr=#{matnr}") public int upWaitPakIn(WaitPakInBean waitPakIn); //根据id删除工作信息 @Delete("delete from cust_wait_pakin where lgnum=#{lgnum} and tbnum=#{tbnum} and tbpos=#{tbpos} and zmatid=#{zmatid}") public int delWaitPakInById(WaitPakInBean waitPakIn); //待删除资料,先插入日志档 @Insert("insert into cust_wait_pakin_log select * from cust_wait_pakin where lgnum=#{lgnum} and tbnum=#{tbnum} and tbpos=#{tbpos} and zmatid=#{zmatid} and matnr=#{matnr}") public int insertLog(WaitPakInBean waitPakIn); /** * 根据条码查询通知档 * @return */ @Select("select * from cust_wait_pakin a left join bas_mat_code b on a.mat_no=b.mat_no " + "where barcode=#{barcode} order by sheet_no,a.mat_no desc") public List getApiWaitPakInList(@Param("barcode")String barcode); /** * 查询最早一笔待反馈SAP数据 * @return */ @Select("select top 1 * from cust_wait_pakin where io_status='Y' or io_status='X' order by io_status desc,modi_time asc") public WaitPakInBean getWaitPakInFnh(); //根据条码zpallet删除待入库信息 @Delete("delete from cust_wait_pakin where zpallet=#{zpallet}") public int delWaitPakInByBarcode(@Param("zpallet")String zpallet); }