Commit 82bbb942 authored by solho's avatar solho

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

parent 93ca4fb9
...@@ -29,6 +29,7 @@ namespace WebAPI.Controllers ...@@ -29,6 +29,7 @@ namespace WebAPI.Controllers
response = new CommonResponseMsg(); response = new CommonResponseMsg();
connString = ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString; connString = ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString;
} }
/// <summary> /// <summary>
/// 取得 Mail_js內返稿文件命名規範 資訊 /// 取得 Mail_js內返稿文件命名規範 資訊
/// </summary> /// </summary>
...@@ -48,22 +49,32 @@ namespace WebAPI.Controllers ...@@ -48,22 +49,32 @@ namespace WebAPI.Controllers
using (SqlConnection Conn = new SqlConnection(connString)) using (SqlConnection Conn = new SqlConnection(connString))
{ {
var dysql = Conn.QueryBuilder($@" 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 select epci.customer_name,eppi.ctrl_proc_zh_tw,eppi.ctrl_proc_zh_cn,ebfr.* from evw_p_proc_info eppi
left join c_customer cc on cc.customer_id =ebfr.customer_id left join evw_p_case_info epci on epci.case_id=eppi.case_id
left join i_ctrl_proc icp on icp.ctrl_proc_id =ebfr.ctrl_proc_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**/ "); /**where**/ ");
if (obj_input["ctrl_proc_id"] != null) if (obj_input["proc_id"] != null)
{
string[] procids = obj_input["proc_id"].ToString().Split(',');
dysql.Where($"eppi.proc_id in ({procids})");
}
if (obj_input["case_id"] != null)
{
dysql.Where($"epci.case_id in ('{obj_input["case_id"].ToString()}')");
}
if (obj_input["Case_country_id"] != null)
{ {
dysql.Where( $"icp.ctrl_proc_id in ({obj_input["ctrl_proc_id"].ToString()})"); dysql.Where($"epci.country_id = '{obj_input["Case_country_id"].ToString()}'");
} }
if (obj_input["customer_id"] != null) if (obj_input["case_type_Code"] != null)
{ {
dysql.Where($"cc.customer_id in ({obj_input["customer_id"].ToString()})"); dysql.Where($"epci.case_type_Code = '{obj_input["case_type_Code"].ToString()}'");
} }
if (obj_input["country_id"] != null) if (obj_input["customer_name"] != null)
{ {
dysql.Where($" ebfr.country_id in ({obj_input["country_id"].ToString()})"); dysql.Where($"epci.customer_name like '{obj_input["customer_name"].ToString()}%'");
} }
var results = dysql.Query(); var results = dysql.Query();
response.Msg = JsonConvert.SerializeObject(results); response.Msg = JsonConvert.SerializeObject(results);
response.Code = "1"; response.Code = "1";
...@@ -85,8 +96,9 @@ namespace WebAPI.Controllers ...@@ -85,8 +96,9 @@ namespace WebAPI.Controllers
return result; return result;
} }
/// <summary> /// <summary>
/// 取得 Mail_js內返稿文件命名規範 資訊 /// 取得 處理事項,案件資訊
/// </summary> /// </summary>
/// <param name="param"></param> /// <param name="param"></param>
/// <returns></returns> /// <returns></returns>
...@@ -104,15 +116,14 @@ namespace WebAPI.Controllers ...@@ -104,15 +116,14 @@ namespace WebAPI.Controllers
using (SqlConnection Conn = new SqlConnection(connString)) using (SqlConnection Conn = new SqlConnection(connString))
{ {
string sql_fields = obj_input["sql_fields"] == null ? "*" : obj_input["sql_fields"].ToString(); 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 left join evw_p_case_info epci on epci.case_id=eppi.case_id
/**where**/ "; /**where**/ ";
var dysql = Conn.QueryBuilder(); var dysql = Conn.QueryBuilder(sql);
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");
if (obj_input["proc_id"] != null) 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) 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