| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 文章表 |
| | |
| | | @TableField(exist = false) |
| | | private String columnName; |
| | | |
| | | @TableField(exist = false) |
| | | private List<Long> columnIds; |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | } |
| | | 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); |
| | |
| | | <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> |