123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using Models;
- using System.Data.SqlClient;
- using System.Data;
- namespace DAL
- {
- /// <summary>
- /// 地接各项地区总费用数据访问类
- /// </summary>
- public class ViewGroudCitySumPriceService
- {
- /// <summary>
- /// 查询所有
- /// </summary>
- /// <param name="sql">sql语句</param>
- /// <param name="param">可变参数数组</param>
- /// <returns>返回集合</returns>
- List<ViewGroudCitySumPrice> excuteSql(string sql, params SqlParameter[] param)
- {
- return ServiceBase<ViewGroudCitySumPrice>.excuteSql(new ViewGroudCitySumPrice(), "ViewGroudCitySumPrice", sql, CommandType.Text, param);
- }
- /// <summary>
- /// 获取单个对象
- /// </summary>
- /// <param name="sql">sql语句</param>
- /// <param name="param">可变参数数组</param>
- /// <returns>返回空或者单个对象</returns>
- ViewGroudCitySumPrice excuteType(string sql, params SqlParameter[] param)
- {
- //查询结果放入对象集合
- List<ViewGroudCitySumPrice> ctggdList = excuteSql(sql, param);
- //判断集合是否为空
- if (ctggdList == null || ctggdList.Count == 0)
- //返回null
- return null;
- //返回单个对象
- return ctggdList[0];
- }
- /// <summary>
- /// 根据编号查询对象信息
- /// </summary>
- /// <param name="id">对象编号</param>
- /// <returns>返回空或者单个对象信息</returns>
- public ViewGroudCitySumPrice GetViewGroudCitySumPriceByID(int id)
- {
- //调用获取单个对象的方法
- return excuteType("select * from ViewGroudCitySumPrice where Id = @id and IsDel = 0", new SqlParameter("@id", id));
- }
- /// <summary>
- /// 获取全部
- /// </summary>
- /// <returns></returns>
- public List<ViewGroudCitySumPrice> GetAll()
- {
- return excuteSql("select * from ViewGroudCitySumPrice where IsDel = 0");
- }
- /// <summary>
- /// 根据编号查询对象信息
- /// </summary>
- /// <param name="id">对象编号</param>
- /// <returns>返回空或者对象信息</returns>
- public List<ViewGroudCitySumPrice> GetByDIId(int DIId)
- {
- //调用获取单个对象的方法
- //return excuteSql("select c.OperatorDate,ccp.PayPercentage,ccp.PayThenMoney,c.Area,sum(cc.Price) as sumPrice,sd2.[name] as Currency,ccp.PayMoney,ccp.DayRate,ccp.RMBPrice from CarTouristGuideGroundReservationsContent cc join CarTouristGuideGroundReservations c on c.id = cc.CTGGRId join CreditCardPayment ccp on ccp.Diid = c.Diid and ccp.Cid = c.Id join SetData sd on sd.id = cc.Sid join SetData sd2 on sd2.id = cc.Currency where c.DIID = @DIId and c.IsDel = 0 and ccp.CTable= 79 and ccp.IsPay = 1 group by c.Area,sd2.[name],ccp.PayMoney,ccp.DayRate,ccp.RMBPrice,ccp.PayPercentage,ccp.PayThenMoney,c.OperatorDate order by c.Area", new SqlParameter("@DIId", DIId));
- return excuteSql("select c.OperatorDate,ccp.PayPercentage,ccp.PayThenMoney,c.Area,sum(cc.Price) as sumPrice,sd2.[name] as Currency,ccp.PayMoney,ccp.DayRate,ccp.RMBPrice,ccp.payee from CarTouristGuideGroundReservationsContent cc join CarTouristGuideGroundReservations c on c.id = cc.CTGGRId join CreditCardPayment ccp on ccp.Diid = c.Diid and ccp.Cid = c.Id join SetData sd on sd.id = cc.Sid join SetData sd2 on sd2.id = cc.Currency where c.DIID = @DIId and c.IsDel = 0 and ccp.CTable= 79 and IsAuditGM <> 2 and ccp.isDel=0 and ccp.operator != 0 group by c.Area,sd2.[name],ccp.PayMoney,ccp.DayRate,ccp.RMBPrice,ccp.PayPercentage,ccp.PayThenMoney,c.OperatorDate,ccp.payee order by c.Area", new SqlParameter("@DIId", DIId));
- }
- }
- }
|