Browse Source

fix bug:当参数为空时未进行逻辑判断

lijie 3 years ago
parent
commit
923049fb98

+ 4 - 1
dmp-business/dmp-rwd/src/main/resources/mapper/DefineInfoMapper.xml

@@ -84,7 +84,10 @@
     <select id="queryByClassCodes" resultType="com.persagy.dmp.define.entity.ObjectInfoDefine" resultMap="BaseResultMap">
         select ${ew.sqlSelect}
         from ( <include refid="InfoTableSQL"/> ) dt_define_info
-        WHERE ${ew.expression.sqlSegment}
+        WHERE 1=1
+        <if test="ew.expression.sqlSegment!=null and ew.expression.sqlSegment.length>0">
+            AND ${ew.expression.sqlSegment}
+        </if>
     </select>
     <select id="queryCollectInfos" resultType="java.util.Map">
         select dt_object.id, dt_object.local_id, dt_object.local_name, dt_define_info.class_code, dt_define_type.name as class_name,