Commit 4384a575af66b71d1f362b03802aedd3fbaef373
1 parent
b90d350c
品类查询子元素添加名称模糊查询
Showing
1 changed file
with
4 additions
and
1 deletions
assistant-product/src/main/resources/com/diligrp/assistant/dao/mapper/ProductCategoryDao.xml
@@ -90,6 +90,9 @@ | @@ -90,6 +90,9 @@ | ||
90 | 90 | ||
91 | <select id="listChildrenById" parameterType="com.diligrp.assistant.product.domain.CategoryPageQuery" resultMap="CategoryMap"> | 91 | <select id="listChildrenById" parameterType="com.diligrp.assistant.product.domain.CategoryPageQuery" resultMap="CategoryMap"> |
92 | SELECT * FROM product_category WHERE parent_Id = #{id} AND state > 0 | 92 | SELECT * FROM product_category WHERE parent_Id = #{id} AND state > 0 |
93 | + <if test="name != null"> | ||
94 | + AND name LIKE CONCAT('%',#{name},'%') | ||
95 | + </if> | ||
93 | ORDER BY ID LIMIT #{start}, #{limit} | 96 | ORDER BY ID LIMIT #{start}, #{limit} |
94 | </select> | 97 | </select> |
95 | 98 | ||
@@ -135,7 +138,7 @@ | @@ -135,7 +138,7 @@ | ||
135 | WHERE | 138 | WHERE |
136 | (id = #{id} OR parent_Id = #{id} ) | 139 | (id = #{id} OR parent_Id = #{id} ) |
137 | <if test="name != null"> | 140 | <if test="name != null"> |
138 | - AND name like CONCAT('%',#{name},'%') | 141 | + AND name LIKE CONCAT('%',#{name},'%') |
139 | </if> | 142 | </if> |
140 | <if test="state != null"> | 143 | <if test="state != null"> |
141 | AND state = #{state} | 144 | AND state = #{state} |