123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- 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 ViewInvitationOfficialActivitiesPayService
- {
- /// <summary>
- /// 查询所有
- /// </summary>
- /// <param name="sql">sql语句</param>
- /// <param name="param">可变参数数组</param>
- /// <returns>返回集合</returns>
- List<ViewInvitationOfficialActivitiesPay> excuteSql(string sql, params SqlParameter[] param)
- {
- return ServiceBase<ViewInvitationOfficialActivitiesPay>.excuteSql(new ViewInvitationOfficialActivitiesPay(), "ViewInvitationOfficialActivitiesPay", sql, CommandType.Text, param);
- }
- /// <summary>
- /// 获取单个对象
- /// </summary>
- /// <param name="sql">sql语句</param>
- /// <param name="param">可变参数数组</param>
- /// <returns>返回空或者单个对象</returns>
- ViewInvitationOfficialActivitiesPay excuteType(string sql, params SqlParameter[] param)
- {
- //查询结果放入对象集合
- List<ViewInvitationOfficialActivitiesPay> 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 ViewInvitationOfficialActivitiesPay GetViewInvitationOfficialActivitiesPayByID(int id)
- {
- //调用获取单个对象的方法
- return excuteType("select * from ViewInvitationOfficialActivitiesPay where Id = @id and IsDel = 0", new SqlParameter("@id", id));
- }
- /// <summary>
- /// 获取全部
- /// </summary>
- /// <returns></returns>
- public List<ViewInvitationOfficialActivitiesPay> GetAll()
- {
- return excuteSql("select * from ViewInvitationOfficialActivitiesPay where IsDel = 0");
- }
- /// <summary>
- /// 根据编号查询对象信息
- /// </summary>
- /// <param name="id">对象编号</param>
- /// <returns>返回空或者对象信息</returns>
- public List<ViewInvitationOfficialActivitiesPay> GetByDIId1(int DIId)
- {
-
- //调用获取单个对象的方法
- //return excuteSql("select ccp.RMBPrice,ioa.OperatorDate,ioa.InviterArea,ioa.Inviter,ioa.InviteTime,sd.[Name],ioa.InviteCosts,ioa.Currency,ccp.PayMoney,ccp.DayRate,ioa.remark from InvitationOfficialActivities ioa join CreditCardPayment ccp on ccp.Diid = ioa.Diid and ccp.Cid = ioa.Id join SetData sd on sd.Id =ioa.Currency where ioa.DIID = @DIId and ioa.IsDel = 0 and ccp.CTable = 81 and ccp.IsPay = 1", new SqlParameter("@DIId", DIId));
- //去除ispay=1条件
- return excuteSql("select ioa.SendCost,ioa.EventsCost,ioa.TranslateCost,ccp.IsMatchCreditCard,ccp.Operator,ccp.AuditGMDate,sd1.name as PaydName,ccp.OrbitalPrivateTransfer," +
- "ccp.PayDid,ccp.payee,ccp.ispay,ccp.RMBPrice,ioa.OperatorDate,ioa.InviterArea,ioa.Inviter,ioa.InviteTime,sd.[Name],ioa.InviteCosts," +
- "ioa.Currency,ccp.PayMoney,ccp.DayRate,ioa.remark from InvitationOfficialActivities ioa join CreditCardPayment ccp on ccp.Diid = ioa.Diid " +
- "and ccp.Cid = ioa.Id join SetData sd on sd.Id =ioa.Currency join setdata sd1 on sd1.id=ccp.PayDid where ioa.DIID = @DIId and ioa.IsDel = 0 " +
- "and ccp.CTable = 81 and ccp.IsAuditGM <> 2 and ccp.isDel=0", new SqlParameter("@DIId", DIId));
- }
- /// <summary>
- /// 根据编号查询对象信息
- /// </summary>
- /// <param name="id">对象编号</param>
- /// <returns>返回空或者对象信息</returns>
- public List<ViewInvitationOfficialActivitiesPay> GetByDIId(int DIId)
- {
- //调用获取单个对象的方法
- //return excuteSql("select ccp.RMBPrice,ioa.OperatorDate,ioa.InviterArea,ioa.Inviter,ioa.InviteTime,sd.[Name],ioa.InviteCosts,ioa.Currency,ccp.PayMoney,ccp.DayRate,ioa.remark from InvitationOfficialActivities ioa join CreditCardPayment ccp on ccp.Diid = ioa.Diid and ccp.Cid = ioa.Id join SetData sd on sd.Id =ioa.Currency where ioa.DIID = @DIId and ioa.IsDel = 0 and ccp.CTable = 81 and ccp.IsPay = 1", new SqlParameter("@DIId", DIId));
- //去除ispay=1条件
- return excuteSql("select ioa.SendCost,ioa.EventsCost,ioa.TranslateCost,ccp.IsMatchCreditCard,ccp.Operator,ccp.AuditGMDate,sd1.name as PaydName,ccp.OrbitalPrivateTransfer," +
- "ccp.PayDid, ccp.payee, ccp.ispay, ccp.RMBPrice, ioa.OperatorDate, ioa.InviterArea, ioa.Inviter, ioa.InviteTime, sd.[Name], sd3.[Name] as SendCurrency, sd4.[Name] as EventsCurrency," +
- " sd5.[Name] as TranslateCurrency, ioa.InviteCosts,ccp.PaymentCurrency as Currency, ccp.PayMoney, ccp.DayRate, ioa.remark from InvitationOfficialActivities ioa join CreditCardPayment " +
- "ccp on ccp.Diid = ioa.Diid and ccp.Cid = ioa.Id left join SetData sd on sd.Id = ioa.Currency join setdata sd1 on sd1.id = ccp.PayDid left join setdata sd3 on sd3.id = ioa.SendCurrency left join " +
- "setdata sd4 on sd4.id = ioa.EventsCurrency left join setdata sd5 on sd5.id = ioa.TranslateCurrency where ioa.DIID = @DIId and ioa.IsDel = 0 and ccp.CTable = 81 and (ccp.IsAuditGM=1 or ccp.IsAuditGM=3) and ccp.isDel = 0", new SqlParameter("@DIId", DIId));
- }
- }
- }
|