12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Data.SqlClient;
- using Models;
- using System.Data;
- namespace DAL
- {
- /// <summary>
- /// 增减款项多表联查数据访问类
- /// </summary>
- public class ViewGroupsDecreasePaymentsService
- {
- /// <summary>
- /// 查询所有
- /// </summary>
- /// <param name="sql">sql语句</param>
- /// <param name="param">可变参数数组</param>
- /// <returns>返回集合</returns>
- List<ViewGroupsDecreasePayments> excuteSql(string sql, params SqlParameter[] param)
- {
- return ServiceBase<ViewGroupsDecreasePayments>.excuteSql(new ViewGroupsDecreasePayments(), "ViewGroupsDecreasePayments", sql, CommandType.Text, param);
- }
- /// <summary>
- /// 获取单个对象
- /// </summary>
- /// <param name="sql">sql语句</param>
- /// <param name="param">可变参数数组</param>
- /// <returns>返回空或者单个对象</returns>
- ViewGroupsDecreasePayments excuteType(string sql, params SqlParameter[] param)
- {
- //查询结果放入对象集合
- List<ViewGroupsDecreasePayments> vgdpList = excuteSql(sql, param);
- //判断集合是否为空
- if (vgdpList == null || vgdpList.Count == 0)
- //返回null
- return null;
- //返回单个对象
- return vgdpList[0];
- }
- /// <summary>
- /// 根据编号查询对象信息
- /// </summary>
- /// <param name="id">对象编号</param>
- /// <returns>返回空或者单个对象信息</returns>
- public ViewGroupsDecreasePayments GetViewGroupsDecreasePaymentsByID(int id)
- {
- //调用获取单个对象的方法
- return excuteType("select * from ViewGroupsDecreasePayments where Id = @id and IsDel = 0", new SqlParameter("@id", id));
- }
- /// <summary>
- /// 获取全部
- /// </summary>
- /// <returns></returns>
- public List<ViewGroupsDecreasePayments> GetAll()
- {
- return excuteSql("select * from ViewGroupsDecreasePayments where IsDel = 0");
- }
- /// <summary>
- /// 根据编号查询对象信息
- /// </summary>
- /// <param name="id">对象编号</param>
- /// <returns>返回空或者对象信息</returns>
- public List<ViewGroupsDecreasePayments> GetByDIId(int DIId)
- {
- //调用获取单个对象的方法
- //去除ispay=1条件
- //return excuteSql("select gdp.OperatorDate,gdp.PriceName,gdp.Price,sd.[Name],ccp.PayMoney as Spread,ccp.DayRate,gdp.Remark from GroupsDecreasePayments gdp join CreditCardPayment ccp on ccp.Diid = gdp.Diid and ccp.Cid = gdp.Id join SetData sd on sd.Id =gdp.Currency where gdp.DIID = @DIId and gdp.IsDel = 0 and ccp.CTable=98 and ccp.IsPay=1", new SqlParameter("@DIId", DIId));
- //去除ispay=1条件
- return excuteSql("select ccp.IsMatchCreditCard,ccp.Operator,ccp.AuditGMDate,sd1.name as PaydName,ccp.OrbitalPrivateTransfer,ccp.PayDid,ccp.payee,ccp.ispay,gdp.OperatorDate,gdp.PriceName,gdp.Price,sd.[Name],ccp.PayMoney as Spread,ccp.DayRate,gdp.Remark,gdp.PriceType,gdp.coefficient from GroupsDecreasePayments gdp join CreditCardPayment ccp on ccp.Diid = gdp.Diid and ccp.Cid = gdp.Id join SetData sd on sd.Id =gdp.Currency join setdata sd1 on sd1.id=ccp.PayDid where gdp.DIID = @DIId and gdp.IsDel = 0 and ccp.CTable=98 and ccp.IsAuditGM = 1 and ccp.isDel=0", new SqlParameter("@DIId", DIId));
- }
- }
- }
|