12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- 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
- {
- /// <summary>
- /// 查询所有
- /// </summary>
- /// <param name="sql">sql语句</param>
- /// <param name="param">可变参数数组</param>
- /// <returns>返回集合</returns>
- List<ViewbreakfastPrice> excuteSql(string sql, params SqlParameter[] param)
- {
- return ServiceBase<ViewbreakfastPrice>.excuteSql(new ViewbreakfastPrice(), "ViewbreakfastPrice", sql, CommandType.Text, param);
- }
- /// <summary>
- /// 获取单个对象
- /// </summary>
- /// <param name="sql">sql语句</param>
- /// <param name="param">可变参数数组</param>
- /// <returns>返回空或者单个对象</returns>
- ViewbreakfastPrice excuteType(string sql, params SqlParameter[] param)
- {
- //查询结果放入对象集合
- List<ViewbreakfastPrice> ctggdList = excuteSql(sql, param);
- //判断集合是否为空
- if (ctggdList == null || ctggdList.Count == 0)
- //返回null
- return null;
- //返回单个对象
- return ctggdList[0];
- }
- public List<ViewbreakfastPrice> 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);
- }
- }
- }
|