给商品选择接口增加商品类别的查询条件

This commit is contained in:
季圣华
2020-12-15 21:38:43 +08:00
parent 0388b8fa86
commit 5ee379241d
6 changed files with 71 additions and 9 deletions

View File

@@ -46,6 +46,10 @@
ofType="com.jsh.erp.datasource.vo.TreeNode" select="getNextNodeTree"/>
</resultMap>
<resultMap id="ResultCategoryMapList" type="com.jsh.erp.datasource.entities.MaterialCategory">
<result column="id" jdbcType="BIGINT" property="id" />
</resultMap>
<sql id="Base_Column_List">
id, name
</sql>
@@ -123,4 +127,12 @@
and ifnull(status,'0') !='2'
</select>
<select id="getListByParentId" resultMap="ResultCategoryMapList">
SELECT id FROM jsh_material_category
where 1=1
<if test="parentId != null and parentId !=''">
and parent_id = #{parentId}
</if>
</select>
</mapper>

View File

@@ -106,6 +106,12 @@
<if test="q != null">
and (m.name like '%${q}%' or me.bar_code like '%${q}%')
</if>
<if test="idList.size()>0">
and m.category_id in
<foreach collection="idList" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
and ifnull(m.delete_flag,'0') !='1'
ORDER BY id desc
<if test="offset != null and rows != null">
@@ -121,6 +127,12 @@
<if test="q != null">
and (m.name like '%${q}%' or me.bar_code like '%${q}%')
</if>
<if test="idList.size()>0">
and m.category_id in
<foreach collection="idList" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
and ifnull(m.delete_flag,'0') !='1'
</select>