房屋标签迁移user_house_label + 圈子表+点赞+文章范围
13 files modified
1 files renamed
4 files copied
16 files added
| | |
| | | package org.springblade.modules.article.controller; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhongrj |
| | |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详情", notes = "传入articleoy") |
| | | public R<Article> detail(ArticleVO article) { |
| | | Article detail = articleService.getArticleOne(article); |
| | | ArticleVO detail = articleService.getArticleOne(article); |
| | | UpdateWrapper<Article> objectUpdateWrapper = new UpdateWrapper<>(); |
| | | objectUpdateWrapper.setSql("view_number = view_number + 1"); |
| | | objectUpdateWrapper.eq("id", article.getId()); |
| | | articleService.update(null, objectUpdateWrapper); |
| | | List<List<String>> lists = (List<List<String>>) JSON.parse(detail.getArticleRange() ); |
| | | detail.setArticleList(lists); |
| | | return R.data(detail); |
| | | } |
| | | |
| | |
| | | @TableLogic |
| | | @ApiModelProperty("是否已删除 0:否 1:是") |
| | | private Integer isDeleted; |
| | | |
| | | |
| | | /** 资讯范围 */ |
| | | @ApiModelProperty(value = "资讯范围", example = "") |
| | | @TableField("article_range") |
| | | private String articleRange; |
| | | } |
| | |
| | | <result column="update_user" property="updateUser"/> |
| | | <result column="create_user" property="createUser"/> |
| | | <result column="is_deleted" property="isDeleted"/> |
| | | |
| | | <!-- <collection property="lickFlag" javaType="int"--> |
| | | <!-- column="id" select="selectStlLick">--> |
| | | <!-- </collection>--> |
| | | |
| | | <result property="articleRange" column="article_range" /> |
| | | <collection property="countNumber" column="id" javaType="int" select="selectStlCount"> |
| | | </collection> |
| | | |
| | | </resultMap> |
| | | |
| | | <!-- <select id="selectStlLick" parameterType="Long" resultType="int">--> |
| | | <!-- select IFNULL(jnl.id, 0) lickFlag--> |
| | | <!-- FROM jczz_notice jn--> |
| | | <!-- LEFT JOIN jczz_notice_like jnl ON jn.id = jnl.notice_id--> |
| | | <!-- WHERE jnl.notice_user_id = #{notice.userId}--> |
| | | <!-- and jn.is_deleted = 0--> |
| | | <!-- and jn.id = #{id}--> |
| | | <!-- </select>--> |
| | | |
| | | <select id="selectStlCount" resultType="int"> |
| | | select count(1) countNumber |
| | |
| | | and jnl.delete_flag = 0 |
| | | and jn.id = #{id} |
| | | </select> |
| | | |
| | | |
| | | |
| | | <sql id="selectArticle"> |
| | |
| | | update_time, |
| | | update_user, |
| | | create_user, |
| | | is_deleted |
| | | is_deleted, |
| | | article_range |
| | | from |
| | | jczz_article |
| | | </sql> |
| | |
| | | <if test="article.articleType != null and article.articleType != ''"> |
| | | and ja.article_type = #{article.articleType} |
| | | </if> |
| | | |
| | | <if test="article.eventType != null"> |
| | | and jpd.event_type = #{article.eventType} |
| | | </if> |
| | |
| | | ja.update_user, |
| | | ja.create_user, |
| | | ja.is_deleted, |
| | | ja.article_range, |
| | | bdb.dict_value dictValue |
| | | from jczz_article ja LEFT JOIN blade_dict_biz bdb on ja.article_type = bdb.dict_key |
| | | <where> |
| | |
| | | <if test="updateUser != null "> and ja.update_user = #{updateUser}</if> |
| | | <if test="createUser != null "> and ja.create_user = #{createUser}</if> |
| | | <if test="isDeleted != null "> and ja.is_deleted = #{isDeleted}</if> |
| | | <if test="articleRange != null and articleRange != ''"> and article_range = #{articleRange}</if> |
| | | </where> |
| | | and ja.is_deleted = 0 |
| | | and ja.publish = 1 |
| | |
| | | import org.springblade.modules.article.entity.Article; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class ArticleVO extends Article implements Serializable { |
| | |
| | | |
| | | private Integer eventType; |
| | | |
| | | private List<List<String>> articleList; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.circle.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.circle.entity.CircleEntity; |
| | | import org.springblade.modules.circle.vo.CircleVO; |
| | | import org.springblade.modules.circle.wrapper.CircleWrapper; |
| | | import org.springblade.modules.circle.service.ICircleService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | |
| | | /** |
| | | * 圈子表 控制器 |
| | | * |
| | | * @author BladeX |
| | | * @since 2023-11-30 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("blade-circle/circle") |
| | | @Api(value = "圈子表", tags = "圈子表接口") |
| | | public class CircleController extends BladeController { |
| | | |
| | | private final ICircleService circleService; |
| | | |
| | | /** |
| | | * 圈子表 详情 |
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详情", notes = "传入circle") |
| | | public R<CircleVO> detail(CircleEntity circle) { |
| | | CircleEntity detail = circleService.getOne(Condition.getQueryWrapper(circle)); |
| | | return R.data(CircleWrapper.build().entityVO(detail)); |
| | | } |
| | | /** |
| | | * 圈子表 分页 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "传入circle") |
| | | public R<IPage<CircleVO>> list(CircleEntity circle, Query query) { |
| | | IPage<CircleEntity> pages = circleService.page(Condition.getPage(query), Condition.getQueryWrapper(circle)); |
| | | return R.data(CircleWrapper.build().pageVO(pages)); |
| | | } |
| | | |
| | | /** |
| | | * 圈子表 自定义分页 |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入circle") |
| | | public R<IPage<CircleVO>> page(CircleVO circle, Query query) { |
| | | IPage<CircleVO> pages = circleService.selectCirclePage(Condition.getPage(query), circle); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 圈子表 新增 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入circle") |
| | | public R save(@Valid @RequestBody CircleEntity circle) { |
| | | circle.setUserId(AuthUtil.getUserId()); |
| | | return R.status(circleService.save(circle)); |
| | | } |
| | | |
| | | /** |
| | | * 圈子表 修改 |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入circle") |
| | | public R update(@Valid @RequestBody CircleEntity circle) { |
| | | return R.status(circleService.updateById(circle)); |
| | | } |
| | | |
| | | /** |
| | | * 圈子表 新增或修改 |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入circle") |
| | | public R submit(@Valid @RequestBody CircleEntity circle) { |
| | | return R.status(circleService.saveOrUpdate(circle)); |
| | | } |
| | | |
| | | /** |
| | | * 圈子表 删除 |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "逻辑删除", notes = "传入ids") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | return R.status(circleService.removeBatchByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.circle.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | 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.springblade.modules.article.entity.ArticleLikeEntity; |
| | | import org.springblade.modules.circle.entity.CircleLikeEntity; |
| | | import org.springblade.modules.circle.service.ICircleLikeService; |
| | | import org.springblade.modules.circle.vo.CircleLikeVO; |
| | | import org.springblade.modules.circle.wrapper.CircleLikeWrapper; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | /** |
| | | * 圈子点赞表 控制器 |
| | | * |
| | | * @author BladeX |
| | | * @since 2023-11-30 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("blade-circleLike/circleLike") |
| | | @Api(value = "圈子点赞表", tags = "圈子点赞表接口") |
| | | public class CircleLikeController extends BladeController { |
| | | |
| | | private final ICircleLikeService circleService; |
| | | |
| | | /** |
| | | * 圈子点赞表 详情 |
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详情", notes = "传入circle") |
| | | public R<CircleLikeVO> detail(CircleLikeEntity circle) { |
| | | CircleLikeEntity detail = circleService.getOne(Condition.getQueryWrapper(circle)); |
| | | return R.data(CircleLikeWrapper.build().entityVO(detail)); |
| | | } |
| | | |
| | | /** |
| | | * 圈子点赞表 分页 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "传入circle") |
| | | public R<IPage<CircleLikeVO>> list(CircleLikeEntity circle, Query query) { |
| | | IPage<CircleLikeEntity> pages = circleService.page(Condition.getPage(query), Condition.getQueryWrapper(circle)); |
| | | return R.data(CircleLikeWrapper.build().pageVO(pages)); |
| | | } |
| | | |
| | | /** |
| | | * 圈子点赞表 自定义分页 |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入circle") |
| | | public R<IPage<CircleLikeVO>> page(CircleLikeVO circle, Query query) { |
| | | IPage<CircleLikeVO> pages = circleService.selectCircleLikePage(Condition.getPage(query), circle); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 圈子点赞表 新增 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入circle") |
| | | public R save(@Valid @RequestBody CircleLikeEntity circle) { |
| | | circle.setUserId(AuthUtil.getUserId()); |
| | | return R.status(circleService.save(circle)); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 圈子点赞表 修改 |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入circle") |
| | | public R update(@Valid @RequestBody CircleLikeEntity circle) { |
| | | return R.status(circleService.updateById(circle)); |
| | | } |
| | | |
| | | /** |
| | | * 圈子点赞表 新增或修改 |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入circle") |
| | | public R submit(@Valid @RequestBody CircleLikeEntity circle) { |
| | | UpdateWrapper<CircleLikeEntity> objectUpdateWrapper = new UpdateWrapper<>(); |
| | | objectUpdateWrapper.eq("user_id", circle.getUserId()); |
| | | objectUpdateWrapper.eq("circle_id", circle.getCircleId()); |
| | | return R.status(circleService.saveOrUpdate(circle,objectUpdateWrapper)); |
| | | } |
| | | |
| | | /** |
| | | * 圈子点赞表 删除 |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "逻辑删除", notes = "传入ids") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | return R.status(circleService.removeBatchByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | |
| | | } |
copy from src/main/java/org/springblade/modules/house/vo/HouseLabelVO.java
copy to src/main/java/org/springblade/modules/circle/dto/CircleDTO.java
| File was copied from src/main/java/org/springblade/modules/house/vo/HouseLabelVO.java |
| | |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.house.vo; |
| | | package org.springblade.modules.circle.dto; |
| | | |
| | | import org.springblade.modules.circle.entity.CircleEntity; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springblade.modules.house.entity.HouseLabelEntity; |
| | | |
| | | /** |
| | | * 房屋-标签 视图实体类 |
| | | * 圈子表 数据传输对象实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2023-10-28 |
| | | * @since 2023-11-30 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class HouseLabelVO extends HouseLabelEntity { |
| | | public class CircleDTO extends CircleEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |
copy from src/main/java/org/springblade/modules/house/vo/HouseLabelVO.java
copy to src/main/java/org/springblade/modules/circle/dto/CircleLikeDTO.java
| File was copied from src/main/java/org/springblade/modules/house/vo/HouseLabelVO.java |
| | |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.house.vo; |
| | | package org.springblade.modules.circle.dto; |
| | | |
| | | import org.springblade.modules.circle.entity.CircleLikeEntity; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springblade.modules.house.entity.HouseLabelEntity; |
| | | |
| | | /** |
| | | * 房屋-标签 视图实体类 |
| | | * 圈子点赞表 数据传输对象实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2023-10-28 |
| | | * @since 2023-11-30 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class HouseLabelVO extends HouseLabelEntity { |
| | | public class CircleLikeDTO extends CircleLikeEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.circle.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springblade.core.tenant.mp.TenantEntity; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 圈子表 实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2023-11-30 |
| | | */ |
| | | @Data |
| | | @TableName("jczz_circle") |
| | | @ApiModel(value = "Circle对象", description = "圈子表") |
| | | public class CircleEntity { |
| | | |
| | | |
| | | @ApiModelProperty(value = "主键ID", example = "") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** 用户id */ |
| | | @ApiModelProperty(value = "用户id", example = "") |
| | | @TableField("user_id") |
| | | private Long userId; |
| | | |
| | | /** 创建时间 */ |
| | | @ApiModelProperty(value = "创建时间", example = "") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @TableField(value = "create_time",fill = FieldFill.INSERT) |
| | | private Date createTime; |
| | | |
| | | /** 动态内容 */ |
| | | @ApiModelProperty(value = "动态内容", example = "") |
| | | @TableField("circle_text") |
| | | private String circleText; |
| | | |
| | | /** 动态图片 */ |
| | | @ApiModelProperty(value = "动态图片", example = "") |
| | | @TableField("circle_images") |
| | | private String circleImages; |
| | | |
| | | /** 动态视频 */ |
| | | @ApiModelProperty(value = "动态视频", example = "") |
| | | @TableField("circle_video") |
| | | private String circleVideo; |
| | | |
| | | /** 0 否 1是 */ |
| | | @ApiModelProperty(value = "0 否 1是", example = "") |
| | | @TableField("deleted_falg") |
| | | @TableLogic |
| | | private Integer deletedFalg; |
| | | |
| | | /** 0 :邻里 1网格 */ |
| | | @ApiModelProperty(value = "0 :邻里 1网格", example = "") |
| | | @TableField("circle_type") |
| | | private Integer circleType; |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.circle.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springblade.core.tenant.mp.TenantEntity; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 圈子点赞表 实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2023-11-30 |
| | | */ |
| | | @Data |
| | | @TableName("jczz_circle_like") |
| | | @ApiModel(value = "CircleLike对象", description = "圈子点赞表") |
| | | public class CircleLikeEntity { |
| | | |
| | | @ApiModelProperty(value = "主键ID", example = "") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** 圈子id */ |
| | | @ApiModelProperty(value = "圈子id", example = "") |
| | | @TableField("circle_id") |
| | | private Long circleId; |
| | | |
| | | /** 点赞用户id */ |
| | | @ApiModelProperty(value = "点赞用户id", example = "") |
| | | @TableField("user_id") |
| | | private Long userId; |
| | | |
| | | /** 点赞时间 */ |
| | | @ApiModelProperty(value = "点赞时间", example = "") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @TableField(value = "create_time",fill = FieldFill.INSERT) |
| | | private Date createTime; |
| | | |
| | | /** 0:否 1:是 */ |
| | | @ApiModelProperty(value = "0:否 1:是", example = "") |
| | | @TableField("delete_flag") |
| | | @TableLogic |
| | | private Integer deleteFlag; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.circle.mapper; |
| | | |
| | | import io.lettuce.core.dynamic.annotation.Param; |
| | | import org.springblade.modules.circle.dto.CircleLikeDTO; |
| | | import org.springblade.modules.circle.entity.CircleLikeEntity; |
| | | import org.springblade.modules.circle.vo.CircleLikeVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 圈子点赞表 Mapper 接口 |
| | | * |
| | | * @author BladeX |
| | | * @since 2023-11-30 |
| | | */ |
| | | public interface CircleLikeMapper extends BaseMapper<CircleLikeEntity> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param circle |
| | | * @return |
| | | */ |
| | | List<CircleLikeVO> selectCircleLikePage(IPage page, @Param("circle") CircleLikeVO circle); |
| | | |
| | | |
| | | /** |
| | | * 查询圈子点赞表 |
| | | * |
| | | * @param id 圈子点赞表ID |
| | | * @return 圈子点赞表 |
| | | */ |
| | | public CircleLikeDTO selectCircleLikeById(Long id); |
| | | |
| | | /** |
| | | * 查询圈子点赞表列表 |
| | | * |
| | | * @param circleLikeDTO 圈子点赞表 |
| | | * @return 圈子点赞表集合 |
| | | */ |
| | | public List<CircleLikeDTO> selectCircleLikeList(CircleLikeDTO circleLikeDTO); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | <?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.circle.mapper.CircleLikeMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="circleResultMap" type="org.springblade.modules.circle.vo.CircleLikeVO"> |
| | | <result property="id" column="id" /> |
| | | <result property="circleId" column="circle_id" /> |
| | | <result property="userId" column="user_id" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="deleteFlag" column="delete_flag" /> |
| | | </resultMap> |
| | | |
| | | <resultMap type="org.springblade.modules.circle.vo.CircleLikeVO" id="CircleLikeDTOResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="circleId" column="circle_id" /> |
| | | <result property="userId" column="user_id" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="deleteFlag" column="delete_flag" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectCircleLike"> |
| | | select |
| | | id, |
| | | circle_id, |
| | | user_id, |
| | | create_time, |
| | | delete_flag |
| | | from |
| | | jczz_circle_like |
| | | </sql> |
| | | |
| | | <select id="selectCircleLikeById" parameterType="long" resultMap="CircleLikeDTOResult"> |
| | | <include refid="selectCircleLike"/> |
| | | where |
| | | id = #{id} |
| | | </select> |
| | | |
| | | <select id="selectCircleLikeList" parameterType="org.springblade.modules.circle.dto.CircleLikeDTO" resultMap="CircleLikeDTOResult"> |
| | | <include refid="selectCircleLike"/> |
| | | <where> |
| | | <if test="id != null "> and id = #{id}</if> |
| | | <if test="circleId != null "> and circle_id = #{circleId}</if> |
| | | <if test="userId != null "> and user_id = #{userId}</if> |
| | | <if test="createTime != null "> and create_time = #{createTime}</if> |
| | | <if test="deleteFlag != null "> and delete_flag = #{deleteFlag}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | <select id="selectCircleLikePage" resultMap="circleResultMap"> |
| | | select * from jczz_circle_like |
| | | <where> |
| | | <if test="circle.id != null "> and id = #{circle.id}</if> |
| | | <if test="circle.circleId != null "> and circle_id = #{circle.circleId}</if> |
| | | <if test="circle.userId != null "> and user_id = #{circle.userId}</if> |
| | | <if test="circle.createTime != null "> and create_time = #{circle.createTime}</if> |
| | | <if test="circle.deleteFlag != null "> and delete_flag = #{circle.deleteFlag}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| New file |
| | |
| | | /* |
| | | * 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.circle.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import io.lettuce.core.dynamic.annotation.Param; |
| | | import org.springblade.modules.circle.dto.CircleDTO; |
| | | import org.springblade.modules.circle.entity.CircleEntity; |
| | | import org.springblade.modules.circle.vo.CircleVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 圈子表 Mapper 接口 |
| | | * |
| | | * @author BladeX |
| | | * @since 2023-11-30 |
| | | */ |
| | | public interface CircleMapper extends BaseMapper<CircleEntity> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param circle |
| | | * @return |
| | | */ |
| | | List<CircleVO> selectCirclePage(IPage page, @Param("circle") CircleVO circle); |
| | | |
| | | /** |
| | | * 查询圈子表 |
| | | * |
| | | * @param id 圈子表ID |
| | | * @return 圈子表 |
| | | */ |
| | | public CircleVO selectCircleById(Integer id); |
| | | |
| | | |
| | | /** |
| | | * 查询圈子表列表 |
| | | * |
| | | * @param circleDTO 圈子表 |
| | | * @return 圈子表集合 |
| | | */ |
| | | public List<CircleVO> selectCircleList(CircleDTO circleDTO); |
| | | } |
| New file |
| | |
| | | <?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.circle.mapper.CircleMapper"> |
| | | |
| | | <resultMap type="org.springblade.modules.circle.vo.CircleVO" id="CircleVOResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="userId" column="user_id" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="circleText" column="circle_text" /> |
| | | <result property="circleImages" column="circle_images" /> |
| | | <result property="circleVideo" column="circle_video" /> |
| | | <result property="deletedFalg" column="deleted_falg" /> |
| | | <result property="circleType" column="circle_type" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectCircle"> |
| | | select |
| | | id, |
| | | user_id, |
| | | create_time, |
| | | circle_text, |
| | | circle_images, |
| | | circle_video, |
| | | deleted_falg, |
| | | circle_type |
| | | from |
| | | jczz_circle |
| | | </sql> |
| | | |
| | | <select id="selectCircleById" parameterType="int" resultMap="CircleVOResult"> |
| | | <include refid="selectCircle"/> |
| | | where |
| | | id = #{id} |
| | | </select> |
| | | |
| | | <select id="selectCircleList" parameterType="org.springblade.modules.circle.dto.CircleDTO" resultMap="CircleVOResult"> |
| | | <include refid="selectCircle"/> |
| | | <where> |
| | | <if test="id != null "> and id = #{id}</if> |
| | | <if test="userId != null "> and user_id = #{userId}</if> |
| | | <if test="createTime != null "> and create_time = #{createTime}</if> |
| | | <if test="circleText != null and circleText != ''"> and circle_text = #{circleText}</if> |
| | | <if test="circleImages != null and circleImages != ''"> and circle_images = #{circleImages}</if> |
| | | <if test="circleVideo != null and circleVideo != ''"> and circle_video = #{circleVideo}</if> |
| | | <if test="deletedFalg != null "> and deleted_falg = #{deletedFalg}</if> |
| | | <if test="circleType != null "> and circle_type = #{circleType}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | <select id="selectCirclePage" resultMap="CircleVOResult"> |
| | | select jc.id, |
| | | jc.user_id, |
| | | jc.create_time, |
| | | jc.circle_text, |
| | | jc.circle_images, |
| | | jc.circle_video, |
| | | jc.deleted_falg, |
| | | bu.name, |
| | | bu.avatar, |
| | | jc.circle_type |
| | | (selelct count(1) from jczz_circle_like jcl where jcl.circle_id = jc.id and user_id = #{userId} ) likeFlag |
| | | from jczz_circle jc left join blade_user bu on jc.user_id = bu.id |
| | | <where> |
| | | <if test="circle.id != null "> and id = #{circle.id}</if> |
| | | <if test="circle.userId != null "> and user_id = #{circle.userId}</if> |
| | | <if test="circle.createTime != null "> and create_time = #{circle.createTime}</if> |
| | | <if test="circle.circleText != null and circle.circleText != ''"> and circle_text = #{circle.circleText}</if> |
| | | <if test="circle.circleImages != null and circle.circleImages != ''"> and circle_images = #{circle.circleImages}</if> |
| | | <if test="circle.circleVideo != null and circle.circleVideo != ''"> and circle_video = #{circle.circleVideo}</if> |
| | | <if test="circle.deletedFalg != null "> and deleted_falg = #{circle.deletedFalg}</if> |
| | | <if test="circle.circleType != null "> and circle_type = #{circle.circleType}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| New file |
| | |
| | | /* |
| | | * 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.circle.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springblade.modules.circle.dto.CircleLikeDTO; |
| | | import org.springblade.modules.circle.entity.CircleLikeEntity; |
| | | import org.springblade.modules.circle.vo.CircleLikeVO; |
| | | import org.springblade.core.mp.base.BaseService; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 圈子点赞表 服务类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2023-11-30 |
| | | */ |
| | | public interface ICircleLikeService extends IService<CircleLikeEntity> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param circle |
| | | * @return |
| | | */ |
| | | IPage<CircleLikeVO> selectCircleLikePage(IPage<CircleLikeVO> page, CircleLikeVO circle); |
| | | |
| | | /** |
| | | * 查询圈子点赞表 |
| | | * |
| | | * @param id 圈子点赞表ID |
| | | * @return 圈子点赞表 |
| | | */ |
| | | public CircleLikeDTO selectCircleLikeById(Long id); |
| | | |
| | | /** |
| | | * 查询圈子点赞表列表 |
| | | * |
| | | * @param circleLikeDTO 圈子点赞表 |
| | | * @return 圈子点赞表集合 |
| | | */ |
| | | public List<CircleLikeDTO> selectCircleLikeList(CircleLikeDTO circleLikeDTO); |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.circle.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springblade.modules.circle.dto.CircleDTO; |
| | | import org.springblade.modules.circle.entity.CircleEntity; |
| | | import org.springblade.modules.circle.vo.CircleVO; |
| | | import org.springblade.core.mp.base.BaseService; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 圈子表 服务类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2023-11-30 |
| | | */ |
| | | public interface ICircleService extends IService<CircleEntity> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param circle |
| | | * @return |
| | | */ |
| | | IPage<CircleVO> selectCirclePage(IPage<CircleVO> page, CircleVO circle); |
| | | |
| | | /** |
| | | * 查询圈子表 |
| | | * |
| | | * @param id 圈子表ID |
| | | * @return 圈子表 |
| | | */ |
| | | public CircleVO selectCircleById(Integer id); |
| | | |
| | | /** |
| | | * 查询圈子表列表 |
| | | * |
| | | * @param circleDTO 圈子表 |
| | | * @return 圈子表集合 |
| | | */ |
| | | public List<CircleVO> selectCircleList(CircleDTO circleDTO); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.circle.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.modules.circle.dto.CircleLikeDTO; |
| | | import org.springblade.modules.circle.entity.CircleLikeEntity; |
| | | import org.springblade.modules.circle.vo.CircleLikeVO; |
| | | import org.springblade.modules.circle.mapper.CircleLikeMapper; |
| | | import org.springblade.modules.circle.service.ICircleLikeService; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 圈子点赞表 服务实现类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2023-11-30 |
| | | */ |
| | | @Service |
| | | public class CircleLikeServiceImpl extends ServiceImpl<CircleLikeMapper, CircleLikeEntity> implements ICircleLikeService { |
| | | |
| | | @Override |
| | | public IPage<CircleLikeVO> selectCircleLikePage(IPage<CircleLikeVO> page, CircleLikeVO circle) { |
| | | return page.setRecords(baseMapper.selectCircleLikePage(page, circle)); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询圈子点赞表 |
| | | * |
| | | * @param id 圈子点赞表ID |
| | | * @return 圈子点赞表 |
| | | */ |
| | | @Override |
| | | public CircleLikeDTO selectCircleLikeById(Long id) |
| | | { |
| | | return this.baseMapper.selectCircleLikeById(id); |
| | | } |
| | | |
| | | /** |
| | | * 查询圈子点赞表列表 |
| | | * |
| | | * @param circleLikeDTO 圈子点赞表 |
| | | * @return 圈子点赞表集合 |
| | | */ |
| | | @Override |
| | | public List<CircleLikeDTO> selectCircleLikeList(CircleLikeDTO circleLikeDTO) |
| | | { |
| | | return this.baseMapper.selectCircleLikeList(circleLikeDTO); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.circle.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.modules.circle.dto.CircleDTO; |
| | | import org.springblade.modules.circle.entity.CircleEntity; |
| | | import org.springblade.modules.circle.vo.CircleVO; |
| | | import org.springblade.modules.circle.mapper.CircleMapper; |
| | | import org.springblade.modules.circle.service.ICircleService; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 圈子表 服务实现类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2023-11-30 |
| | | */ |
| | | @Service |
| | | public class CircleServiceImpl extends ServiceImpl<CircleMapper, CircleEntity> implements ICircleService { |
| | | |
| | | @Override |
| | | public IPage<CircleVO> selectCirclePage(IPage<CircleVO> page, CircleVO circle) { |
| | | return page.setRecords(baseMapper.selectCirclePage(page, circle)); |
| | | } |
| | | |
| | | /** |
| | | * 查询圈子表 |
| | | * |
| | | * @param id 圈子表ID |
| | | * @return 圈子表 |
| | | */ |
| | | @Override |
| | | public CircleVO selectCircleById(Integer id) |
| | | { |
| | | return this.baseMapper.selectCircleById(id); |
| | | } |
| | | |
| | | /** |
| | | * 查询圈子表列表 |
| | | * |
| | | * @param circleDTO 圈子表 |
| | | * @return 圈子表集合 |
| | | */ |
| | | @Override |
| | | public List<CircleVO> selectCircleList(CircleDTO circleDTO) |
| | | { |
| | | return this.baseMapper.selectCircleList(circleDTO); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
copy from src/main/java/org/springblade/modules/house/vo/HouseLabelVO.java
copy to src/main/java/org/springblade/modules/circle/vo/CircleLikeVO.java
| File was copied from src/main/java/org/springblade/modules/house/vo/HouseLabelVO.java |
| | |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.house.vo; |
| | | package org.springblade.modules.circle.vo; |
| | | |
| | | import org.springblade.modules.circle.entity.CircleLikeEntity; |
| | | import org.springblade.core.tool.node.INode; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springblade.modules.house.entity.HouseLabelEntity; |
| | | |
| | | /** |
| | | * 房屋-标签 视图实体类 |
| | | * 圈子点赞表 视图实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2023-10-28 |
| | | * @since 2023-11-30 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class HouseLabelVO extends HouseLabelEntity { |
| | | public class CircleLikeVO extends CircleLikeEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |
copy from src/main/java/org/springblade/modules/house/vo/HouseLabelVO.java
copy to src/main/java/org/springblade/modules/circle/vo/CircleVO.java
| File was copied from src/main/java/org/springblade/modules/house/vo/HouseLabelVO.java |
| | |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.house.vo; |
| | | package org.springblade.modules.circle.vo; |
| | | |
| | | import org.springblade.modules.circle.entity.CircleEntity; |
| | | import org.springblade.core.tool.node.INode; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springblade.modules.house.entity.HouseLabelEntity; |
| | | |
| | | /** |
| | | * 房屋-标签 视图实体类 |
| | | * 圈子表 视图实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2023-10-28 |
| | | * @since 2023-11-30 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class HouseLabelVO extends HouseLabelEntity { |
| | | public class CircleVO extends CircleEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | private String name; |
| | | |
| | | private String avatar; |
| | | |
| | | private Integer likeFlag; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.circle.wrapper; |
| | | |
| | | import org.springblade.core.mp.support.BaseEntityWrapper; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.modules.circle.entity.CircleLikeEntity; |
| | | import org.springblade.modules.circle.vo.CircleLikeVO; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 圈子点赞表 包装类,返回视图层所需的字段 |
| | | * |
| | | * @author BladeX |
| | | * @since 2023-11-30 |
| | | */ |
| | | public class CircleLikeWrapper extends BaseEntityWrapper<CircleLikeEntity, CircleLikeVO> { |
| | | |
| | | public static CircleLikeWrapper build() { |
| | | return new CircleLikeWrapper(); |
| | | } |
| | | |
| | | @Override |
| | | public CircleLikeVO entityVO(CircleLikeEntity circle) { |
| | | CircleLikeVO circleVO = Objects.requireNonNull(BeanUtil.copy(circle, CircleLikeVO.class)); |
| | | |
| | | //User createUser = UserCache.getUser(circle.getCreateUser()); |
| | | //User updateUser = UserCache.getUser(circle.getUpdateUser()); |
| | | //circleVO.setCreateUserName(createUser.getName()); |
| | | //circleVO.setUpdateUserName(updateUser.getName()); |
| | | |
| | | return circleVO; |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.circle.wrapper; |
| | | |
| | | import org.springblade.core.mp.support.BaseEntityWrapper; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.modules.circle.entity.CircleEntity; |
| | | import org.springblade.modules.circle.vo.CircleVO; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 圈子表 包装类,返回视图层所需的字段 |
| | | * |
| | | * @author BladeX |
| | | * @since 2023-11-30 |
| | | */ |
| | | public class CircleWrapper extends BaseEntityWrapper<CircleEntity, CircleVO> { |
| | | |
| | | public static CircleWrapper build() { |
| | | return new CircleWrapper(); |
| | | } |
| | | |
| | | @Override |
| | | public CircleVO entityVO(CircleEntity circle) { |
| | | CircleVO circleVO = Objects.requireNonNull(BeanUtil.copy(circle, CircleVO.class)); |
| | | |
| | | //User createUser = UserCache.getUser(circle.getCreateUser()); |
| | | //User updateUser = UserCache.getUser(circle.getUpdateUser()); |
| | | //circleVO.setCreateUserName(createUser.getName()); |
| | | //circleVO.setUpdateUserName(updateUser.getName()); |
| | | |
| | | return circleVO; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | jpd.appoint_user, |
| | | jpd.user_ids, |
| | | jpd.event_type, |
| | | (SELECT user_id from jczz_user_public_enroll where user_id = #{userId})userId |
| | | (SELECT user_id from jczz_user_public_enroll where user_id = #{userId} and public_discuss_id = jpd.id)userId |
| | | from |
| | | jczz_public_discuss jpd |
| | | <where> |
| | |
| | | package org.springblade.modules.district.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.common.node.TreeIntegerNode; |
| | | import org.springblade.common.node.TreeStringNode; |
| | | import org.springblade.common.utils.NodeTreeUtil; |
| | | import org.springblade.modules.district.entity.DistrictEntity; |
| | | import org.springblade.modules.district.vo.DistrictVO; |
| | |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 小区表 服务实现类 |
| | |
| | | */ |
| | | @Override |
| | | public Object getDistrictTree(DistrictVO district) { |
| | | return NodeTreeUtil.getStringNodeTree(baseMapper.getDistrictTree(district)); |
| | | List<TreeStringNode> stringNodeTree = NodeTreeUtil.getStringNodeTree(baseMapper.getDistrictTree(district)); |
| | | stringNodeTree.forEach(node -> recursion(node)); |
| | | return stringNodeTree; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 去除空的数据组 |
| | | * @param node |
| | | */ |
| | | private void recursion(TreeStringNode node) { |
| | | if (node.getChildren() != null && node.getChildren().size() > 0) { |
| | | node.getChildren().forEach(node2 -> recursion(node2)); |
| | | } else { |
| | | node.setChildren(null); |
| | | } |
| | | } |
| | | } |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.modules.house.entity.HouseLabelEntity; |
| | | import org.springblade.modules.house.vo.HouseLabelVO; |
| | | import org.springblade.modules.house.vo.UserHouseLabelVO; |
| | | import org.springblade.modules.house.wrapper.HouseLabelWrapper; |
| | | import org.springblade.modules.house.service.IHouseLabelService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详情", notes = "传入houseLabel") |
| | | public R<HouseLabelVO> detail(HouseLabelEntity houseLabel) { |
| | | public R<UserHouseLabelVO> detail(HouseLabelEntity houseLabel) { |
| | | HouseLabelEntity detail = houseLabelService.getOne(Condition.getQueryWrapper(houseLabel)); |
| | | return R.data(HouseLabelWrapper.build().entityVO(detail)); |
| | | } |
| | |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "传入houseLabel") |
| | | public R<IPage<HouseLabelVO>> list(HouseLabelEntity houseLabel, Query query) { |
| | | public R<IPage<UserHouseLabelVO>> list(HouseLabelEntity houseLabel, Query query) { |
| | | IPage<HouseLabelEntity> pages = houseLabelService.page(Condition.getPage(query), Condition.getQueryWrapper(houseLabel)); |
| | | return R.data(HouseLabelWrapper.build().pageVO(pages)); |
| | | } |
| | |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入houseLabel") |
| | | public R<IPage<HouseLabelVO>> page(HouseLabelVO houseLabel, Query query) { |
| | | IPage<HouseLabelVO> pages = houseLabelService.selectHouseLabelPage(Condition.getPage(query), houseLabel); |
| | | public R<IPage<UserHouseLabelVO>> page(UserHouseLabelVO houseLabel, Query query) { |
| | | IPage<UserHouseLabelVO> pages = houseLabelService.selectHouseLabelPage(Condition.getPage(query), houseLabel); |
| | | return R.data(pages); |
| | | } |
| | | |
| | |
| | | package org.springblade.modules.house.mapper; |
| | | |
| | | import org.springblade.modules.house.entity.HouseLabelEntity; |
| | | import org.springblade.modules.house.vo.HouseLabelVO; |
| | | import org.springblade.modules.house.vo.UserHouseLabelVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import java.util.List; |
| | |
| | | * @param houseLabel |
| | | * @return |
| | | */ |
| | | List<HouseLabelVO> selectHouseLabelPage(IPage page, HouseLabelVO houseLabel); |
| | | List<UserHouseLabelVO> selectHouseLabelPage(IPage page, UserHouseLabelVO houseLabel); |
| | | |
| | | |
| | | } |
| | |
| | | <!--房屋详情--> |
| | | <resultMap id="houseAndHouseLabelMap" type="org.springblade.modules.house.vo.HouseVO" autoMapping="true"> |
| | | <id property="id" column="id"/> |
| | | <collection property="houseLabelVOList" javaType="java.util.List" |
| | | ofType="org.springblade.modules.house.vo.HouseLabelVO" autoMapping="true"> |
| | | <collection property="userHouseLabelVOList" javaType="java.util.List" |
| | | ofType="org.springblade.modules.house.vo.UserHouseLabelVO" autoMapping="true"> |
| | | <id property="id" column="cid"/> |
| | | <result property="remark" column="cremark"/> |
| | | </collection> |
| | |
| | | jh.*, |
| | | jhl.id as cid,jhl.*,jhl.remark as cremark |
| | | from jczz_house jh |
| | | left join jczz_house_label jhl on jh.house_code = jhl.house_code |
| | | where jh.is_deleted = 0 |
| | | left join jczz_user_house_label jhl on jh.house_code = jhl.house_code |
| | | where jh.is_deleted = 0 and jhl.lable_type = 2 |
| | | and jh.house_code = #{house.houseCode} |
| | | </select> |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springblade.modules.house.entity.HouseLabelEntity; |
| | | import org.springblade.modules.house.vo.HouseLabelVO; |
| | | import org.springblade.modules.house.vo.UserHouseLabelVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | /** |
| | |
| | | * @param houseLabel |
| | | * @return |
| | | */ |
| | | IPage<HouseLabelVO> selectHouseLabelPage(IPage<HouseLabelVO> page, HouseLabelVO houseLabel); |
| | | IPage<UserHouseLabelVO> selectHouseLabelPage(IPage<UserHouseLabelVO> page, UserHouseLabelVO houseLabel); |
| | | |
| | | |
| | | /** |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.modules.house.entity.HouseLabelEntity; |
| | | import org.springblade.modules.house.vo.HouseLabelVO; |
| | | import org.springblade.modules.house.vo.UserHouseLabelVO; |
| | | import org.springblade.modules.house.mapper.HouseLabelMapper; |
| | | import org.springblade.modules.house.service.IHouseLabelService; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springblade.modules.label.entity.LabelEntity; |
| | | import org.springblade.modules.label.service.ILabelService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private ILabelService labelService; |
| | | |
| | | @Override |
| | | public IPage<HouseLabelVO> selectHouseLabelPage(IPage<HouseLabelVO> page, HouseLabelVO houseLabel) { |
| | | public IPage<UserHouseLabelVO> selectHouseLabelPage(IPage<UserHouseLabelVO> page, UserHouseLabelVO houseLabel) { |
| | | return page.setRecords(baseMapper.selectHouseLabelPage(page, houseLabel)); |
| | | } |
| | | |
| | |
| | | package org.springblade.modules.house.vo; |
| | | |
| | | import org.springblade.modules.house.entity.HouseEntity; |
| | | import org.springblade.core.tool.node.INode; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | |
| | | */ |
| | | private String address; |
| | | |
| | | private List<HouseLabelVO> houseLabelVOList = new ArrayList<>(); |
| | | private List<UserHouseLabelVO> userHouseLabelVOList = new ArrayList<>(); |
| | | } |
| File was renamed from src/main/java/org/springblade/modules/house/vo/HouseLabelVO.java |
| | |
| | | |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springblade.modules.house.entity.HouseLabelEntity; |
| | | import org.springblade.modules.house.entity.UserHouseLabelEntity; |
| | | |
| | | /** |
| | | * 房屋-标签 视图实体类 |
| | |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class HouseLabelVO extends HouseLabelEntity { |
| | | public class UserHouseLabelVO extends UserHouseLabelEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |
| | |
| | | import org.springblade.core.mp.support.BaseEntityWrapper; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.modules.house.entity.HouseLabelEntity; |
| | | import org.springblade.modules.house.vo.HouseLabelVO; |
| | | import org.springblade.modules.house.vo.UserHouseLabelVO; |
| | | |
| | | import java.util.Objects; |
| | | |
| | |
| | | * @author BladeX |
| | | * @since 2023-10-28 |
| | | */ |
| | | public class HouseLabelWrapper extends BaseEntityWrapper<HouseLabelEntity, HouseLabelVO> { |
| | | public class HouseLabelWrapper extends BaseEntityWrapper<HouseLabelEntity, UserHouseLabelVO> { |
| | | |
| | | public static HouseLabelWrapper build() { |
| | | return new HouseLabelWrapper(); |
| | | } |
| | | |
| | | @Override |
| | | public HouseLabelVO entityVO(HouseLabelEntity houseLabel) { |
| | | HouseLabelVO houseLabelVO = Objects.requireNonNull(BeanUtil.copy(houseLabel, HouseLabelVO.class)); |
| | | public UserHouseLabelVO entityVO(HouseLabelEntity houseLabel) { |
| | | UserHouseLabelVO houseLabelVO = Objects.requireNonNull(BeanUtil.copy(houseLabel, UserHouseLabelVO.class)); |
| | | |
| | | //User createUser = UserCache.getUser(houseLabel.getCreateUser()); |
| | | //User updateUser = UserCache.getUser(houseLabel.getUpdateUser()); |
| New file |
| | |
| | | INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) |
| | | VALUES ('1730120254748745729', 1123598815738675201, 'circle', '圈子表', 'menu', '/circle/circle', NULL, 1, 1, 0, 1, NULL, 0); |
| | | INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) |
| | | VALUES ('1730120254748745730', '1730120254748745729', 'circle_add', '新增', 'add', '/circle/circle/add', 'plus', 1, 2, 1, 1, NULL, 0); |
| | | INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) |
| | | VALUES ('1730120254748745731', '1730120254748745729', 'circle_edit', '修改', 'edit', '/circle/circle/edit', 'form', 2, 2, 2, 1, NULL, 0); |
| | | INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) |
| | | VALUES ('1730120254748745732', '1730120254748745729', 'circle_delete', '删除', 'delete', '/api/blade-circle/circle/remove', 'delete', 3, 2, 3, 1, NULL, 0); |
| | | INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) |
| | | VALUES ('1730120254748745733', '1730120254748745729', 'circle_view', '查看', 'view', '/circle/circle/view', 'file-text', 4, 2, 2, 1, NULL, 0); |
| New file |
| | |
| | | INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) |
| | | VALUES ('1730146232548057090', 1123598815738675201, 'circle', '圈子点赞表', 'menu', '/circle/circle', NULL, 1, 1, 0, 1, NULL, 0); |
| | | INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) |
| | | VALUES ('1730146232548057091', '1730146232548057090', 'circle_add', '新增', 'add', '/circle/circle/add', 'plus', 1, 2, 1, 1, NULL, 0); |
| | | INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) |
| | | VALUES ('1730146232548057092', '1730146232548057090', 'circle_edit', '修改', 'edit', '/circle/circle/edit', 'form', 2, 2, 2, 1, NULL, 0); |
| | | INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) |
| | | VALUES ('1730146232548057093', '1730146232548057090', 'circle_delete', '删除', 'delete', '/api/blade-circle/circle/remove', 'delete', 3, 2, 3, 1, NULL, 0); |
| | | INSERT INTO `blade_menu`(`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `remark`, `is_deleted`) |
| | | VALUES ('1730146232548057094', '1730146232548057090', 'circle_view', '查看', 'view', '/circle/circle/view', 'file-text', 4, 2, 2, 1, NULL, 0); |