1.2
luo
2024-01-02 59f63a8ef0078b06f010d25abfef2772c944a56f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?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>