254 lines
12 KiB
C#
254 lines
12 KiB
C#
using System;
|
||
using System.Collections.Generic;
|
||
using System.Data;
|
||
using SuperMap.RealEstate.ServiceModel;
|
||
using Business = SuperMap.RealEstate.HighWay.Storage.Business;
|
||
using HCC = HZQR.Common.Common;
|
||
using HZQR.Common;
|
||
|
||
namespace EShang.Common.GeneralMethod
|
||
{
|
||
/// <summary>
|
||
/// 服务区附属表相关方法
|
||
/// 2024/8/7 15:27:32自动生成
|
||
/// </summary>
|
||
public class RTSERVERPARTHelper
|
||
{
|
||
#region 获取服务区附属表列表
|
||
/// <summary>
|
||
/// 获取服务区附属表列表
|
||
/// </summary>
|
||
/// <param name="transaction">事务管理器</param>
|
||
/// <param name="TotalCount">查询结果总数</param>
|
||
/// <param name="searchModel">查询条件对象</param>
|
||
public static List<Model.RTSERVERPARTModel> GetRTSERVERPARTList(Transaction transaction,
|
||
ref int TotalCount, Model.SearchModel<Model.RTSERVERPARTModel> searchModel)
|
||
{
|
||
List<Model.RTSERVERPARTModel> RTSERVERPARTList = new List<Model.RTSERVERPARTModel>();
|
||
|
||
string WhereSQL = "", RowFilterSQL = "";
|
||
if (searchModel.SearchParameter != null)
|
||
{
|
||
WhereSQL = OperationDataHelper<Model.RTSERVERPARTModel>.GetWhereSQL(searchModel.SearchParameter, searchModel.QueryType);
|
||
if (WhereSQL != "")
|
||
{
|
||
WhereSQL = " WHERE " + WhereSQL;
|
||
}
|
||
}
|
||
|
||
DataTable dtRTSERVERPART = new Business.HIGHWAYPROINST(transaction).ExecuteDataTable(
|
||
"SELECT * FROM HIGHWAY_STORAGE.T_RTSERVERPART" + WhereSQL);
|
||
//增加组合查询条件
|
||
if (searchModel.keyWord != null && !string.IsNullOrWhiteSpace(searchModel.keyWord.Key))
|
||
{
|
||
foreach (string KeyName in searchModel.keyWord.Key.Split(','))
|
||
{
|
||
RowFilterSQL += (RowFilterSQL == "" ? "" : " or ") +
|
||
KeyName + " like '%" + searchModel.keyWord.Value + "%'";
|
||
}
|
||
}
|
||
if (RowFilterSQL != "")
|
||
{
|
||
dtRTSERVERPART.DefaultView.RowFilter = RowFilterSQL;
|
||
}
|
||
//排序:
|
||
dtRTSERVERPART.DefaultView.Sort = searchModel.SortStr;
|
||
dtRTSERVERPART = dtRTSERVERPART.DefaultView.ToTable();
|
||
//获取查询结果总记录条数
|
||
TotalCount = dtRTSERVERPART.Rows.Count;
|
||
//根据传入的页码和每页显示条数返回结果
|
||
dtRTSERVERPART = CommonHelper.GetDataTableWithPageSize(dtRTSERVERPART, searchModel.PageSize, searchModel.PageIndex);
|
||
|
||
foreach (DataRow drRTSERVERPART in dtRTSERVERPART.Rows)
|
||
{
|
||
Model.RTSERVERPARTModel rtserverpartModel = new Model.RTSERVERPARTModel();
|
||
//绑定服务区附属表数据对象
|
||
BindDataRowToModel(drRTSERVERPART, rtserverpartModel);
|
||
|
||
RTSERVERPARTList.Add(rtserverpartModel);
|
||
}
|
||
|
||
return RTSERVERPARTList;
|
||
}
|
||
|
||
#region 绑定model
|
||
/// <summary>
|
||
/// 绑定model
|
||
/// </summary>
|
||
/// <param name="drRTSERVERPART">datarow数据源</param>
|
||
/// <param name="rtserverpartModel">model对象</param>
|
||
public static void BindDataRowToModel(DataRow drRTSERVERPART, Model.RTSERVERPARTModel rtserverpartModel)
|
||
{
|
||
if (drRTSERVERPART["RTSERVERPART_ID"].ToString() != "")
|
||
{
|
||
rtserverpartModel.RTSERVERPART_ID = drRTSERVERPART["RTSERVERPART_ID"].TryParseToInt(); //内码
|
||
}
|
||
if (drRTSERVERPART["SERVERPART_ID"].ToString() != "")
|
||
{
|
||
rtserverpartModel.SERVERPART_ID = drRTSERVERPART["SERVERPART_ID"].TryParseToInt(); //服务区内码
|
||
}
|
||
rtserverpartModel.SERVERPART_ADDRESS = drRTSERVERPART["SERVERPART_ADDRESS"].ToString(); //服务区地址
|
||
rtserverpartModel.EXPRESSWAY_NAME = drRTSERVERPART["EXPRESSWAY_NAME"].ToString(); //服务区所在高速路
|
||
if (drRTSERVERPART["SELLERCOUNT"].ToString() != "")
|
||
{
|
||
rtserverpartModel.SELLERCOUNT = drRTSERVERPART["SELLERCOUNT"].TryParseToInt(); //商家服务数
|
||
}
|
||
if (drRTSERVERPART["SERVERPART_X"].ToString() != "")
|
||
{
|
||
rtserverpartModel.SERVERPART_X = drRTSERVERPART["SERVERPART_X"].TryParseToDouble(); //服务区坐标X
|
||
}
|
||
if (drRTSERVERPART["SERVERPART_Y"].ToString() != "")
|
||
{
|
||
rtserverpartModel.SERVERPART_Y = drRTSERVERPART["SERVERPART_Y"].TryParseToDouble(); //服务区坐标Y
|
||
}
|
||
rtserverpartModel.SERVERPART_TEL = drRTSERVERPART["SERVERPART_TEL"].ToString(); //联系电话
|
||
if (drRTSERVERPART["STARTDATE"].ToString() != "")
|
||
{
|
||
rtserverpartModel.STARTDATE = drRTSERVERPART["STARTDATE"].TryParseToDateTime(); //开业时间
|
||
}
|
||
if (drRTSERVERPART["SERVERPART_AREA"].ToString() != "")
|
||
{
|
||
rtserverpartModel.SERVERPART_AREA = drRTSERVERPART["SERVERPART_AREA"].TryParseToDouble(); //服务区面积
|
||
}
|
||
if (drRTSERVERPART["FLOORAREA"].ToString() != "")
|
||
{
|
||
rtserverpartModel.FLOORAREA = drRTSERVERPART["FLOORAREA"].TryParseToDouble(); //占地面积
|
||
}
|
||
if (drRTSERVERPART["BUSINESSAREA"].ToString() != "")
|
||
{
|
||
rtserverpartModel.BUSINESSAREA = drRTSERVERPART["BUSINESSAREA"].TryParseToDouble(); //经营面积
|
||
}
|
||
if (drRTSERVERPART["SHAREAREA"].ToString() != "")
|
||
{
|
||
rtserverpartModel.SHAREAREA = drRTSERVERPART["SHAREAREA"].TryParseToDouble(); //公共区域面积
|
||
}
|
||
if (drRTSERVERPART["TOTALPARKING"].ToString() != "")
|
||
{
|
||
rtserverpartModel.TOTALPARKING = drRTSERVERPART["TOTALPARKING"].TryParseToInt(); //车位数量
|
||
}
|
||
rtserverpartModel.OWNEDCOMPANY = drRTSERVERPART["OWNEDCOMPANY"].ToString(); //所属公司
|
||
rtserverpartModel.MANAGERCOMPANY = drRTSERVERPART["MANAGERCOMPANY"].ToString(); //管理公司
|
||
if (drRTSERVERPART["STAFF_ID"].ToString() != "")
|
||
{
|
||
rtserverpartModel.STAFF_ID = drRTSERVERPART["STAFF_ID"].TryParseToInt(); //操作员内码
|
||
}
|
||
rtserverpartModel.STAFF_NAME = drRTSERVERPART["STAFF_NAME"].ToString(); //操作人员
|
||
if (drRTSERVERPART["OPERATE_DATE"].ToString() != "")
|
||
{
|
||
rtserverpartModel.OPERATE_DATE = drRTSERVERPART["OPERATE_DATE"].TryParseToDateTime(); //操作时间
|
||
}
|
||
rtserverpartModel.SERVERPART_INFO = drRTSERVERPART["SERVERPART_INFO"].ToString(); //备注说明
|
||
rtserverpartModel.CENTERSTAKE_NUM = drRTSERVERPART["CENTERSTAKE_NUM"].ToString(); //中心桩号
|
||
rtserverpartModel.TAXPAYER_IDENTIFYCODE = drRTSERVERPART["TAXPAYER_IDENTIFYCODE"].ToString(); //统一信用代码
|
||
if (drRTSERVERPART["WATERINTAKE_TYPE"].ToString() != "")
|
||
{
|
||
rtserverpartModel.WATERINTAKE_TYPE = drRTSERVERPART["WATERINTAKE_TYPE"].TryParseToShort(); //取水形式(1:自来水;2:井水)
|
||
}
|
||
if (drRTSERVERPART["SEWAGEDISPOSAL_TYPE"].ToString() != "")
|
||
{
|
||
rtserverpartModel.SEWAGEDISPOSAL_TYPE = drRTSERVERPART["SEWAGEDISPOSAL_TYPE"].TryParseToShort(); //污水处理形式(1:市政;2:污水处理设备)
|
||
}
|
||
if (drRTSERVERPART["BUSINESS_REGION"].ToString() != "")
|
||
{
|
||
rtserverpartModel.BUSINESS_REGION = drRTSERVERPART["BUSINESS_REGION"].TryParseToShort(); //分区形式(1000:服务区双侧;1010:服务区单侧;2000:加油站双侧;2010:加油站单侧)
|
||
}
|
||
}
|
||
#endregion
|
||
|
||
#endregion
|
||
|
||
#region 获取服务区附属表明细
|
||
/// <summary>
|
||
/// 获取服务区附属表明细
|
||
/// </summary>
|
||
/// <param name="transaction">事务管理器</param>
|
||
/// <param name="RTSERVERPARTId">服务区附属表内码</param>
|
||
public static Model.RTSERVERPARTModel GetRTSERVERPARTDetail(Transaction transaction, int RTSERVERPARTId)
|
||
{
|
||
Model.RTSERVERPARTModel rtserverpartModel = new Model.RTSERVERPARTModel();
|
||
|
||
string WhereSQL = "WHERE RTSERVERPART_ID = " + RTSERVERPARTId;
|
||
//查询明细数据
|
||
DataTable dtRTSERVERPART = new Business.HIGHWAYPROINST(transaction).ExecuteDataTable(
|
||
"SELECT * FROM HIGHWAY_STORAGE.T_RTSERVERPART " + WhereSQL);
|
||
if (dtRTSERVERPART.Rows.Count > 0)
|
||
{
|
||
//绑定服务区附属表数据对象
|
||
BindDataRowToModel(dtRTSERVERPART.Rows[0], rtserverpartModel);
|
||
}
|
||
|
||
return rtserverpartModel;
|
||
}
|
||
#endregion
|
||
|
||
#region 同步服务区附属表
|
||
/// <summary>
|
||
/// 赋值服务区附属表数据对象
|
||
/// </summary>
|
||
/// <param name="transaction">事务管理器</param>
|
||
/// <param name="rtserverpartModel">服务区附属表数据对象</param>
|
||
public static bool SynchroRTSERVERPART(Transaction transaction, Model.RTSERVERPARTModel rtserverpartModel)
|
||
{
|
||
bool SynchroFlag = true;
|
||
|
||
string SQLString;
|
||
List<string> excludeField = new List<string>();
|
||
Dictionary<string, string> dateFieldList = new Dictionary<string, string>();
|
||
string tableName = "HIGHWAY_STORAGE.T_RTSERVERPART", keyField = "RTSERVERPART_ID", seqName = "SEQ_RTSERVERPART";
|
||
Business.HIGHWAYPROINST _HIGHWAYPROINST = new Business.HIGHWAYPROINST(transaction);
|
||
|
||
#region 添加SQL语句中需要排除在外的字段
|
||
#endregion
|
||
|
||
#region 添加SQL语句中日期相关字段的执行语句
|
||
#endregion
|
||
|
||
if (rtserverpartModel.RTSERVERPART_ID != null)
|
||
{
|
||
string WhereSQL = " WHERE RTSERVERPART_ID = " + rtserverpartModel.RTSERVERPART_ID;
|
||
DataTable dtRTSERVERPART = _HIGHWAYPROINST.ExecuteDataTable(
|
||
"SELECT * FROM HIGHWAY_STORAGE.T_RTSERVERPART" + WhereSQL);
|
||
if (dtRTSERVERPART.Rows.Count > 0)
|
||
{
|
||
SQLString = OperationDataHelper<Model.RTSERVERPARTModel>.GetTableExcuteSQL(
|
||
rtserverpartModel, 1, tableName, keyField, seqName, dateFieldList, excludeField, WhereSQL);
|
||
}
|
||
else
|
||
{
|
||
return false;
|
||
}
|
||
}
|
||
else
|
||
{
|
||
DataTable dtRTSERVERPART = _HIGHWAYPROINST.ExecuteDataTable(
|
||
"SELECT " + seqName + ".NEXTVAL FROM DUAL");
|
||
rtserverpartModel.RTSERVERPART_ID = dtRTSERVERPART.Rows[0][0].TryParseToInt();
|
||
SQLString = OperationDataHelper<Model.RTSERVERPARTModel>.GetTableExcuteSQL(
|
||
rtserverpartModel, 0, tableName, keyField, seqName, dateFieldList, excludeField);
|
||
}
|
||
_HIGHWAYPROINST.ExecuteNonQuery(SQLString, null);
|
||
|
||
return SynchroFlag;
|
||
}
|
||
#endregion
|
||
|
||
#region 删除服务区附属表
|
||
/// <summary>
|
||
/// 删除服务区附属表
|
||
/// </summary>
|
||
/// <param name="transaction">事务管理器</param>
|
||
/// <param name="RTSERVERPARTId">服务区附属表内码</param>
|
||
public static bool DeleteRTSERVERPART(Transaction transaction, int? RTSERVERPARTId)
|
||
{
|
||
bool DeleteFlag = false;
|
||
|
||
if (RTSERVERPARTId != null)
|
||
{
|
||
}
|
||
|
||
return DeleteFlag;
|
||
}
|
||
#endregion
|
||
}
|
||
}
|