update page查询新增动态参数查询(Dapper)

This commit is contained in:
2021-05-28 19:17:21 +08:00
parent e3e0c40d30
commit 4d81cd714f
10 changed files with 421 additions and 20 deletions

View File

@@ -64,14 +64,17 @@ namespace Ewide.Application.Service.HouseCode
}
[HttpPost("/houseCode/page")]
[Microsoft.AspNetCore.Authorization.AllowAnonymous]
public async Task<dynamic> QueryPage([FromBody] QueryHouseCodeInput input)
{
var sql = @"SELECT HC.*,AA.Name AreaName,RA.Name RoadName,CA.Name CommName,Proj.AreaCode,Proj.Note,Proj.Name+'('+Proj.Note+')' FullProjName FROM bs_house_code HC
LEFT JOIN bs_house_projectinfo Proj ON Proj.Id=HC.ProjectId
LEFT JOIN sys_area_code CA ON CA.Code = Proj.AreaCode
LEFT JOIN sys_area_code RA ON RA.AdCode = SUBSTR(CA.AdCode,1,9)
LEFT JOIN sys_area_code AA ON AA.AdCode = SUBSTR(CA.AdCode,1,6) WHERE HC.Address LIKE @Address AND HC.HouseCode LIKE @HouseCode";
return await _dapperRepository.QueryPageData(sql, input, param: new { Address = '%' + input.Address + '%', HouseCode = '%' + input.HouseCode + '%'});
LEFT JOIN sys_area_code AA ON AA.AdCode = SUBSTR(CA.AdCode,1,6) ";
//WHERE HC.Address LIKE @Address AND HC.HouseCode LIKE @HouseCode";
//return await _dapperRepository.QueryPageData(sql, input, param: new { Address = '%' + input.Address + '%', HouseCode = '%' + input.HouseCode + '%'});
return await _dapperRepository.QueryPageDataDynamic(sql, input);
}
/// <summary>