zhongrj
2024-01-06 39845297a67bba9a02a8b4301c87b9985d7ca258
新增物业公司评价评分
1 files modified
18 files added
1069 ■■■■■ changed files
src/main/java/org/springblade/modules/grid/mapper/GridWorkLogMapper.xml 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/property/controller/PropertyCompanyCommentController.java 121 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/property/controller/PropertyCompanyScoreController.java 107 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/property/dto/PropertyCompanyCommentDTO.java 34 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/property/dto/PropertyCompanyScoreDTO.java 34 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/property/entity/PropertyCompanyCommentEntity.java 101 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/property/entity/PropertyCompanyScoreEntity.java 70 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/property/mapper/PropertyCompanyCommentMapper.java 53 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/property/mapper/PropertyCompanyCommentMapper.xml 56 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/property/mapper/PropertyCompanyScoreMapper.java 43 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/property/mapper/PropertyCompanyScoreMapper.xml 21 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/property/service/IPropertyCompanyCommentService.java 47 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/property/service/IPropertyCompanyScoreService.java 43 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/property/service/impl/PropertyCompanyCommentServiceImpl.java 94 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/property/service/impl/PropertyCompanyScoreServiceImpl.java 43 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/property/vo/PropertyCompanyCommentVO.java 65 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/property/vo/PropertyCompanyScoreVO.java 35 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/property/wrapper/PropertyCompanyCommentWrapper.java 50 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/property/wrapper/PropertyCompanyScoreWrapper.java 50 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/grid/mapper/GridWorkLogMapper.xml
@@ -48,7 +48,7 @@
            and jda.town_street_name like concat('%',#{gridWorkLog.townName},'%')
        </if>
        <if test="gridWorkLog.neiName!=null and gridWorkLog.neiName!=''">
            and jda.nei_name like concat('%',#{household.neiName},'%')
            and jda.nei_name like concat('%',#{gridWorkLog.neiName},'%')
        </if>
        <if test="gridWorkLog.regionCode!=null and gridWorkLog.regionCode!=''">
            and jg.community_code like concat('%',#{gridWorkLog.regionCode},'%')
src/main/java/org/springblade/modules/property/controller/PropertyCompanyCommentController.java
New file
@@ -0,0 +1,121 @@
package org.springblade.modules.property.controller;
import com.qiniu.util.Auth;
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.property.entity.PropertyCompanyCommentEntity;
import org.springblade.modules.property.vo.PropertyCompanyCommentVO;
import org.springblade.modules.property.wrapper.PropertyCompanyCommentWrapper;
import org.springblade.modules.property.service.IPropertyCompanyCommentService;
/**
 * 物业公司评论表 控制器
 *
 * @author BladeX
 * @since 2024-01-05
 */
@RestController
@AllArgsConstructor
@RequestMapping("blade-propertyCompanyComment/propertyCompanyComment")
@Api(value = "物业公司评论表", tags = "物业公司评论表接口")
public class PropertyCompanyCommentController {
    private final IPropertyCompanyCommentService propertyCompanyCommentService;
    /**
     * 物业公司评论表 详情
     */
    @GetMapping("/detail")
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "详情", notes = "传入propertyCompanyComment")
    public R<PropertyCompanyCommentVO> detail(PropertyCompanyCommentEntity propertyCompanyComment) {
        PropertyCompanyCommentEntity detail = propertyCompanyCommentService.getOne(Condition.getQueryWrapper(propertyCompanyComment));
        return R.data(PropertyCompanyCommentWrapper.build().entityVO(detail));
    }
    /**
     * 物业公司评论表 分页
     */
    @GetMapping("/list")
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "分页", notes = "传入propertyCompanyComment")
    public R<IPage<PropertyCompanyCommentVO>> list(PropertyCompanyCommentEntity propertyCompanyComment, Query query) {
        IPage<PropertyCompanyCommentEntity> pages = propertyCompanyCommentService.page(Condition.getPage(query), Condition.getQueryWrapper(propertyCompanyComment));
        return R.data(PropertyCompanyCommentWrapper.build().pageVO(pages));
    }
    /**
     * 物业公司评论表 自定义分页
     */
    @GetMapping("/page")
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "分页", notes = "传入propertyCompanyComment")
    public R<IPage<PropertyCompanyCommentVO>> page(PropertyCompanyCommentVO propertyCompanyComment, Query query) {
        IPage<PropertyCompanyCommentVO> pages = propertyCompanyCommentService.selectPropertyCompanyCommentPage(Condition.getPage(query), propertyCompanyComment);
        return R.data(pages);
    }
    /**
     * 物业公司评论表 新增
     */
    @PostMapping("/save")
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "新增", notes = "传入propertyCompanyComment")
    public R save(@Valid @RequestBody PropertyCompanyCommentEntity propertyCompanyComment) {
        propertyCompanyComment.setCreateUser(AuthUtil.getUserId());
        return R.status(propertyCompanyCommentService.save(propertyCompanyComment));
    }
    /**
     * 物业公司评论表 修改
     */
    @PostMapping("/update")
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "修改", notes = "传入propertyCompanyComment")
    public R update(@Valid @RequestBody PropertyCompanyCommentEntity propertyCompanyComment) {
        return R.status(propertyCompanyCommentService.updateById(propertyCompanyComment));
    }
    /**
     * 物业公司评论表 自定义新增或修改
     */
    @PostMapping("/saveOrUpdate")
    @ApiOperation(value = "新增", notes = "传入propertyCompanyComment")
    public R saveOrUpdate(@Valid @RequestBody PropertyCompanyCommentVO propertyCompanyComment) {
        propertyCompanyComment.setCreateUser(AuthUtil.getUserId());
        return R.status(propertyCompanyCommentService.saveOrUpdatePropertyCompanyComment(propertyCompanyComment));
    }
    /**
     * 物业公司评论表 新增或修改
     */
    @PostMapping("/submit")
    @ApiOperationSupport(order = 6)
    @ApiOperation(value = "新增或修改", notes = "传入propertyCompanyComment")
    public R submit(@Valid @RequestBody PropertyCompanyCommentEntity propertyCompanyComment) {
        return R.status(propertyCompanyCommentService.saveOrUpdate(propertyCompanyComment));
    }
    /**
     * 物业公司评论表 删除
     */
    @PostMapping("/remove")
    @ApiOperationSupport(order = 7)
    @ApiOperation(value = "逻辑删除", notes = "传入ids")
    public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
        return R.status(propertyCompanyCommentService.removeByIds(Func.toLongList(ids)));
    }
}
src/main/java/org/springblade/modules/property/controller/PropertyCompanyScoreController.java
New file
@@ -0,0 +1,107 @@
package org.springblade.modules.property.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.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.property.entity.PropertyCompanyScoreEntity;
import org.springblade.modules.property.vo.PropertyCompanyScoreVO;
import org.springblade.modules.property.wrapper.PropertyCompanyScoreWrapper;
import org.springblade.modules.property.service.IPropertyCompanyScoreService;
/**
 * 物业公司评分表 控制器
 *
 * @author BladeX
 * @since 2024-01-05
 */
