wl
2022-09-20 4e260f558428dd81c4dd8981a965cdaa0ebf12de
修改查询分页处理
10个文件已修改
1个文件已添加
152 ■■■■ 已修改文件
ycl-common/src/main/java/com/ycl/mapper/platform/zf/EnforcelawReportMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/com/ycl/mapper/platform/zf/VideowarmEventsreportMapper.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/com/ycl/service/platform/zf/IEnforcelawReportService.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/com/ycl/service/platform/zf/IVideowarmEventsreportService.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/com/ycl/service/platform/zf/impl/EnforcelawReportServiceImpl.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/com/ycl/service/platform/zf/impl/VideowarmEventsreportServiceImpl.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/resources/mapper/platform/zf/EnforcelawReportMapper.xml 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/resources/mapper/platform/zf/VideowarmEventsreportMapper.xml 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-generator/src/main/java/com/ycl/MysqlGenerator.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/controller/zf/EnforcelawReportController.java 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/controller/zf/VideowarmEventsreportController.java 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/com/ycl/mapper/platform/zf/EnforcelawReportMapper.java
@@ -1,6 +1,7 @@
package com.ycl.mapper.platform.zf;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ycl.entity.platform.zf.EnforcelawReport;
/**
@@ -13,4 +14,5 @@
 */
public interface EnforcelawReportMapper extends BaseMapper<EnforcelawReport> {
    Page<EnforcelawReport> selectPageVo(Page<EnforcelawReport> page, String startTime, String endTime, String community, String status, String partiesName, String partiesID);
}
ycl-common/src/main/java/com/ycl/mapper/platform/zf/VideowarmEventsreportMapper.java
@@ -1,6 +1,8 @@
package com.ycl.mapper.platform.zf;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ycl.entity.platform.zf.EnforcelawReport;
import com.ycl.entity.platform.zf.VideowarmEventsreport;
/**
@@ -13,4 +15,5 @@
 */
public interface VideowarmEventsreportMapper extends BaseMapper<VideowarmEventsreport> {
    Page selectPageVo(Page<VideowarmEventsreport> page, String startTime, String endTime, String eventLocation, String eventName, String eventType, String eventRegion);
}
ycl-common/src/main/java/com/ycl/service/platform/zf/IEnforcelawReportService.java
@@ -1,5 +1,6 @@
package com.ycl.service.platform.zf;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ycl.entity.platform.zf.EnforcelawReport;
import com.ycl.vo.zf.ZfVO;
@@ -9,7 +10,7 @@
 * 违规事项处置管理:包含违法(违建)情况上报、立案、派遣、处置、核查、结案 服务类
 * </p>
 *
 * @author lyq
 * @author wl
 * @since 2022-09-14
 */
public interface IEnforcelawReportService extends IService<EnforcelawReport> {
@@ -19,4 +20,7 @@
     * @param params
     */
    void report(ZfVO.ZfReportVO params);
    Page<EnforcelawReport> selectPageVo(Page<EnforcelawReport> page, String startTime, String endTime, String community, String status, String partiesName, String partiesID);
}
ycl-common/src/main/java/com/ycl/service/platform/zf/IVideowarmEventsreportService.java
@@ -1,6 +1,8 @@
package com.ycl.service.platform.zf;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ycl.entity.platform.zf.EnforcelawReport;
import com.ycl.entity.platform.zf.VideowarmEventsreport;
/**
@@ -8,9 +10,10 @@
 * 服务类
 * </p>
 *
 * @author lyq
 * @author wl
 * @since 2022-09-16
 */
