lsw 9 月之前
父節點
當前提交
2a59f8dc16

+ 3 - 1
admin-ui/src/views/work/knowledge/index.vue

@@ -33,7 +33,9 @@
           <el-tag type="danger" v-if="scope.row.state == 1">停用</el-tag>
           <el-tag type="danger" v-if="scope.row.state == 1">停用</el-tag>
         </template>
         </template>
       </el-table-column>
       </el-table-column>
-      <el-table-column label="创建时间" align="center" prop="createTime" width="200" />
+      <el-table-column label="创建人" align="center" prop="createBy" width="130" />
+      <el-table-column label="创建时间" align="center" prop="createTime" width="160" />
+      <el-table-column label="所属科室" align="center" prop="deptName" width="130" />
       <el-table-column label="操作" align="center" width="200">
       <el-table-column label="操作" align="center" width="200">
         <template slot-scope="scope">
         <template slot-scope="scope">
           <el-button size="mini" type="text" icon="el-icon-edit" @click="op('edit', scope.row)" v-hasPermi="['work:knowledge:edit']">修改</el-button>
           <el-button size="mini" type="text" icon="el-icon-edit" @click="op('edit', scope.row)" v-hasPermi="['work:knowledge:edit']">修改</el-button>

+ 10 - 7
ruoyi-admin/src/main/resources/mapper/work/KnowledgeMapper.xml

@@ -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>