新增:转发规则新增是否启用状态

pull/115/head
pppscn 2 years ago
parent 3f8f37c59b
commit 1f75928ac3

@ -68,7 +68,7 @@ public class SendUtil {
LogUtil.init(context);
String key = "SIM" + simId;
List<RuleModel> ruleList = RuleUtil.getRule(null, key, type);
List<RuleModel> ruleList = RuleUtil.getRule(null, key, type, "1"); //只取已启用的规则
if (!ruleList.isEmpty()) {
Log.d(TAG, ruleList.toString());
SenderUtil.init(context);

@ -92,6 +92,10 @@ public class RuleUtil {
}
public static List<RuleModel> getRule(Long id, String key, String type) {
return getRule(id, key, type, null);
}
public static List<RuleModel> getRule(Long id, String key, String type, String status) {
// Define a projection that specifies which columns from the database
// you will actually use after this query.
String[] projection = {
@ -123,6 +127,11 @@ public class RuleUtil {
selectionArgList.add(type);
}
if (status != null) {
selection += " and " + RuleTable.RuleEntry.COLUMN_NAME_STATUS + " = ? ";
selectionArgList.add(status);
}
if (key != null) {
// Define 'where' part of query.
if (key.equals("SIM1") || key.equals("SIM2")) {

Loading…
Cancel
Save