|  |  |  | @ -2,10 +2,9 @@ | 
			
		
	
		
			
				
					|  |  |  |  | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | <mapper namespace="com.glxp.api.dao.auth.DeptDao"> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     <select id="filterInvWarehouse" parameterType="com.glxp.api.req.auth.FilterInvWarehouseRequest" | 
			
		
	
		
			
				
					|  |  |  |  |             resultType="com.glxp.api.entity.auth.DeptEntity"> | 
			
		
	
		
			
				
					|  |  |  |  |         select * ,(select name from auth_dept WHERE a.pcode = code) pName | 
			
		
	
		
			
				
					|  |  |  |  |         select *, (select name from auth_dept WHERE a.pcode = code) pName | 
			
		
	
		
			
				
					|  |  |  |  |         FROM auth_dept a | 
			
		
	
		
			
				
					|  |  |  |  |         <where> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="id != '' and id != null"> | 
			
		
	
	
		
			
				
					|  |  |  | @ -18,7 +17,7 @@ | 
			
		
	
		
			
				
					|  |  |  |  |                 AND a.code = #{code} | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="name != '' and name != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 AND a.name like concat('%',#{name},'%') | 
			
		
	
		
			
				
					|  |  |  |  |                 AND a.name like concat('%', #{name}, '%') | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="advanceType != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 AND a.advanceType = #{advanceType} | 
			
		
	
	
		
			
				
					|  |  |  | @ -38,15 +37,14 @@ | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="spUse != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 AND a.spUse = #{spUse} | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         </where> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     </select> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     <select id="filterAllByUser" parameterType="com.glxp.api.req.auth.FilterInvWarehouseRequest" | 
			
		
	
		
			
				
					|  |  |  |  |             resultType="com.glxp.api.entity.auth.DeptEntity"> | 
			
		
	
		
			
				
					|  |  |  |  |         select auth_dept.* from auth_dept INNER JOIN auth_warehouse | 
			
		
	
		
			
				
					|  |  |  |  |         on auth_dept.`code` =auth_warehouse.parentId | 
			
		
	
		
			
				
					|  |  |  |  |         select auth_dept.* from auth_dept | 
			
		
	
		
			
				
					|  |  |  |  |                 INNER JOIN auth_warehouse | 
			
		
	
		
			
				
					|  |  |  |  |                 on auth_dept.`code` = auth_warehouse.parentId | 
			
		
	
		
			
				
					|  |  |  |  |         <if test="CustomerId != '' and CustomerId != null"> | 
			
		
	
		
			
				
					|  |  |  |  |             INNER JOIN auth_warehouse_user on auth_warehouse_user.`code` = auth_warehouse.code | 
			
		
	
		
			
				
					|  |  |  |  |         </if> | 
			
		
	
	
		
			
				
					|  |  |  | @ -63,7 +61,7 @@ | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="name != '' and name != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 AND name = #{name} | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test=" advanceType != null"> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="advanceType != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 AND advanceType = #{advanceType} | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="isDefault != null"> | 
			
		
	
	
		
			
				
					|  |  |  | @ -84,7 +82,6 @@ | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |         </where> | 
			
		
	
		
			
				
					|  |  |  |  |         group by auth_dept.code | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     </select> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  |  | @ -93,7 +90,6 @@ | 
			
		
	
		
			
				
					|  |  |  |  |         SELECT * | 
			
		
	
		
			
				
					|  |  |  |  |         FROM auth_dept | 
			
		
	
		
			
				
					|  |  |  |  |         WHERE id = #{id} | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     </select> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     <select id="selectByIdCode" | 
			
		
	
	
		
			
				
					|  |  |  | @ -108,12 +104,12 @@ | 
			
		
	
		
			
				
					|  |  |  |  |                 </foreach> | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |         </where> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     </select> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     <select id="selectMaxCode" parameterType="com.glxp.api.req.auth.FilterInvWarehouseRequest" | 
			
		
	
		
			
				
					|  |  |  |  |             resultType="com.glxp.api.entity.auth.DeptEntity"> | 
			
		
	
		
			
				
					|  |  |  |  |         select max(code) as code from auth_dept | 
			
		
	
		
			
				
					|  |  |  |  |         select max(code) as code | 
			
		
	
		
			
				
					|  |  |  |  |         from auth_dept | 
			
		
	
		
			
				
					|  |  |  |  |         <where> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="id != '' and id != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 AND id = #{id} | 
			
		
	
	
		
			
				
					|  |  |  | @ -127,7 +123,7 @@ | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="name != '' and name != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 AND name = #{name} | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test=" advanceType != null"> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="advanceType != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 AND advanceType = #{advanceType} | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="isDefault != null"> | 
			
		
	
	
		
			
				
					|  |  |  | @ -140,13 +136,13 @@ | 
			
		
	
		
			
				
					|  |  |  |  |                 AND `level` = #{level} | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |         </where> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     </select> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     <select id="filterGroupInvWarehouse" parameterType="com.glxp.api.req.auth.FilterInvWarehouseRequest" | 
			
		
	
		
			
				
					|  |  |  |  |             resultType="com.glxp.api.entity.auth.DeptEntity"> | 
			
		
	
		
			
				
					|  |  |  |  |         SELECT * FROM auth_dept | 
			
		
	
		
			
				
					|  |  |  |  |         SELECT * | 
			
		
	
		
			
				
					|  |  |  |  |         FROM auth_dept | 
			
		
	
		
			
				
					|  |  |  |  |         <where> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="id != '' and id != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 AND id = #{id} | 
			
		
	
	
		
			
				
					|  |  |  | @ -175,14 +171,17 @@ | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="spUse != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 AND spUse = #{spUse} | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="updateTime!=null and updateTime!=''"> | 
			
		
	
		
			
				
					|  |  |  |  |                 <![CDATA[   and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>=  DATE_FORMAT(#{updateTime}, '%Y-%m-%d %H:%i:%S')   ]]> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="updateTime != null and updateTime != ''"> | 
			
		
	
		
			
				
					|  |  |  |  |                 <![CDATA[ | 
			
		
	
		
			
				
					|  |  |  |  |                 and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S') >= DATE_FORMAT(#{updateTime}, '%Y-%m-%d %H:%i:%S') | 
			
		
	
		
			
				
					|  |  |  |  |                 ]]> | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="lastUpdateTime!=null and lastUpdateTime!=''"> | 
			
		
	
		
			
				
					|  |  |  |  |                 <![CDATA[   and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>=  DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S')   ]]> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="lastUpdateTime != null and lastUpdateTime != ''"> | 
			
		
	
		
			
				
					|  |  |  |  |                 <![CDATA[ | 
			
		
	
		
			
				
					|  |  |  |  |                 and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S') >= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') | 
			
		
	
		
			
				
					|  |  |  |  |                 ]]> | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |         </where> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     </select> | 
			
		
	
		
			
				
					|  |  |  |  |     <select id="getNameByCode" resultType="java.lang.String"> | 
			
		
	
		
			
				
					|  |  |  |  |         select name | 
			
		
	
	
		
			
				
					|  |  |  | @ -197,27 +196,25 @@ | 
			
		
	
		
			
				
					|  |  |  |  |     <insert id="insertInvWarehouse" keyProperty="id" | 
			
		
	
		
			
				
					|  |  |  |  |             parameterType="com.glxp.api.entity.auth.DeptEntity"> | 
			
		
	
		
			
				
					|  |  |  |  |         replace | 
			
		
	
		
			
				
					|  |  |  |  |         INTO auth_dept | 
			
		
	
		
			
				
					|  |  |  |  |         (pid, code, `name`, advanceType, isDefault, | 
			
		
	
		
			
				
					|  |  |  |  |          status, updateTime, remark,`level`,pcode,spUse, thirdId, thirdId1, thirdId2, thirdId3, thirdId4) | 
			
		
	
		
			
				
					|  |  |  |  |         values ( | 
			
		
	
		
			
				
					|  |  |  |  |         #{pid}, | 
			
		
	
		
			
				
					|  |  |  |  |         #{code}, | 
			
		
	
		
			
				
					|  |  |  |  |         #{name}, | 
			
		
	
		
			
				
					|  |  |  |  |         #{advanceType}, | 
			
		
	
		
			
				
					|  |  |  |  |         #{isDefault}, | 
			
		
	
		
			
				
					|  |  |  |  |         #{status}, | 
			
		
	
		
			
				
					|  |  |  |  |         #{updateTime}, | 
			
		
	
		
			
				
					|  |  |  |  |         #{remark}, | 
			
		
	
		
			
				
					|  |  |  |  |         #{level}, | 
			
		
	
		
			
				
					|  |  |  |  |         #{pcode}, | 
			
		
	
		
			
				
					|  |  |  |  |         #{spUse}, | 
			
		
	
		
			
				
					|  |  |  |  |         #{thirdId}, | 
			
		
	
		
			
				
					|  |  |  |  |         #{thirdId1}, | 
			
		
	
		
			
				
					|  |  |  |  |         #{thirdId2}, | 
			
		
	
		
			
				
					|  |  |  |  |         #{thirdId3}, | 
			
		
	
		
			
				
					|  |  |  |  |         #{thirdId4} | 
			
		
	
		
			
				
					|  |  |  |  |         ) | 
			
		
	
		
			
				
					|  |  |  |  |                 INTO auth_dept | 
			
		
	
		
			
				
					|  |  |  |  |                 (id, pid, code, `name`, advanceType, isDefault, | 
			
		
	
		
			
				
					|  |  |  |  |                  status, updateTime, remark, `level`, pcode, spUse, thirdId, thirdId1, thirdId2, thirdId3, thirdId4) | 
			
		
	
		
			
				
					|  |  |  |  |         values (#{id}, #{pid}, | 
			
		
	
		
			
				
					|  |  |  |  |                 #{code}, | 
			
		
	
		
			
				
					|  |  |  |  |                 #{name}, | 
			
		
	
		
			
				
					|  |  |  |  |                 #{advanceType}, | 
			
		
	
		
			
				
					|  |  |  |  |                 #{isDefault}, | 
			
		
	
		
			
				
					|  |  |  |  |                 #{status}, | 
			
		
	
		
			
				
					|  |  |  |  |                 #{updateTime}, | 
			
		
	
		
			
				
					|  |  |  |  |                 #{remark}, | 
			
		
	
		
			
				
					|  |  |  |  |                 #{level}, | 
			
		
	
		
			
				
					|  |  |  |  |                 #{pcode}, | 
			
		
	
		
			
				
					|  |  |  |  |                 #{spUse}, | 
			
		
	
		
			
				
					|  |  |  |  |                 #{thirdId}, | 
			
		
	
		
			
				
					|  |  |  |  |                 #{thirdId1}, | 
			
		
	
		
			
				
					|  |  |  |  |                 #{thirdId2}, | 
			
		
	
		
			
				
					|  |  |  |  |                 #{thirdId3}, | 
			
		
	
		
			
				
					|  |  |  |  |                 #{thirdId4}) | 
			
		
	
		
			
				
					|  |  |  |  |     </insert> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  |  | @ -227,58 +224,87 @@ | 
			
		
	
		
			
				
					|  |  |  |  |         WHERE id = #{id} | 
			
		
	
		
			
				
					|  |  |  |  |     </delete> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     <select id="getDeptById" resultType="com.glxp.api.entity.auth.DeptEntity" > | 
			
		
	
		
			
				
					|  |  |  |  |     <select id="getDeptById" resultType="com.glxp.api.entity.auth.DeptEntity"> | 
			
		
	
		
			
				
					|  |  |  |  |         select * | 
			
		
	
		
			
				
					|  |  |  |  |         from auth_dept | 
			
		
	
		
			
				
					|  |  |  |  |             where id in | 
			
		
	
		
			
				
					|  |  |  |  |                <foreach item="item" index="index" collection="ids" open="(" separator="," close=")"> | 
			
		
	
		
			
				
					|  |  |  |  |                    #{item} | 
			
		
	
		
			
				
					|  |  |  |  |                </foreach> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 where id in | 
			
		
	
		
			
				
					|  |  |  |  |         <foreach item="item" index="index" collection="ids" open="(" separator="," close=")"> | 
			
		
	
		
			
				
					|  |  |  |  |             #{item} | 
			
		
	
		
			
				
					|  |  |  |  |         </foreach> | 
			
		
	
		
			
				
					|  |  |  |  |     </select> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     <update id="updateInvWarehouse" parameterType="com.glxp.api.entity.auth.DeptEntity"> | 
			
		
	
		
			
				
					|  |  |  |  |         UPDATE auth_dept | 
			
		
	
		
			
				
					|  |  |  |  |         <trim prefix="set" suffixOverrides=","> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="pid != null">pid=#{pid},</if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="name != null">name=#{name},</if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="code != null">code=#{code},</if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="advanceType != null">advanceType=#{advanceType},</if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="isDefault != null">isDefault=#{isDefault},</if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="status != null">status=#{status},</if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="updateTime != null">updateTime=#{updateTime},</if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="remark != null">remark=#{remark},</if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="level != null">level=#{level},</if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="pcode != null">pcode=#{pcode},</if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="thirdId != null">remark=#{thirdId},</if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="thirdId1 != null">remark=#{thirdId1},</if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="thirdId2 != null">remark=#{thirdId2},</if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="thirdId3 != null">remark=#{thirdId3},</if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="thirdId4 != null">remark=#{thirdId4},</if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="spUse != null">spUse=#{spUse},</if> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="pid != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 pid=#{pid}, | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="name != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 name=#{name}, | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="code != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 code=#{code}, | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="advanceType != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 advanceType=#{advanceType}, | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="isDefault != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 isDefault=#{isDefault}, | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="status != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 status=#{status}, | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="updateTime != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 updateTime=#{updateTime}, | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="remark != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 remark=#{remark}, | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="level != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 level=#{level}, | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="pcode != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 pcode=#{pcode}, | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="thirdId != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 remark=#{thirdId}, | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="thirdId1 != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 remark=#{thirdId1}, | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="thirdId2 != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 remark=#{thirdId2}, | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="thirdId3 != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 remark=#{thirdId3}, | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="thirdId4 != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 remark=#{thirdId4}, | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |             <if test="spUse != null"> | 
			
		
	
		
			
				
					|  |  |  |  |                 spUse=#{spUse}, | 
			
		
	
		
			
				
					|  |  |  |  |             </if> | 
			
		
	
		
			
				
					|  |  |  |  |         </trim> | 
			
		
	
		
			
				
					|  |  |  |  |         WHERE id = #{id} | 
			
		
	
		
			
				
					|  |  |  |  |     </update> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     <insert id="importInvWarehouse" parameterType="java.util.List"> | 
			
		
	
		
			
				
					|  |  |  |  |         replace into auth_dept (id, pid, code, `name`, advanceType, isDefault, status, | 
			
		
	
		
			
				
					|  |  |  |  |         updateTime, remark, `level`, pcode, thirdId, thirdId1, thirdId2, thirdId3, | 
			
		
	
		
			
				
					|  |  |  |  |         thirdId4,spUse) values | 
			
		
	
		
			
				
					|  |  |  |  |                                 updateTime, remark, `level`, pcode, thirdId, thirdId1, thirdId2, thirdId3, | 
			
		
	
		
			
				
					|  |  |  |  |                                 thirdId4, spUse) values | 
			
		
	
		
			
				
					|  |  |  |  |         <foreach collection="invWarehouseEntities" item="item" index="index" separator=","> | 
			
		
	
		
			
				
					|  |  |  |  |             (#{item.id}, | 
			
		
	
		
			
				
					|  |  |  |  |             #{item.pid}, | 
			
		
	
		
			
				
					|  |  |  |  |             #{item.code}, | 
			
		
	
		
			
				
					|  |  |  |  |             #{item.name}, | 
			
		
	
		
			
				
					|  |  |  |  |             #{item.advanceType}, | 
			
		
	
		
			
				
					|  |  |  |  |             #{item.isDefault}, | 
			
		
	
		
			
				
					|  |  |  |  |             #{item.status}, | 
			
		
	
		
			
				
					|  |  |  |  |             #{item.updateTime}, | 
			
		
	
		
			
				
					|  |  |  |  |             #{item.remark}, #{item.level}, | 
			
		
	
		
			
				
					|  |  |  |  |             #{item.pcode}, #{item.thirdId}, | 
			
		
	
		
			
				
					|  |  |  |  |             #{item.thirdId1}, #{item.thirdId2}, | 
			
		
	
		
			
				
					|  |  |  |  |             #{item.thirdId3}, #{item.thirdId4},#{item.spUse}) | 
			
		
	
		
			
				
					|  |  |  |  |              #{item.pid}, | 
			
		
	
		
			
				
					|  |  |  |  |              #{item.code}, | 
			
		
	
		
			
				
					|  |  |  |  |              #{item.name}, | 
			
		
	
		
			
				
					|  |  |  |  |              #{item.advanceType}, | 
			
		
	
		
			
				
					|  |  |  |  |              #{item.isDefault}, | 
			
		
	
		
			
				
					|  |  |  |  |              #{item.status}, | 
			
		
	
		
			
				
					|  |  |  |  |              #{item.updateTime}, | 
			
		
	
		
			
				
					|  |  |  |  |              #{item.remark}, #{item.level}, | 
			
		
	
		
			
				
					|  |  |  |  |              #{item.pcode}, #{item.thirdId}, | 
			
		
	
		
			
				
					|  |  |  |  |              #{item.thirdId1}, #{item.thirdId2}, | 
			
		
	
		
			
				
					|  |  |  |  |              #{item.thirdId3}, #{item.thirdId4}, #{item.spUse}) | 
			
		
	
		
			
				
					|  |  |  |  |         </foreach> | 
			
		
	
		
			
				
					|  |  |  |  |     </insert> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  |  | @ -308,28 +334,42 @@ | 
			
		
	
		
			
				
					|  |  |  |  |     </select> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     <select id="selectNameByCode" resultType="java.lang.String"> | 
			
		
	
		
			
				
					|  |  |  |  |         select name from auth_dept where code = #{code} | 
			
		
	
		
			
				
					|  |  |  |  |         select name | 
			
		
	
		
			
				
					|  |  |  |  |         from auth_dept | 
			
		
	
		
			
				
					|  |  |  |  |         where code = #{code} | 
			
		
	
		
			
				
					|  |  |  |  |     </select> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     <select id="selectByPcode" resultType="com.glxp.api.entity.auth.DeptEntity"> | 
			
		
	
		
			
				
					|  |  |  |  |         select * from auth_dept where pcode = #{pcode} | 
			
		
	
		
			
				
					|  |  |  |  |         select * | 
			
		
	
		
			
				
					|  |  |  |  |         from auth_dept | 
			
		
	
		
			
				
					|  |  |  |  |         where pcode = #{pcode} | 
			
		
	
		
			
				
					|  |  |  |  |     </select> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     <select id="selectupDeptAll" parameterType="java.lang.String" resultType="com.glxp.api.entity.auth.DeptEntity"> | 
			
		
	
		
			
				
					|  |  |  |  |         with recursive table_a as ( | 
			
		
	
		
			
				
					|  |  |  |  |             select * from auth_dept ta where code = #{pcode} | 
			
		
	
		
			
				
					|  |  |  |  |             union all | 
			
		
	
		
			
				
					|  |  |  |  |             select tb.* from auth_dept tb inner join table_a on table_a.pcode = tb.code | 
			
		
	
		
			
				
					|  |  |  |  |         ) | 
			
		
	
		
			
				
					|  |  |  |  |         select * from  table_a | 
			
		
	
		
			
				
					|  |  |  |  |                 select * | 
			
		
	
		
			
				
					|  |  |  |  |                 from auth_dept ta | 
			
		
	
		
			
				
					|  |  |  |  |                 where code = #{pcode} | 
			
		
	
		
			
				
					|  |  |  |  |                 union all | 
			
		
	
		
			
				
					|  |  |  |  |                 select tb.* | 
			
		
	
		
			
				
					|  |  |  |  |                 from auth_dept tb | 
			
		
	
		
			
				
					|  |  |  |  |                              inner join table_a on table_a.pcode = tb.code | 
			
		
	
		
			
				
					|  |  |  |  |                 ) | 
			
		
	
		
			
				
					|  |  |  |  |         select * | 
			
		
	
		
			
				
					|  |  |  |  |         from table_a | 
			
		
	
		
			
				
					|  |  |  |  |     </select> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     <select id="selectLowDeptAll" parameterType="java.lang.String" resultType="com.glxp.api.entity.auth.DeptEntity"> | 
			
		
	
		
			
				
					|  |  |  |  |         with recursive table_a as ( | 
			
		
	
		
			
				
					|  |  |  |  |             select * from auth_dept ta where pcode = #{pcode} | 
			
		
	
		
			
				
					|  |  |  |  |             union all | 
			
		
	
		
			
				
					|  |  |  |  |             select tb.* from auth_dept tb inner join table_a on table_a.code = tb.pcode | 
			
		
	
		
			
				
					|  |  |  |  |         ) | 
			
		
	
		
			
				
					|  |  |  |  |         select * from  table_a | 
			
		
	
		
			
				
					|  |  |  |  |                 select * | 
			
		
	
		
			
				
					|  |  |  |  |                 from auth_dept ta | 
			
		
	
		
			
				
					|  |  |  |  |                 where pcode = #{pcode} | 
			
		
	
		
			
				
					|  |  |  |  |                 union all | 
			
		
	
		
			
				
					|  |  |  |  |                 select tb.* | 
			
		
	
		
			
				
					|  |  |  |  |                 from auth_dept tb | 
			
		
	
		
			
				
					|  |  |  |  |                              inner join table_a on table_a.code = tb.pcode | 
			
		
	
		
			
				
					|  |  |  |  |                 ) | 
			
		
	
		
			
				
					|  |  |  |  |         select * | 
			
		
	
		
			
				
					|  |  |  |  |         from table_a | 
			
		
	
		
			
				
					|  |  |  |  |     </select> | 
			
		
	
		
			
				
					|  |  |  |  | </mapper> | 
			
		
	
	
		
			
				
					|  |  |  | 
 |