zhongrj
2023-11-16 41583127f55f91d91d53f3b31d75cf6eabffb603
网格工作日志,巡查,轮播图新增
27 files added
1537 ■■■■■ changed files
src/main/java/org/springblade/modules/grid/controller/GridPatrolRecordController.java 131 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/grid/controller/GridWorkLogController.java 131 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/grid/dto/GridPatrolRecordDTO.java 34 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/grid/dto/GridWorkLogDTO.java 34 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/grid/entity/GridPatrolRecordEntity.java 94 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/grid/entity/GridWorkLogEntity.java 104 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/grid/mapper/GridPatrolRecordMapper.java 45 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/grid/mapper/GridPatrolRecordMapper.xml 25 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/grid/mapper/GridWorkLogMapper.java 44 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/grid/mapper/GridWorkLogMapper.xml 30 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/grid/service/IGridPatrolRecordService.java 43 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/grid/service/IGridWorkLogService.java 43 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/grid/service/impl/GridPatrolRecordServiceImpl.java 50 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/grid/service/impl/GridWorkLogServiceImpl.java 43 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/grid/vo/GridPatrolRecordVO.java 35 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/grid/vo/GridWorkLogVO.java 35 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/grid/wrapper/GridPatrolRecordWrapper.java 50 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/grid/wrapper/GridWorkLogWrapper.java 50 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/rotation/controller/RotationController.java 129 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/rotation/dto/RotationDTO.java 34 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/rotation/entity/RotationEntity.java 104 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/rotation/mapper/RotationMapper.java 44 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/rotation/mapper/RotationMapper.xml 27 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/rotation/service/IRotationService.java 43 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/rotation/service/impl/RotationServiceImpl.java 50 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/rotation/vo/RotationVO.java 35 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/rotation/wrapper/RotationWrapper.java 50 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/grid/controller/GridPatrolRecordController.java
New file
@@ -0,0 +1,131 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.grid.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import lombok.AllArgsConstructor;
import javax.validation.Valid;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.grid.entity.GridPatrolRecordEntity;
import org.springblade.modules.grid.vo.GridPatrolRecordVO;
import org.springblade.modules.grid.wrapper.GridPatrolRecordWrapper;
import org.springblade.modules.grid.service.IGridPatrolRecordService;
import org.springblade.core.boot.ctrl.BladeController;
import java.util.Date;
/**
 * 网格巡查记录表 控制器
 *
 * @author BladeX
 * @since 2023-11-16
 */
@RestController
@AllArgsConstructor
@RequestMapping("blade-gridPatrolRecord/gridPatrolRecord")
@Api(value = "网格巡查记录表", tags = "网格巡查记录表接口")
public class GridPatrolRecordController{
    private final IGridPatrolRecordService gridPatrolRecordService;
    /**
     * 网格巡查记录表 详情
     */
    @GetMapping("/detail")
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "详情", notes = "传入gridPatrolRecord")
    public R<GridPatrolRecordVO> detail(GridPatrolRecordEntity gridPatrolRecord) {
        GridPatrolRecordEntity detail = gridPatrolRecordService.getOne(Condition.getQueryWrapper(gridPatrolRecord));
        return R.data(GridPatrolRecordWrapper.build().entityVO(detail));
    }
    /**
     * 网格巡查记录表 分页
     */
    @GetMapping("/list")
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "分页", notes = "传入gridPatrolRecord")
    public R<IPage<GridPatrolRecordVO>> list(GridPatrolRecordEntity gridPatrolRecord, Query query) {
        IPage<GridPatrolRecordEntity> pages = gridPatrolRecordService.page(Condition.getPage(query), Condition.getQueryWrapper(gridPatrolRecord));
        return R.data(GridPatrolRecordWrapper.build().pageVO(pages));
    }
    /**
     * 网格巡查记录表 自定义分页
     */
    @GetMapping("/page")
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "分页", notes = "传入gridPatrolRecord")
    public R<IPage<GridPatrolRecordVO>> page(GridPatrolRecordVO gridPatrolRecord, Query query) {
        IPage<GridPatrolRecordVO> pages = gridPatrolRecordService.selectGridPatrolRecordPage(Condition.getPage(query), gridPatrolRecord);
        return R.data(pages);
    }
    /**
     * 网格巡查记录表 新增
     */
    @PostMapping("/save")
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "新增", notes = "传入gridPatrolRecord")
    public R save(@Valid @RequestBody GridPatrolRecordEntity gridPatrolRecord) {
        gridPatrolRecord.setCreateTime(new Date());
        gridPatrolRecord.setCreateUser(AuthUtil.getUserId());
        return R.status(gridPatrolRecordService.save(gridPatrolRecord));
    }
    /**
     * 网格巡查记录表 修改
     */
    @PostMapping("/update")
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "修改", notes = "传入gridPatrolRecord")
    public R update(@Valid @RequestBody GridPatrolRecordEntity gridPatrolRecord) {
        return R.status(gridPatrolRecordService.updateById(gridPatrolRecord));
    }
    /**
     * 网格巡查记录表 新增或修改
     */
    @PostMapping("/submit")
    @ApiOperationSupport(order = 6)
    @ApiOperation(value = "新增或修改", notes = "传入gridPatrolRecord")
    public R submit(@Valid @RequestBody GridPatrolRecordEntity gridPatrolRecord) {
        return R.status(gridPatrolRecordService.saveOrUpdate(gridPatrolRecord));
    }
    /**
     * 网格巡查记录表 删除
     */
    @PostMapping("/remove")
    @ApiOperationSupport(order = 7)
    @ApiOperation(value = "逻辑删除", notes = "传入ids")
    public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
        return R.status(gridPatrolRecordService.removeByIds(Func.toLongList(ids)));
    }
}
src/main/java/org/springblade/modules/grid/controller/GridWorkLogController.java
New file
@@ -0,0 +1,131 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.grid.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import lombok.AllArgsConstructor;
import javax.validation.Valid;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.grid.entity.GridWorkLogEntity;
import org.springblade.modules.grid.vo.GridWorkLogVO;
import org.springblade.modules.grid.wrapper.GridWorkLogWrapper;
import org.springblade.modules.grid.service.IGridWorkLogService;
import org.springblade.core.boot.ctrl.BladeController;
import java.util.Date;
/**
 * 网格工作日志表 控制器
 *
 * @author BladeX
 * @since 2023-11-16
 */