@RestController
@AllArgsConstructor
@RequestMapping("blade-propertyCompanyScore/propertyCompanyScore")
@Api(value = "物业公司评分表", tags = "物业公司评分表接口")
public class PropertyCompanyScoreController{
    private final IPropertyCompanyScoreService propertyCompanyScoreService;
    /**
     * 物业公司评分表 详情
     */
    @GetMapping("/detail")
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "详情", notes = "传入propertyCompanyScore")
    public R<PropertyCompanyScoreVO> detail(PropertyCompanyScoreEntity propertyCompanyScore) {
        PropertyCompanyScoreEntity detail = propertyCompanyScoreService.getOne(Condition.getQueryWrapper(propertyCompanyScore));
        return R.data(PropertyCompanyScoreWrapper.build().entityVO(detail));
    }
    /**
     * 物业公司评分表 分页
     */
    @GetMapping("/list")
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "分页", notes = "传入propertyCompanyScore")
    public R<IPage<PropertyCompanyScoreVO>> list(PropertyCompanyScoreEntity propertyCompanyScore, Query query) {
        IPage<PropertyCompanyScoreEntity> pages = propertyCompanyScoreService.page(Condition.getPage(query), Condition.getQueryWrapper(propertyCompanyScore));
        return R.data(PropertyCompanyScoreWrapper.build().pageVO(pages));
    }
    /**
     * 物业公司评分表 自定义分页
     */
    @GetMapping("/page")
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "分页", notes = "传入propertyCompanyScore")
    public R<IPage<PropertyCompanyScoreVO>> page(PropertyCompanyScoreVO propertyCompanyScore, Query query) {
        IPage<PropertyCompanyScoreVO> pages = propertyCompanyScoreService.selectPropertyCompanyScorePage(Condition.getPage(query), propertyCompanyScore);
        return R.data(pages);
    }
    /**
     * 物业公司评分表 新增
     */
    @PostMapping("/save")
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "新增", notes = "传入propertyCompanyScore")
    public R save(@Valid @RequestBody PropertyCompanyScoreEntity propertyCompanyScore) {
        return R.status(propertyCompanyScoreService.save(propertyCompanyScore));
    }
    /**
     * 物业公司评分表 修改
     */
    @PostMapping("/update")
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "修改", notes = "传入propertyCompanyScore")
    public R update(@Valid @RequestBody PropertyCompanyScoreEntity propertyCompanyScore) {
        return R.status(propertyCompanyScoreService.updateById(propertyCompanyScore));
    }
    /**
     * 物业公司评分表 新增或修改
     */
    @PostMapping("/submit")
    @ApiOperationSupport(order = 6)
    @ApiOperation(value = "新增或修改", notes = "传入propertyCompanyScore")
    public R submit(@Valid @RequestBody PropertyCompanyScoreEntity propertyCompanyScore) {
        return R.status(propertyCompanyScoreService.saveOrUpdate(propertyCompanyScore));
    }
    /**
     * 物业公司评分表 删除
     */
    @PostMapping("/remove")
    @ApiOperationSupport(order = 7)
    @ApiOperation(value = "逻辑删除", notes = "传入ids")
    public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
        return R.status(propertyCompanyScoreService.removeByIds(Func.toLongList(ids)));
    }
}
src/main/java/org/springblade/modules/property/dto/PropertyCompanyCommentDTO.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.property.dto;
import org.springblade.modules.property.entity.PropertyCompanyCommentEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * 物业公司评论表 数据传输对象实体类
 *
 * @author BladeX
 * @since 2024-01-05
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class PropertyCompanyCommentDTO extends PropertyCompanyCommentEntity {
    private static final long serialVersionUID = 1L;
}
src/main/java/org/springblade/modules/property/dto/PropertyCompanyScoreDTO.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.property.dto;
import org.springblade.modules.property.entity.PropertyCompanyScoreEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * 物业公司评分表 数据传输对象实体类
 *
 * @author BladeX
 * @since 2024-01-05
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class PropertyCompanyScoreDTO extends PropertyCompanyScoreEntity {
    private static final long serialVersionUID = 1L;
}
src/main/java/org/springblade/modules/property/entity/PropertyCompanyCommentEntity.java
New file
@@ -0,0 +1,101 @@
package org.springblade.modules.property.entity;
import com.baomidou.mybatisplus.annotation.*;
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 org.springframework.format.annotation.DateTimeFormat;
/**
 * 物业公司评论表 实体类
 *
 * @author BladeX
 * @since 2024-01-05
 */
