using Models;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DAL
{
public class ViewbreakfastPriceService
{
///
/// 查询所有
///
/// sql语句
/// 可变参数数组
/// 返回集合
List excuteSql(string sql, params SqlParameter[] param)
{
return ServiceBase.excuteSql(new ViewbreakfastPrice(), "ViewbreakfastPrice", sql, CommandType.Text, param);
}
///
/// 获取单个对象
///
/// sql语句
/// 可变参数数组
/// 返回空或者单个对象
ViewbreakfastPrice excuteType(string sql, params SqlParameter[] param)
{
//查询结果放入对象集合
List ctggdList = excuteSql(sql, param);
//判断集合是否为空
if (ctggdList == null || ctggdList.Count == 0)
//返回null
return null;
//返回单个对象
return ctggdList[0];
}
public List GetAll(int diid)
{
string sql = $@" select a.breakfastPrice,b.PayMoney, c.HotelName,b.PaymentCurrency,c.City,d.Name as PayCurrencyName,b.DayRate,b.RMBPrice
from hotelidbreakfast a inner join CreditCardPayment b on a.diid = b.diid and a.tid = b.cid inner join HotelReservations c on a.hotelid = c.id
inner join SetData d on b.PaymentCurrency = d.Id
where a.isdel = 0 and b.isdel = 0 and a.diid = {diid} And d.STid = 13 and d.Name <> '其他款项' and a.breakfastPrice > 0 ";
return excuteSql(sql);
}
}
}