jobTitles=_dbConnection.Query<sub_jobtitle>($@"SELECT DISTINCT JobTitle FROM db_performance_subsidy.sub_subsidy where AllotID=@allotId and JobTitle is not null;",new{allotId}).Select(t=>newsub_jobtitle{JobTitle=t.JobTitle,BasicPerforFee=t.BasicPerforFee??0});
jobTitles=_dbConnection.Query<sub_jobtitle>($@"SELECT DISTINCT JobTitle FROM db_performance_subsidy.sub_subsidy where AllotID=@allotId ",new{allotId}).Select(t=>newsub_jobtitle{JobTitle=t.JobTitle,BasicPerforFee=t.BasicPerforFee??0});
varallotOder=_dbConnection.Query<view_allot>($@"SELECT * from view_allot a WHERE a.HospitalId=@HospitalId ORDER BY a.`Year`,a.`Month`;",new{hospitalId}).ToList();
if(!allotOder.Any())returnjobTitles;
...
...
@@ -82,7 +82,7 @@ public void GetHrpJobTitle(int allotId, int hospitalId, bool isRefresh)
varallot=GetAllot(allotId);
if(allot==null)thrownewException("AllotId无效");
varsubsidies=_dbConnection.Query<sub_subsidy>("select * from sub_subsidy where AllotID=@allotId and JobTitle is not null;",new{allotId});
varsubsidies=_dbConnection.Query<sub_subsidy>("select * from sub_subsidy where AllotID=@allotId ",new{allotId});
if(subsidies.Any()&&isRefresh==false)return;
varconfig=_dbConnection.QueryFirst<ex_config>("select * from ex_config where hospitalId=@hospitalId",new{hospitalId});
...
...
@@ -91,15 +91,18 @@ public void GetHrpJobTitle(int allotId, int hospitalId, bool isRefresh)
varhrp=_dbConnection.QueryFirst<ex_script>("select * from ex_script;");
varsubsidy=_dbConnection.Query<sub_jobtitle>("select * from sub_jobtitle where AllotID=@allotId and JobTitle is not null;",new{allotId}).Select(t=>new{t.JobTitle,t.BasicPerforFee}).Distinct();
varsubsidy=_dbConnection.Query<sub_jobtitle>("select * from sub_jobtitle where AllotID=@allotId ;",new{allotId}).Select(t=>new{t.JobTitle,t.BasicPerforFee}).Distinct();
//删除:在点击重新加载时删除记录重新插入
_dbConnection.Execute("delete from sub_subsidy where AllotID=@allotId;delete from sub_jobtitle where AllotID=@allotId;",new{allotId});