DataBaseHelpter.java
3.42 KB
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
package com.lijinji.scan.util;
import com.lijinji.scan.WMSApplication;
import com.lijinji.scan.bean.ActivityIslandBean;
import com.lijinji.scan.bean.LineBean;
import com.lijinji.scan.bean.MenuOperationBean;
import com.lijinji.scan.bean.ProductBean;
import com.lijinji.scan.bean.ProductTransBean;
import com.lijinji.scan.bean.RGVUserBean;
import com.lijinji.scan.bean.RolesBean;
import com.lijinji.scan.bean.WorkProcessBean;
import com.lijinji.scan.bean.WorkProcessDetailBean;
import com.lijinji.scan.wmsgreendao.DaoManager;
import java.util.List;
public class DataBaseHelpter {
public static List<ActivityIslandBean> queryAllActivityIsland(){
return DaoManager.getInstance(WMSApplication.getContext()).getDaoSession().loadAll(ActivityIslandBean.class);
}
public static void insertActivityIsland(ActivityIslandBean activityIslandBean) {
DaoManager.getInstance(WMSApplication.getContext()).getDaoSession().getActivityIslandBeanDao().insert(activityIslandBean);
}
public static List<LineBean> queryAllLine(){
return DaoManager.getInstance(WMSApplication.getContext()).getDaoSession().loadAll(LineBean.class);
}
public static void insertLine(LineBean lineBean) {
DaoManager.getInstance(WMSApplication.getContext()).getDaoSession().getLineBeanDao().insert(lineBean);
}
public static List<ProductBean> queryAllProduct(){
return DaoManager.getInstance(WMSApplication.getContext()).getDaoSession().loadAll(ProductBean.class);
}
public static void insertProduct(ProductBean productBean) {
DaoManager.getInstance(WMSApplication.getContext()).getDaoSession().getProductBeanDao().insert(productBean);
}
public static List<MenuOperationBean> queryAllMenuOperation(){
return DaoManager.getInstance(WMSApplication.getContext()).getDaoSession().loadAll(MenuOperationBean.class);
}
public static void insertMenuOperationBean(MenuOperationBean menuOperationBean) {
DaoManager.getInstance(WMSApplication.getContext()).getDaoSession().getMenuOperationBeanDao().insert(menuOperationBean);
}
// public static List<RGVUserBean> queryAllUser(){
// return DaoManager.getInstance(WMSApplication.getContext()).getDaoSession().loadAll(RGVUserBean.class);
// }
//
// public static void insertUser(RGVUserBean rgvUserBean) {
// DaoManager.getInstance(WMSApplication.getContext()).getDaoSession().getRGVUserBeanDao().insert(rgvUserBean);
// }
public static <T> void deleteAll(Class<T> entityClass) {
DaoManager.getInstance(WMSApplication.getContext()).getDaoSession().deleteAll(entityClass);
}
public static List<WorkProcessBean> queryAllWorkProcess(){
return DaoManager.getInstance(WMSApplication.getContext()).getDaoSession().loadAll(WorkProcessBean.class);
}
public static void insertWorkProcess(WorkProcessBean workProcessBean) {
// DaoManager.getInstance(WMSApplication.getContext()).getDaoSession().getWorkProcessBeanDao().insert(workProcessBean);
}
public static List<WorkProcessDetailBean> queryAllWorkProcessDetailBean(){
return DaoManager.getInstance(WMSApplication.getContext()).getDaoSession().loadAll(WorkProcessDetailBean.class);
}
public static void insertWorkProcessDetailBean(WorkProcessDetailBean workProcessDetailBean) {
DaoManager.getInstance(WMSApplication.getContext()).getDaoSession().getWorkProcessDetailBeanDao().insert(workProcessDetailBean);
}
}