Commit 7554f448 authored by wzp's avatar wzp

修改appbug

parent 09a5b074
......@@ -2,6 +2,9 @@ package cn.chnmuseum.party.mapper;
import cn.chnmuseum.party.model.ExhibitionBoard;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
......@@ -13,4 +16,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface ExhibitionBoardMapper extends BaseMapper<ExhibitionBoard> {
List<ExhibitionBoard> getList(@Param("learningProjectId") String learningProjectId, @Param("isPublished") boolean isPublished);
}
......@@ -118,4 +118,20 @@ public interface LearningContentBoardMapper extends BaseMapper<LearningContentBo
)
IPage<Asset> selectAssetPageByOrganCode(Page<?> page, String organCode);
@Select("<script>"
+ "SELECT distinct a.* from "
+ "(SELECT eb.* FROM learning_project p,learning_content lc,learning_content_board lcb, exhibition_board eb "
+ "WHERE lcb.exhibition_board_id = eb.id and p.id = lc.learning_project_id and lc.id = lcb.learning_content_id "
+ "and eb.is_published = 1 and eb.is_deleted = 0 and lc.is_deleted = 0 "
+ "<if test='learningProjectId != null'>and p.id = #{learningProjectId} </if>"
+ "<if test='nameOrCode != null'>"
+"AND ( eb.name LIKE CONCAT('%', #{nameOrCode}, '%') OR eb.name_pin_yin LIKE CONCAT('%', #{nameOrCode}, '%') " +
"OR eb.name_first_pin_yin LIKE CONCAT('%', #{nameOrCode}, '%') " +
"OR eb.serial_no LIKE CONCAT('%', #{nameOrCode}, '%'))"
+ "</if>"
+ "order by lcb.sortorder, eb.create_time DESC)a "
+ "</script>"
)
IPage<ExhibitionBoard> getBoardPageByLearningProjectId(Page<ExhibitionBoard> page, String learningProjectId, String nameOrCode);
}
......@@ -145,6 +145,10 @@ public class ExhibitionBoard implements Serializable {
@TableField(exist = false)
private String learningContentId;
@ApiModelProperty("所属学习项目ID")
@TableField(exist = false)
private String learningProjectId;
@ApiModelProperty("展板版权方名称")
@TableField(exist = false)
private String boardCopyrightOwnerName;
......
......@@ -66,4 +66,8 @@ public class LearningProject implements Serializable {
@TableField(exist = false)
private String learningContentNames;
@ApiModelProperty("相关展板")
@TableField(exist = false)
private String exhibitionBoardNames;
}
......@@ -3,6 +3,8 @@ package cn.chnmuseum.party.service;
import cn.chnmuseum.party.model.ExhibitionBoard;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* <p>
* 展板 服务类
......@@ -13,4 +15,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface ExhibitionBoardService extends IService<ExhibitionBoard> {
List<ExhibitionBoard> getList(String learningProjectId, boolean b);
}
......@@ -25,4 +25,5 @@ public interface LearningContentBoardService extends IService<LearningContentBoa
IPage<Asset> getAssetPageByOrganCode(Page<Asset> page, String organCode);
IPage<ExhibitionBoard> getBoardPageByLearningProjectId(Page<ExhibitionBoard> page, String learningProjectId, String nameOrCode);
}
......@@ -4,8 +4,11 @@ import cn.chnmuseum.party.model.ExhibitionBoard;
import cn.chnmuseum.party.mapper.ExhibitionBoardMapper;
import cn.chnmuseum.party.service.ExhibitionBoardService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 展板 服务实现类
......@@ -17,4 +20,11 @@ import org.springframework.stereotype.Service;
@Service
public class ExhibitionBoardServiceImpl extends ServiceImpl<ExhibitionBoardMapper, ExhibitionBoard> implements ExhibitionBoardService {
@Autowired
private ExhibitionBoardMapper exhibitionBoardMapper;
@Override
public List<ExhibitionBoard> getList(String learningProjectId, boolean isPublished) {
return exhibitionBoardMapper.getList(learningProjectId,isPublished);
}
}
......@@ -42,4 +42,9 @@ public class LearningContentBoardServiceImpl extends ServiceImpl<LearningContent
return learningContentBoardMapper.selectAssetPageByOrganCode(page, organCode);
}
@Override
public IPage<ExhibitionBoard> getBoardPageByLearningProjectId(Page<ExhibitionBoard> page, String learningProjectId, String nameOrCode) {
return learningContentBoardMapper.getBoardPageByLearningProjectId(page, learningProjectId, nameOrCode);
}
}
......@@ -30,4 +30,16 @@
audit_status, is_published, is_deleted, create_time, update_time
</sql>
<select id="getList" resultMap="BaseResultMap">
SELECT distinct a.name,a.cover from
( select e.name,e.cover,lb.sortorder,e.create_time
from exhibition_board e
left join learning_content_board lb on lb.exhibition_board_id = e.id
left join learning_content lc on lb.learning_content_id = lc.id and lc.is_deleted = 0
left join learning_project p on lc.learning_project_id = p.id
where e.is_published = #{isPublished} and p.id = #{learningProjectId}
order by lb.sortorder,e.create_time DESC)a
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment