DataBaseHelpter.java 3.42 KB
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);
    }

}