sqlstr=@"select distinct td.SN, case_id, finishedDate as finish_date, attorneyDueDate as int_due_date,
LegalDueDate as legal_due_date, todosStatus_name as todos_status_name, taskDescription as taskName, assignedTo_userID,
...
...
@@ -47,10 +58,7 @@ namespace WebAPI.Controllers
,case when (ISNULL(points,0)<>0 AND ISNULL(PointsType,'') <>'MP') AND ISNULL(exchangeRate,0)=0 THEn 1 ELSE ISNULL(exchangeRate,0) END as exchangeRate
from esn_Todos td where td.SN in ("+SN+")";
sqlstr="select distinct td.*, tds.date_points_settlement, tds.date_points_settlement_pic_confirm from ("+sqlstr+") td left join esn_todos_points tds on tds.sn=td.sn ";
//'gDebugha_wade(sqlstr)
//'---+ 承辦人員
sqlstr="select t11.*, isnull(ui1.cn_name, ' ') as cn_name from ("+sqlstr+") t11 left join s_user_info ui1 on ui1.user_id=t11.assignedTo_userID";
...
...
@@ -69,7 +77,8 @@ namespace WebAPI.Controllers
left join c_customer c1 on c1.customer_id=ci1.customer_id";
//'結算 FLOW'
sqlstr+=@"left join esn_todos_Flow etf on etf.esn_todos_sn = t1.sn
sqlstr+=@"
left join esn_todos_Flow etf on etf.esn_todos_sn = t1.sn
left join esn_todos_Flow_his etfh on etf.id=etfh.Flow_id
left join esn_todos_Flow_StepType etfs on etf.StepType_id=etfs.id ";