const system = require("../../../system");
const Dao = require("../../dao.base");
class SaasOrderDeliverInfoDao extends Dao {
  constructor() {
    super(Dao.getModelName(SaasOrderDeliverInfoDao));
  }

  async mapByIds(ids, attrs) {
    let result = {};
    if (!ids || ids.length == 0) {
      return result;
    }
    let sql = [];
    sql.push("SELECT");
    sql.push(attrs || "*");
    sql.push("FROM");
    sql.push(this.model.tableName);
    sql.push("WHERE id IN (:ids)");

    var list = await this.customQuery(sql.join(" "), {
      ids: ids
    });
    if (!list || list.length == 0) {
      return result;
    }
    for (var item of list) {
      result[item.id] = item;
    }
    return result;
  }
}
module.exports = SaasOrderDeliverInfoDao;