<?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="com.stylefeng.guns.modular.system.dao.EncyclopedicKnowledgeMapper">
|
|
|
<select id="getEncyclopedicKnowledgeList" resultType="com.stylefeng.guns.modular.system.warpper.res.EncyclopedicKnowledgeRes">
|
select
|
id,
|
title,
|
img_url as imgUrl,
|
content_text as content
|
from t_encyclopedic_knowledge where sys_data_type_id = #{typeId} order by insert_time desc
|
</select>
|
<select id="list" resultType="com.stylefeng.guns.modular.system.model.EncyclopedicKnowledge">
|
SELECT kn.id,ty.`name` as type ,kn.title,kn.content,us.`name` as createByName,kn.insert_time as insertTime,kn.sys_data_type_id as sysDataTypeId
|
FROM t_encyclopedic_knowledge kn
|
LEFT JOIN t_sys_data_type ty ON kn.sys_data_type_id = ty.id
|
LEFT JOIN sys_user us ON kn.create_by = us.id
|
<where>
|
<if test="null != type ">
|
and kn.sys_data_type_id = #{type}
|
</if>
|
|
<if test="null != title and '' != title">
|
and kn.title like CONCAT('%', #{title}, '%')
|
</if>
|
|
|
</where>
|
|
|
|
</select>
|
</mapper>
|