王佳豪
2021-06-26 718f604deb342b0bee6c588bb44e22ced3371fb8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
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.WaitCheckCondition;
import com.slcf.pojo.WaitCheckBean;
 
@Repository
public interface WaitCheckDao {
 
    /**
     * 添加
     * @param waitCheck
     * @return
     */
    @Insert("insert into cust_wait_check(lgnum,ivnum,ivpos,lqnum,matnr,maktx,werks,lgtyp,lgpla, "
            + " memo,modi_time) "
            + " values(#{lgnum},#{ivnum},#{ivpos},#{lqnum},#{matnr},#{maktx},#{werks},#{lgtyp},#{lgpla}, "
            + " #{memo},getdate())")
    public int insertWaitCheck(WaitCheckBean waitCheck);
    
    //分页查询所有信息
    public List<WaitCheckBean> queryWaitCheckList(WaitCheckCondition waitCheckCon);
    
//    //统计所有数据总数量
//    @Select("select count(*) from cust_wait_check")
//    public int getLocationCount();
    
    //根据过滤条件统计总数量
    public int getWaitCheckCount(WaitCheckCondition waitCheckCon);
    
    /**
     * 查询所有
     * @return
     */
    @Select("select * from cust_wait_check order by sheet_no,mat_no desc")
    public List<WaitCheckBean> getWaitCheckList();
    
    /**
     * 查询信息
     * @param id
     * @return
     */
    @Select("select * from cust_wait_check where lgnum=#{lgnum} and tbnum=#{tbnum} and tbpos=#{tbpos} and zmatid=#{zmatid}")
    public WaitCheckBean getWaitCheckById(WaitCheckBean waitCheck);
    
    //更新
    @Update("update cust_wait_check set qty=#{qty},ctns=#{ctns},wt=#{wt},memo=#{memo},modi_user=#{modi_user},modi_time=getdate(), "
            + " loc_no=#{loc_no}, sta_no=#{sta_no},type=#{type},in_qty=#{in_qty},barcode=#{barcode} "
            + " where sheet_no=#{sheet_no} and mat_no=#{mat_no}")
    public int upWaitCheck(WaitCheckBean waitCheck);
    
    //根据id删除工作信息
    @Delete("delete from cust_wait_check where lgnum=#{lgnum} and ivnum=#{ivnum} and ivpos=#{ivpos}")
    public int delWaitCheckById(WaitCheckBean waitCheckBean);
    
    //待删除资料,先插入日志档
    @Insert("insert into cust_wait_check_log select * from cust_wait_check where lgnum=#{lgnum} and ivnum=#{ivnum} and ivpos=#{ivpos}")
    public int insertLog(WaitCheckBean waitCheckBean);
    
    /**
     * 根据条码查询通知档
     * @return
     */
    @Select("select * from cust_wait_check 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<WaitCheckBean> getApiWaitCheckList(@Param("barcode")String barcode);
}