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

  async getById(id) {
    return await this.model.findOne({where:{id:id}, raw: true});
  }

  async findMapByIds(ids) {
    var result = [];
    if(!ids || ids.length == 0) {
      return result;
    }

    var sql = "SELECT * FROM bm_requirements where id IN (:ids) ";
    var list = await this.customQuery(sql, {ids:ids});
    if(!list || list.length == 0) {
      return result;
    }

    for(var item of list) {
      result["id_" + item.id] = item;
    }

    return result;
  }
}
module.exports=BmrequirementsDao;
