This commit is contained in:
geh
2026-09-14 15:58:12 +08:00
parent a815e09879
commit 77f61d7e06
128 changed files with 25181 additions and 960 deletions
+11 -1
View File
@@ -37,7 +37,7 @@ namespace FineUIPro.Web.SysManage
+ @" LEFT JOIN Base_UnitType AS UnitType ON UnitType.UnitTypeId=Unit.UnitTypeId"
+ @" WHERE 1=1";*/
string strSql = @"SELECT Unit.UnitId,Unit.UnitCode,Unit.UnitName,Unit.ProjectRange,Unit.Corporate,Unit.Address,Unit.Telephone,Unit.Fax,Unit.EMail,UnitType.UnitTypeId,UnitType.UnitTypeCode,UnitType.UnitTypeName,Unit.IsBranch,
(case Unit.IsBranch when '1' then ( select UnitId from Base_Unit where IsThisUnit=1 ) else '0' end ) as SuperUnitId
(case Unit.IsBranch when '1' then ( select UnitId from Base_Unit where IsThisUnit=1 ) else '0' end ) as SuperUnitId ,Unit.MasterAdOrgCode, CASE WHEN Unit.MasterAdOrgCode IS NULL OR LTRIM(RTRIM(Unit.MasterAdOrgCode)) = '' THEN '未关联' ELSE Unit.MasterAdOrgName END AS MasterAdOrgName
From dbo.Base_Unit AS Unit
LEFT JOIN Base_UnitType AS UnitType ON UnitType.UnitTypeId=Unit.UnitTypeId
WHERE 1=1 ";
@@ -47,6 +47,16 @@ namespace FineUIPro.Web.SysManage
strSql += " AND Unit.UnitName LIKE @UnitName";
listStr.Add(new SqlParameter("@UnitName", "%" + this.txtUnitName.Text.Trim() + "%"));
}
string rela = this.rbRela.SelectedValue;
if (rela == "1")
{//主数据组织已关联
strSql += " AND Unit.MasterAdOrgCode IS NOT NULL ";
}
else if (rela == "0")
{//主数据组织未关联
strSql += " AND Unit.MasterAdOrgCode IS NULL ";
}
strSql += " order by IsThisUnit desc ";
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);