Browse Source

fix:列表降序、生成查询sql逻辑删除

韩帛霖 1 year ago
parent
commit
0e5e2f1163

+ 1 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/DragTableServiceImpl.java

@@ -203,7 +203,7 @@ public class DragTableServiceImpl implements IDragTableService {
                 }
                 break;
         }
-        String where = dragTableVo.getDtTableName() + ".del_flag = '2' AND ";
+        String where = dragTableVo.getDtTableName() + ".del_flag = '0' AND ";
         tableSql.setTableCondition(where + SQL + SQL_END);
         tableSql.setTableAlias(dragTableVo.getDtTableName());
         tableSql.setTableExportField(JSON.toJSONString(dragTableVo.getTableExportField()));

+ 16 - 10
ruoyi-system/src/main/resources/mapper/dragmapper/DragTableMapper.xml

@@ -50,17 +50,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectDragTableList" parameterType="com.ruoyi.system.entity.DragTable" resultMap="DragTableResult">
         <include refid="selectDragTableVo"/>
-        <where>  
-            <if test="dtName != null  and dtName != ''"> and dt_name like concat('%', #{dtName}, '%')</if>
-            <if test="dtNickname != null  and dtNickname != ''"> and dt_nickname like concat('%', #{dtNickname}, '%')</if>
-            <if test="tableKey != null  and tableKey != ''"> and table_key = #{tableKey}</if>
-            <if test="sqlKey != null  and sqlKey != ''"> and sql_key = #{sqlKey}</if>
-            <if test="dtTableName != null  and dtTableName != ''"> and dt_table_name like concat('%', #{dtTableName}, '%')</if>
-            <if test="dtNotes != null  and dtNotes != ''"> and dt_notes = #{dtNotes}</if>
-            <if test="dtColumnName != null  and dtColumnName != ''"> and dt_column_name like concat('%', #{dtColumnName}, '%')</if>
-            <if test="spare != null  and spare != ''"> and spare = #{spare}</if>
-            <if test="spare1 != null  and spare1 != ''"> and spare1 = #{spare1}</if>
+        <where>
+            <if test="dtName != null  and dtName != ''">and dt_name like concat('%', #{dtName}, '%')</if>
+            <if test="dtNickname != null  and dtNickname != ''">and dt_nickname like concat('%', #{dtNickname}, '%')
+            </if>
+            <if test="tableKey != null  and tableKey != ''">and table_key = #{tableKey}</if>
+            <if test="sqlKey != null  and sqlKey != ''">and sql_key = #{sqlKey}</if>
+            <if test="dtTableName != null  and dtTableName != ''">and dt_table_name like concat('%', #{dtTableName},
+                '%')
+            </if>
+            <if test="dtNotes != null  and dtNotes != ''">and dt_notes = #{dtNotes}</if>
+            <if test="dtColumnName != null  and dtColumnName != ''">and dt_column_name like concat('%', #{dtColumnName},
+                '%')
+            </if>
+            <if test="spare != null  and spare != ''">and spare = #{spare}</if>
+            <if test="spare1 != null  and spare1 != ''">and spare1 = #{spare1}</if>
         </where>
+        ORDER BY t_id DESC
     </select>
     
     <select id="selectDragTableByTId" parameterType="Long" resultMap="DragTableResult">