Browse Source

修改模糊查询

conghelong 1 year ago
parent
commit
c7d39e3bc4

+ 3 - 2
sooka-jnb/src/main/resources/mapper/department/DepartmentMapper.xml

@@ -9,16 +9,17 @@
         <result property="name"    column="name"    />
         <result property="shows"    column="shows"    />
         <result property="application"    column="application"    />
+
     </resultMap>
 
     <select id="selectSysDeptVo"  resultMap="DepartmentResult">
         select  id,name, shows, application from jnb_department_configuration
         <where>
             <if test="name != null and name !=''">
-                AND name LIKE '%' #{name} '%'
+                AND name LIKE  concat('%', #{name}, '%')
             </if>
             <if test="application != null and application !=''">
-                AND application LIKE '%' #{application} '%'
+                AND application LIKE  concat('%', #{application}, '%')
             </if>
         </where>
     </select>

+ 3 - 2
sooka-jnb/src/main/resources/mapper/matter/matterMapper.xml

@@ -21,11 +21,12 @@
     <select id="selectSysMatterVo"  resultMap="MatterResult">
         select  id,title, type, department,operation,address,phone,picture,examine ,content from jnb_list_of_matters
         <where>
+
             <if test="title != null and title !=''">
-                AND title LIKE '%' #{title} '%'
+                AND title LIKE   concat('%', #{title}, '%')
             </if>
             <if test="examine != null and examine !=''">
-                AND examine LIKE '%' #{examine} '%'
+                AND examine LIKE   concat('%', #{examine}, '%')
             </if>
             <if test="department != null and department !=''">
                 AND department = #{department}