From d7d9b601b2e4fdb663375993e2cfbdbd363df421 Mon Sep 17 00:00:00 2001
From: Your Name <you@example.com>
Date: 星期二, 11 七月 2023 22:17:37 +0800
Subject: [PATCH] Merge branch 'master' of http://git.homecommunity.cn/supervip/MicroCommunity

---
 java110-db/src/main/resources/mapper/user/OrgServiceDaoImplMapper.xml |   63 +++++++++++++++++--------------
 1 files changed, 35 insertions(+), 28 deletions(-)

diff --git a/java110-db/src/main/resources/mapper/user/OrgServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/user/OrgServiceDaoImplMapper.xml
old mode 100644
new mode 100755
index 0798880..e3537d7
--- a/java110-db/src/main/resources/mapper/user/OrgServiceDaoImplMapper.xml
+++ b/java110-db/src/main/resources/mapper/user/OrgServiceDaoImplMapper.xml
@@ -1,16 +1,14 @@
 <?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper
-        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="orgServiceDaoImpl">
 
     <!-- 淇濆瓨缁勭粐淇℃伅 add by wuxw 2018-07-03 -->
     <insert id="saveBusinessOrgInfo" parameterType="Map">
-        insert into business_org(
-        org_name,operate,parent_org_id,description,org_level,store_id,b_id,org_id,belong_community_id,allow_operation
-        ) values (
-        #{orgName},#{operate},#{parentOrgId},#{description},#{orgLevel},#{storeId},#{bId},#{orgId},#{belongCommunityId},#{allowOperation}
-        )
+        insert into business_org(org_name, operate, parent_org_id, description, org_level, store_id, b_id, org_id,
+                                 belong_community_id, allow_operation)
+        values (#{orgName}, #{operate}, #{parentOrgId}, #{description}, #{orgLevel}, #{storeId}, #{bId}, #{orgId},
+                #{belongCommunityId}, #{allowOperation})
     </insert>
 
 
@@ -52,15 +50,14 @@
         <if test="allowOperation !=null and allowOperation != ''">
             and t.allow_operation= #{allowOperation}
         </if>
-
     </select>
-
 
     <!-- 淇濆瓨缁勭粐淇℃伅鑷� instance琛ㄤ腑 add by wuxw 2018-07-03 -->
     <insert id="saveOrgInfoInstance" parameterType="Map">
         insert into u_org(
         org_name,parent_org_id,description,org_level,status_cd,store_id,b_id,org_id,belong_community_id,allow_operation
-        ) select t.org_name,t.parent_org_id,t.description,t.org_level,'0',t.store_id,t.b_id,t.org_id,t.belong_community_id,t.allow_operation
+        ) select
+        t.org_name,t.parent_org_id,t.description,t.org_level,'0',t.store_id,t.b_id,t.org_id,t.belong_community_id,t.allow_operation
         from business_org t
         where 1=1
         <if test="orgName !=null and orgName != ''">
@@ -91,9 +88,7 @@
         <if test="allowOperation !=null and allowOperation != ''">
             and t.allow_operation= #{allowOperation}
         </if>
-
     </insert>
-
 
     <!-- 鏌ヨ缁勭粐淇℃伅 add by wuxw 2018-07-03 -->
     <select id="getOrgInfo" parameterType="Map" resultType="Map">
@@ -113,7 +108,7 @@
         and t.parent_org_id = uo.org_id
         and uo.status_cd = '0'
         <if test="staffId != null and staffId !=''">
-            and uosr.org_id = uo.org_id
+            and uosr.org_id = t.org_id
             and uosr.staff_id = #{staffId}
             and uosr.status_cd = '0'
         </if>
@@ -147,12 +142,11 @@
         <if test="allowOperation !=null and allowOperation != ''">
             and t.allow_operation= #{allowOperation}
         </if>
+        ORDER BY t.create_time ASC
         <if test="page != -1 and page != null ">
             limit #{page}, #{row}
         </if>
-
     </select>
-
 
     <!-- 淇敼缁勭粐淇℃伅 add by wuxw 2018-07-03 -->
     <update id="updateOrgInfoInstance" parameterType="Map">
@@ -188,7 +182,6 @@
         <if test="orgId !=null and orgId != ''">
             and t.org_id= #{orgId}
         </if>
-
     </update>
 
     <!-- 鏌ヨ缁勭粐鏁伴噺 add by wuxw 2018-07-03 -->
@@ -205,7 +198,7 @@
         and t.parent_org_id = uo.org_id
         and uo.status_cd = '0'
         <if test="staffId != null and staffId !=''">
-            and uosr.org_id = uo.org_id
+            and uosr.org_id = t.org_id
             and uosr.staff_id = #{staffId}
             and uosr.status_cd = '0'
         </if>
@@ -239,21 +232,35 @@
         <if test="allowOperation !=null and allowOperation != ''">
             and t.allow_operation= #{allowOperation}
         </if>
-
     </select>
+
     <!-- 鏌ヨ涓婄骇缁勭粐淇℃伅 -->
     <select id="getParentOrgInfo" parameterType="Map" resultType="Map">
         <![CDATA[
-            SELECT t.org_name,t.org_name orgName,t.parent_org_id,t.parent_org_id
-                parentOrgId,t.description,t.org_level,t.org_level orgLevel,t.status_cd,t.status_cd
-                statusCd,t.store_id,t.store_id storeId,t.b_id,t.b_id bId,t.org_id,t.org_id orgId
-            FROM u_org o,u_org t
-            WHERE o.`org_level` = #{orgLevel}
-                AND o.`store_id` = t.`store_id`
-                AND o.`parent_org_id` = t.`org_id`
-                AND o.`org_id` <> o.`parent_org_id`
-                AND o.`store_id` = #{storeId}
+        SELECT t.org_name,
+               t.org_name  orgName,
+               t.parent_org_id,
+               t.parent_org_id
+                           parentOrgId,
+               t.description,
+               t.org_level,
+               t.org_level orgLevel,
+               t.status_cd,
+               t.status_cd
+                           statusCd,
+               t.store_id,
+               t.store_id  storeId,
+               t.b_id,
+               t.b_id      bId,
+               t.org_id,
+               t.org_id    orgId
+        FROM u_org o,
+             u_org t
+        WHERE o.`org_level` = #{orgLevel}
+          AND o.`store_id` = t.`store_id`
+          AND o.`parent_org_id` = t.`org_id`
+          AND o.`org_id` <> o.`parent_org_id`
+          AND o.`store_id` = #{storeId}
         ]]>
     </select>
-
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0