|
@@ -5,14 +5,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<mapper namespace="com.ruoyi.web.work.mapper.KnowledgeMapper">
|
|
<mapper namespace="com.ruoyi.web.work.mapper.KnowledgeMapper">
|
|
|
|
|
|
<select id="selectList" resultType="com.ruoyi.web.work.domain.Knowledge">
|
|
<select id="selectList" resultType="com.ruoyi.web.work.domain.Knowledge">
|
|
- select * from tb_knowledge
|
|
|
|
|
|
+ SELECT
|
|
|
|
+ k.*,
|
|
|
|
+ d.dept_name AS deptName
|
|
|
|
+ FROM
|
|
|
|
+ tb_knowledge k
|
|
|
|
+ LEFT JOIN sys_dept d ON d.dept_id = k.dept_id
|
|
<where>
|
|
<where>
|
|
- <if test="userId != null "> and user_id = #{userId}</if>
|
|
|
|
- <if test="type != null and type != ''"> and type = #{type}</if>
|
|
|
|
- <if test="title != null and title != ''"> and title like concat('%', #{title}, '%')</if>
|
|
|
|
- <if test="content != null and content != ''"> and content = #{content}</if>
|
|
|
|
- <if test="deptId != null "> and dept_id = #{deptId}</if>
|
|
|
|
- <if test="dateBegin != null and dateBegin != ''"> AND create_time BETWEEN #{dateBegin} AND #{dateEnd} + INTERVAL 1 DAY</if>
|
|
|
|
|
|
+ <if test="userId != null "> and k.user_id = #{userId}</if>
|
|
|
|
+ <if test="type != null and type != ''"> and k.type = #{type}</if>
|
|
|
|
+ <if test="title != null and title != ''"> and k.title like concat('%', #{title}, '%')</if>
|
|
|
|
+ <if test="dateBegin != null and dateBegin != ''"> AND k.create_time BETWEEN #{dateBegin} AND #{dateEnd} + INTERVAL 1 DAY</if>
|
|
</where>
|
|
</where>
|
|
</select>
|
|
</select>
|
|
|
|
|