Parcourir la source

部门加字段20181116

suochencheng il y a 7 ans
Parent
commit
83a7c9d4e7

+ 371 - 318
src/main/java/com/izouma/awesomeadmin/dao/DepartInfoMapper.xml

@@ -1,340 +1,393 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
-<mapper namespace="com.izouma.awesomeadmin.dao.DepartInfoMapper" >
-	<resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.DepartInfo" >
-		<id column="id" property="id" jdbcType="INTEGER" />
-		<result column="depart_name" property="departName" jdbcType="VARCHAR" />
-		<result column="parent_id" property="parentId" jdbcType="INTEGER" />
-		<result column="all_parent_id" property="allParentId" jdbcType="VARCHAR" />
-		<result column="description" property="description" jdbcType="VARCHAR" />
-		<result column="depart_code" property="departCode" jdbcType="VARCHAR" />
-		<result column="org_code" property="orgCode" jdbcType="VARCHAR" />
-		<result column="type" property="type" jdbcType="INTEGER" />
-		<result column="remark" property="remark" jdbcType="VARCHAR" />
-		<result column="sort" property="sort" jdbcType="INTEGER" />
-		<result column="del_flag" property="delFlag" jdbcType="CHAR" />
-		<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
-		<result column="permission" property="permission" jdbcType="VARCHAR" />
-	</resultMap>
-	<sql id="Base_Column_List" >
-		 id, depart_name, parent_id, all_parent_id, description, depart_code, org_code, type, remark, sort, del_flag, create_time, permission
+<mapper namespace="com.izouma.awesomeadmin.dao.DepartInfoMapper">
+    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.DepartInfo">
+        <id column="id" property="id" jdbcType="INTEGER"/>
+        <result column="depart_name" property="departName" jdbcType="VARCHAR"/>
+        <result column="parent_id" property="parentId" jdbcType="INTEGER"/>
+        <result column="all_parent_id" property="allParentId" jdbcType="VARCHAR"/>
+        <result column="description" property="description" jdbcType="VARCHAR"/>
+        <result column="depart_code" property="departCode" jdbcType="VARCHAR"/>
+        <result column="org_code" property="orgCode" jdbcType="VARCHAR"/>
+        <result column="type" property="type" jdbcType="INTEGER"/>
+        <result column="remark" property="remark" jdbcType="VARCHAR"/>
+        <result column="sort" property="sort" jdbcType="INTEGER"/>
+        <result column="del_flag" property="delFlag" jdbcType="CHAR"/>
+        <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
+        <result column="permission" property="permission" jdbcType="VARCHAR"/>
+        <result column="mis_org_code" property="misOrgCode" jdbcType="VARCHAR"/>
+        <result column="mis_org_name" property="misOrgName" jdbcType="VARCHAR"/>
+        <result column="mis_include" property="misInclude" jdbcType="CHAR"/>
+        <result column="mis_child" property="misChild" jdbcType="VARCHAR"/>
+    </resultMap>
+    <sql id="Base_Column_List">
+		 id, depart_name, parent_id, all_parent_id, description, depart_code,
+		 org_code, type, remark, sort, del_flag, create_time, permission,
+		 mis_org_code, mis_org_name, mis_include, mis_child
 	</sql>
