plf %!s(int64=4) %!d(string=hai) anos
pai
achega
79ebf5761b
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      src/main/resources/mapper/SellerMapper.xml

+ 3 - 1
src/main/resources/mapper/SellerMapper.xml

@@ -52,7 +52,9 @@
           club_temporary
         WHERE
           userId = #{userId}
-          AND (name LIKE CONCAT('%',#{searchName},'%') OR linkMan LIKE CONCAT('%',#{searchName},'%'))
+          <if test="searchName != null and searchName != ''">
+              AND (name LIKE CONCAT('%',#{searchName},'%') OR linkMan LIKE CONCAT('%',#{searchName},'%'))
+          </if>
         ORDER BY
           id DESC
     </select>