@RestController
@AllArgsConstructor
@RequestMapping("blade-gridWorkLog/gridWorkLog")
@Api(value = "网格工作日志表", tags = "网格工作日志表接口")
public class GridWorkLogController{
    private final IGridWorkLogService gridWorkLogService;
    /**
     * 网格工作日志表 详情
     */
    @GetMapping("/detail")
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "详情", notes = "传入gridWorkLog")
    public R<GridWorkLogVO> detail(GridWorkLogEntity gridWorkLog) {
        GridWorkLogEntity detail = gridWorkLogService.getOne(Condition.getQueryWrapper(gridWorkLog));
        return R.data(GridWorkLogWrapper.build().entityVO(detail));
    }
    /**
     * 网格工作日志表 分页
     */
    @GetMapping("/list")
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "分页", notes = "传入gridWorkLog")
    public R<IPage<GridWorkLogVO>> list(GridWorkLogEntity gridWorkLog, Query query) {
        IPage<GridWorkLogEntity> pages = gridWorkLogService.page(Condition.getPage(query), Condition.getQueryWrapper(gridWorkLog));
        return R.data(GridWorkLogWrapper.build().pageVO(pages));
    }
    /**
     * 网格工作日志表 自定义分页
     */
    @GetMapping("/page")
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "分页", notes = "传入gridWorkLog")
    public R<IPage<GridWorkLogVO>> page(GridWorkLogVO gridWorkLog, Query query) {
        IPage<GridWorkLogVO> pages = gridWorkLogService.selectGridWorkLogPage(Condition.getPage(query), gridWorkLog);
        return R.data(pages);
    }
    /**
     * 网格工作日志表 新增
     */
    @PostMapping("/save")
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "新增", notes = "传入gridWorkLog")
    public R save(@Valid @RequestBody GridWorkLogEntity gridWorkLog) {
        gridWorkLog.setCreateTime(new Date());
        gridWorkLog.setCreateUser(AuthUtil.getUserId());
        return R.status(gridWorkLogService.save(gridWorkLog));
    }
    /**
     * 网格工作日志表 修改
     */
    @PostMapping("/update")
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "修改", notes = "传入gridWorkLog")
    public R update(@Valid @RequestBody GridWorkLogEntity gridWorkLog) {
        return R.status(gridWorkLogService.updateById(gridWorkLog));
    }
    /**
     * 网格工作日志表 新增或修改
     */
    @PostMapping("/submit")
    @ApiOperationSupport(order = 6)
    @ApiOperation(value = "新增或修改", notes = "传入gridWorkLog")
    public R submit(@Valid @RequestBody GridWorkLogEntity gridWorkLog) {
        return R.status(gridWorkLogService.saveOrUpdate(gridWorkLog));
    }
    /**
     * 网格工作日志表 删除
     */
    @PostMapping("/remove")
    @ApiOperationSupport(order = 7)
    @ApiOperation(value = "逻辑删除", notes = "传入ids")
    public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
        return R.status(gridWorkLogService.removeByIds(Func.toLongList(ids)));
    }
}
src/main/java/org/springblade/modules/grid/dto/GridPatrolRecordDTO.java
New file
@@ -0,0 +1,34 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.grid.dto;
import org.springblade.modules.grid.entity.GridPatrolRecordEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * 网格巡查记录表 数据传输对象实体类
 *
 * @author BladeX
 * @since 2023-11-16
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class GridPatrolRecordDTO extends GridPatrolRecordEntity {
    private static final long serialVersionUID = 1L;
}
src/main/java/org/springblade/modules/grid/dto/GridWorkLogDTO.java
New file
@@ -0,0 +1,34 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.grid.dto;
import org.springblade.modules.grid.entity.GridWorkLogEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * 网格工作日志表 数据传输对象实体类
 *
 * @author BladeX
 * @since 2023-11-16
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class GridWorkLogDTO extends GridWorkLogEntity {
    private static final long serialVersionUID = 1L;
}
src/main/java/org/springblade/modules/grid/entity/GridPatrolRecordEntity.java
New file
@@ -0,0 +1,94 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.grid.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import org.springframework.format.annotation.DateTimeFormat;
/**
 * 网格巡查记录表 实体类
 *
 * @author BladeX
 * @since 2023-11-16
 */
@Data
@TableName("jczz_grid_patrol_record")
@ApiModel(value = "GridPatrolRecord对象", description = "网格巡查记录表")
public class GridPatrolRecordEntity implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 主键
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty("主键id")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;
    /**
     * 名称
     */
    @ApiModelProperty(value = "名称")
    private String name;
    /**
     * 内容
     */
    @ApiModelProperty(value = "内容")
    private String context;
    /**
     * 图片地址
     */
    @ApiModelProperty(value = "图片地址")
    private String url;
    /**
     * 创建人
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty("创建人")
    private Long createUser;
    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty("创建时间")
    private Date createTime;
    /**
     * 是否删除
     */
    @TableLogic
    @ApiModelProperty("是否已删除 0:否  1:是")
    private Integer isDeleted;
}
src/main/java/org/springblade/modules/grid/entity/GridWorkLogEntity.java
New file
@@ -0,0 +1,104 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.grid.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import org.springframework.format.annotation.DateTimeFormat;
/**
 * 网格工作日志表 实体类
 *
 * @author BladeX
 * @since 2023-11-16
 */
@Data
@TableName("jczz_grid_work_log")
@ApiModel(value = "GridWorkLog对象", description = "网格工作日志表")
public class GridWorkLogEntity implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 主键
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty("主键id")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;
    /**
     * 房屋编号
     */
    @ApiModelProperty(value = "房屋编号")
    private String houseCode;
    /**
     * 走访人姓名
     */
    @ApiModelProperty(value = "走访人姓名")
    private String name;
    /**
     * 走访人电话
     */
    @ApiModelProperty(value = "走访人电话")
    private String phone;
    /**
     * 内容
     */
    @ApiModelProperty(value = "内容")
    private String context;
    /**
     * 图片地址
     */
    @ApiModelProperty(value = "图片地址")
    private String url;
    /**
     * 创建人
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty("创建人")
    private Long createUser;
    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty("创建时间")
    private Date createTime;
    /**
     * 是否删除
     */
    @TableLogic
    @ApiModelProperty("是否已删除 0:否  1:是")
    private Integer isDeleted;
}
src/main/java/org/springblade/modules/grid/mapper/GridPatrolRecordMapper.java
New file
@@ -0,0 +1,45 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.grid.mapper;
import org.apache.ibatis.annotations.Param;
import org.springblade.modules.grid.entity.GridPatrolRecordEntity;
import org.springblade.modules.grid.vo.GridPatrolRecordVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List;
/**
 * 网格巡查记录表 Mapper 接口
 *
 * @author BladeX
 * @since 2023-11-16
 */
