浏览代码

修复代码生成模块查询条件忘记加where

gcii 5 年之前
父节点
当前提交
a2c1bfef8f
共有 1 个文件被更改,包括 8 次插入6 次删除
  1. 8 6
      ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml

+ 8 - 6
ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml

@@ -55,12 +55,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     
     <select id="selectGenTableList" parameterType="GenTable" resultMap="GenTableResult">
 		<include refid="selectGenTableVo"/>
-		<if test="tableName != null and tableName != ''">
-			AND table_name like concat('%', #{tableName}, '%')
-		</if>
-		<if test="tableComment != null and tableComment != ''">
-			AND table_comment like concat('%', #{tableComment}, '%')
-		</if>
+		<where>
+			<if test="tableName != null and tableName != ''">
+				AND table_name like concat('%', #{tableName}, '%')
+			</if>
+			<if test="tableComment != null and tableComment != ''">
+				AND table_comment like concat('%', #{tableComment}, '%')
+			</if>
+		</where>
 	</select>
 
 	<select id="selectDbTableList" parameterType="GenTable" resultMap="GenTableResult">