@Data
@TableName("jczz_property_company_comment")
@ApiModel(value = "PropertyCompanyComment对象", description = "物业公司评论表")
public class PropertyCompanyCommentEntity implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 主键
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty("主键id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 物业公司id
     */
    @ApiModelProperty(value = "物业公司id")
    private Integer propertyCompanyId;
    /**
     * 父级id
     */
    @ApiModelProperty(value = "父级id")
    private Long parentId;
    /**
     * 评论内容
     */
    @ApiModelProperty(value = "评论内容")
    private String content;
    /**
     * 评论图片
     */
    @ApiModelProperty(value = "评论图片")
    private String imageUrls;
    /**
     * 审核人
     */
    @ApiModelProperty(value = "审核人")
    private Long checkUser;
    /**
     * 审核时间
     */
    @ApiModelProperty(value = "审核时间")
    private Date checkTime;
    /**
     * 审核状态
     */
    @ApiModelProperty(value = "审核状态")
    private Integer checkStatus;
    /**
     * 审核备注
     */
    @ApiModelProperty(value = "审核备注")
    private String checkRemark;
    /**
     * 创建人
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty("创建人")
    @TableField(fill = FieldFill.INSERT)
    private Long createUser;
    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty("创建时间")
    private Date createTime;
    /**
     * 是否删除
     */
    @TableLogic
    @ApiModelProperty("是否已删除 0:否  1:是")
    private Integer isDeleted;
}
src/main/java/org/springblade/modules/property/entity/PropertyCompanyScoreEntity.java
New file
@@ -0,0 +1,70 @@
package org.springblade.modules.property.entity;
import com.baomidou.mybatisplus.annotation.*;
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 org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
 * 物业公司评分表 实体类
 *
 * @author BladeX
 * @since 2024-01-05
 */
@Data
@TableName("jczz_property_company_score")
@ApiModel(value = "PropertyCompanyScore对象", description = "物业公司评分表")
public class PropertyCompanyScoreEntity implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 主键
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty("主键id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 物业公司id
     */
    @ApiModelProperty(value = "物业公司id")
    private Integer propertyCompanyId;
    /**
     * 评分
     */
    @ApiModelProperty(value = "评分")
    private Integer score;
    /**
     * 创建人
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty("创建人")
    @TableField(fill = FieldFill.INSERT)
    private Long createUser;
    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty("创建时间")
    private Date createTime;
    /**
     * 是否删除
     */
    @TableLogic
    @ApiModelProperty("是否已删除 0:否  1:是")
    private Integer isDeleted;
}
src/main/java/org/springblade/modules/property/mapper/PropertyCompanyCommentMapper.java
New file
@@ -0,0 +1,53 @@
/*
 *      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.property.mapper;
import org.apache.ibatis.annotations.Param;
import org.springblade.modules.property.entity.PropertyCompanyCommentEntity;
import org.springblade.modules.property.vo.PropertyCompanyCommentVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List;
/**
 * 物业公司评论表 Mapper 接口
 *
 * @author BladeX
 * @since 2024-01-05
 */
public interface PropertyCompanyCommentMapper extends BaseMapper<PropertyCompanyCommentEntity> {
    /**
     * 自定义分页
     *
     * @param page
     * @param propertyCompanyComment
     * @return
     */
    List<PropertyCompanyCommentVO> selectPropertyCompanyCommentPage(IPage page,
                                                                    @Param("propertyCompanyComment") PropertyCompanyCommentVO propertyCompanyComment);
    /**
     * 递归分页查询
     * @param page
     * @param propertyCompanyComment
     * @return
     */
    List<PropertyCompanyCommentVO> selectPropertyCompanyCommentPageRec(IPage<PropertyCompanyCommentVO> page,
                                                                       @Param("propertyCompanyComment") PropertyCompanyCommentVO propertyCompanyComment);
}
src/main/java/org/springblade/modules/property/mapper/PropertyCompanyCommentMapper.xml
New file
@@ -0,0 +1,56 @@
<?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.property.mapper.PropertyCompanyCommentMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="propertyCompanyCommentResultMap" type="org.springblade.modules.property.vo.PropertyCompanyCommentVO" autoMapping="true">
        <id property="id" column="id"/>
        <collection property="children" column="id"  javaType="java.util.List"
                    ofType="org.springblade.modules.property.vo.PropertyCompanyCommentVO"
                    autoMapping="true"
                    select="selectPropertyCompanyCommentByParentId">
        </collection>
    </resultMap>
    <!--自定义分页查询-->
    <select id="selectPropertyCompanyCommentPage" resultType="org.springblade.modules.property.vo.PropertyCompanyCommentVO">
        select
        jpcc.*,
        bu.real_name as realName,bu.avatar
        from jczz_property_company_comment jpcc
        left join blade_user bu on bu.id = jpcc.create_user
        where jpcc.is_deleted = 0
        and jpcc.parent_id = 0
        <if test="propertyCompanyComment.propertyCompanyId!=null">
            and jpcc.property_company_id = #{propertyCompanyComment.propertyCompanyId}
        </if>
    </select>
    <!--自定义分页查询(递归)-->
    <select id="selectPropertyCompanyCommentPageRec" parameterType="long"
            resultMap="propertyCompanyCommentResultMap">
        select
        jpcc.*,
        bu.real_name as realName,bu.avatar
        from jczz_property_company_comment jpcc
        left join blade_user bu on bu.id = jpcc.create_user
        where jpcc.is_deleted = 0
        and jpcc.parent_id = 0
        <if test="propertyCompanyComment.propertyCompanyId!=null">
            and jpcc.property_company_id = #{propertyCompanyComment.propertyCompanyId}
        </if>
    </select>
    <!--递归查询-->
    <select id="selectPropertyCompanyCommentByParentId"
            resultType="org.springblade.modules.property.vo.PropertyCompanyCommentVO">
        select
        jpcc.*,
        bu.real_name as realName,bu.avatar
        from jczz_property_company_comment jpcc
        left join blade_user bu on bu.id = jpcc.create_user
        where jpcc.is_deleted = 0
        and jpcc.parent_id = #{id}
    </select>
