Commit 60c6cfb3 authored by 赵啸非's avatar 赵啸非

测试 事项查询

parent 82a8b7e9
...@@ -27,7 +27,6 @@ import java.util.List; ...@@ -27,7 +27,6 @@ import java.util.List;
public class MatterDaoImpl extends BaseCRUDDaoMybatis<MatterEntity, Long> implements MatterDao { public class MatterDaoImpl extends BaseCRUDDaoMybatis<MatterEntity, Long> implements MatterDao {
@Override @Override
public Result<MatterEntity> getSubList(MatterEntity matterQuery, PageInfo pageInfo) { public Result<MatterEntity> getSubList(MatterEntity matterQuery, PageInfo pageInfo) {
Result<MatterEntity> result = new Result(); Result<MatterEntity> result = new Result();
...@@ -51,6 +50,7 @@ public class MatterDaoImpl extends BaseCRUDDaoMybatis<MatterEntity, Long> implem ...@@ -51,6 +50,7 @@ public class MatterDaoImpl extends BaseCRUDDaoMybatis<MatterEntity, Long> implem
public int getSubCount(ParamDto paramDto) { public int getSubCount(ParamDto paramDto) {
return this.getSqlSession().selectOne(this.getSqlId(SQLID_SUB_COUNT), this.cpyQueryParamDto(paramDto)); return this.getSqlSession().selectOne(this.getSqlId(SQLID_SUB_COUNT), this.cpyQueryParamDto(paramDto));
} }
@Override @Override
public int getMatterListByAreaCodeCount(ParamDto paramDto) { public int getMatterListByAreaCodeCount(ParamDto paramDto) {
return this.getSqlSession().selectOne(this.getSqlId(SQLID_MATTERLIST_AREACODE_COUNT), this.cpyQueryParamDto(paramDto)); return this.getSqlSession().selectOne(this.getSqlId(SQLID_MATTERLIST_AREACODE_COUNT), this.cpyQueryParamDto(paramDto));
...@@ -61,7 +61,7 @@ public class MatterDaoImpl extends BaseCRUDDaoMybatis<MatterEntity, Long> implem ...@@ -61,7 +61,7 @@ public class MatterDaoImpl extends BaseCRUDDaoMybatis<MatterEntity, Long> implem
ParamDto param = new ParamDto(); ParamDto param = new ParamDto();
param.getCondition().put("areaCode", matterQuery.getAreaCode()); param.getCondition().put("areaCode", matterQuery.getAreaCode());
if(!ObjectUtils.isEmpty(matterQuery.getSource())){ if (!ObjectUtils.isEmpty(matterQuery.getSource())) {
param.getCondition().put("source", matterQuery.getSource()); param.getCondition().put("source", matterQuery.getSource());
} }
return this.getSqlSession().selectList(this.getSqlId("getMatterListByAreaCode"), param); return this.getSqlSession().selectList(this.getSqlId("getMatterListByAreaCode"), param);
...@@ -75,18 +75,15 @@ public class MatterDaoImpl extends BaseCRUDDaoMybatis<MatterEntity, Long> implem ...@@ -75,18 +75,15 @@ public class MatterDaoImpl extends BaseCRUDDaoMybatis<MatterEntity, Long> implem
@Override @Override
public Result<MatterEntity> getMatterListByAreaCodePage(MatterEntity matterQuery, PageInfo pageInfo) { public Result<MatterEntity> getMatterListByAreaCodePage(MatterEntity matterQuery, PageInfo pageInfo) {
Result<MatterEntity> result = new Result(); Result<MatterEntity> result = new Result();
ParamDto paramDto = this.getQueryParam(matterQuery); ParamDto param = new ParamDto();
int count = this.getMatterListByAreaCodeCount(paramDto); param.getCondition().put("areaCode", matterQuery.getAreaCode());
List list = null; if (!ObjectUtils.isEmpty(matterQuery.getSource())) {
if (count == 0) { param.getCondition().put("source", matterQuery.getSource());
list = new ArrayList();
} else if (pageInfo.getPrePageResult() == -1) {
list = this.getSqlSession().selectList(this.getSqlId(SQLID_MATTERLIST_AREACODE), paramDto);
} else {
RowBounds rowBounds = new RowBounds(pageInfo.getBeginIndex(), pageInfo.getPrePageResult());
list = this.getSqlSession().selectList(this.getSqlId(SQLID_MATTERLIST_AREACODE), this.cpyQueryParamDto(paramDto), rowBounds);
} }
pageInfo.setTotalResult(count); RowBounds rowBounds = new RowBounds(pageInfo.getBeginIndex(), pageInfo.getPrePageResult());
List<MatterEntity> list = this.getSqlSession().selectList(this.getSqlId(SQLID_MATTERLIST_AREACODE), param, rowBounds);
// pageInfo.setTotalResult(count);
result.setPageInfo(pageInfo); result.setPageInfo(pageInfo);
result.setList(list); result.setList(list);
return result; return result;
......
...@@ -122,6 +122,15 @@ Content-Type: application/json ...@@ -122,6 +122,15 @@ Content-Type: application/json
} }
###test testAllMatterCount
POST {{baseUrl}}/test/testAllMatterCount
Content-Type: application/json
{
"areaCode":"511500000000"
}
###testre ###testre
POST {{baseUrl}}/test/reDepts POST {{baseUrl}}/test/reDepts
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment