Your Name
2023-07-11 d7d9b601b2e4fdb663375993e2cfbdbd363df421
java110-db/src/main/resources/mapper/user/OrgServiceDaoImplMapper.xml
old mode 100644 new mode 100755
@@ -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">
@@ -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 -->
@@ -239,24 +232,35 @@
        <if test="allowOperation !=null and allowOperation != ''">
            and t.allow_operation= #{allowOperation}
        </if>
        <if test="orgId !=null and orgId != ''">
            and t.org_id= #{orgId}
        </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>