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

  async delByUserId(user_id, t) {
    var sql = "DELETE FROM uc_user_role WHERE user_id = :user_id";
    await this.customUpdate(sql, {
      user_id: user_id
    }, t) || [];
  }

  async listByUserId(user_id, t) {
    var sql = "SELECT * FROM uc_user_role WHERE user_id = :user_id";
    return await this.customQuery(sql, {
      user_id: user_id
    }, t) || [];
  }
}
module.exports = UserroleDao;