王佳豪
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
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.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
 
import com.slcf.bean.MatCodeCondition;
import com.slcf.pojo.LocDetailBean;
import com.slcf.pojo.MatCodeBean;
import com.slcf.pojo.WorkDetailBean;
 
@Repository
public interface MatCodeDao {
 
    /**
     * 添加
     * @param matCode
     * @return
     */
    @Insert("insert into bas_mat_code(mat_no,mat_name,str1,str2,str3,str4,str5,"
            + " str6,str7,str8,str9,str10,str11,str12,str13,str14,str15, "
            + " str16,str17,str18,str19,str20,str21,str22,str23, "
            + " num1,num2,num3,num4,num5,num6,date1,barcode) "
            + " values(#{mat_no},#{mat_name},#{str1},#{str2},#{str3},#{str4},#{str5},"
            + " #{str6},#{str7},#{str8},#{str9},#{str10},#{str11},#{str12},#{str13},#{str14},#{str15}, " 
            + " #{str16},#{str17},#{str18},#{str19},#{str20},#{str21},#{str22},#{str23},"
            + " #{num1},#{num2},#{num3},#{num4},#{num5},#{num6},#{date1},#{barcode})")
    public int insertMatCode(MatCodeBean MatCode);
    
    /**
     * 分页查询所有信息     
     * @param matCodeCon
     * @return
     */
    public List<MatCodeBean> queryMatCodeList(MatCodeCondition matCodeCon);
    
    /**
     * 根据箱号查询
     * @param matCodeCon
     * @return
     */
    @Select("select * from bas_mat_code where mat_no=#{mat_no}")
    public List<MatCodeBean> queryMatCodeByNo(MatCodeCondition matCodeCon);
    
    @Select("select count(*) from bas_mat_code where mat_no=#{mat_no}")
    public int getMatCountByNo(MatCodeCondition matCodeCon);
    
    /**
     * 不分页查询所有信息,用于excel导出
     * @param matCodeCon
     * @return
     */
    public List<MatCodeBean> getMatCodeAll(MatCodeCondition matCodeCon);
    
//    //统计所有数据总数量
//    @Select("select count(*) from bas_mat_code")
//    public int getMatCodeCount();
    
    //根据过滤条件统计总数量
    public int getMatCodeCount(MatCodeCondition matCodeCon);
    
    /**
     * 查询所有
     * @return
     */
    @Select("select * from bas_mat_code order by mat_no asc")
    public List<MatCodeBean> getMatCodeList();
    
    /**
     * 根据id查询信息
     * @param id
     * @return
     */
    @Select("select * from bas_mat_code where mat_no=#{id}")
    public MatCodeBean getMatCodeById(String id);
    
    /**
     * 根据barcode查询信息
     * @param id
     * @return
     */
    @Select("select * from bas_mat_code where barcode=#{id}")
    public MatCodeBean getMatCodeByBarcode(String id);
    
    //更新
    @Update("update bas_mat_code set mat_name=#{mat_name},str1=#{str1},str2=#{str2},str3=#{str3}, "
            + " str4=#{str4},str5=#{str5},str6=#{str6},str7=#{str7},str8=#{str8},str9=#{str9}, " 
            + " str10=#{str10},num1=#{num1},num2=#{num2},num3=#{num3},num4=#{num4},num5=#{num5}, "
            + " modi_user=#{modi_user},modi_time=getdate() where mat_no=#{mat_no}")
    public int upMatCode(MatCodeBean MatCode);
    
    //组托,更新条码
    @Update("update bas_mat_code set barcode=#{barcode},modi_time=getdate() where mat_no=#{mat_no}")
    public int upMatBarcode(MatCodeBean MatCode);
        
    //根据id删除工作信息
    @Delete("delete from bas_mat_code where mat_no=#{id}")
    public int delMatCodeById(String id);
    
    //根据id删除工作信息
    @Delete("delete from bas_mat_code where mat_no in (#{id})")
    public int delMatCodesById(String id);
    
    /**
     * 查询库存中物料号是否存在
     * @return
     */
    @Select("select * from asr_loc_detl where mat_no=#{mat_no}")
    public List<LocDetailBean> getLocMatNoList(String mat_no);
    
    /**
     * 查询工作档中物料号是否存在
     * @return
     */
    @Select("select * from asr_wrk_detl where mat_no=#{mat_no}")
    public List<WorkDetailBean> getWrkMatNoList(String mat_no);
}