添加商品类型和机构选择父级的时候只能从父级或者旁级选择的控制

This commit is contained in:
qiankunpingtai
2019-03-14 15:12:09 +08:00
parent 08d3490a5f
commit bd3d8bd2bd
13 changed files with 71 additions and 62 deletions

View File

@@ -33,14 +33,14 @@
<resultMap id="BaseTreeResultMap" type="com.jsh.erp.datasource.vo.TreeNode">
<result column="id" property="id"/>
<result column="name" property="text"/>
<collection column="id" property="children" javaType="java.util.ArrayList"
<collection column="{currentId=currentId,id=id}" property="children" javaType="java.util.ArrayList"
ofType="com.jsh.erp.datasource.vo.TreeNode" select="getNextNodeTree"/>
</resultMap>
<resultMap id="NextTreeResultMap" type="com.jsh.erp.datasource.vo.TreeNode">
<result column="id" property="id"/>
<result column="name" property="text"/>
<collection column="id" property="children" javaType="java.util.ArrayList"
<collection column="{currentId=currentId,id=id}" property="children" javaType="java.util.ArrayList"
ofType="com.jsh.erp.datasource.vo.TreeNode" select="getNextNodeTree"/>
</resultMap>
@@ -50,19 +50,25 @@
<select id="getNextNodeTree" resultMap="NextTreeResultMap">
SELECT
<include refid="Base_Column_List"/>
<include refid="Base_Column_List"/>,#{currentId} as currentId
FROM jsh_materialcategory
WHERE ParentId = #{id}
<if test="currentId != null">
and id !=#{currentId}
</if>
and status !='2'
order by sort asc
</select>
<select id="getNodeTree" resultMap="BaseTreeResultMap">
SELECT
<include refid="Base_Column_List"/>
<include refid="Base_Column_List"/>,#{currentId} as currentId
FROM jsh_materialcategory
WHERE ParentId = -1
and status !='2'
<if test="currentId != null">
and id !=#{currentId}
</if>
order by sort asc
</select>
<insert id="addMaterialCategory" parameterType="com.jsh.erp.datasource.entities.MaterialCategory"

View File

@@ -6,7 +6,7 @@
<result column="id" property="id"/>
<result column="org_abr" property="text"/>
<result column="org_no" property="attributes"/>
<collection column="org_no" property="children" javaType="java.util.ArrayList"
<collection column="{currentId=currentId,org_no=org_no}" property="children" javaType="java.util.ArrayList"
ofType="com.jsh.erp.datasource.vo.TreeNode" select="getNextNodeTree"/>
</resultMap>
@@ -14,7 +14,7 @@
<result column="id" property="id"/>
<result column="org_abr" property="text"/>
<result column="org_no" property="attributes"/>
<collection column="org_no" property="children" javaType="java.util.ArrayList"
<collection column="{currentId=currentId,org_no=org_no}" property="children" javaType="java.util.ArrayList"
ofType="com.jsh.erp.datasource.vo.TreeNode" select="getNextNodeTree"/>
</resultMap>
@@ -24,18 +24,24 @@
<select id="getNextNodeTree" resultMap="NextTreeResultMap">
SELECT
<include refid="Base_Column_List"/>
<include refid="Base_Column_List"/>,#{currentId} as currentId
FROM jsh_organization
WHERE org_parent_no = #{org_no}
<if test="currentId != null">
and id !=#{currentId}
</if>
and org_stcd !='5'
order by sort asc
</select>
<select id="getNodeTree" resultMap="BaseTreeResultMap">
SELECT
<include refid="Base_Column_List"/>
<include refid="Base_Column_List"/>,#{currentId} as currentId
FROM jsh_organization
WHERE org_parent_no = -1
<if test="currentId != null">
and id !=#{currentId}
</if>
and org_stcd !='5'
order by sort asc
</select>