// Path: app/src/main/java/com/liying/ipgw/model/Express.java
// public class Express {
//     /** 时间戳 */
//     private long time;
//     /** 快递单号 */
//     private String expressCode;
//     /** 快递公司公司 */
//     private String shipperName;
//     /** 快递公司编码 */
//     private String shipperCode;
//     /** 备注 */
//     private String mark;
// 
//     public static final String TIME = "time";
//     public static final String EXPRESS_CODE = "expressCode";
//     public static final String SHIPPER_NAME = "shipperName";
//     public static final String SHIPPER_CODE = "shipperCode";
//     public static final String MARK = "mark";
// 
//     public Express() {
//     }
// 
//     public Express(String expressCode, String shipperName, String shipperCode, String mark) {
//         this.expressCode = expressCode;
//         this.shipperName = shipperName;
//         this.shipperCode = shipperCode;
//         this.mark = mark;
//     }
// 
//     public long getTime() {
//         return time;
//     }
// 
//     public void setTime(long time) {
//         this.time = time;
//     }
// 
//     public String getExpressCode() {
//         return expressCode;
//     }
// 
//     public void setExpressCode(String expressCode) {
//         this.expressCode = expressCode;
//     }
// 
//     public String getShipperName() {
//         return shipperName;
//     }
// 
//     public void setShipperName(String shipperName) {
//         this.shipperName = shipperName;
//     }
// 
//     public String getShipperCode() {
//         return shipperCode;
//     }
// 
//     public void setShipperCode(String shipperCode) {
//         this.shipperCode = shipperCode;
//     }
// 
//     public String getMark() {
//         return mark;
//     }
// 
//     public void setMark(String mark) {
//         this.mark = mark;
//     }
// }


import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import com.liying.ipgw.model.Express;
import java.util.ArrayList;
import java.util.List;

    public void delExpressByTime(long time) {
        SQLiteDatabase db = this.dbHelper.getWritableDatabase();
        String sql = "DELETE FROM " + DBInfo.Table.EXPRESS_TB_NAME + " WHERE " + columns[0] + " = " + time;
        db.execSQL(sql);
        db.close();
    }

    /**
     * 查询所有快递单信息
     *
     * @return 所有快递单信息List
     */
    public List<Express> getAllExpress() {
        SQLiteDatabase db = this.dbHelper.getReadableDatabase();
        List<Express> expresses = null;
        Cursor cursor = db.query(DBInfo.Table.EXPRESS_TB_NAME, columns, null, null, null, null, null);
        if (null != cursor) {
            if (cursor.getCount() > 0) {
                expresses = new ArrayList<>(cursor.getCount());
                Express express = null;
                while (cursor.moveToNext()) {
                    express = new Express();
                    Long _time = cursor.getLong(cursor.getColumnIndex(columns[0]));
                    String _expressCode = cursor.getString(cursor.getColumnIndex(columns[1]));
                    String _shipperName = cursor.getString(cursor.getColumnIndex(columns[2]));
                    String _shipperCode = cursor.getString(cursor.getColumnIndex(columns[3]));
                    String _mark = cursor.getString(cursor.getColumnIndex(columns[4]));

                    express.setTime(_time);
                    express.setExpressCode(_expressCode);

// Path: app/src/main/java/com/liying/ipgw/model/Express.java
// public class Express {
//     /** 时间戳 */
//     private long time;
//     /** 快递单号 */
//     private String expressCode;
//     /** 快递公司公司 */
//     private String shipperName;
//     /** 快递公司编码 */
//     private String shipperCode;
//     /** 备注 */
//     private String mark;
// 
//     public static final String TIME = "time";
//     public static final String EXPRESS_CODE = "expressCode";
//     public static final String SHIPPER_NAME = "shipperName";
//     public static final String SHIPPER_CODE = "shipperCode";
//     public static final String MARK = "mark";
// 
//     public Express() {
//     }
// 
//     public Express(String expressCode, String shipperName, String shipperCode, String mark) {
//         this.expressCode = expressCode;
//         this.shipperName = shipperName;
//         this.shipperCode = shipperCode;
//         this.mark = mark;
//     }
// 
//     public long getTime() {
//         return time;
//     }
// 
//     public void setTime(long time) {
//         this.time = time;
//     }
// 
//     public String getExpressCode() {
//         return expressCode;
//     }
// 
//     public void setExpressCode(String expressCode) {
//         this.expressCode = expressCode;
//     }
// 
//     public String getShipperName() {
//         return shipperName;
//     }
// 
//     public void setShipperName(String shipperName) {
//         this.shipperName = shipperName;
//     }
// 
//     public String getShipperCode() {
//         return shipperCode;
//     }
// 
//     public void setShipperCode(String shipperCode) {
//         this.shipperCode = shipperCode;
//     }
// 
//     public String getMark() {
//         return mark;
//     }
// 
//     public void setMark(String mark) {
//         this.mark = mark;
//     }
// }


// Path: app/src/main/java/com/liying/ipgw/db/ExpressServices.java
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import com.liying.ipgw.model.Express;
import java.util.ArrayList;
import java.util.List;

    public void delExpressByTime(long time) {
        SQLiteDatabase db = this.dbHelper.getWritableDatabase();
        String sql = "DELETE FROM " + DBInfo.Table.EXPRESS_TB_NAME + " WHERE " + columns[0] + " = " + time;
        db.execSQL(sql);
        db.close();
    }

    /**
     * 查询所有快递单信息
     *
     * @return 所有快递单信息List
     */
    public List<Express> getAllExpress() {
        SQLiteDatabase db = this.dbHelper.getReadableDatabase();
        List<Express> expresses = null;
        Cursor cursor = db.query(DBInfo.Table.EXPRESS_TB_NAME, columns, null, null, null, null, null);
        if (null != cursor) {
            if (cursor.getCount() > 0) {
                expresses = new ArrayList<>(cursor.getCount());
                Express express = null;
                while (cursor.moveToNext()) {
                    express = new Express();
                    Long _time = cursor.getLong(cursor.getColumnIndex(columns[0]));
                    String _expressCode = cursor.getString(cursor.getColumnIndex(columns[1]));
                    String _shipperName = cursor.getString(cursor.getColumnIndex(columns[2]));
                    String _shipperCode = cursor.getString(cursor.getColumnIndex(columns[3]));
                    String _mark = cursor.getString(cursor.getColumnIndex(columns[4]));

                    express.setTime(_time);
                    express.setExpressCode(_expressCode);

                    express.setShipperName(_shipperName);
