北京经济技术开发区经开区虚拟城市项目-【后端】-服务,Poi,企业,地块等定制接口
13693261870
2023-10-06 fb9b8e5fb4311a10a77aa7664616f8c41534c160
解决查询为空报错
已修改2个文件
26 ■■■■■ 文件已修改
src/main/java/com/smartearth/poiexcel/controller/EntController.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mybatis.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/smartearth/poiexcel/controller/EntController.java
@@ -130,6 +130,28 @@
        }
    }
    @ApiOperation(value = "分页查询")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "Integer", paramType = "query", example = "10"),
            @ApiImplicitParam(name = "pageIndex", value = "分页数(从1开始)", dataType = "Integer", paramType = "query", example = "1")
    })
    @GetMapping(value = "/selectByPage")
    public ResponseMsg<Object> selectByPage(Integer pageSize, Integer pageIndex) {
        try {
            if (null == pageSize || pageSize < 1) {
                pageSize = 10;
            }
            if (null == pageIndex || pageIndex < 1) {
                pageIndex = 1;
            }
            List<EntEntity> list = qiYeMapper.selectByPage(pageSize, StaticData.I100 * (pageIndex - 1));
            return success(null == list || list.isEmpty() ? 0 : list.size(), list);
        } catch (Exception ex) {
            return fail(ex, -1);
        }
    }
    @ApiOperation(value = "批量更新企业坐标")
    @GetMapping({"/updateCoords"})
    public ResponseMsg<Object> updateCoords() {
@@ -141,7 +163,7 @@
            }
            int pages = (count - 1) / StaticData.I100 + 1;
            for (int i = 0; i < pages; i++) {
            for (int i = 1; i <= pages; i++) {
                List<EntEntity> list = qiYeMapper.selectByPage(StaticData.I100, StaticData.I100 * (i - 1));
                if (null == list || list.isEmpty()) {
                    continue;
src/main/resources/mybatis.xml
@@ -29,7 +29,7 @@
        <!--指定当结果集中值为 null 时,是否调用映射对象的 setter(map 对象时为 put)方法-->
        <setting name="callSettersOnNulls" value="true"/>
        <!--指定 MyBatis 所用日志的具体实现:LOG4J/LOG4J2/SLF4J/STDOUT_LOGGING/NO_LOGGING-->
        <setting name="logImpl" value="STDOUT_LOGGING" />
        <setting name="logImpl" value="NO_LOGGING" />
    </settings>
    <typeAliases>
        <package name="com.smartearth.poiexcel.entity"/>