public interface IVideowarmEventsreportService extends IService<VideowarmEventsreport> {
}
    Page selectPageVo(Page<VideowarmEventsreport> enforcelawReportPage, String startTime, String endTime, String eventName, String eventType, String eventLocation, String eventRegion);
}
ycl-common/src/main/java/com/ycl/service/platform/zf/impl/EnforcelawReportServiceImpl.java
@@ -1,7 +1,7 @@
package com.ycl.service.platform.zf.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ycl.api.BaseEntity;
import com.ycl.entity.platform.zf.EnforcelawReport;
import com.ycl.enums.common.ResultCode;
import com.ycl.exception.ApiException;
@@ -37,4 +37,9 @@
            throw new ApiException(ResultCode.RECORD_SAVE_FAIL);
        }
    }
    @Override
    public Page<EnforcelawReport> selectPageVo(Page<EnforcelawReport> page, String startTime, String endTime, String community, String status, String partiesName, String partiesID) {
        return enforcelawReportMapper.selectPageVo(page, startTime, endTime, community, status, partiesName, partiesID);
    }
}
ycl-common/src/main/java/com/ycl/service/platform/zf/impl/VideowarmEventsreportServiceImpl.java
@@ -1,9 +1,12 @@
package com.ycl.service.platform.zf.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ycl.entity.platform.zf.EnforcelawReport;
import com.ycl.entity.platform.zf.VideowarmEventsreport;
import com.ycl.mapper.platform.zf.VideowarmEventsreportMapper;
import com.ycl.service.platform.zf.IVideowarmEventsreportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
@@ -17,4 +20,11 @@
@Service
public class VideowarmEventsreportServiceImpl extends ServiceImpl<VideowarmEventsreportMapper, VideowarmEventsreport> implements IVideowarmEventsreportService {
    @Autowired
    VideowarmEventsreportMapper eventsreportMapper;
    @Override
    public Page selectPageVo(Page<VideowarmEventsreport> page, String startTime, String endTime, String eventName, String eventType, String eventLocation, String eventRegion) {
        return eventsreportMapper.selectPageVo(page, startTime, endTime, eventLocation, eventName, eventType, eventRegion);
    }
}
ycl-common/src/main/resources/mapper/platform/zf/EnforcelawReportMapper.xml
@@ -42,4 +42,25 @@
        id, infoResoure, acceptor, problemTypes, category, county, street, afAddr, informer, contact, reason, problemDesc, lawOfficer, partiesName, partiesID, partiesPhone, idPositiveImage, idNegativeImage, illegalBuildLocation, illegalBuildLength, illegalBuildWidth, illegalBuildHigh, illegalBuildMaterials, IllegalPhotos, rectifidPhotos, accessory, disposeRemark, inspectors, status, cTime, community
    </sql>
    <select id="selectPageVo" resultType="com.ycl.entity.platform.zf.EnforcelawReport">
        SELECT * FROM ums_enforcelaw_report
            <where>
                <if test="community!=null and community!=''" >
                    community=#{community}
                </if>
                <if test="status!=null and status!=''" >
                    status=#{status}
                </if>
                <if test="partiesName!=null and partiesName!=''" >
                    partiesName=#{partiesName}
                </if>
                <if test="partiesID!=null and partiesID!=''" >
                    partiesID=#{partiesID}
                </if>
                <if test="startTime!=null and startTime!=''and endTime!=null and endTime!=''" >
                    ctime between #{startTime} and #{endTime}
                </if>
            </where>
    </select>
</mapper>
ycl-common/src/main/resources/mapper/platform/zf/VideowarmEventsreportMapper.xml
New file
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ycl.mapper.platform.zf.VideowarmEventsreportMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ycl.entity.platform.zf.VideowarmEventsreport">
        <id column="id" property="id" />
        <result column="eventName" property="eventName" />
        <result column="eventType" property="eventType" />
        <result column="associatedShops" property="associatedShops" />
        <result column="eventLocaation" property="eventLocaation" />
        <result column="eventRegion" property="eventRegion" />
        <result column="videoOrImage" property="videoOrImage" />
        <result column="contentDesc" property="contentDesc" />
        <result column="eventTime" property="eventTime" />
        <result column="cTime" property="cTime" />
    </resultMap>
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, eventName, eventType, associatedShops, eventLocaation, eventRegion, videoOrImage, contentDesc, eventTime, cTime
    </sql>
    <select id="selectPageVo" resultType="com.ycl.entity.platform.zf.VideowarmEventsreport">
        SELECT * FROM ums_videowarm_eventsreport
        <where>
            <if test="eventName!=null and eventName!=''" >
                eventName=#{eventName}
            </if>
            <if test="eventType!=null and eventType!=''" >
                eventType=#{eventType}
            </if>
            <if test="eventLocation!=null and eventLocation!=''" >
                eventLocation=#{eventLocation}
            </if>
            <if test="eventRegion!=null and eventRegion!=''" >
                eventRegion=#{eventRegion}
            </if>
            <if test="startTime!=null and startTime!=''and endTime!=null and endTime!=''" >
                ctime between #{startTime} and #{endTime}
            </if>
        </where>
    </select>
</mapper>
ycl-generator/src/main/java/com/ycl/MysqlGenerator.java
@@ -59,7 +59,7 @@
        GlobalConfig gc = new GlobalConfig();
        String projectPath = System.getProperty("user.dir");
        gc.setOutputDir(projectPath + "/ycl-generator/src/main/java");
        gc.setAuthor("lyq");//作者
        gc.setAuthor("wl");//作者
        gc.setBaseResultMap(true); //mapper.xml 生成 ResultMap
        gc.setBaseColumnList(true); //mapper.xml 生成 ColumnList
