yonge %!s(int64=4) %!d(string=hai) anos
pai
achega
0cfd05693a

+ 24 - 9
cms/src/main/resources/config/mybatis/SysNewsInformationMapper.xml

@@ -48,9 +48,14 @@
 			<if test="search != null">
 				and title_ like '%' #{search} '%'
 			</if>
-			<if test="memo != null and memo != ''">
-				and memo_ = #{memo}
-			</if>
+			<choose>
+				<when test="memo != null and memo != ''">
+					and memo_ = #{memo}
+				</when>
+				<otherwise>
+					and (memo_ is null or memo_ = '')
+				</otherwise>
+			</choose>
 		</where>
 	</sql>
 	
@@ -182,9 +187,14 @@
 		<if test="tenantId != null">
 			and tenant_id_ = #{tenantId}
 		</if>
-			<if test="memo != null and memo != ''">
-				and memo_ = #{memo}
-			</if>
+			<choose>
+				<when test="memo != null and memo != ''">
+					and memo_ = #{memo}
+				</when>
+				<otherwise>
+					and (memo_ is null or memo_ = '')
+				</otherwise>
+			</choose>
 		order by status_ desc,order_ desc,update_time_ desc
 		<include refid="global.limit" />
 	</select>
@@ -211,8 +221,13 @@
 		<if test="tenantId != null">
 			and tenant_id_ = #{tenantId}
 		</if>
-			<if test="memo != null and memo != ''">
-				and memo_ = #{memo}
-			</if>
+			<choose>
+				<when test="memo != null and memo != ''">
+					and memo_ = #{memo}
+				</when>
+				<otherwise>
+					and (memo_ is null or memo_ = '')
+				</otherwise>
+			</choose>
 	</select>
 </mapper>