获取关区企业图标坐标

This commit is contained in:
陈向学 2024-06-23 16:38:30 +08:00
parent 8b92e809c9
commit c3bbc3bed5
3 changed files with 57 additions and 0 deletions

View File

@ -217,6 +217,17 @@ namespace Competition.Mysql.BLL
}
return modelList;
}
/// <summary>
/// 根据关区id获取模型信息
/// </summary>
/// <param name="customids"></param>
/// <returns></returns>
public List<Competition.Mysql.Model.v_model_version> GetListByCustom(string[] customids)
{
DataSet ds = dal.GetListByCustom(customids);
return DataTableToList(ds.Tables[0]);
}
#endregion ExtensionMethod
}
}

View File

@ -491,6 +491,37 @@ namespace Competition.Mysql.DAL
}
return model;
}
/// <summary>
/// 根据关区id获取模型信息
/// </summary>
/// <param name="customIds"></param>
/// <returns></returns>
public DataSet GetListByCustom(string[] customIds)
{
//三表联查
StringBuilder strSql = new StringBuilder();
strSql.Append("SELECT T1.* FROM v_model_version T1 ");
strSql.Append("INNER JOIN ");
strSql.Append("(SELECT S1.* FROM T_BAS_CORPORATION S1 ");
strSql.Append("INNER JOIN ");
strSql.Append("T_BAS_CUSTOMS S2 ");
strSql.Append("ON S1.CUSTOMS_CODE=S2.CUSTOMS_CODE ");
//拼接
string tmp="";
customIds.ToList().ForEach(a =>
{
tmp += string.Format("S2.CUSTOMS_CODE = '{0}' OR ",a);
});
string endTmp=tmp.TrimEnd("OR ".ToCharArray())+" ";
strSql.Append("WHERE "+ endTmp);
strSql.Append(") T2 ");
strSql.Append("ON T1.MONITOR_ID=T2.MONITOR_ID ");
return DbHelperSQL.Query(strSql.ToString());
}
#endregion ExtensionMethod
}
}

View File

@ -12,6 +12,7 @@ namespace CompetitionAPI.Controllers.api
{
Competition.Mysql.BLL.T_BAS_CORPORATION bll = new Competition.Mysql.BLL.T_BAS_CORPORATION();
Competition.Mysql.BLL.v_model_version bll_version=new Competition.Mysql.BLL.v_model_version();
public IConfiguration Configuration { get; }
@ -77,5 +78,19 @@ namespace CompetitionAPI.Controllers.api
return Json(Tool.GetJsonWithCode(APICode.Success, tmp));
}
/// <summary>
/// 获取关区下所有企业图标的经纬度
/// </summary>
/// <param name="customCodes">逗号隔开</param>
/// <returns></returns>
[HttpGet]
public JsonResult GetAllPosition(string customCodes)
{
var mysql = Configuration.GetConnectionString("MySQL").ToString();
string[] customlist=customCodes.Split(',');
var list =bll_version.GetListByCustom(customlist);
return Json(Tool.GetJsonWithCode(APICode.Success, list));
}
}
}