|
|
@@ -5,6 +5,8 @@ import android.database.sqlite.SQLiteDatabase; |
|
|
|
import com.example.bpa.config.ConfigName; |
|
|
|
import com.example.bpa.db.file.DBHelper; |
|
|
|
import com.example.bpa.db.mode.BPA_ALERTLOG; |
|
|
|
import com.example.bpa.db.mode.BPA_CRAFT; |
|
|
|
import com.example.bpa.db.mode.BPA_CRAFTPROCESS; |
|
|
|
import com.example.bpa.db.mode.BPA_GOODS; |
|
|
|
import com.example.bpa.db.mode.BPA_GOODSRECIPE; |
|
|
|
import com.example.bpa.db.mode.BPA_LOG; |
|
|
@@ -1669,6 +1671,125 @@ public class QueryDB { |
|
|
|
} |
|
|
|
//endregion |
|
|
|
|
|
|
|
//region BPA_CRAFT 工艺基础信息表 |
|
|
|
|
|
|
|
/** |
|
|
|
* 新增工艺基础信息表 |
|
|
|
* add fengyoufu 20230413 |
|
|
|
* |
|
|
|
* @param data |
|
|
|
* @return 是否成功 |
|
|
|
*/ |
|
|
|
public static boolean AddCraft(BPA_CRAFT data) { |
|
|
|
return Add(BPA_CRAFT.class, data); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 修改工艺基础信息表 |
|
|
|
* add fengyoufu 20230413 |
|
|
|
* |
|
|
|
* @param data |
|
|
|
*/ |
|
|
|
public static void UpdateCraft(BPA_CRAFT data) { |
|
|
|
Update(BPA_CRAFT.class, data); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 删除工艺基础信息表 |
|
|
|
* add fengyoufu 20230413 |
|
|
|
* |
|
|
|
* @return 是否成功 |
|
|
|
*/ |
|
|
|
public static boolean DeleteCraft(String id) { |
|
|
|
return Delete(BPA_CRAFT.class, id); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取工艺基础信息表 |
|
|
|
* |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public static ArrayList<BPA_CRAFT> GetCraftALL() { |
|
|
|
String orderby = Desc_Time_Up;//先按排序 创建时间倒序 |
|
|
|
String where = "isDelete=?"; |
|
|
|
String[] args = new String[]{"0"}; |
|
|
|
ArrayList<BPA_CRAFT> data = new ArrayList<>(); |
|
|
|
ArrayList<Object> obj = Get(BPA_CRAFT.class, where, args, orderby); |
|
|
|
for (Object k : obj) { |
|
|
|
data.add((BPA_CRAFT) k); |
|
|
|
} |
|
|
|
return data; |
|
|
|
} |
|
|
|
//endregion |
|
|
|
|
|
|
|
//region BPA_CRAFTPROCESS 工艺流程表 |
|
|
|
|
|
|
|
/** |
|
|
|
* 新增工艺流程表 |
|
|
|
* add fengyoufu 20230413 |
|
|
|
* |
|
|
|
* @param data |
|
|
|
* @return 是否成功 |
|
|
|
*/ |
|
|
|
public static boolean AddCraftProcess(BPA_CRAFTPROCESS data) { |
|
|
|
return Add(BPA_CRAFTPROCESS.class, data); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 修改工艺流程表 |
|
|
|
* add fengyoufu 20230413 |
|
|
|
* |
|
|
|
* @param data |
|
|
|
*/ |
|
|
|
public static void UpdateCraftProcess(BPA_CRAFTPROCESS data) { |
|
|
|
Update(BPA_CRAFTPROCESS.class, data); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 删除工艺流程表 |
|
|
|
* add fengyoufu 20230413 |
|
|
|
* |
|
|
|
* @return 是否成功 |
|
|
|
*/ |
|
|
|
public static boolean DeleteCraftProcess(String id) { |
|
|
|
return Delete(BPA_CRAFTPROCESS.class, id); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取工艺流程表 |
|
|
|
* |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public static ArrayList<BPA_CRAFTPROCESS> GetCraftProcessALL() { |
|
|
|
String orderby = Desc_Time_Up;//先按排序 创建时间倒序 |
|
|
|
String where = "isDelete=?"; |
|
|
|
String[] args = new String[]{"0"}; |
|
|
|
ArrayList<BPA_CRAFTPROCESS> data = new ArrayList<>(); |
|
|
|
ArrayList<Object> obj = Get(BPA_CRAFTPROCESS.class, where, args, orderby); |
|
|
|
for (Object k : obj) { |
|
|
|
data.add((BPA_CRAFTPROCESS) k); |
|
|
|
} |
|
|
|
return data; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 根据工艺id获取工艺流程表 |
|
|
|
* |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public static ArrayList<BPA_CRAFTPROCESS> GetCraftProcessId(String id) { |
|
|
|
String orderby = Desc_Time_Up;//先按排序 创建时间倒序 |
|
|
|
String where = "isDelete=? and gyid=?"; |
|
|
|
String[] args = new String[]{"0",id}; |
|
|
|
ArrayList<BPA_CRAFTPROCESS> data = new ArrayList<>(); |
|
|
|
ArrayList<Object> obj = Get(BPA_CRAFTPROCESS.class, where, args, orderby); |
|
|
|
for (Object k : obj) { |
|
|
|
data.add((BPA_CRAFTPROCESS) k); |
|
|
|
} |
|
|
|
return data; |
|
|
|
} |
|
|
|
//endregion |
|
|
|
|
|
|
|
//region 私有 |
|
|
|
|
|
|
|
/** |
|
|
@@ -1880,6 +2001,7 @@ public class QueryDB { |
|
|
|
((BPA_GOODS) data).sort = cursor.getInt((int) cursor.getColumnIndex("sort")); |
|
|
|
((BPA_GOODS) data).status = cursor.getInt((int) cursor.getColumnIndex("status")); |
|
|
|
((BPA_GOODS) data).url = cursor.getString((int) cursor.getColumnIndex("url")); |
|
|
|
((BPA_GOODS) data).gyid = cursor.getString((int) cursor.getColumnIndex("gyid")); |
|
|
|
break; |
|
|
|
case "BPA_GOODSRECIPE": |
|
|
|
data = new BPA_GOODSRECIPE(); |
|
|
@@ -1960,6 +2082,19 @@ public class QueryDB { |
|
|
|
//私有 |
|
|
|
((BPA_SUGAR)data).sugarName = cursor.getString((int) cursor.getColumnIndex("sugarName")); |
|
|
|
((BPA_SUGAR)data).plcvar = cursor.getString((int) cursor.getColumnIndex("plcvar")); |
|
|
|
case "BPA_CRAFT": |
|
|
|
data = new BPA_CRAFT(); |
|
|
|
//私有 |
|
|
|
((BPA_CRAFT)data).status = cursor.getInt((int) cursor.getColumnIndex("status")); |
|
|
|
((BPA_CRAFT)data).name = cursor.getString((int) cursor.getColumnIndex("name")); |
|
|
|
case "BPA_CRAFTPROCESS": |
|
|
|
data = new BPA_CRAFTPROCESS(); |
|
|
|
//私有 |
|
|
|
((BPA_CRAFTPROCESS)data).gyid = cursor.getString((int) cursor.getColumnIndex("gyid")); |
|
|
|
((BPA_CRAFTPROCESS)data).pfid = cursor.getString((int) cursor.getColumnIndex("pfid")); |
|
|
|
((BPA_CRAFTPROCESS)data).sort = cursor.getInt((int) cursor.getColumnIndex("sort")); |
|
|
|
((BPA_CRAFTPROCESS)data).value = cursor.getInt((int) cursor.getColumnIndex("value")); |
|
|
|
|
|
|
|
} |
|
|
|
((ModeBase) data).id = cursor.getString((int) cursor.getColumnIndex("id")); |
|
|
|
((ModeBase) data).createTime = cursor.getString((int) cursor.getColumnIndex("createTime")); |
|
|
|