refactor(communityCenter): 优化社区列表查询逻辑并添加

feature/admin
yang 2025-04-26 16:21:34 +08:00
parent 01b4f6c535
commit a0f21fc32c
3 changed files with 6 additions and 7 deletions

View File

@ -3,8 +3,7 @@ package com.mcwl.communityCenter.domain.dto;
import com.mcwl.common.core.page.PageDomain; import com.mcwl.common.core.page.PageDomain;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.*;
import lombok.EqualsAndHashCode;
/** /**
* *
@ -12,6 +11,9 @@ import lombok.EqualsAndHashCode;
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ApiModel(value = "社区列表分页请求参数") @ApiModel(value = "社区列表分页请求参数")
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class JoinCommunityListPageRes extends PageDomain { public class JoinCommunityListPageRes extends PageDomain {
/** /**

View File

@ -98,9 +98,6 @@
<if test="joinCommunityListPageRes.isMyCreate == 1"> <if test="joinCommunityListPageRes.isMyCreate == 1">
and c.tenant_id = #{userId} and c.tenant_id = #{userId}
</if> </if>
<if test="joinCommunityListPageRes.isMyCreate == 0">
and c.tenant_id != #{userId}
</if>
<if test="joinCommunityListPageRes.searchContent != null and joinCommunityListPageRes.searchContent != ''"> <if test="joinCommunityListPageRes.searchContent != null and joinCommunityListPageRes.searchContent != ''">
and (c.community_name like concat('%', #{joinCommunityListPageRes.searchContent}, '%') and (c.community_name like concat('%', #{joinCommunityListPageRes.searchContent}, '%')
or c.description like concat('%', #{joinCommunityListPageRes.searchContent}, '%')) or c.description like concat('%', #{joinCommunityListPageRes.searchContent}, '%'))

View File

@ -5,9 +5,9 @@
<mapper namespace="com.mcwl.communityCenter.mapper.PublishMapper"> <mapper namespace="com.mcwl.communityCenter.mapper.PublishMapper">
<insert id="insertPublish"> <insert id="insertPublish">
insert into cc_publish insert into cc_publish
(tenant_id, community_id, user_id, content, image_url, file_url, file_name, publish_time) (tenant_id, community_id, user_id, content, image_url, file_url, file_name, publish_time, create_time)
values (#{publish.tenantId}, #{publish.communityId}, #{publish.userId}, #{publish.content}, #{publish.imageUrl}, values (#{publish.tenantId}, #{publish.communityId}, #{publish.userId}, #{publish.content}, #{publish.imageUrl},
#{publish.fileUrl}, #{publish.fileName}, #{publish.publishTime}) #{publish.fileUrl}, #{publish.fileName}, #{publish.publishTime}, now())
</insert> </insert>
<update id="elitePublish"> <update id="elitePublish">
update cc_publish update cc_publish