update HouseCodeList
This commit is contained in:
@@ -9,10 +9,6 @@ using Furion.FriendlyException;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Dapper;
|
||||
using Ewide.Core.Extension;
|
||||
@@ -51,26 +47,21 @@ namespace Ewide.Application.Service.HouseCode
|
||||
}
|
||||
|
||||
[HttpPost("/houseCode/delete")]
|
||||
public async Task DeleteHouseCode(DeleteProjectInput input)
|
||||
public async Task DeleteHouseCode(DeleteHouseCodeInput input)
|
||||
{
|
||||
var houseCode = _houseCodeRep.FirstOrDefault(p => p.Id == input.Id);
|
||||
await houseCode.DeleteNowAsync();
|
||||
}
|
||||
|
||||
//public async Task<dynamic> QueryHouseCodePageList([FromBody] AddHouseCodeInput input)
|
||||
//{
|
||||
// var areaCodeRep = Db.GetRepository<SysAreaCode>();
|
||||
// var projectCodeRep = Db.GetRepository<BsHouseProjectInfo>();
|
||||
// var houseCodes = await _houseCodeRep.DetachedEntities
|
||||
// .Join(projectCodeRep.DetachedEntities, c => c.ProjectId, p => p.Id, (c, p) => new { c, p })
|
||||
// .Join(areaCodeRep.DetachedEntities, cp => cp.p.AreaCode, a => a.Code, (cp, a) => new { cp, a })
|
||||
// .Where(!string.IsNullOrEmpty(input.HouseCode), cpa => cpa.cp.c.HouseCode.Contains(input.HouseCode))
|
||||
//}
|
||||
|
||||
public async Task<dynamic> QueryPage()
|
||||
[HttpPost("/houseCode/page")]
|
||||
public async Task<dynamic> QueryPage([FromBody] QueryHouseCodeInput input)
|
||||
{
|
||||
var sql = "SELECT * FROM bs_house_code";
|
||||
return await _dapperRepository.QueryPageData(sql, new PageInputBase());
|
||||
var sql = @"SELECT HC.*,HP.Note,AA.Name AreaName,RA.Name RoadName,CA.Name CommName FROM bs_house_code HC
|
||||
LEFT JOIN bs_house_projectinfo HP ON HP.Id=HC.ProjectId
|
||||
LEFT JOIN sys_area_code CA ON CA.Code = HP.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";
|
||||
return await _dapperRepository.QueryPageData(sql, input, param: new { Address = '%' + input.Address + '%' });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user