using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QMFrameWork.Data;
using QMAPP.Entity.Sys;
using System.Data;
using QMAPP.MD.Entity.Sys;
namespace QMAPP.DAL.Sys
{
///
/// 超时提醒数据层对象
/// 创建者:
/// 创建日期:
///
public class OverTimeRemindDAL : BaseDAL
{
#region 获取未处理问题列表
///
/// 获取未处理问题列表
///
/// 条件
/// 数据页
/// 数据页
public List GetOverTimeRemindList(string userId)
{
StringBuilder sb = new StringBuilder();
List parameters = new List();
List resultList = null;
try
{
sb.Append(" SELECT DEAL.ACTIONTIME,ZP.SDEPT,ZP.PDESP FROM T_QM_ZPDEALINFO DEAL LEFT JOIN T_QM_ZPDDB ZP ON DEAL.ZPDDB_PID = ZP.PID ");
sb.Append(" WHERE DEAL.ZPDDB_PID IN ");
sb.Append(" (SELECT PID FROM T_QM_ZPDDB DBB WHERE ECIND = 0 AND SUSER IS NOT NULL ");
if (!string.IsNullOrEmpty(userId))
{
sb.Append(" AND SUSER = @USERID ");
parameters.Add(new DataParameter { ParameterName = "USERID", DataType = DbType.String, Value = userId });
}
sb.Append(" ) ");
sb.Append(" AND DEAL.ACTION = '创建' ");
using (IDataSession session = AppDataFactory.CreateMainSession())
{
string sql = this.ChangeSqlByDB(sb.ToString(), session);
resultList = session.GetList(sql, parameters.ToArray()).ToList();
}
return resultList;
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 获取所有的业务管理员列表
///
/// 获取未处理问题列表
///
/// 条件
/// 数据页
/// 数据页
public List GetBusinessManage()
{
StringBuilder sb = new StringBuilder();
List parameters = new List();
List resultList = null;
try
{
sb.Append(" SELECT USERID,ORGANID,EMAIL FROM T_QM_USER WHERE USERTYPE = 'LO' AND ACTIVATEFLG = 1 AND FLGDEL = 0 ");
using (IDataSession session = AppDataFactory.CreateMainSession())
{
string sql = this.ChangeSqlByDB(sb.ToString(), session);
resultList = session.GetList(sql, parameters.ToArray()).ToList();
}
return resultList;
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
}
}