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 | 90 | |
91 | 91 | <select id="listChildrenById" parameterType="com.diligrp.assistant.product.domain.CategoryPageQuery" resultMap="CategoryMap"> |
92 | 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 | 96 | ORDER BY ID LIMIT #{start}, #{limit} |
94 | 97 | </select> |
95 | 98 | |
... | ... | @@ -135,7 +138,7 @@ |
135 | 138 | WHERE |
136 | 139 | (id = #{id} OR parent_Id = #{id} ) |
137 | 140 | <if test="name != null"> |
138 | - AND name like CONCAT('%',#{name},'%') | |
141 | + AND name LIKE CONCAT('%',#{name},'%') | |
139 | 142 | </if> |
140 | 143 | <if test="state != null"> |
141 | 144 | AND state = #{state} | ... | ... |