//        gc.setSwagger2(true);
ycl-platform/src/main/java/com/ycl/controller/zf/EnforcelawReportController.java
@@ -3,7 +3,9 @@
import com.alibaba.excel.EasyExcel;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ycl.api.CommonResult;
import com.ycl.controller.BaseController;
import com.ycl.entity.platform.zf.EnforcelawReport;
@@ -25,7 +27,7 @@
 * 违规事项处置管理:包含违法(违建)情况上报、立案、派遣、处置、核查、结案 前端控制器
 * </p>
 *
 * @author lyq
 * @author wl
 * @since 2022-09-14
 */
@RestController
@@ -47,23 +49,10 @@
                               @RequestParam(required = false) Integer current,
                               @RequestParam(required = false) Integer size
    ) {
        QueryWrapper<EnforcelawReport> enforcelawReportQueryWrapper = new QueryWrapper<>();
        if (StringUtils.isNotBlank(startTime) && StringUtils.isNotBlank(endTime)) {
            enforcelawReportQueryWrapper.between("cTime", startTime, endTime);
        }
        if (StringUtils.isNotBlank(community)) {
            enforcelawReportQueryWrapper.eq("community", community);
        }
        if (StringUtils.isNotBlank(status)) {
            enforcelawReportQueryWrapper.eq("status", status);
        }
        if (StringUtils.isNotBlank(partiesName)) {
            enforcelawReportQueryWrapper.eq("partiesName", partiesName);
        }
        if (StringUtils.isNotBlank(partiesID)) {
            enforcelawReportQueryWrapper.eq("partiesID", partiesID);
        }
        return CommonResult.success(enforcelawReportService.list(enforcelawReportQueryWrapper).stream().skip((current-1)*size).limit(size).collect(Collectors.toList()));
        Page<EnforcelawReport> enforcelawReportPage = new Page<>();
        enforcelawReportPage.setCurrent(current);
        enforcelawReportPage.setSize(size);
        return CommonResult.success(enforcelawReportService.selectPageVo(enforcelawReportPage,startTime,endTime,community,status,partiesName,partiesID));
    }
    @GetMapping("/search/one")
    @ApiOperation("查询城市违建详情")
ycl-platform/src/main/java/com/ycl/controller/zf/VideowarmEventsreportController.java
@@ -4,8 +4,10 @@
import com.alibaba.excel.EasyExcel;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ycl.api.CommonResult;
import com.ycl.controller.BaseController;
import com.ycl.entity.platform.zf.EnforcelawReport;
import com.ycl.entity.platform.zf.VideowarmEventsreport;
import com.ycl.service.platform.zf.IVideowarmEventsreportService;
import io.swagger.annotations.Api;
@@ -47,23 +49,10 @@
                               @RequestParam(required = false) Integer current,
                               @RequestParam(required = false) Integer size
    ) {
        QueryWrapper<VideowarmEventsreport> videowarmEventsreportQueryWrapper = new QueryWrapper<>();
        if (StringUtils.isNotBlank(startTime) && StringUtils.isNotBlank(endTime)) {
            videowarmEventsreportQueryWrapper.between("cTime", startTime, endTime);
        }
        if (StringUtils.isNotBlank(eventName)) {
            videowarmEventsreportQueryWrapper.eq("eventName", eventName);
        }
        if (StringUtils.isNotBlank(eventType)) {
            videowarmEventsreportQueryWrapper.eq("eventType", eventType);
        }
        if (StringUtils.isNotBlank(eventLocation)) {
            videowarmEventsreportQueryWrapper.eq("eventLocation", eventLocation);
        }
        if (StringUtils.isNotBlank(eventRegion)) {
            videowarmEventsreportQueryWrapper.eq("eventRegion", eventRegion);
        }
        return CommonResult.success(iVideowarmEventsreportService.list(videowarmEventsreportQueryWrapper).stream().skip((current-1)*size).limit(size).collect(Collectors.toList()));
        Page<VideowarmEventsreport> page = new Page<>();
        page.setCurrent(current);
        page.setSize(size);
        return CommonResult.success(iVideowarmEventsreportService.selectPageVo(page,startTime,endTime,eventName,eventType,eventLocation,eventRegion));
    }
    @GetMapping("/search/one")
    @ApiOperation("查询违规情况详情")