varsql=$"select * from dc_base_finance_fee where cost_status=4 and is_lend!=2 and pay_time>='{start.ToString("yyyy-MM-dd")}' and pay_time<'{end.AddDays(1).ToString("yyyy-MM-dd")}'";
if(!string.IsNullOrEmpty(feesupertype))
{
sql+=" and fee_super_type=@type";
sqlparam.Add("type",feesupertype);
}
if(!string.IsNullOrEmpty(feesubtype))
{
sql+=" and fee_sub_type=@subtype";
sqlparam.Add("subtype",feesubtype);
}
if(!string.IsNullOrEmpty(departmentname))
{
if(departmentname=="四千里主体")
{
//72, 67, 58, 54, 78
sql+=" and company_value in (72, 67, 58, 54, 78)";
}
else
{
sql+=" and department_name=@department_name";
sqlparam.Add("department_name",departmentname);
}
}
if(paycompanyid.HasValue&&paycompanyid.Value>0)
{
if(paycompanyid.Value==53)
{
sql+=" and company_value in (53,59,60,61,66)";
}
elseif(paycompanyid.Value==54)//四千里
{
sql+=" and company_value in (72, 67, 58, 54, 78)";
//var list = new Services.FinanceReportServices().ListFinanceManageCost(start,end,"","","",paycompanyid); //new Services.FinanceReportServices().ListOtherCost(url);