public interface GridPatrolRecordMapper extends BaseMapper<GridPatrolRecordEntity> {
    /**
     * 自定义分页
     *
     * @param page
     * @param gridPatrolRecord
     * @return
     */
    List<GridPatrolRecordVO> selectGridPatrolRecordPage(IPage page,
                                                        @Param("gridPatrolRecord") GridPatrolRecordVO gridPatrolRecord);
}
src/main/java/org/springblade/modules/grid/mapper/GridPatrolRecordMapper.xml
New file
@@ -0,0 +1,25 @@
<?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="org.springblade.modules.grid.mapper.GridPatrolRecordMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="gridPatrolRecordResultMap" type="org.springblade.modules.grid.entity.GridPatrolRecordEntity">
        <result column="id" property="id"/>
        <result column="name" property="name"/>
        <result column="context" property="context"/>
        <result column="url" property="url"/>
        <result column="create_time" property="createTime"/>
        <result column="create_user" property="createUser"/>
        <result column="is_deleted" property="isDeleted"/>
    </resultMap>
    <!--自定义分页查询-->
    <select id="selectGridPatrolRecordPage" resultMap="gridPatrolRecordResultMap">
        select * from jczz_grid_patrol_record where is_deleted = 0
        <if test="gridPatrolRecord.name!=null and gridPatrolRecord.name!=''">
            and name like concat('%',#{gridPatrolRecord.name},'%')
        </if>
    </select>
</mapper>
src/main/java/org/springblade/modules/grid/mapper/GridWorkLogMapper.java
New file
@@ -0,0 +1,44 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.grid.mapper;
import org.apache.ibatis.annotations.Param;
import org.springblade.modules.grid.entity.GridWorkLogEntity;
import org.springblade.modules.grid.vo.GridWorkLogVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List;
/**
 * 网格工作日志表 Mapper 接口
 *
 * @author BladeX
 * @since 2023-11-16
 */
public interface GridWorkLogMapper extends BaseMapper<GridWorkLogEntity> {
    /**
     * 自定义分页
     *
     * @param page
     * @param gridWorkLog
     * @return
     */
    List<GridWorkLogVO> selectGridWorkLogPage(IPage page,@Param("gridWorkLog") GridWorkLogVO gridWorkLog);
}
src/main/java/org/springblade/modules/grid/mapper/GridWorkLogMapper.xml
New file
@@ -0,0 +1,30 @@
<?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="org.springblade.modules.grid.mapper.GridWorkLogMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="gridWorkLogResultMap" type="org.springblade.modules.grid.entity.GridWorkLogEntity">
        <result column="id" property="id"/>
        <result column="house_code" property="houseCode"/>
        <result column="name" property="name"/>
        <result column="phone" property="phone"/>
        <result column="context" property="context"/>
        <result column="url" property="url"/>
        <result column="create_time" property="createTime"/>
        <result column="create_user" property="createUser"/>
        <result column="is_deleted" property="isDeleted"/>
    </resultMap>
    <select id="selectGridWorkLogPage" resultMap="gridWorkLogResultMap">
        select * from jczz_grid_work_log where is_deleted = 0
        <if test="gridWorkLog.name !=null and gridWorkLog.name!=''">
            and name like concat('%',#{gridWorkLog.name},'%')
        </if>
        <if test="gridWorkLog.phone !=null and gridWorkLog.phone!=''">
            and phone like concat('%',#{gridWorkLog.phone},'%')
        </if>
    </select>
</mapper>
src/main/java/org/springblade/modules/grid/service/IGridPatrolRecordService.java
New file
@@ -0,0 +1,43 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.grid.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springblade.modules.grid.entity.GridPatrolRecordEntity;
import org.springblade.modules.grid.vo.GridPatrolRecordVO;
import org.springblade.core.mp.base.BaseService;
import com.baomidou.mybatisplus.core.metadata.IPage;
/**
 * 网格巡查记录表 服务类
 *
 * @author BladeX
 * @since 2023-11-16
 */
public interface IGridPatrolRecordService extends IService<GridPatrolRecordEntity> {
    /**
     * 自定义分页
     *
     * @param page
     * @param gridPatrolRecord
     * @return
     */
    IPage<GridPatrolRecordVO> selectGridPatrolRecordPage(IPage<GridPatrolRecordVO> page, GridPatrolRecordVO gridPatrolRecord);
}
src/main/java/org/springblade/modules/grid/service/IGridWorkLogService.java
New file
@@ -0,0 +1,43 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.grid.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springblade.modules.grid.entity.GridWorkLogEntity;
import org.springblade.modules.grid.vo.GridWorkLogVO;
import org.springblade.core.mp.base.BaseService;
import com.baomidou.mybatisplus.core.metadata.IPage;
/**
 * 网格工作日志表 服务类
 *
 * @author BladeX
 * @since 2023-11-16
 */
public interface IGridWorkLogService extends IService<GridWorkLogEntity> {
    /**
     * 自定义分页
     *
     * @param page
     * @param gridWorkLog
     * @return
     */
    IPage<GridWorkLogVO> selectGridWorkLogPage(IPage<GridWorkLogVO> page, GridWorkLogVO gridWorkLog);
}
src/main/java/org/springblade/modules/grid/service/impl/GridPatrolRecordServiceImpl.java
New file
@@ -0,0 +1,50 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.grid.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.modules.grid.entity.GridPatrolRecordEntity;
import org.springblade.modules.grid.vo.GridPatrolRecordVO;
import org.springblade.modules.grid.mapper.GridPatrolRecordMapper;
import org.springblade.modules.grid.service.IGridPatrolRecordService;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
/**
 * 网格巡查记录表 服务实现类
 *
 * @author BladeX
 * @since 2023-11-16
 */
@Service
public class GridPatrolRecordServiceImpl extends ServiceImpl<GridPatrolRecordMapper, GridPatrolRecordEntity> implements IGridPatrolRecordService {
    /**
     * 自定义分页
     *
     * @param page
     * @param gridPatrolRecord
     * @return
     */
    @Override
    public IPage<GridPatrolRecordVO> selectGridPatrolRecordPage(IPage<GridPatrolRecordVO> page, GridPatrolRecordVO gridPatrolRecord) {
        return page.setRecords(baseMapper.selectGridPatrolRecordPage(page, gridPatrolRecord));
    }
}
src/main/java/org/springblade/modules/grid/service/impl/GridWorkLogServiceImpl.java
New file
@@ -0,0 +1,43 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.grid.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.modules.grid.entity.GridWorkLogEntity;
import org.springblade.modules.grid.vo.GridWorkLogVO;
import org.springblade.modules.grid.mapper.GridWorkLogMapper;
import org.springblade.modules.grid.service.IGridWorkLogService;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
/**
 * 网格工作日志表 服务实现类
 *
 * @author BladeX
 * @since 2023-11-16
 */
@Service
public class GridWorkLogServiceImpl extends ServiceImpl<GridWorkLogMapper, GridWorkLogEntity> implements IGridWorkLogService {
    @Override
    public IPage<GridWorkLogVO> selectGridWorkLogPage(IPage<GridWorkLogVO> page, GridWorkLogVO gridWorkLog) {
        return page.setRecords(baseMapper.selectGridWorkLogPage(page, gridWorkLog));
    }
}
src/main/java/org/springblade/modules/grid/vo/GridPatrolRecordVO.java
New file
@@ -0,0 +1,35 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.grid.vo;
import org.springblade.modules.grid.entity.GridPatrolRecordEntity;
import org.springblade.core.tool.node.INode;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * 网格巡查记录表 视图实体类
 *
 * @author BladeX
 * @since 2023-11-16
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class GridPatrolRecordVO extends GridPatrolRecordEntity {
    private static final long serialVersionUID = 1L;
}
src/main/java/org/springblade/modules/grid/vo/GridWorkLogVO.java
New file
@@ -0,0 +1,35 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.grid.vo;
import org.springblade.modules.grid.entity.GridWorkLogEntity;
import org.springblade.core.tool.node.INode;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * 网格工作日志表 视图实体类
 *
 * @author BladeX
 * @since 2023-11-16
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class GridWorkLogVO extends GridWorkLogEntity {
    private static final long serialVersionUID = 1L;
}
src/main/java/org/springblade/modules/grid/wrapper/GridPatrolRecordWrapper.java
New file
@@ -0,0 +1,50 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.grid.wrapper;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.modules.grid.entity.GridPatrolRecordEntity;
import org.springblade.modules.grid.vo.GridPatrolRecordVO;
import java.util.Objects;
/**
 * 网格巡查记录表 包装类,返回视图层所需的字段
 *
 * @author BladeX
 * @since 2023-11-16
 */
public class GridPatrolRecordWrapper extends BaseEntityWrapper<GridPatrolRecordEntity, GridPatrolRecordVO>  {
    public static GridPatrolRecordWrapper build() {
        return new GridPatrolRecordWrapper();
     }
    @Override
    public GridPatrolRecordVO entityVO(GridPatrolRecordEntity gridPatrolRecord) {
        GridPatrolRecordVO gridPatrolRecordVO = Objects.requireNonNull(BeanUtil.copy(gridPatrolRecord, GridPatrolRecordVO.class));
        //User createUser = UserCache.getUser(gridPatrolRecord.getCreateUser());
        //User updateUser = UserCache.getUser(gridPatrolRecord.getUpdateUser());
        //gridPatrolRecordVO.setCreateUserName(createUser.getName());
        //gridPatrolRecordVO.setUpdateUserName(updateUser.getName());
        return gridPatrolRecordVO;
    }
}
src/main/java/org/springblade/modules/grid/wrapper/GridWorkLogWrapper.java
New file
@@ -0,0 +1,50 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.grid.wrapper;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.modules.grid.entity.GridWorkLogEntity;
import org.springblade.modules.grid.vo.GridWorkLogVO;
import java.util.Objects;
/**
 * 网格工作日志表 包装类,返回视图层所需的字段
 *
 * @author BladeX
 * @since 2023-11-16
 */
public class GridWorkLogWrapper extends BaseEntityWrapper<GridWorkLogEntity, GridWorkLogVO>  {
    public static GridWorkLogWrapper build() {
        return new GridWorkLogWrapper();
     }
    @Override
    public GridWorkLogVO entityVO(GridWorkLogEntity gridWorkLog) {
        GridWorkLogVO gridWorkLogVO = Objects.requireNonNull(BeanUtil.copy(gridWorkLog, GridWorkLogVO.class));
        //User createUser = UserCache.getUser(gridWorkLog.getCreateUser());
        //User updateUser = UserCache.getUser(gridWorkLog.getUpdateUser());
        //gridWorkLogVO.setCreateUserName(createUser.getName());
        //gridWorkLogVO.setUpdateUserName(updateUser.getName());
        return gridWorkLogVO;
    }
}
src/main/java/org/springblade/modules/rotation/controller/RotationController.java
New file
@@ -0,0 +1,129 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.rotation.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import lombok.AllArgsConstructor;
import javax.validation.Valid;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.rotation.entity.RotationEntity;
import org.springblade.modules.rotation.vo.RotationVO;
import org.springblade.modules.rotation.wrapper.RotationWrapper;
import org.springblade.modules.rotation.service.IRotationService;
import java.util.Date;
/**
 * 轮播图 控制器
 *
 * @author BladeX
 * @since 2023-11-16
 */
@RestController
@AllArgsConstructor
@RequestMapping("blade-rotation/rotation")
@Api(value = "轮播图", tags = "轮播图接口")
public class RotationController{
    private final IRotationService rotationService;
    /**
     * 轮播图 详情
     */
    @GetMapping("/detail")
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "详情", notes = "传入rotation")
    public R<RotationVO> detail(RotationEntity rotation) {
        RotationEntity detail = rotationService.getOne(Condition.getQueryWrapper(rotation));
        return R.data(RotationWrapper.build().entityVO(detail));
    }
    /**
     * 轮播图 分页
     */
    @GetMapping("/list")
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "分页", notes = "传入rotation")
    public R<IPage<RotationVO>> list(RotationEntity rotation, Query query) {
        IPage<RotationEntity> pages = rotationService.page(Condition.getPage(query), Condition.getQueryWrapper(rotation));
        return R.data(RotationWrapper.build().pageVO(pages));
    }
    /**
     * 轮播图 自定义分页
     */
    @GetMapping("/page")
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "分页", notes = "传入rotation")
    public R<IPage<RotationVO>> page(RotationVO rotation, Query query) {
        IPage<RotationVO> pages = rotationService.selectRotationPage(Condition.getPage(query), rotation);
        return R.data(pages);
    }
    /**
     * 轮播图 新增
     */
    @PostMapping("/save")
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "新增", notes = "传入rotation")
    public R save(@Valid @RequestBody RotationEntity rotation) {
        rotation.setCreateTime(new Date());
        rotation.setCreateUser(AuthUtil.getUserId());
        return R.status(rotationService.save(rotation));
    }
    /**
     * 轮播图 修改
     */
    @PostMapping("/update")
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "修改", notes = "传入rotation")
    public R update(@Valid @RequestBody RotationEntity rotation) {
        return R.status(rotationService.updateById(rotation));
    }
    /**
     * 轮播图 新增或修改
     */
    @PostMapping("/submit")
    @ApiOperationSupport(order = 6)
    @ApiOperation(value = "新增或修改", notes = "传入rotation")
    public R submit(@Valid @RequestBody RotationEntity rotation) {
        return R.status(rotationService.saveOrUpdate(rotation));
    }
    /**
     * 轮播图 删除
     */
    @PostMapping("/remove")
    @ApiOperationSupport(order = 7)
    @ApiOperation(value = "逻辑删除", notes = "传入ids")
    public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
        return R.status(rotationService.removeByIds(Func.toLongList(ids)));
    }
}
src/main/java/org/springblade/modules/rotation/dto/RotationDTO.java
New file
@@ -0,0 +1,34 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.rotation.dto;
import org.springblade.modules.rotation.entity.RotationEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * 轮播图 数据传输对象实体类
 *
 * @author BladeX
 * @since 2023-11-16
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class RotationDTO extends RotationEntity {
    private static final long serialVersionUID = 1L;
}
src/main/java/org/springblade/modules/rotation/entity/RotationEntity.java
New file
@@ -0,0 +1,104 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.rotation.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import org.springframework.format.annotation.DateTimeFormat;
/**
 * 轮播图 实体类
 *
 * @author BladeX
 * @since 2023-11-16
 */
@Data
@TableName("jczz_rotation")
@ApiModel(value = "Rotation对象", description = "轮播图")
public class RotationEntity implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 主键
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty("主键id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 名称
     */
    @ApiModelProperty(value = "名称")
    private String name;
    /**
     * 类型
     */
    @ApiModelProperty(value = "类型")
    private String type;
    /**
     * 内容
     */
    @ApiModelProperty(value = "内容")
    private String context;
    /**
     * 图片地址
     */
    @ApiModelProperty(value = "图片地址")
    private String url;
    /**
     * 跳转地址
     */
    @ApiModelProperty(value = "跳转地址")
    private String junpUrl;
    /**
     * 创建人
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty("创建人")
    private Long createUser;
    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty("创建时间")
    private Date createTime;
    /**
     * 是否删除
     */
    @TableLogic
    @ApiModelProperty("是否已删除 0:否  1:是")
    private Integer isDeleted;
}
src/main/java/org/springblade/modules/rotation/mapper/RotationMapper.java
New file
@@ -0,0 +1,44 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.rotation.mapper;
import org.apache.ibatis.annotations.Param;
import org.springblade.modules.rotation.entity.RotationEntity;
import org.springblade.modules.rotation.vo.RotationVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List;
/**
 * 轮播图 Mapper 接口
 *
 * @author BladeX
 * @since 2023-11-16
 */
public interface RotationMapper extends BaseMapper<RotationEntity> {
    /**
     * 自定义分页
     *
     * @param page
     * @param rotation
     * @return
     */
    List<RotationVO> selectRotationPage(IPage page,@Param("rotation") RotationVO rotation);
}
src/main/java/org/springblade/modules/rotation/mapper/RotationMapper.xml
New file
@@ -0,0 +1,27 @@
<?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="org.springblade.modules.rotation.mapper.RotationMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="rotationResultMap" type="org.springblade.modules.rotation.entity.RotationEntity">
        <result column="id" property="id"/>
        <result column="name" property="name"/>
        <result column="type" property="type"/>
        <result column="context" property="context"/>
        <result column="url" property="url"/>
        <result column="junp_url" property="junpUrl"/>
        <result column="create_time" property="createTime"/>
        <result column="create_user" property="createUser"/>
        <result column="is_deleted" property="isDeleted"/>
    </resultMap>
    <!--自定义分页查询-->
    <select id="selectRotationPage" resultMap="rotationResultMap">
        select * from jczz_rotation where is_deleted = 0
        <if test="rotation.name!=null and rotation.name!=''">
            and name like concat('%',#{rotation.name},'%')
        </if>
    </select>
</mapper>
src/main/java/org/springblade/modules/rotation/service/IRotationService.java
New file
@@ -0,0 +1,43 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.rotation.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springblade.modules.rotation.entity.RotationEntity;
import org.springblade.modules.rotation.vo.RotationVO;
import org.springblade.core.mp.base.BaseService;
import com.baomidou.mybatisplus.core.metadata.IPage;
/**
 * 轮播图 服务类
 *
 * @author BladeX
 * @since 2023-11-16
 */
public interface IRotationService extends IService<RotationEntity> {
    /**
     * 自定义分页
     *
     * @param page
     * @param rotation
     * @return
     */
    IPage<RotationVO> selectRotationPage(IPage<RotationVO> page, RotationVO rotation);
}
src/main/java/org/springblade/modules/rotation/service/impl/RotationServiceImpl.java
New file
@@ -0,0 +1,50 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.rotation.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.modules.rotation.entity.RotationEntity;
import org.springblade.modules.rotation.vo.RotationVO;
import org.springblade.modules.rotation.mapper.RotationMapper;
import org.springblade.modules.rotation.service.IRotationService;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
/**
 * 轮播图 服务实现类
 *
 * @author BladeX
 * @since 2023-11-16
 */
@Service
public class RotationServiceImpl extends ServiceImpl<RotationMapper, RotationEntity> implements IRotationService {
    /**
     * 自定义分页
     *
     * @param page
     * @param rotation
     * @return
     */
    @Override
    public IPage<RotationVO> selectRotationPage(IPage<RotationVO> page, RotationVO rotation) {
        return page.setRecords(baseMapper.selectRotationPage(page, rotation));
    }
}
src/main/java/org/springblade/modules/rotation/vo/RotationVO.java
New file
@@ -0,0 +1,35 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.rotation.vo;
import org.springblade.modules.rotation.entity.RotationEntity;
import org.springblade.core.tool.node.INode;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * 轮播图 视图实体类
 *
 * @author BladeX
 * @since 2023-11-16
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class RotationVO extends RotationEntity {
    private static final long serialVersionUID = 1L;
}
src/main/java/org/springblade/modules/rotation/wrapper/RotationWrapper.java
New file
@@ -0,0 +1,50 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.rotation.wrapper;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.modules.rotation.entity.RotationEntity;
import org.springblade.modules.rotation.vo.RotationVO;
import java.util.Objects;
/**
 * 轮播图 包装类,返回视图层所需的字段
 *
 * @author BladeX
 * @since 2023-11-16
 */
public class RotationWrapper extends BaseEntityWrapper<RotationEntity, RotationVO>  {
    public static RotationWrapper build() {
        return new RotationWrapper();
     }
    @Override
    public RotationVO entityVO(RotationEntity rotation) {
        RotationVO rotationVO = Objects.requireNonNull(BeanUtil.copy(rotation, RotationVO.class));
        //User createUser = UserCache.getUser(rotation.getCreateUser());
        //User updateUser = UserCache.getUser(rotation.getUpdateUser());
        //rotationVO.setCreateUserName(createUser.getName());
        //rotationVO.setUpdateUserName(updateUser.getName());
        return rotationVO;
    }
}