Commit 82bbb942 authored by solho's avatar solho

feat:命名規範改從處理事項 取得資訊

parent 93ca4fb9
......@@ -29,13 +29,14 @@ namespace WebAPI.Controllers
response = new CommonResponseMsg();
connString = ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString;
}
/// <summary>
/// 取得 Mail_js內返稿文件命名規範 資訊
/// </summary>
/// <param name="param"></param>
/// <returns></returns>
[Route("Get_essen_back_file_rule")]
[CorsHandle]
[CorsHandle]
[HttpPost]
public HttpResponseMessage Get_essen_back_file_rule(ParamModel param)
{
......@@ -48,26 +49,36 @@ namespace WebAPI.Controllers
using (SqlConnection Conn = new SqlConnection(connString))
{
var dysql = Conn.QueryBuilder($@"
SELECT cc.customer_name,icp.ctrl_proc_zh_tw,icp.ctrl_proc_zh_cn,ebfr.* FROM essen_back_file_rule ebfr
left join c_customer cc on cc.customer_id =ebfr.customer_id
left join i_ctrl_proc icp on icp.ctrl_proc_id =ebfr.ctrl_proc_id
select epci.customer_name,eppi.ctrl_proc_zh_tw,eppi.ctrl_proc_zh_cn,ebfr.* from evw_p_proc_info eppi
left join evw_p_case_info epci on epci.case_id=eppi.case_id
inner join essen_back_file_rule ebfr on eppi.ctrl_proc_id=ebfr.ctrl_proc_id and eppi.country_id=ebfr.country_id
/**where**/ ");
if (obj_input["ctrl_proc_id"] != null)
if (obj_input["proc_id"] != null)
{
dysql.Where( $"icp.ctrl_proc_id in ({obj_input["ctrl_proc_id"].ToString()})");
string[] procids = obj_input["proc_id"].ToString().Split(',');
dysql.Where($"eppi.proc_id in ({procids})");
}
if (obj_input["customer_id"] != null)
if (obj_input["case_id"] != null)
{
dysql.Where($"cc.customer_id in ({obj_input["customer_id"].ToString()})");
dysql.Where($"epci.case_id in ('{obj_input["case_id"].ToString()}')");
}
if (obj_input["country_id"] != null)
if (obj_input["Case_country_id"] != null)
{
dysql.Where($" ebfr.country_id in ({obj_input["country_id"].ToString()})");
}
var results = dysql.Query();
dysql.Where($"epci.country_id = '{obj_input["Case_country_id"].ToString()}'");
}
if (obj_input["case_type_Code"] != null)
{
dysql.Where($"epci.case_type_Code = '{obj_input["case_type_Code"].ToString()}'");
}
if (obj_input["customer_name"] != null)
{
dysql.Where($"epci.customer_name like '{obj_input["customer_name"].ToString()}%'");
}
var results = dysql.Query();
response.Msg = JsonConvert.SerializeObject(results);
response.Code = "1";
}
}
}
catch (Exception e)
{
......@@ -84,9 +95,10 @@ namespace WebAPI.Controllers
result.Content = new StringContent(JsonConvert.SerializeObject(response), System.Text.Encoding.UTF8, "application/json");
return result;
}
/// <summary>
/// 取得 Mail_js內返稿文件命名規範 資訊
/// 取得 處理事項,案件資訊
/// </summary>
/// <param name="param"></param>
/// <returns></returns>
......@@ -104,15 +116,14 @@ namespace WebAPI.Controllers
using (SqlConnection Conn = new SqlConnection(connString))
{
string sql_fields = obj_input["sql_fields"] == null ? "*" : obj_input["sql_fields"].ToString();
FormattableString sql= $@" select TOP 10 {sql_fields} from evw_p_proc_info eppi
FormattableString sql= $@" select * from evw_p_proc_info eppi
left join evw_p_case_info epci on epci.case_id=eppi.case_id
/**where**/ ";
var dysql = Conn.QueryBuilder();
dysql.AppendLine($" select TOP 10 {sql_fields} from evw_p_proc_info eppi");
dysql.AppendLine($"left join evw_p_case_info epci on epci.case_id=eppi.case_id");
var dysql = Conn.QueryBuilder(sql);
if (obj_input["proc_id"] != null)
{
dysql.Where($"eppi.proc_id in ({obj_input["proc_id"].ToString()})");
string[] procids = obj_input["proc_id"].ToString().Split(',');
dysql.Where($"eppi.proc_id in ({procids})");
}
if (obj_input["case_id"] != null)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment