Helius
2022-07-05 b95699652357c6218b45eceb81170ddfebb30e1d
fix conflect
3 files modified
23 ■■■■ changed files
src/main/java/com/xcong/farmer/cms/modules/system/entity/ArticleEntity.java 3 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/ArticleServiceImpl.java 13 ●●●●● patch | view | raw | blame | history
src/main/resources/mapper/ArticleMapper.xml 7 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/farmer/cms/modules/system/entity/ArticleEntity.java
@@ -7,6 +7,7 @@
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
 * 文章表
@@ -95,5 +96,7 @@
     */
    @TableField(exist = false)
    private String path;
    @TableField(exist = false)
    private List<Long> columnIds;
}
src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/ArticleServiceImpl.java
@@ -1,5 +1,6 @@
package com.xcong.farmer.cms.modules.system.service.Impl;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringPool;
@@ -61,7 +62,17 @@
        }
        Integer contentType = adminArticleDto.getContentType() == null ? 0 : adminArticleDto.getContentType();
        if(contentType != 0){
            articleEntity.setContentType(adminArticleDto.getContentType());
            QueryWrapper<ColumnEntity> objectQueryWrapper = new QueryWrapper<>();
            objectQueryWrapper.eq("content_type",contentType);
            List<ColumnEntity> columnEntities = columnMapper.selectList(objectQueryWrapper);
            if(CollUtil.isNotEmpty(columnEntities)){
                List<Long> columIds = new ArrayList<>();
                for(ColumnEntity columnEntity : columnEntities){
                    Long id = columnEntity.getId();
                    columIds.add(id);
                }
                articleEntity.setColumnIds(columIds);
            }
        }
        if(UserEntity.USER_BELONG_TOP != companyId){
            articleEntity.setCompanyId(companyId);
src/main/resources/mapper/ArticleMapper.xml
@@ -21,8 +21,11 @@
                <if test="record.title!=null">
                    and a.title like concat ('%',#{record.title},'%')
                </if>
                <if test="record.contentType != null">
                    and a.content_type = #{record.contentType}
                <if test="record.columnIds != null">
                    and a.column_id =
                    <foreach collection="record.columnIds" separator="," close=")" open="(" item="item">
                        #{item}
                    </foreach>
                </if>
            </if>
        </where>