-	<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
-		select
-		<include refid="Base_Column_List" />
-		from sys_depart
-		where id = #{id,jdbcType=INTEGER}
-	</select>
-	<select id="selectByPrimaryKeys" resultMap="BaseResultMap" parameterType="java.lang.String" >
-		select
-		<include refid="Base_Column_List" />
-		from sys_depart
-		where FIND_IN_SET(id, #{ids,jdbcType=INTEGER}) and del_flag = 'N'
-	</select>
-	<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
+        select
+        <include refid="Base_Column_List"/>
+        from sys_depart
+        where id = #{id,jdbcType=INTEGER}
+    </select>
+    <select id="selectByPrimaryKeys" resultMap="BaseResultMap" parameterType="java.lang.String">
+        select
+        <include refid="Base_Column_List"/>
+        from sys_depart
+        where FIND_IN_SET(id, #{ids,jdbcType=INTEGER}) and del_flag = 'N'
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
 		delete from sys_depart
 		where id = #{id,jdbcType=INTEGER}
 	</delete>
-	<insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.DepartInfo" useGeneratedKeys="true" keyProperty="id">
-		insert into sys_depart
-		<trim prefix="(" suffix=")" suffixOverrides="," >
-			<if test="id != null" >
-				id,	
-			</if>
-			<if test="departName != null" >
-				depart_name,	
-			</if>
-			<if test="parentId != null" >
-				parent_id,	
-			</if>
-			<if test="allParentId != null" >
-				all_parent_id,	
-			</if>
-			<if test="description != null" >
-				description,	
-			</if>
-			<if test="departCode != null" >
-				depart_code,	
-			</if>
-			<if test="orgCode != null" >
-				org_code,	
-			</if>
-			<if test="type != null" >
-				type,	
-			</if>
-			<if test="remark != null" >
-				remark,	
-			</if>
-			<if test="sort != null" >
-				sort,
-			</if>
-			<if test="delFlag != null" >
-				del_flag,	
-			</if>
-			<if test="createTime != null" >
-				create_time,	
-			</if>
-			<if test="permission != null" >
-				permission,	
-			</if>
-		</trim>
-		<trim prefix="values (" suffix=")" suffixOverrides="," >
-			<if test="id != null" >
-				#{id,jdbcType=INTEGER},	
-			</if>
-			<if test="departName != null" >
-				#{departName,jdbcType=VARCHAR},	
-			</if>
-			<if test="parentId != null" >
-				#{parentId,jdbcType=INTEGER},	
-			</if>
-			<if test="allParentId != null" >
-				#{allParentId,jdbcType=VARCHAR},	
-			</if>
-			<if test="description != null" >
-				#{description,jdbcType=VARCHAR},	
-			</if>
-			<if test="departCode != null" >
-				#{departCode,jdbcType=VARCHAR},	
-			</if>
-			<if test="orgCode != null" >
-				#{orgCode,jdbcType=VARCHAR},	
-			</if>
-			<if test="type != null" >
-				#{type,jdbcType=INTEGER},	
-			</if>
-			<if test="remark != null" >
-				#{remark,jdbcType=VARCHAR},	
-			</if>
-			<if test="sort != null" >
-				#{sort,jdbcType=INTEGER},
-			</if>
-			<if test="delFlag != null" >
-				#{delFlag,jdbcType=CHAR},	
-			</if>
-			<if test="createTime != null" >
-				#{createTime,jdbcType=TIMESTAMP},	
-			</if>
-			<if test="permission != null" >
-				#{permission,jdbcType=VARCHAR},	
-			</if>
-		</trim>
-	</insert>
-	<update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.DepartInfo" >
-		UPDATE sys_depart
-		<set >
-			<if test="departName != null" >
-				depart_name = #{departName,jdbcType=VARCHAR},	
-			</if>
-			<if test="parentId != null" >
-				parent_id = #{parentId,jdbcType=INTEGER},	
-			</if>
-			<if test="allParentId != null" >
-				all_parent_id = #{allParentId,jdbcType=VARCHAR},	
-			</if>
-			<if test="description != null" >
-				description = #{description,jdbcType=VARCHAR},	
-			</if>
-			<if test="departCode != null" >
-				depart_code = #{departCode,jdbcType=VARCHAR},	
-			</if>
-			<if test="orgCode != null" >
-				org_code = #{orgCode,jdbcType=VARCHAR},	
-			</if>
-			<if test="type != null" >
-				type = #{type,jdbcType=INTEGER},	
-			</if>
-			<if test="remark != null" >
-				remark = #{remark,jdbcType=VARCHAR},	
-			</if>
-			<if test="sort != null" >
-				sort = #{sort,jdbcType=INTEGER},
-			</if>
-			<if test="delFlag != null" >
-				del_flag = #{delFlag,jdbcType=CHAR},	
-			</if>
-			<if test="createTime != null" >
-				create_time = #{createTime,jdbcType=TIMESTAMP},	
-			</if>
-			<if test="permission != null" >
-				permission = #{permission,jdbcType=VARCHAR},	
-			</if>
-		</set>
-		where id = #{id,jdbcType=INTEGER}
-	</update>
-	<select id="queryDepartInfosByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.DepartInfo">
-		select <include refid="Base_Column_List"/> from sys_depart
-		<where>
-			and del_flag = 'N'
-			<if test="record.id != null and !&quot;&quot;.equals(record.id)">
-				and id = #{record.id}	
-			</if>
-			<if test="record.departName != null and !&quot;&quot;.equals(record.departName)">
-				and depart_name = #{record.departName}	
-			</if>
-			<if test="record.parentId != null and !&quot;&quot;.equals(record.parentId)">
-				and parent_id = #{record.parentId}	
-			</if>
-			<if test="record.allParentId != null and !&quot;&quot;.equals(record.allParentId)">
-				and all_parent_id = #{record.allParentId}	
-			</if>
-			<if test="record.description != null and !&quot;&quot;.equals(record.description)">
-				and description = #{record.description}	
-			</if>
-			<if test="record.departCode != null and !&quot;&quot;.equals(record.departCode)">
-				and depart_code = #{record.departCode}	
-			</if>
-			<if test="record.orgCode != null and !&quot;&quot;.equals(record.orgCode)">
-				and org_code = #{record.orgCode}	
-			</if>
-			<if test="record.type != null and !&quot;&quot;.equals(record.type)">
-				and type = #{record.type}	
-			</if>
-			<if test="record.remark != null and !&quot;&quot;.equals(record.remark)">
-				and remark = #{record.remark}	
-			</if>
-			<if test="record.sort != null and !&quot;&quot;.equals(record.sort)">
-				and sort = #{record.sort}
-			</if>
-			<if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
-				and del_flag = #{record.delFlag}	
-			</if>
-			<if test="record.createTime != null and !&quot;&quot;.equals(record.createTime)">
-				and create_time = #{record.createTime}	
-			</if>
-			<if test="record.permission != null and !&quot;&quot;.equals(record.permission)">
-				and permission = #{record.permission}	
-			</if>
-		</where>
-		order by id desc
-	</select>
-	<select id="queryAllDepartInfo" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.DepartInfo">
-		select <include refid="Base_Column_List"/> from sys_depart
-		<where>
-			and del_flag = 'N'
-			<if test="id != null and !&quot;&quot;.equals(id)">
-				and id = #{id}	
-			</if>
-			<if test="departName != null and !&quot;&quot;.equals(departName)">
-				and depart_name = #{departName}	
-			</if>
-			<if test="parentId != null and !&quot;&quot;.equals(parentId)">
-				and parent_id = #{parentId}	
-			</if>
-			<if test="allParentId != null and !&quot;&quot;.equals(allParentId)">
-				and all_parent_id = #{allParentId}	
-			</if>
-			<if test="description != null and !&quot;&quot;.equals(description)">
-				and description = #{description}	
-			</if>
-			<if test="departCode != null and !&quot;&quot;.equals(departCode)">
-				and depart_code = #{departCode}	
-			</if>
-			<if test="orgCode != null and !&quot;&quot;.equals(orgCode)">
-				and org_code = #{orgCode}	
-			</if>
-			<if test="type != null and !&quot;&quot;.equals(type)">
-				and type = #{type}	
-			</if>
-			<if test="remark != null and !&quot;&quot;.equals(remark)">
-				and remark = #{remark}	
-			</if>
-			<if test="sort != null and !&quot;&quot;.equals(sort)">
-				and sort = #{sort}
-			</if>
-			<if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
-				and del_flag = #{delFlag}	
-			</if>
-			<if test="createTime != null and !&quot;&quot;.equals(createTime)">
-				and create_time = #{createTime}	
-			</if>
-			<if test="permission != null and !&quot;&quot;.equals(permission)">
-				and permission = #{permission}	
-			</if>
-		</where>
-		order by id desc
-	</select>
-	<select id="queryDepartInfo" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.DepartInfo">
-		select <include refid="Base_Column_List"/> from sys_depart
-		<where>
-			and del_flag = 'N'
-			<if test="id != null and !&quot;&quot;.equals(id)">
-				and id = #{id}	
-			</if>
-			<if test="departName != null and !&quot;&quot;.equals(departName)">
-				and depart_name = #{departName}	
-			</if>
-			<if test="parentId != null and !&quot;&quot;.equals(parentId)">
-				and parent_id = #{parentId}	
-			</if>
-			<if test="allParentId != null and !&quot;&quot;.equals(allParentId)">
-				and all_parent_id = #{allParentId}	
-			</if>
-			<if test="description != null and !&quot;&quot;.equals(description)">
-				and description = #{description}	
-			</if>
-			<if test="departCode != null and !&quot;&quot;.equals(departCode)">
-				and depart_code = #{departCode}	
-			</if>
-			<if test="orgCode != null and !&quot;&quot;.equals(orgCode)">
-				and org_code = #{orgCode}	
-			</if>
-			<if test="type != null and !&quot;&quot;.equals(type)">
-				and type = #{type}	
-			</if>
-			<if test="remark != null and !&quot;&quot;.equals(remark)">
-				and remark = #{remark}	
-			</if>
-			<if test="sort != null and !&quot;&quot;.equals(sort)">
-				and sort = #{sort}
-			</if>
-			<if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
-				and del_flag = #{delFlag}	
-			</if>
-			<if test="createTime != null and !&quot;&quot;.equals(createTime)">
-				and create_time = #{createTime}	
-			</if>
-			<if test="permission != null and !&quot;&quot;.equals(permission)">
-				and permission = #{permission}	
-			</if>
-		</where>
-		LIMIT 1
-	</select>
+    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.DepartInfo" useGeneratedKeys="true"
+            keyProperty="id">
+        insert into sys_depart
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                id,
+            </if>
+            <if test="departName != null">
+                depart_name,
+            </if>
+            <if test="parentId != null">
+                parent_id,
+            </if>
+            <if test="allParentId != null">
+                all_parent_id,
+            </if>
+            <if test="description != null">
+                description,
+            </if>
+            <if test="departCode != null">
+                depart_code,
+            </if>
+            <if test="orgCode != null">
+                org_code,
+            </if>
+            <if test="type != null">
+                type,
+            </if>
+            <if test="remark != null">
+                remark,
+            </if>
+            <if test="sort != null">
+                sort,
+            </if>
+            <if test="delFlag != null">
+                del_flag,
+            </if>
+            <if test="createTime != null">
+                create_time,
+            </if>
+            <if test="permission != null">
+                permission,
+            </if>
+            <if test="misOrgCode != null">
+                mis_org_code,
+            </if>
+            <if test="misOrgName != null">
+                mis_org_name,
+            </if>
+            <if test="misInclude != null">
+                mis_include,
+            </if>
+            <if test="misChild != null">
+                mis_child,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                #{id,jdbcType=INTEGER},
+            </if>
+            <if test="departName != null">
+                #{departName,jdbcType=VARCHAR},
+            </if>
+            <if test="parentId != null">
+                #{parentId,jdbcType=INTEGER},
+            </if>
+            <if test="allParentId != null">
+                #{allParentId,jdbcType=VARCHAR},
+            </if>
+            <if test="description != null">
+                #{description,jdbcType=VARCHAR},
+            </if>
+            <if test="departCode != null">
+                #{departCode,jdbcType=VARCHAR},
+            </if>
+            <if test="orgCode != null">
+                #{orgCode,jdbcType=VARCHAR},
+            </if>
+            <if test="type != null">
+                #{type,jdbcType=INTEGER},
+            </if>
+            <if test="remark != null">
+                #{remark,jdbcType=VARCHAR},
+            </if>
+            <if test="sort != null">
+                #{sort,jdbcType=INTEGER},
+            </if>
+            <if test="delFlag != null">
+                #{delFlag,jdbcType=CHAR},
+            </if>
+            <if test="createTime != null">
+                #{createTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="permission != null">
+                #{permission,jdbcType=VARCHAR},
+            </if>
+            <if test="misOrgCode != null">
+                #{misOrgCode,jdbcType=VARCHAR},
+            </if>
+            <if test="misOrgName != null">
+                #{misOrgName,jdbcType=VARCHAR},
+            </if>
+            <if test="misInclude != null">
+                #{misInclude,jdbcType=CHAR},
+            </if>
+            <if test="misChild != null">
+                #{misChild,jdbcType=VARCHAR},
+            </if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.DepartInfo">
+        UPDATE sys_depart
+        <set>
+            <if test="departName != null">
+                depart_name = #{departName,jdbcType=VARCHAR},
+            </if>
+            <if test="parentId != null">
+                parent_id = #{parentId,jdbcType=INTEGER},
+            </if>
+            <if test="allParentId != null">
+                all_parent_id = #{allParentId,jdbcType=VARCHAR},
+            </if>
+            <if test="description != null">
+                description = #{description,jdbcType=VARCHAR},
+            </if>
+            <if test="departCode != null">
+                depart_code = #{departCode,jdbcType=VARCHAR},
+            </if>
+            <if test="orgCode != null">
+                org_code = #{orgCode,jdbcType=VARCHAR},
+            </if>
+            <if test="type != null">
+                type = #{type,jdbcType=INTEGER},
+            </if>
+            <if test="remark != null">
+                remark = #{remark,jdbcType=VARCHAR},
+            </if>
+            <if test="sort != null">
+                sort = #{sort,jdbcType=INTEGER},
+            </if>
+            <if test="delFlag != null">
+                del_flag = #{delFlag,jdbcType=CHAR},
+            </if>
+            <if test="createTime != null">
+                create_time = #{createTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="permission != null">
+                permission = #{permission,jdbcType=VARCHAR},
+            </if>
+            <if test="misOrgCode != null">
+                mis_org_code = #{misOrgCode,jdbcType=VARCHAR},
+            </if>
+            <if test="misOrgName != null">
+                mis_org_name = #{misOrgName,jdbcType=VARCHAR},
+            </if>
+            <if test="misInclude != null">
+                mis_include = #{misInclude,jdbcType=CHAR},
+            </if>
+            <if test="misChild != null">
+                mis_child = #{misChild,jdbcType=VARCHAR},
+            </if>
+        </set>
+        where id = #{id,jdbcType=INTEGER}
+    </update>
+    <select id="queryDepartInfosByPage" parameterType="java.util.Map"
+            resultType="com.izouma.awesomeadmin.model.DepartInfo">
+        select
+        <include refid="Base_Column_List"/>
+        from sys_depart
+        <where>
+            and del_flag = 'N'
+            <if test="record.id != null and !&quot;&quot;.equals(record.id)">
+                and id = #{record.id}
+            </if>
+            <if test="record.departName != null and !&quot;&quot;.equals(record.departName)">
+                and depart_name = #{record.departName}
+            </if>
+            <if test="record.parentId != null and !&quot;&quot;.equals(record.parentId)">
+                and parent_id = #{record.parentId}
+            </if>
+            <if test="record.allParentId != null and !&quot;&quot;.equals(record.allParentId)">
+                and all_parent_id = #{record.allParentId}
+            </if>
+            <if test="record.description != null and !&quot;&quot;.equals(record.description)">
+                and description = #{record.description}
+            </if>
+            <if test="record.departCode != null and !&quot;&quot;.equals(record.departCode)">
+                and depart_code = #{record.departCode}
+            </if>
+            <if test="record.orgCode != null and !&quot;&quot;.equals(record.orgCode)">
+                and org_code = #{record.orgCode}
+            </if>
+            <if test="record.type != null and !&quot;&quot;.equals(record.type)">
+                and type = #{record.type}
+            </if>
+            <if test="record.remark != null and !&quot;&quot;.equals(record.remark)">
+                and remark = #{record.remark}
+            </if>
+            <if test="record.sort != null and !&quot;&quot;.equals(record.sort)">
+                and sort = #{record.sort}
+            </if>
+            <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
+                and del_flag = #{record.delFlag}
+            </if>
+            <if test="record.createTime != null and !&quot;&quot;.equals(record.createTime)">
+                and create_time = #{record.createTime}
+            </if>
+            <if test="record.permission != null and !&quot;&quot;.equals(record.permission)">
+                and permission = #{record.permission}
+            </if>
+        </where>
+        order by id desc
+    </select>
+    <select id="queryAllDepartInfo" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.DepartInfo">
+        select
+        <include refid="Base_Column_List"/>
+        from sys_depart
+        <where>
+            and del_flag = 'N'
+            <if test="id != null and !&quot;&quot;.equals(id)">
+                and id = #{id}
+            </if>
+            <if test="idStr != null and !&quot;&quot;.equals(idStr)">
+                and id in (${idStr})
+            </if>
+            <if test="departName != null and !&quot;&quot;.equals(departName)">
+                and depart_name = #{departName}
+            </if>
+            <if test="parentId != null and !&quot;&quot;.equals(parentId)">
+                and parent_id = #{parentId}
+            </if>
+            <if test="allParentId != null and !&quot;&quot;.equals(allParentId)">
+                and all_parent_id = #{allParentId}
+            </if>
+            <if test="description != null and !&quot;&quot;.equals(description)">
+                and description = #{description}
+            </if>
+            <if test="departCode != null and !&quot;&quot;.equals(departCode)">
+                and depart_code = #{departCode}
+            </if>
+            <if test="orgCode != null and !&quot;&quot;.equals(orgCode)">
+                and org_code = #{orgCode}
+            </if>
+            <if test="type != null and !&quot;&quot;.equals(type)">
+                and type = #{type}
+            </if>
+            <if test="remark != null and !&quot;&quot;.equals(remark)">
+                and remark = #{remark}
+            </if>
+            <if test="sort != null and !&quot;&quot;.equals(sort)">
+                and sort = #{sort}
+            </if>
+            <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and del_flag = #{delFlag}
+            </if>
+            <if test="createTime != null and !&quot;&quot;.equals(createTime)">
+                and create_time = #{createTime}
+            </if>
+            <if test="permission != null and !&quot;&quot;.equals(permission)">
+                and permission = #{permission}
+            </if>
+        </where>
+        order by id desc
+    </select>
+    <select id="queryDepartInfo" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.DepartInfo">
+        select
+        <include refid="Base_Column_List"/>
+        from sys_depart
+        <where>
+            and del_flag = 'N'
+            <if test="id != null and !&quot;&quot;.equals(id)">
+                and id = #{id}
+            </if>
+            <if test="departName != null and !&quot;&quot;.equals(departName)">
+                and depart_name = #{departName}
+            </if>
+            <if test="parentId != null and !&quot;&quot;.equals(parentId)">
+                and parent_id = #{parentId}
+            </if>
+            <if test="allParentId != null and !&quot;&quot;.equals(allParentId)">
+                and all_parent_id = #{allParentId}
+            </if>
+            <if test="description != null and !&quot;&quot;.equals(description)">
+                and description = #{description}
+            </if>
+            <if test="departCode != null and !&quot;&quot;.equals(departCode)">
+                and depart_code = #{departCode}
+            </if>
+            <if test="orgCode != null and !&quot;&quot;.equals(orgCode)">
+                and org_code = #{orgCode}
+            </if>
+            <if test="type != null and !&quot;&quot;.equals(type)">
+                and type = #{type}
+            </if>
+            <if test="remark != null and !&quot;&quot;.equals(remark)">
+                and remark = #{remark}
+            </if>
+            <if test="sort != null and !&quot;&quot;.equals(sort)">
+                and sort = #{sort}
+            </if>
+            <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and del_flag = #{delFlag}
+            </if>
+            <if test="createTime != null and !&quot;&quot;.equals(createTime)">
+                and create_time = #{createTime}
+            </if>
+            <if test="permission != null and !&quot;&quot;.equals(permission)">
+                and permission = #{permission}
+            </if>
+        </where>
+        LIMIT 1
+    </select>
     <select id="findPower" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.DepartInfo">
 		select * from sys_depart where all_parent_id  LIKE '${allParentId}%'  and id=  #{parentId}
 	</select>
     <update id="delete">
-		UPDATE sys_depart SET del_flag = 'Y'
-		<where>
-			AND id = #{id}
-		</where>
-	</update>
+        UPDATE sys_depart SET del_flag = 'Y'
+        <where>
+            AND id = #{id}
+        </where>
+    </update>
 
-	<select id="getParentList" resultType="departInfo" parameterType="integer">
+    <select id="getParentList" resultType="departInfo" parameterType="integer">
 	    SELECT * from sys_depart WHERE FIND_IN_SET(id,(SELECT all_parent_id from sys_depart WHERE id  = #{id})) AND del_flag = 'N'
 	</select>
 
-	<select id="getUserDeparts" resultType="com.izouma.awesomeadmin.model.DepartInfo">
-		select
-		<include refid="Base_Column_List" />
-		from sys_depart
-		where id in (select depart_id from sys_user_depart where user_id = #{userId})
-		and del_flag = 'N'
-	</select>
+    <select id="getUserDeparts" resultType="com.izouma.awesomeadmin.model.DepartInfo">
+        select
+        <include refid="Base_Column_List"/>
+        from sys_depart
+        where id in (select depart_id from sys_user_depart where user_id = #{userId})
+        and del_flag = 'N'
+    </select>
     <insert id="setUserDeparts">
-		insert into sys_user_depart (user_id, depart_id)
-		values
-		<foreach collection="departs" item="departId" separator=",">
-			(#{userId}, #{departId})
-		</foreach>
-	</insert>
-	<delete id="clearUserDeparts">
+        insert into sys_user_depart (user_id, depart_id)
+        values
+        <foreach collection="departs" item="departId" separator=",">
+            (#{userId}, #{departId})
+        </foreach>
+    </insert>
+    <delete id="clearUserDeparts">
 		delete from sys_user_depart where user_id = #{userId}
 	</delete>
-	<select id="getUserDepartId" resultType="java.lang.String">
+    <select id="getUserDepartId" resultType="java.lang.String">
 		SELECT group_concat(depart_id) FROM sys_user_depart WHERE user_id = #{id}
 	</select>
-	<select id="getDepartUsers" resultType="com.izouma.awesomeadmin.model.UserInfo">
+    <select id="getDepartUsers" resultType="com.izouma.awesomeadmin.model.UserInfo">
 		select * from sys_user where id in (select user_id from sys_user_depart where depart_id = #{departId}) and del_flag = 'N'
 	</select>
 </mapper>

+ 182 - 132
src/main/java/com/izouma/awesomeadmin/model/DepartInfo.java

@@ -8,179 +8,229 @@ import com.fasterxml.jackson.annotation.JsonInclude;
 /**
  * depart_info 实体类
  * Thu Apr 26 10:56:37 CST 2018  Suo Chen Cheng
- */ 
+ */
 @JsonAutoDetect
 @JsonInclude(JsonInclude.Include.NON_NULL)
-public class DepartInfo{
+public class DepartInfo {
 
-/**
-* 	 id
-*/
-	private Integer id;
+    /**
+     * id
+     */
+    private Integer id;
 
-/**
-* 	 部门名称
-*/
-	private String departName;
+    /**
+     * 部门名称
+     */
+    private String departName;
+
+    /**
+     * 上级部门id
+     */
+    private Integer parentId;
 
-/**
-* 	 上级部门id
-*/
-	private Integer parentId;
+    /**
+     * 所有上级id
+     */
+    private String allParentId;
 
-/**
-* 	 所有上级id
-*/
-	private String allParentId;
+    /**
+     * 描述
+     */
+    private String description;
 
-/**
-* 	 描述
-*/
-	private String description;
+    /**
+     * 部门代码
+     */
+    private String departCode;
+
+    /**
+     * 组织代码
+     */
+    private String orgCode;
 
-/**
-* 	 部门代码
-*/
-	private String departCode;
+    /**
+     * 类型
+     */
+    private Integer type;
 
-/**
-* 	 组织代码
-*/
-	private String orgCode;
+    /**
+     * 备注
+     */
+    private String remark;
 
-/**
-* 	 类型
-*/
-	private Integer type;
+    /**
+     * 排序
+     */
+    private Integer sort;
+
+    /**
+     * del_flag
+     */
+    private String delFlag;
 
-/**
-* 	 备注
-*/
-	private String remark;
+    /**
+     * create_time
+     */
+    private Date createTime;
 
-/**
-* 	 排序
-*/
-	private Integer sort;
+    /**
+     * 权限标识
+     */
+    private String permission;
 
-/**
-* 	 del_flag
-*/
-	private String delFlag;
+    private String misOrgCode;
 
-/**
-* 	 create_time
-*/
-	private Date createTime;
+    private String misOrgName;
 
-/**
-* 	 权限标识
-*/
-	private String permission;
+    private String misInclude;
+
+    private String misChild;
+
+    private String idStr;
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setDepartName(String departName) {
+        this.departName = departName;
+    }
+
+    public String getDepartName() {
+        return departName;
+    }
+
+    public void setParentId(Integer parentId) {
+        this.parentId = parentId;
+    }
+
+    public Integer getParentId() {
+        return parentId;
+    }
+
+    public void setAllParentId(String allParentId) {
+        this.allParentId = allParentId;
+    }
+
+    public String getAllParentId() {
+        return allParentId;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public String getDescription() {
+        return description;
+    }
 
-	public void setId(Integer id){
-		this.id=id;
-	}
+    public void setDepartCode(String departCode) {
+        this.departCode = departCode;
+    }
 
-	public Integer getId(){
-		return id;
-	}
+    public String getDepartCode() {
+        return departCode;
+    }
 
-	public void setDepartName(String departName){
-		this.departName=departName;
-	}
+    public void setOrgCode(String orgCode) {
+        this.orgCode = orgCode;
+    }
 
-	public String getDepartName(){
-		return departName;
-	}
+    public String getOrgCode() {
+        return orgCode;
+    }
 
-	public void setParentId(Integer parentId){
-		this.parentId=parentId;
-	}
+    public void setType(Integer type) {
+        this.type = type;
+    }
 
-	public Integer getParentId(){
-		return parentId;
-	}
+    public Integer getType() {
+        return type;
+    }
 
-	public void setAllParentId(String allParentId){
-		this.allParentId=allParentId;
-	}
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
 
-	public String getAllParentId(){
-		return allParentId;
-	}
+    public String getRemark() {
+        return remark;
+    }
 
-	public void setDescription(String description){
-		this.description=description;
-	}
+    public Integer getSort() {
+        return sort;
+    }
 
-	public String getDescription(){
-		return description;
-	}
+    public void setSort(Integer sort) {
+        this.sort = sort;
+    }
 
-	public void setDepartCode(String departCode){
-		this.departCode=departCode;
-	}
+    public void setDelFlag(String delFlag) {
+        this.delFlag = delFlag;
+    }
 
-	public String getDepartCode(){
-		return departCode;
-	}
+    public String getDelFlag() {
+        return delFlag;
+    }
 
-	public void setOrgCode(String orgCode){
-		this.orgCode=orgCode;
-	}
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
 
-	public String getOrgCode(){
-		return orgCode;
-	}
+    public Date getCreateTime() {
+        return createTime;
+    }
 
-	public void setType(Integer type){
-		this.type=type;
-	}
+    public void setPermission(String permission) {
+        this.permission = permission;
+    }
 
-	public Integer getType(){
-		return type;
-	}
+    public String getPermission() {
+        return permission;
+    }
 
-	public void setRemark(String remark){
-		this.remark=remark;
-	}
 
-	public String getRemark(){
-		return remark;
-	}
+    public String getMisOrgCode() {
+        return misOrgCode;
+    }
 
-	public Integer getSort() {
-		return sort;
-	}
+    public void setMisOrgCode(String misOrgCode) {
+        this.misOrgCode = misOrgCode;
+    }
 
-	public void setSort(Integer sort) {
-		this.sort = sort;
-	}
+    public String getMisOrgName() {
+        return misOrgName;
+    }
 
-	public void setDelFlag(String delFlag){
-		this.delFlag=delFlag;
-	}
+    public void setMisOrgName(String misOrgName) {
+        this.misOrgName = misOrgName;
+    }
 
-	public String getDelFlag(){
-		return delFlag;
-	}
+    public String getMisInclude() {
+        return misInclude;
+    }
 
-	public void setCreateTime(Date createTime){
-		this.createTime=createTime;
-	}
+    public void setMisInclude(String misInclude) {
+        this.misInclude = misInclude;
+    }
 
-	public Date getCreateTime(){
-		return createTime;
-	}
+    public String getMisChild() {
+        return misChild;
+    }
 
-	public void setPermission(String permission){
-		this.permission=permission;
-	}
+    public void setMisChild(String misChild) {
+        this.misChild = misChild;
+    }
 
-	public String getPermission(){
-		return permission;
-	}
+    public String getIdStr() {
+        return idStr;
+    }
 
+    public void setIdStr(String idStr) {
+        this.idStr = idStr;
+    }
 }
 

+ 2 - 0
src/main/java/com/izouma/awesomeadmin/service/DepartInfoService.java

@@ -29,6 +29,8 @@ public interface DepartInfoService {
 
     List<DepartInfo> getParentList(Integer id);
 
+    List<DepartInfo> getUserDeparts(Integer userId);
+
     List<TreeNode> getDepartTree(boolean all, Integer userId);
 
     List<UserInfo> getDepartUsers(Integer departId);

+ 14 - 0
src/main/java/com/izouma/awesomeadmin/service/impl/DepartInfoServiceImpl.java

@@ -162,6 +162,20 @@ public class DepartInfoServiceImpl implements DepartInfoService {
         return null;
     }
 
+    @Override
+    public List<DepartInfo> getUserDeparts(Integer userId) {
+        logger.info("getUserDeparts");
+        try {
+
+            List<DepartInfo> list = departInfoMapper.getUserDeparts(userId);
+
+            return list;
+        } catch (Exception e) {
+            logger.error("getUserDeparts", e);
+        }
+        return null;
+    }
+
     private List<DepartInfo> getParents(DepartInfo departInfo) {
         List<DepartInfo> menuList = new ArrayList<>();
         menuList.add(departInfo);

+ 8 - 0
src/main/java/com/izouma/awesomeadmin/web/DepartInfoController.java

@@ -43,6 +43,14 @@ public class DepartInfoController {
         return new Result(true, pp);
     }
 
+    @RequestMapping(value = "/userDeparts", method = RequestMethod.GET)
+    @ResponseBody
+    public Result userDeparts(@RequestParam(required = false, value = "userId") Integer userId) {
+
+        List<DepartInfo> pp = departInfoService.getUserDeparts(userId);
+        return new Result(true, pp);
+    }
+
     /**
      * <p>根据Id。</p>
      */

+ 31 - 3
src/main/vue/src/pages/Departs.vue

@@ -26,6 +26,18 @@
                 <el-form-item label="部门代码" prop="departCode">
                     <el-input v-model="menu.departCode"></el-input>
                 </el-form-item>
+                <el-form-item label="MIS部门代码" prop="misOrgCode">
+                    <el-input v-model="menu.misOrgCode"></el-input>
+                </el-form-item>
+                <el-form-item label="MIS部门名称" prop="misOrgName">
+                    <el-input v-model="menu.misOrgName"></el-input>
+                </el-form-item>
+                <el-form-item label="MIS包含下属" prop="misInclude">
+                    <el-input v-model="menu.misInclude"></el-input>
+                </el-form-item>
+                <el-form-item label="MIS下属部门信息" prop="misChild">
+                    <el-input v-model="menu.misChild"></el-input>
+                </el-form-item>
             </el-form>
             <div slot="footer">
                 <el-button @click="dialogVisible = false" size="small">取消</el-button>
@@ -58,7 +70,11 @@ export default {
             menus: [],
             menu: {
                 departName: '',
-                departCode: ''
+                departCode: '',
+                misInclude: 'N',
+                misOrgCode: '',
+                misOrgName: '',
+                misChild: '',
             },
             departUsers: [],
             showTable: false,
@@ -73,7 +89,11 @@ export default {
             this.menu = {
                 parentId: 0,
                 departName: '',
-                departCode: ''
+                departCode: '',
+                misInclude: 'N',
+                misOrgCode: '',
+                misOrgName: '',
+                misChild: '',
             };
             /*  if (this.menus && this.menus.length > 0) {
                   this.menu.sort = this.menus[this.menus.length - 1].extra.sort + 1;
@@ -86,7 +106,11 @@ export default {
             this.menu = {
                 parentId: node.data.extra.id,
                 departName: '',
-                departCode: ''
+                departCode: '',
+                misInclude: 'N',
+                misOrgCode: '',
+                misOrgName: '',
+                misChild: '',
             };
             if (node.childNodes && node.childNodes.length > 0) {
                 this.menu.sort = node.childNodes[node.childNodes.length - 1].data.extra.sort + 1;
@@ -120,6 +144,10 @@ export default {
                 id: data.extra.id,
                 departName: data.extra.departName,
                 departCode: data.extra.departCode,
+                misInclude: data.extra.misInclude,
+                misOrgCode: data.extra.misOrgCode,
+                misOrgName: data.extra.misOrgName,
+                misChild: data.extra.misChild,
             };
             this.dialogVisible = true;
         },