</mapper>
src/main/java/org/springblade/modules/property/mapper/PropertyCompanyScoreMapper.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.property.mapper;
import org.springblade.modules.property.entity.PropertyCompanyScoreEntity;
import org.springblade.modules.property.vo.PropertyCompanyScoreVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List;
/**
 * 物业公司评分表 Mapper 接口
 *
 * @author BladeX
 * @since 2024-01-05
 */
public interface PropertyCompanyScoreMapper extends BaseMapper<PropertyCompanyScoreEntity> {
    /**
     * 自定义分页
     *
     * @param page
     * @param propertyCompanyScore
     * @return
     */
    List<PropertyCompanyScoreVO> selectPropertyCompanyScorePage(IPage page, PropertyCompanyScoreVO propertyCompanyScore);
}
src/main/java/org/springblade/modules/property/mapper/PropertyCompanyScoreMapper.xml
New file
@@ -0,0 +1,21 @@
<?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.property.mapper.PropertyCompanyScoreMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="propertyCompanyScoreResultMap" type="org.springblade.modules.property.entity.PropertyCompanyScoreEntity">
        <result column="id" property="id"/>
        <result column="property_company_id" property="propertyCompanyId"/>
        <result column="score" property="score"/>
        <result column="create_user" property="createUser"/>
        <result column="create_time" property="createTime"/>
        <result column="is_deleted" property="isDeleted"/>
    </resultMap>
    <select id="selectPropertyCompanyScorePage" resultMap="propertyCompanyScoreResultMap">
        select * from jczz_property_company_score where is_deleted = 0
    </select>
</mapper>
src/main/java/org/springblade/modules/property/service/IPropertyCompanyCommentService.java
New file
@@ -0,0 +1,47 @@
/*
 *      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.property.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springblade.modules.property.entity.PropertyCompanyCommentEntity;
import org.springblade.modules.property.vo.PropertyCompanyCommentVO;
import org.springblade.core.mp.base.BaseService;
import com.baomidou.mybatisplus.core.metadata.IPage;
/**
 * 物业公司评论表 服务类
 *
 * @author BladeX
 * @since 2024-01-05
 */
public interface IPropertyCompanyCommentService extends IService<PropertyCompanyCommentEntity> {
    /**
     * 自定义分页
     *
     * @param page
     * @param propertyCompanyComment
     * @return
     */
    IPage<PropertyCompanyCommentVO> selectPropertyCompanyCommentPage(IPage<PropertyCompanyCommentVO> page, PropertyCompanyCommentVO propertyCompanyComment);
    /**
     * 物业公司评论表 自定义新增或修改
     */
    boolean saveOrUpdatePropertyCompanyComment(PropertyCompanyCommentVO propertyCompanyComment);
}
src/main/java/org/springblade/modules/property/service/IPropertyCompanyScoreService.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.property.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springblade.modules.property.entity.PropertyCompanyScoreEntity;
import org.springblade.modules.property.vo.PropertyCompanyScoreVO;
import org.springblade.core.mp.base.BaseService;
import com.baomidou.mybatisplus.core.metadata.IPage;
/**
 * 物业公司评分表 服务类
 *
 * @author BladeX
 * @since 2024-01-05
 */
public interface IPropertyCompanyScoreService extends IService<PropertyCompanyScoreEntity> {
    /**
     * 自定义分页
     *
     * @param page
     * @param propertyCompanyScore
     * @return
     */
    IPage<PropertyCompanyScoreVO> selectPropertyCompanyScorePage(IPage<PropertyCompanyScoreVO> page, PropertyCompanyScoreVO propertyCompanyScore);
}
src/main/java/org/springblade/modules/property/service/impl/PropertyCompanyCommentServiceImpl.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.property.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.logging.log4j.util.Strings;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.modules.property.entity.PropertyCompanyCommentEntity;
import org.springblade.modules.property.entity.PropertyCompanyScoreEntity;
import org.springblade.modules.property.service.IPropertyCompanyScoreService;
import org.springblade.modules.property.vo.PropertyCompanyCommentVO;
import org.springblade.modules.property.mapper.PropertyCompanyCommentMapper;
import org.springblade.modules.property.service.IPropertyCompanyCommentService;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.transaction.annotation.Transactional;
/**
 * 物业公司评论表 服务实现类
 *
 * @author BladeX
 * @since 2024-01-05
 */
@Service
public class PropertyCompanyCommentServiceImpl extends ServiceImpl<PropertyCompanyCommentMapper, PropertyCompanyCommentEntity> implements IPropertyCompanyCommentService {
    @Autowired
    private IPropertyCompanyScoreService propertyCompanyScoreService;
    @Override
    public IPage<PropertyCompanyCommentVO> selectPropertyCompanyCommentPage(IPage<PropertyCompanyCommentVO> page, PropertyCompanyCommentVO propertyCompanyComment) {
        if (null!=propertyCompanyComment.getIsRec()){
            // 递归查询
            return page.setRecords(baseMapper.selectPropertyCompanyCommentPageRec(page, propertyCompanyComment));
        }
        return page.setRecords(baseMapper.selectPropertyCompanyCommentPage(page, propertyCompanyComment));
    }
    /**
     * 物业公司评论表 自定义新增或修改
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean saveOrUpdatePropertyCompanyComment(PropertyCompanyCommentVO propertyCompanyComment) {
        boolean save = save(propertyCompanyComment);
        // 更新评分
        updatePropertyCompanyScore(propertyCompanyComment);
        // 返回
        return save;
    }
    /**
     * 更新评分
     * @param propertyCompanyComment
     */
    public void updatePropertyCompanyScore(PropertyCompanyCommentVO propertyCompanyComment) {
        // 查询当前的物业公司,当前人是否已经评分,如果已经评分,则更新,否则新增
        if (null!=propertyCompanyComment.getScore()){
            QueryWrapper<PropertyCompanyScoreEntity> queryWrapper = new QueryWrapper<>();
            queryWrapper.eq("is_deleted",0).eq("create_user", AuthUtil.getUserId())
                .eq("property_company_id",propertyCompanyComment.getPropertyCompanyId());
            PropertyCompanyScoreEntity one = propertyCompanyScoreService.getOne(queryWrapper);
            if (null!=one){
                one.setScore(propertyCompanyComment.getScore());
                // 更新
                propertyCompanyScoreService.updateById(one);
            }else {
                PropertyCompanyScoreEntity propertyCompanyScoreEntity = new PropertyCompanyScoreEntity();
                propertyCompanyScoreEntity.setScore(propertyCompanyComment.getScore());
                propertyCompanyScoreEntity.setPropertyCompanyId(propertyCompanyComment.getPropertyCompanyId());
                propertyCompanyScoreEntity.setCreateUser(AuthUtil.getUserId());
                // 新增
                propertyCompanyScoreService.save(propertyCompanyScoreEntity);
            }
        }
    }
}
src/main/java/org/springblade/modules/property/service/impl/PropertyCompanyScoreServiceImpl.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.property.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.modules.property.entity.PropertyCompanyScoreEntity;
import org.springblade.modules.property.vo.PropertyCompanyScoreVO;
import org.springblade.modules.property.mapper.PropertyCompanyScoreMapper;
import org.springblade.modules.property.service.IPropertyCompanyScoreService;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
/**
 * 物业公司评分表 服务实现类
 *
 * @author BladeX
 * @since 2024-01-05
 */
@Service
public class PropertyCompanyScoreServiceImpl extends ServiceImpl<PropertyCompanyScoreMapper, PropertyCompanyScoreEntity> implements IPropertyCompanyScoreService {
    @Override
    public IPage<PropertyCompanyScoreVO> selectPropertyCompanyScorePage(IPage<PropertyCompanyScoreVO> page, PropertyCompanyScoreVO propertyCompanyScore) {
        return page.setRecords(baseMapper.selectPropertyCompanyScorePage(page, propertyCompanyScore));
    }
}
src/main/java/org/springblade/modules/property/vo/PropertyCompanyCommentVO.java
New file
@@ -0,0 +1,65 @@
/*
 *      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.property.vo;
import io.swagger.annotations.ApiModelProperty;
import org.springblade.modules.circle.vo.CircleCommentVO;
import org.springblade.modules.property.entity.PropertyCompanyCommentEntity;
import org.springblade.core.tool.node.INode;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
/**
 * 物业公司评论表 视图实体类
 *
 * @author BladeX
 * @since 2024-01-05
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class PropertyCompanyCommentVO extends PropertyCompanyCommentEntity {
    private static final long serialVersionUID = 1L;
    private List<CircleCommentVO> children;
    /**
     * 姓名
     */
    @ApiModelProperty("姓名")
    private String realName;
    /**
     * 头像
     */
    @ApiModelProperty("头像")
    private String avatar;
    /**
     * 是否递归查询 1:是  2:否
     */
    @ApiModelProperty("是否递归查询 1:是  2:否")
    private Integer isRec;
    /**
     * 评分
     */
    @ApiModelProperty("评分")
    private Integer score;
}
src/main/java/org/springblade/modules/property/vo/PropertyCompanyScoreVO.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.property.vo;
import org.springblade.modules.property.entity.PropertyCompanyScoreEntity;
import org.springblade.core.tool.node.INode;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
 * 物业公司评分表 视图实体类
 *
 * @author BladeX
 * @since 2024-01-05
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class PropertyCompanyScoreVO extends PropertyCompanyScoreEntity {
    private static final long serialVersionUID = 1L;
}
src/main/java/org/springblade/modules/property/wrapper/PropertyCompanyCommentWrapper.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.property.wrapper;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.modules.property.entity.PropertyCompanyCommentEntity;
import org.springblade.modules.property.vo.PropertyCompanyCommentVO;
import java.util.Objects;
/**
 * 物业公司评论表 包装类,返回视图层所需的字段
 *
 * @author BladeX
 * @since 2024-01-05
 */
public class PropertyCompanyCommentWrapper extends BaseEntityWrapper<PropertyCompanyCommentEntity, PropertyCompanyCommentVO>  {
    public static PropertyCompanyCommentWrapper build() {
        return new PropertyCompanyCommentWrapper();
     }
    @Override
    public PropertyCompanyCommentVO entityVO(PropertyCompanyCommentEntity propertyCompanyComment) {
        PropertyCompanyCommentVO propertyCompanyCommentVO = Objects.requireNonNull(BeanUtil.copy(propertyCompanyComment, PropertyCompanyCommentVO.class));
        //User createUser = UserCache.getUser(propertyCompanyComment.getCreateUser());
        //User updateUser = UserCache.getUser(propertyCompanyComment.getUpdateUser());
        //propertyCompanyCommentVO.setCreateUserName(createUser.getName());
        //propertyCompanyCommentVO.setUpdateUserName(updateUser.getName());
        return propertyCompanyCommentVO;
    }
}
src/main/java/org/springblade/modules/property/wrapper/PropertyCompanyScoreWrapper.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.property.wrapper;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.modules.property.entity.PropertyCompanyScoreEntity;
import org.springblade.modules.property.vo.PropertyCompanyScoreVO;
import java.util.Objects;
/**
 * 物业公司评分表 包装类,返回视图层所需的字段
 *
 * @author BladeX
 * @since 2024-01-05
 */
public class PropertyCompanyScoreWrapper extends BaseEntityWrapper<PropertyCompanyScoreEntity, PropertyCompanyScoreVO>  {
    public static PropertyCompanyScoreWrapper build() {
        return new PropertyCompanyScoreWrapper();
     }
    @Override
    public PropertyCompanyScoreVO entityVO(PropertyCompanyScoreEntity propertyCompanyScore) {
        PropertyCompanyScoreVO propertyCompanyScoreVO = Objects.requireNonNull(BeanUtil.copy(propertyCompanyScore, PropertyCompanyScoreVO.class));
        //User createUser = UserCache.getUser(propertyCompanyScore.getCreateUser());
        //User updateUser = UserCache.getUser(propertyCompanyScore.getUpdateUser());
        //propertyCompanyScoreVO.setCreateUserName(createUser.getName());
        //propertyCompanyScoreVO.setUpdateUserName(updateUser.getName());
        return propertyCompanyScoreVO;
    }
}